0% found this document useful (0 votes)
30 views

NS3 Tutorial Installation Randy

Uploaded by

Kenfack Patrick
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

NS3 Tutorial Installation Randy

Uploaded by

Kenfack Patrick
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

NS3 Simulator Installation

By: Anthony Sanchez and Randy Saetern

For the installation of NS3, VMware workstation is required to be installed, along


with an Ubuntu system.

1. Download VMWare workstation from the website:


https://my.vmware.com/en/web/vmware/downloads/info/slug/desktop_end_user_compu
ting/vmware_workstation_player/15_0
2. Download Ubuntu 20.04.01 Desktop AMD 64 from the website:
https://ubuntu.com/download/desktop
3. Install VMWare workstation onto the computer system and open it
4. Set up the VMware workstation:
a. Create a new virtual machine by selecting “Create New Virtual
Machine.”

Figure 1: Creation of a new VM.

b. In the installer wizard, select installer disc image file(iso) and


select the downloaded Ubuntu 20.04.01 AMD 64 iso file by browsing
through the computer download files.
Figure 2: Installation with a disc image file(iso).

c. Name the machine and set the password.


d. Configure the Hardware:
i. For memory: set the value to 4600 MB or above.
ii. For faster VMware, set processors to 2.
5. Power on the virtual machine and let the machine update.
6. Within the Virtual machine, download NS3 on the VM by opening Mozilla firefox
and downloading from the NS3 website.
7. Install prereq packages on Ubuntu using terminal:
a. Open the terminal by right clicking the desktop and select “open in
terminal.”
b. Paste in this code and then press enter:
sudo apt-get install g++ python3 python3-dev pkg-config sqlite3 python3-
setuptools git qt5-default mercurial gir1.2-goocanvas-2.0 python-gi
python-gi-cairo 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 gdb valgrind uncrustify doxygen graphviz
imagemagick texlive texlive-extra-utils texlive-latex-extra texlive-
font-utils dvipng latexmk python3-sphinx dia gsl-bin libgsl-dev libgsl23
libgslcblas0 tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev
cmake libc6-dev libc6-dev-i386 libclang-6.0-dev llvm-6.0-dev automake
python3-pip libgtk-3-dev synaptic vtun lxc uml-utilities

c. After the packages have finished downloading, paste in this code and
press enter: sudo pip3 install cxxfilt
8. After installing the required packages, create a folder named workspace in the
home directory and then put the NS3 tar package into the workspace. See
example figure below.

Figure 3: workspace folder created in home directory

9. Go to terminal and input these commands consecutively after each command


finishes executing:

cd

cd workspace

tar xjf <name of NS3 downloaded file name>

cd <name of extracted NS3>

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

10. Test the NS3 build and installation success by running test.py in the ns
directory using the following commands:

cd ns-<version number>
./test.py
Figure 4: Testing the build and installation.

11. If all of the tests were passed, Congratulations! NS3 has now been installed
successfully.
Building NetAnim and Running a Simulation

1. To build NetAnim, the qmake package will be utilized in the following process:
a. Go to the NetAnim directory pasting these commands in the terminal:

cd

cd workspace

cd <ns folder name>

cd <netanim folder name>

b. Clean make files using the command:

make clean

c. Make NetAnim using the commands:

qmake NetAnim.pro

make

d. Test the NetAnim installation by pasting the following command in the


terminal, while within the netanim directory:
./NetAnim
2. If NetAnim opens, congratulations! NetAnim is now installed.
3. Building and Running simulation procedures:
a. Copy a .cc file to the scratch directory, located in the ns-<version#>
directory.
b. Edit the copied .cc file to include the netanim library files by pasting
in the following code to the code:
#include "ns3/netanim-module.h”
c. Instantiate the animation interface into the code.
d. Exit the scratch directory by using the following command in the
terminal:

cd ../

e. Paste in the following commands to the terminal:


./waf –run scratch/<name of cc file>
Figure 5:Building the cc file.

f. Run NetAnim by entering the netanim directory in the terminal and use
the code:
./NetAnim
g. Select the created xml file and run resulting simulation by following
these procedures:
i. Click on the folder icon in the top left side, shown in Figure 6.

Figure 6: Selecting to open an XML file.


ii. Go into the ns-<version#> folder and select the xml file you
built. Example shown in Figure 7.

Figure 7: Selecting xml file.

iii. Run simulation by pressing the play icon. Example shown in Figure
8.

Figure 8: Pressing Play button.

You might also like