Network simulator is a tool used for simulating the real world network on one computer by writing scripts in C++ or Python. Normally if we want to perform experiments, to see how our network works using various parameters. We don’t have required number of computers and routers for making different topologies. Even if we have these resources it is very expensive to build such a network for experiment purposes.
So to overcome these drawbacks we used NS3, which is a discrete event network simulator for Internet. NS3 helps to create various virtual nodes (i.e., computers in real life) and with the help of various Helper classes it allows us to install devices, internet stacks, application, etc to our nodes.
Using NS3 we can create PointToPoint, Wireless, CSMA, etc connections between nodes. PointToPoint connection is same as a LAN connected between two computers. Wireless connection is same as WiFi connection between various computers and routers. CSMA connection is same as bus topology between computers. After building connections we try to install NIC to every node to enable network connectivity.
When network cards are enabled in the devices, we add different parameters in the channels (i.e., real world path used to send data) which are data-rate, packet size, etc. Now we use Application to generate traffic and send the packets using these applications.
Ns3 gives us special features which can be used for real life integrations. Some of these features are:
- Tracing of the nodes:
NS3 allows us to trace the routes of the nodes which helps us to know how much data is send or received. Trace files are generated to monitor these activities.
It stands for Network Animator.It is an animated version of how network will look in real and how data will be transferred from one node to other.
- Pcap file:
NS3 helps to generate pcap file which can be used to get all information of the packets (e.g., Sequence number, Source IP, destination IP, etc). These pcaps can be seen using a software tool known as wireshark.
GnuPlot is used to plot graphs from the data which we get from trace file of NS3. Gnuplot gives more accurate graph compare to other graph making tools and also it is less complex than other tools.
This is a brief introduction to NS3. Basically NS3 can perform most of the activities which are performed in the network in reality.
- Network Devices (Hub, Repeater, Bridge, Switch, Router, Gateways and Brouter)
- Traceroute in Network Layer
- Types of Network Topology
- Computer Network | Leaky bucket algorithm
- Program to determine class, Network and Host ID of an IPv4 address
- Network configuration and trouble shooting commands in Linux
- Types of Network Address Translation (NAT)
- HMAC Algorithm in Computer Network
- Introduction of Firewall in Computer Network
- Basic Network Attacks in Computer Network
- Circuit Switching in Computer Network
- Packet Switching and Delays in Computer Network
- Routing v/s Routed Protocols in Computer Network
- Collision Domain and Broadcast Domain in Computer Network
- Difference between Unicast, Broadcast and Multicast in Computer Network
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.