You are on page 1of 5

DEPARTMENT OF COMPUTER ENGINEERING

Experiment No. 6

Name: Aditi Narayan Kini Roll No: 574

Class: TE (A) Sem: V

Subject: Computer Network Date:


Aim: Study and Installation of Network Simulator (NS3)(Linux/Windows).

Theory:
ns-3 is a discrete-event network simulator for Internet systems, targeted primarily for research and
educational use. ns-3 is free, open-source software, licensed under the GNU GPLv2 license, and
maintained by a worldwide community.

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.

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.

NetAnim:

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:

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.
Basic models in ns3 simulator:

Various packet routings like AODV, OLSR, Nix-Vector, static and global link state

Supports mobility models Use devices like Wi-Fi, WIMAX, CSMA, Bridge and Point-to-Point etc

Error models and queues

Applications such as echo server and traffic generators Tools used in this installation:

NS3 version ns-3.36.1 OS Used: Ubuntu 22.04 LTS

Installation of ns-3

Step1: Prerequisites

$ sudo apt update

In the following packages, all the required dependencies are taken care and you can install all these
packages for the complete use of ns3.

$ sudo apt install g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git
qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-
cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc
libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3
libsqlite3-dev libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-
pip libxml2 libxml2-dev libboost-all-dev

Step 2 : Download ns-allinone-3.36.1.tar.bz2 from the website nsnam.org.

https://www.nsnam.org/releases/ns-allinone-3.36.1.tar.bz2

Step 3 : Unzip the above file content to the home folder.

To unzip use the GUI with Right click and extract and select the /home/aditi@24/ folder.

else we can use this command

$ tar jxvf ns-allinone-3.36.1.tar.bz2

Step 4: Go to the folder

$ cd ns-allinone-3.36.1/

After changing folder name type

$ ./build.py --enable-examples --enable-tests


Netanim command:

CONCLUSION: Successfully studied and installed Network Simulator (NS3) in Linux/ Windows.

You might also like