Monday 5 May 2014

After installing ns3 what to do??

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

./waf --run first

and you will probably get

At time 2s client sent 1024 bytes to 10.1.1.2 port 9
At time 2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time 2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time 2.00737s client received 1024 bytes from 10.1.1.2 port 9

then you can replace first by second,third till seven to get different outputs.note that you are running files of directory ../examples/tutorials which are of .cc extension but you have not used .cc in your command.

Next thing you need to know is put your programs in scratch directory so that you have not to make entry in wscript file.for eg copy availabe programs in scratch directory using different filename and try to run them.



ok the above information can also be found in ns3 tutorial but more important points for you can be:
 
1)ns3 can be used to generate .xml, .pcap, .csv,  .dat files.
2)Netanim will be used to visualize your output that will use .xml file.
3).pcap is packet capture file you can open it using  wireshark or tcpdump.
4)you can open .csv by  just double clicking it(by Libre office).
5).dat is just your file to store data that can be used by .gnuplot script written by you to generate different graphs.

if you are new to netanim, gnuplot or wireshark don't panic i will probably write some intro that will help you to get started with them.




INSTALLING NS3 IN UBUNTU 12.10 AND ABOVE

 ns-3 is a network simulator for Internet systems, targeted primarily for research and educational use.You should install ns3 on any linux platform like ubuntu.If you want help about how to install ubuntu using pendrive you can refer to this link.

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

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 


 (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
 
 
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)
 
 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
 
To test everything allright
 
./test.py
 
If the tests are ok the installation is done. :)