Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Downloading, Installing and Validating

NS2 ( ns-allinone-2.33 ) on
Ubuntu 8.04 LTS ( Hardy Heron )
By : Gaurav Sharma

Download ns-allinone-2.33
gaurav@gaurav-desktop:~$
wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.33.tar.gz

Install ns-allinone-2.33
gaurav@gaurav-desktop:~$ tar -xzvf ns-allinone-2.33.tar.gz

gaurav@gaurav-desktop:~$ cd ns-allinone-2.33

Run Update

gaurav@gaurav-desktop:~/ns-allinone-2.33$ sudo apt-get update

gaurav@gaurav-desktop:~/ns-allinone-2.33$ sudo aptitude update

Install “build-essential” package


gaurav@gaurav-desktop:~/ns-allinone-2.33$ sudo aptitude install build-essential

( insert CD if required )

gaurav@gaurav-desktop:~/ns-allinone-2.33$
sudo apt-get install build-essential autoconf automake libxmu-dev

gaurav@gaurav-desktop:~/ns-allinone-2.33$ ./install

Edit “.bashrc” file to set environment variables


gaurav@gaurav-desktop:~/ns-allinone-2.33$ gedit ~/.bashrc
Add the following lines to the end of the file.

# LD_LIBRARY_PATH

OTCL_LIB=/home/gaurav/ns-allinone-2.33/otcl-1.13

NS2_LIB=/home/gaurav/ns-allinone-2.33/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_L
OCAL_LIB

# TCL_LIBRARY

TCL_LIB=/home/gaurav/ns-allinone-2.33/tcl8.4.14/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/gaurav/ns-allinone-2.33/bin:/home/gaurav/ns-allinone-
2.33/tcl8.4.14/unix:/home/gaurav/ns-allinone-2.33/tk8.4.14/unix

NS=/home/gaurav/ns-allinone-2.33/ns-2.33/

NAM=/home/gaurav/ns-allinone-2.33/nam-1.13/

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

Save the file


To make the file effective immediately, Run
gaurav@gaurav-desktop:~/ns-allinone-2.33$ source ~/.bashrc

ns2 Installation Complete


Try :
gaurav@gaurav-desktop:~/ns-allinone-2.33$ ns

A"%" will appear on the screen.


Type "exit" to quit the mode and back to "$" .

Run ns Validation Suite

gaurav@gaurav-desktop:~/ns-allinone-2.33$ cd ns-2.33

gaurav@gaurav-desktop:~/ns-allinone-2.33/ns-2.33$ ./validate

You might also like