0% found this document useful (0 votes)
215 views1 page

Installing Ns 3 40 in Ubuntu

Installing ns3 in Ubuntu 22.04 involves 5 steps: 1) Installing prerequisite packages using apt. 2) Downloading the ns-allinone tarball from the nsnam website. 3) Unzipping and installing the tarball using ./build.py to enable examples and tests. 4) Running a sample hello-simulator script to test installation. 5) Saving scripts in the scratch directory and running them to use ns3.

Uploaded by

pradeeprit16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
215 views1 page

Installing Ns 3 40 in Ubuntu

Installing ns3 in Ubuntu 22.04 involves 5 steps: 1) Installing prerequisite packages using apt. 2) Downloading the ns-allinone tarball from the nsnam website. 3) Unzipping and installing the tarball using ./build.py to enable examples and tests. 4) Running a sample hello-simulator script to test installation. 5) Saving scripts in the scratch directory and running them to use ns3.

Uploaded by

pradeeprit16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Installing ns3 in Ubuntu 22.

04
------------------------------
Step 1: Prerequisites (Installing and updating necessary
packages)
-------------------------------------------------------------
1) sudo apt update
2) 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.40.tar.bz2 from the website


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

Step 3: Unzip and Install the tarball


-------------------------------------
1) tar jxvf ns-allinone-3.40.tar.bz2
2) cd ns-allinone-3.40/
3) ./build.py --enable-examples --enable-tests
-----------------------------------------------

Step 4: Running a Sample Script


------------------------------
1) ./ns3 run hello-simulator

(You will get the output as) Hello Simulator

Step 5: Saving and running a ns3 script


---------------------------------------
1) Save the written script inside ns-3.40/scratch directory
2) To run the written script, execute the following command
(for .cc file - C++ file)
./ns3 run scratch/first

(for python file)


./ns3 run scratch/first.py

You might also like