Friday, March 11, 2011

Installing network simulator (ns-allinone-2.34) in Ubuntu 10.04

NS (Network Simulator) is a very useful open source network simulation software tool for communication and computer science engineers. As the name suggests, it is very helpful for the real time simulation of network nodes, channels and their various parameters. We (Me and Gaurav) have chosen our final year project as "Study and simulation of S-Mac protocol" which we are doing in NS. The installation of NS was a difficult task since we didn't get the proper help files. Among the few files we got, some of them were incomplete and some were wrong, so we were in trouble. Later with the help of my friends Pranav, Narayan (They were from Computer Engineering dept with sound knowledge of Ubuntu), i finally installed NS.

I am going to describe the procedures to install NS as follow:

1. Install necessary tools for building:
sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3
2. Now follow the following steps for installation of nsallinone 2.34 and it will work with your machine. (copy ns-allinone-2.34.tar.gz) Suppose that there is "ns-allinone-2.32.tar.gz" in current directory (e.g. "~/" for me is"/home/sudip"). All steps are done in Terminal, so open a terminal in Accessories/Terminal. To extract the file:  
tar xvfz ./ns-allinone-2.34.tar.gz

3. It turns out that otcl does not like the version of gcc installed by default in Lucid. So go ahead and
change ns-allinone-2.34/otcl-1.13/Makefile.in. Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.3

4. Change your directory within terminal as following way(directory for you may be different than mine):
$ cd /home/sudip
$ cd /home/sudip/ns-allinone-2.34

5. Download & install some packages from repository if needed (Now its optional)
$ sudo apt-get install build-essential autoconf automake libxmu-dev

6. Install the ns2
$ cd ns-allinone-2.34
$ ./install

7. Edit some paths
$ gedit ~/.bashrc
Put these lines on that file in the last. Remember that the path for me is "/home/sudip". Replace these lines by your own path directory.

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/sudip/ns-allinone-2.34/bin:/home/sudip/ns-allinone-2.34/tcl8.4.18/unix:/home/sudip/ns-allinone-2.34/tk8.4.18/unix

LD_LIBRARY_PATH=/home/sudip/ns-allinone-2.34/otcl-1.13:/home/sudip/ns-allinone-2.34/lib

TCL_LIBRARY=/home/sudip/ns-allinone-2.34/tcl8.4.18/library

8. Save and reboot

9. Validate it (take very long time compare to install process)
$ cd ns-2.34
$ ./validate

10. Let it take effect immediately
$ source ~/.bashrc

11. Try to run it as following way, by just typing ns with terminal
$ ns
12. If the installation is successful, then you will be able to see % at the command prompt. Type following command to exit
% exit
Hope this may be helpful for you.

1 comment:

  1. ल ठिक छ...अब next batch को student लाई problem न होला...

    ReplyDelete

Visualization of Electromagnetic wave in MATLAB

Wave is imaginary and mysterious thing to us. Many of them are invisible and we even don’t know their pres...