EXPERIMENT – 3
Aim: Installation of ns-3
Theory:
Following are the basic steps which must be followed for installing NS3
1. Install prerequisite packages
2. Download ns3 codes
3. Build ns3
4. Validate ns3
Prerequisite packages for Linux are as follows:
 Minimal      requirements   for   C++:   dnf    install   gcc   gcc-c++   python
   Minimal requirements for Python: dnf install gcc gcc-c++ python python-devel
   Mercurial and git are needed to work with ns-3 development repositories: dnf
    install mercurial git
        For improving some wireless model fidelity is GNU scientific library: dnf
          install gsl gsl-devel
 Support for netanim animator: dnf install qt5-devel
 A GTK-based configuration system: dnf install gtk3 gtk3-devel
 For Debugging: dnf install gdb valgrind
 Doxygen and related inline documentation: dnf install doxygen graphviz
   ImageMagick
 The ns-3 manual and tutorial are written in reStructuredText for Sphinx
  (doc/tutorial, doc/manual, doc/models), and figures typically in dia: dnf
  install python-sphinx dia texlive texlive-latex texlive-fncychap texlive-capt-
  of texlive-tabulary texlive-eqparbox
  dnf install texlive-epstopdf texlive-titlesec texlive-framed texlive-dvipng
  texlive-threeparttable texlive-wrapfig
   dnf install texlive-multirow ImageMagick
 The Network Simulation Cradle (nsc) requires the flex lexical analyzer and
   bison      parser      generator:     dnf        install   flex    bison
 To read pcap packet traces: dnf install tcpdump
 Database support for statistics framework: dnf install sqlite sqlite-devel
 Xml-based version of the config store: dnf install libxml2 libxml2-devel
 Support for utils/check-style.py style check program: dnf install uncrustify
 Support for MPI distributed simulations: dnf install openmpi openmpi-devel
 Support for openflowswitch: dnf install boost-devel
 Support for ns-3 pyviz visualize: pygobject3-devel python3-gobject gobject-
  introspection-devel goocanvas2-devel graphviz-devel graphviz ipython
  easy_install pygraphviz
   Support for generating modified python bindings: dnf install cmake libclang-
    devel llvm-devel llvm-static
    pip install cxxfilt
   Support for bake tool: dnf install patch autoconf cvs
Detail steps are as follows:
1. sudo apt-get update / dnf update
2 .sudo apt-get upgrade / dnf upgrade
3. Once ubuntu/fedora is installed run following command opening the
terminal(ctrl+alt+T) window.
4. To install prerequisites dependancy packages- Type the following command in
terminal window.
sudo apt-get/ dnf 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 texlivegeneric-extra texlive-generic-
recommended texinfo dia texlive texlive-latex-extra texlive-extrautils texlive-
generic-recommended             texi2html         python-pygraphviz      python-kiwi
pythonpygoocanvas libgoocanvas-dev python-pygccxml
5. After downloading NS3 on the drive, extract all the files in the NS3 folder,
which you have created. 6. Then you can find build.py along with other files in
NS3 folder. Then to build the examples in ns-3 run : ./build.py --enable-examples –
enable-tests If the build is successful then it will give output "Build finished
successfully".
7. Now run the following command on the terminal window, to configure with waf
(build tool) ./waf -d debug --enable-examples --enable-tests configure To build
with waf(optional) ./waf
8. To test everything allright run the following command on the terminal window,
./test.py If the tests are ok the installation is done.
9. Now after installing ns3 and testing it run some programs first to be ns3 user:
make sure you are in directory where waf script is available then run.