Friday, May 22, 2009

How to install NS2 in intrepid ibex or fedora 8

Download the ns2-allinone package from here This is version 2.31. You can download 2.30-33 versions. The steps are same for everything. It will be in compressed form. Extract them to a specific directory. Say, /home/chandan

How to install NS2 in intrepid ibex or fedora 8

Download the ns2-allinone package from here This is ns-allinone2.31 version. You can download 2.30-33 versions. The steps are same for everything. It will be in compressed form. Extract them to a specific directory. Say, /home/chandan

Follow the below mentioned steps.
sudo apt-get install autoconf automake libxmu-dev xorg
cd ns-2.30
./install

It will configure all the files needed to execute the tcl scripts. It will take ten minutes. Dont interrupt the terminal in between. It will be linked with otcl and c++ libraries. By default ns2 supports, aodv, dsdv, dsr and tora protocols. zrp protocol is still under research.

Once its installed, you will get series of instructions at the terminal itself. Follow those instructions carefully.

If you cant follow that, do this.

cd /etc
sudo gedit ~/.bashrc (Ubuntu 8.10)
or
gedit ~/.bashrc (Fedora 8)

Copy the following things and paste there. Replace /home/chandan with your installed path. For example, if its /usr/local, replace /home/chandan with /usr/local.

# LD_LIBRARY_PATH

OTCL_LIB=/home/chandan/ns-allinone-2.30/otcl-1.12

NS2_LIB=/home/chandan/ns-allinone-2.30/lib

X11_LIB=/usr/X11R6/lib

USR_LOCAL_LIB=/home/chandan/lib

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY

TCL_LIB=/home/chandan/ns-allinone-2.30/tcl8.4.14/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/chandan/ns-allinone-2.30/bin:/home/chandan/ns-allinone-2.30/tcl8.4.13/unix:/home/chandan/ns-allinone-2.30/tk8.4.13/unix

NS=/home/chandan/ns-allinone-2.30/ns-2.30/

NAM=/home/chandan/ns-allinone-2.30/nam-1.12/

PATH=$PATH:$XGRAPH:$NS:$NAM

Save and close the file.
Now, type this at the terminal

source ~/.bashrc

Then, type this command at the terminal.

$ns
%
You will get a "%" prompt. If not follow the above steps carefully and you can have simulation working on your intrepid ibex or Fedora 8.

NOTE: In case if u get error message in ubuntu, make sure you have not installed "host" package. If its installed, remove it from synaptic package manager.

No comments:

Post a Comment