Sarajevo, Bosnia and Herzegovina

How to install NS3 on Ubuntu 14.10

On the beginning, we need to install prerequisites as root

sudo apt-get install gcc g++ python python-dev mercurial bzr gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev uncrustify doxygen graphviz imagemagick texlive texlive-latex-extra texlive-generic-extra texlive-generic-recommended texinfo dia texlive texlive-latex-extra texlive-extra-utils texlive-generic-recommended texi2html python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev python-pygccxml git  gir1.2-goocanvas-2.0-9

Then switch to the ordinary user (not root) and execute

cd  
mkdir ns3
cd ns3
wget http://www.nsnam.org/release/ns-allinone-3.22.tar.bz2
tar xjf ns-allinone-3.22.tar.bz2
cd ns-allinone-3.22/
ls

Note that you can find the latest version of NS3 on following link https://www.nsnam.org/releases/
In NS3, instead of using MAKE we use WAF build tool. So you need install NS3 by executing PYTHON or WAF scripts:

PYTHON:

Please find build.py along with other files.
Try to build the examples in ns-3 by executing

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

WAF:

./waf -d debug --enable-examples --enable-tests configure
./waf

You should receive following message if everything goes fine:

"Build finished successfully".

Finally to test is everything fine, please execute:

./test.py

Or you can simply try to run some of the example tutorials:

./waf --run first