For .pdf file please click here.
I will share my experiences about NS-2
Why did I need NS-2 even though no one knows anything about it around me.
When I chose my thesis topic I needed to use it. My thesis is about collected data analysis, Welllll how can I collect the data. This is the question and it was answered after a long time. In brief, I used vehicles and vehicles communicated each other and I should the simulate this data exchanging. That’s why I need to use ns-2 and I had to learn it.
Before starting to use ns-2 I installed ubuntu on my computer. At the beginning I used Windows XP and I installed “virtal machine” then I installed “Ubuntu” on it.
When I have Ubuntu I can install ns-2. You can find many things about ns-2 installation.
First of all open your Operating system UBUNTU
Open your console(terminal)
Download ns-allinone-2.32 and Install
$ wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.32.tar.gz
$ tar -xzvf ns-allinone-2.32.tar.gz
$ cd ns-allinone-2.32
(before install ns-2 you will need the packages that are shown below )
$ sudo apt-get install build-essential autoconf automake libxmu-dev
Now run this command
after install ns-2 you should introduce ns-2 to your computer and edit the bash file
$ gedit ~/.bashrc
Add the following lines to the end of it. Remember replace “/your/path” by something like “/home/wexins”
than it take effect immediately.
$ source ~/.bashrc
you should write command at the above, otherwise you cant write ns2 succesfully
Now, open new console and write ns, you will see % at the console.
be carefull!!! you can see % after write ns at any path…by the way to exit from % you should write “exit” on your console.
After these steps, you can now run the ns validation suite with
$ cd ns-2.32 $ ./validate
after this process you can run some files from ns-allinone/ns-2.32/tcl/ex/…..tcl and see the results.
when you run the tcl file if it generates a nam file you can trace it. HOW? go to path where is the tcl source code. than run your tcl code. and write “nam” on your console than small window will appear and click open file than choose your nam file and open it. after that you will see the simulation of your tcl code.