Sunday, March 22, 2015

How to Install NS-2 in Ubantu 10.04


Step # 1
Install Ubuntu 10.04 in oracle virtual box.
Step # 2
By default root user account password is not set. Set root password by login through user created during installation time for example ‘geeks’. Open up the terminal and set new root password by executing the following command
$ sudo passwd root
Now logoff from geeks user and now login to the machine by root user in Gnome.
Step # 3
Now logoff from geeks user and relogin through root user in Gnome. Then Download the latest edition of NS2 source code, but first make sure your internet is working on your newly created virtual machine.
Direct Download link
You can also download by executing the following command. But it is good practice to isolate ns2 work environment. First create ns2 directory in /root directory

# mkdir ns2
# cd ns2

This command will download the ns-allinone-2.35.tar.gz
# wget http://downloads.sourceforge.net/project/nsnam/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz
Step # 4
Since this is compressed archive we will have to decompress it. You can decompress it by double clicking it or by following command
# tar –xzf ns-allinone-2.35.tar.gz
Step # 5
Now install the following software required. First update the Ubuntu software repository.

# apt-get update
# apt-get install autoconf
# apt-get install libc6-dev g++ gcc
# apt-get install build-essential
# apt-get install libx11-dev
# apt-get install x-dev
# apt-get install xorg-dev
# apt-get install xgraph
# apt-get install gnuplot
Step # 6
Now enter /root/ns2/ns-allinone-2.35 directory and execute the install script

# cd /root/ns2/ns-allinone-2.35
# ./install

Step # 7
On successful installation please export the following paths in /root/.bashrc file. Start gedit and open /root/.bashrc file. Add the following 5 lines at the end of the file.

export PATH=$PATH:/root/ns2/ns-allinone-2.35/bin:/root/ns2/ns-allinone-2.35/tcl8.5.10/unix/:/root/ns2/ns-allinone-2.35/tk8.5.10/unix/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/ns2/ns-allinone-2.35/otcl-1.14/:/root/ns2/ns-allinone-2.35/lib
export TCL_LIBRARY=/root/ns2/ns-allinone-2.35/tcl8.5.10/library/:/root/ns2/ns-allinone-2.35/tk8.5.10/library/
export NS=/root/ns2/ns-allinone-2.35/ns-2.35
export NSVER=2.35

Step # 8
Then logoff from root user and relogin and execute type ns at the terminal for checking. Also download the sample script and check it.

# wget http://nile.wpi.edu/NS/Example/ns-simple.tcl
# ns ns-simple.tcl

No comments:

Post a Comment