Monday 7 September 2009

Installing NS2.31 on Ubuntu

Now i am validating ns2 and since it takes lot of time to complete it i thought why not write about what i just did to install NS2.31.

From the begining, steps i have taken:

I downloaded Ubuntu 9.04 Desktop edition and burned it on a cd. Then i installed it from windows. It has been made so easy that you can install Ubuntu like any other software in windows. After installation you have to boot computer and you will get a prompt to choose OS, if you have dual OS. Boot it from Ubuntu and its done so easy. Then you have to configure network. It is required to install required packages for NS.

Then since i have been working on NS-2.31. I mounted windows drive and  i copied ns-allinone-2.31.tar to my /home/ananta folder.

Now you are need to install and upgrade your system in order to install NS. Do following steps. Open terminal and type following line.

$ sudo apt-get install build-essential autoconf automake libxmu-dev

prompt will ask you to install dependent files and upgrade your system. please do  whatever you are asked to do. it will take some time depending upon your internet speed. Remember you have to restart after upgrading your system.

Then,
$ tar -xzvf ns-allinone-2.31.tar.gz
$cd ns-allinone-2.31

Then before installation of NS2.31 if you want to use NAM then you will also have to fix a bug. Yes a bug, i searched ofcourse its not mine, but i have written solution in next blog find it, fix it and then only install it.

$./install

Now you have to update Environmental Variables
$ gedit ~/.bashrc



Add the following lines and do replace “/home/ananta/” by something like “/home/yourname/”
——————————————————————————————–
# LD_LIBRARY_PATH
OTCL_LIB=/home/ananta/ns-allinone-2.31/otcl-1.13
NS2_LIB=/home/ananta/ns-allinone-2.31/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_
LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/ananta/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/ananta/ns-allinone-2.31/bin:/home/ananta/
ns-allinone-2.31/tcl8.4.14/unix:/home/ananta/ns-allinone-2.31/tk8.4.14/unix
NS=/home/ananta/ns-allinone-2.31/ns-2.31/
NAM=/home/ananta/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM
————————–
and since you have changed environmental variables they arent active yet so you need to either restart your computer or
$ source ~/.bashrc
 to check whether you have successfully installed ns
type ns and you should see "% " you can type exit to return back.
$ns
%


Then you have to validate your installation
$ cd ns-2.31
$ ./validate


still now my validation is going on......

No comments:

Post a Comment