WEB ENGINEERING

Installing Network Simulator 2 on Debian GNU/Linux

Posted on: August 15, 2010

Pre-Requisite: Install Debian GNU/Linux

STEP  1: Download Network Simulator Setup.

Download NS2 All In One Package from following link:

http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/

Official Website:

http://www.isi.edu/nsnam/ns/

STEP 2: Place the file in your home directory and extract the tar file

$ tar -xzvf ns-allinone-2.31.tar.gz

Note: This tutorial was designed using 2.31 version.
Please don't forget to replace 2.31 to 2.34 in following commands

STEP 3: Go to folder where tar file is extracted.

$ cd ns-allinone-2.31

STEP 4: Insert Debian DVD for dependency components.

$ sudo apt-get install build-essential autoconf automake libxmu-dev
$ sudo apt-get install -f build-essential
libxt-dev libxt6 libsm-dev libsm6 libice-dev libice6 libxmu-dev

STEP 5: Install NS2 using following command.

$./install
Note: This process will take some time.

STEP 6: Set environment variables

$ gedit ~/.bashrc

Add the following lines to the end of it.

Dont forget to replace "/home/bharat with your directory path.

Example: /home/yourname/

# LD_LIBRARY_PATH
OTCL_LIB=/home/bharat/ns-allinone-2.31/otcl-1.13
NS2_LIB=/home/bharat/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/bharat/ns-allinone-2.31/tcl8.4.14/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/bharat/ns-allinone-2.31/bin:/home/bharat/ns-allinone-2.31
/tcl8.4.14/unix:/home/bharat/ns-allinone-2.31/tk8.4.14/unix
NS=/home/bharat/ns-allinone-2.31/ns-2.31/
NAM=/home/bharat/ns-allinone-2.31/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

STEP 7: Make changes

$ source ~/.bashrc

STEP 8: Check Installation Success

$ ns
%

If you type ns command on shell, then a "%" will appear on the screen.
That means NS2 is successfully installed.

STEP 9: Exit to Linux prompt


%exit
$

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

STEP 10: Validation of NS2 Installation.

Go to network simulator directory inside the all in one
package and execute following command.


$ cd ns-2.31
$ ./validate

Note: Be patient till validation gets successful.
FINISHED

Advertisements

6 Responses to "Installing Network Simulator 2 on Debian GNU/Linux"

[…] About Installing Network Simulator 2 on Debian GNU/Linux […]

Done till
source ~/.bashrc
but after trying to execute the command ‘ns’
it says command not found..any solution(suggestion)

command not found-error indicates that ns is not installed, check whether dependencies packages were installed properly, or check bashrc file in which you edited /home/hostname and most important, while editing the file, make sure you changed ns-allinone-2.31 to 2.34

@Uddhav & Bharat
try the commands
$ cd ns-2.31
$ ./validate just after gedit ~./bashrc and make sure you gives enough space and new lines as in the given text for bashrc.
You can only run command ‘ns’ succefully after validation is succeffully completed.

thank God
and thank you a lot Bharat
finally the installation finished successfully certainly with your ordered steps
Beast Regards

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 50 other followers

What I am Upto Now

Follow Me On Twitter

Blog Stats

  • 69,006 hits

Live Traffic

My Paintings

Guess Who is She

Magnet

Party Goer

Holi

Propose

More Photos
%d bloggers like this: