Bus Topology Report
Bus Topology Report
Bus Topology Report
BACHELOR OF ENGINEERING
Information Science and Engineering
Submitted by:
SHRUTHA . K (1NT21IS157)
V. LIKHITHA CHOWDARY (1NT21IS176)
V.S. SANJANA (1NT21IS177)
VAISHNAVI .A.R (1NT21IS182)
DEPARTMENT OF INFORMATION AND ENGINEERING
NITTE MEENAKSHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution)
KARNATAKA
CERTIFICATE
This is to certify that the “COMPUTER NETWOKS REPORT” submitted by
SHRUTHA. K (1NT21IS157), V. LIKHITHA CHOWDARY
(1NT21IS176), V.S. SANJANA (1NT21IS177), VAISHNAVI. A.R
(1NT21IS182)
is work done by them and submitted during 2022 – 2023 academic year, in partial fulfillment
of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY in
INFORMATION SCIENCE AND ENGINEERING, at Nitte Meenakshi Institute of
Technology.
ACKNOWLEDGEMENT
Last but not the least, we acknowledge our team, our friends and
family, for their contribution in the completion of the project.
ABSTRACT
Introduction 5
Bus Topology 5
Diagram 6
Output 10
Explanation of the code 11-14
Conclusion 15
BUS TOPOLOGY
Here, the node that transmits data is known as Host. All the computers
connected in the network will receive all the network traffic. Each node is given
equal priority for data transmission. The nodes use Media Access Technology
such as a bus master to share the bus.
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/applications-module.h"
// Enable logging
NodeContainer nodes;
nodes.Create (4);
CsmaHelper csma;
// Install devices
InternetStackHelper stack;
stack.Install (nodes);
// Assign IP addresses
Ipv4AddressHelper address;
CsmaHelper::EnablePcapAll ("bus-topology");
Simulator::Run ();
Simulator::Destroy ();
return 0;
OUTPUT
EXPLANATION FOR THE CODE
This code is a simulation script written in C++ using the ns-3 network
simulation framework. It creates a simple bus topology network with four nodes
interconnected by a CSMA (Carrier Sense Multiple Access) channel. In this
network, one node functions as an echo server, and the other three nodes act as
echo clients. The echo clients send UDP echo packets to the echo server, and
the server responds back, simulating a basic client-server communication
scenario.
The code includes the necessary header files for using various modules in ns-
3. These include core modules for basic functionality, network modules for
networking components, CSMA module for the CSMA channel, internet
module for internet protocol stack, and applications module for setting up
applications on nodes.
2. Logging Configuration:
3. Node Creation:
The code creates a container `nodes` that will hold four nodes. These nodes
represent the devices in the network.
The CSMA channel is created using the `CsmaHelper`. The channel's data
rate is set to 5 Mbps (5000000 bits per second), and the delay is set to 2
milliseconds.
5. Device Installation:
The `CsmaHelper` installs network devices on the nodes using the previously
defined channel configuration. The resulting `NetDeviceContainer` `devices`
holds the devices that are now connected in the bus topology.
The Internet stack is installed on all the nodes using the `InternetStackHelper`.
This step sets up the IPv4 routing and forwarding functionalities on the nodes.
7. IP Address Assignment:
This code provides a basic example of how to set up a simple bus topology
network using ns-3 and demonstrates the communication between a client and a
server in the network. When you run this simulation, it will show the exchange
of echo packets between the clients and the server, and you can inspect the
captured packets using a packet analyzer tool.
CONCLUSION
It is a type of network topology in which all devices in the network
are connected by one central RJ-45 network cable or coaxial cable.
The single cable, where all data is transmitted between devices, is
referred to as the bus, backbone, or trunk.