Monday, February 2, 2015

INSTALLING NS3 IN UBUNTU 14.04

1.ubuntu is installed run following command opening your terminal(ctrl+alt+T).


2.To install prerequisites-

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

3. (now make sure you have not run sudo su to be superuser)
Downloading NS-3(ns-3 version 3.19 not 3.13)

   cd  

   mkdir ns3

   cd ns3

   wget http://www.nsnam.org/release/ns-allinone-3.19.tar.bz2

   tar xjf ns-allinone-3.19.tar.bz2

   cd ns-allinone-3.19/
   ls

4.Then you can find build.py along with other files.
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".(clap for yourself)

5.Now run the following command to configure with waf(build tool)
 
 ./waf -d debug --enable-examples --enable-tests configure

To build with waf(optional)
 
./waf

6.To test everything allright
 
./test.py
 
If the tests are ok the installation is done. :)
 

22 comments:

  1. how about
    sudo apt-get install ns3

    ReplyDelete
  2. the ./test.py shows this error

    Modules not built (see ns-3 tutorial for explanation):
    brite click openflow

    ReplyDelete
  3. ./waf -d debug --enable-examples --enable-tests configure
    no such file or directory

    ReplyDelete
    Replies
    1. Go to the ns3/ns-allinone-3.24.1/ns-3.24.1 and try it

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Really very helpful steps to install ns3.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. I've just installed ns-3.19 and tried
    will@ubuntu:~/ns3/ns-allinone-3.19$ ./waf -d debug --enable-examples --enable-tests configure
    bash: ./waf: No such file or directory
    will@ubuntu:~/ns3/ns-allinone-3.19$ ./waf
    bash: ./waf: No such file or directory
    will@ubuntu:~/ns3/ns-allinone-3.19$ ./test.py
    bash: ./test.py: No such file or directory

    Can you help me?

    ReplyDelete
    Replies
    1. Brother you need to enter the folder ns-3.19 where the waf script is present. There you have to run the above program

      Delete
  8. Hi, for ./waf -d debug --enable-examples --enable-tests configure you need to go to next directory ns-3.19, then only ./waf and ./test.py will work. type ls in current directory and see "ns-3.19" then cd ns-3.19.

    ReplyDelete
  9. hello,
    i am new in ns3 and i want to integrete in algourithm into ns3.
    can you help me

    ReplyDelete
  10. hello sir,
    in 4th step error:Could not create the directory /home/ubuntu/ns3/ns-allinone-3.19/ns-3.19/build/src/spectrum/examples
    has occured now what to do?

    ReplyDelete
  11. sir NS2 program will work in NS3?? can we run it in NS3??

    ReplyDelete
  12. Hello dear! please help when i am trying
    To install prerequisites- The following Error display.

    E: Package 'libgsl0ldbl' has no installation candidate

    ReplyDelete
  13. i got my internet connection lost during package installation.. 25% was done. is it possible to continue installation?? help asap

    ReplyDelete
  14. Can i install ns3 on same machine with os ubuntu 14.04 if ns2 is already installed there.....

    ReplyDelete
  15. Bro. Help me, plz. I installed NS3.19 and then building configurations by command ./build.py --enable-examples --enable-tests, its run and shown some informations.
    I copied and pasted this command in terminal
    ./waf -d debug --enable-examples --enable-tests configure
    then tested:
    ./test.py
    i received the result: 291 of 294 tests passed (291 passed, 3 skipped, 0 failed, 0 crashed, 0 valgrind errors):
    SKIP: TestSuite ns3-tcp-cwnd
    SKIP: TestSuite ns3-tcp-interoperability
    SKIP: TestSuite nsc-tcp-loss
    and these:
    Waf: Entering directory `/home/thien/ns3/ns-allinone-3.19/ns-3.19/build'
    Waf: Leaving directory `/home/thien/ns3/ns-allinone-3.19/ns-3.19/build'
    'build' finished successfully (1.494s)

    Modules built:
    antenna aodv applications
    bridge buildings config-store
    core csma csma-layout
    dsdv dsr emu
    energy fd-net-device flow-monitor
    internet lte mesh
    mobility mpi netanim (no Python)
    network nix-vector-routing olsr
    point-to-point point-to-point-layout propagation
    sixlowpan spectrum stats
    tap-bridge test (no Python) topology-read
    uan virtual-net-device visualizer
    wave wifi wimax

    Modules not built (see ns-3 tutorial for explanation):
    brite click openflow
    how can i fix it?

    ReplyDelete
  16. build/src/lte/bindings/ns3module.cc.7.o was showing failed

    ReplyDelete