Wednesday, March 10, 2010

Installation Procedure of NS2 in Ubuntu

Installing ns2.32 on Ubuntu7.10

This article works fine for Installing ns2.31 on Ubuntu 7.04 but for ns2.32 it needs some minor changes so I will repeat the commands with these changes so that others may save time repeating this work

Download ns-allinone-2.32 and Install

$ wget http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.32.tar.gz

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

$ cd ns-allinone-2.32

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

If an error raising Package autoconf is not available or something similar then this post may help you for fixing that

(If previous command still generate some errors, and if it does, restart your computer and try the following step :)

$ sudo apt-get install -f build-essential libxt-dev libxt6 \

libsm-dev libsm6 libice-dev libice6 libxmu-dev

If an error raising Package autoconf is not available or something similar then this post may help you for fixing that

Now run this command

$./install

Set environment variables

$ gedit ~/.bashrc

Add the following lines to the end of it. Remember replace "/your/path" by something like "/home/purple"




# LD_LIBRARY_PATH

OTCL_LIB=/your/path/ns-allinone-2.32/otcl-1.13

NS2_LIB=/your/path/ns-allinone-2.32/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=/your/path/ns-allinone-2.32/tcl8.4.15/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/your/path/ns-allinone-2.32/bin:/your/path/ns-allinone-2.32/tcl8.4.15/unix:/your/path/ns-allinone-2.32/tk8.4.14/unix

NS=/your/path/ns-allinone-2.32/ns-2.32/

NAM=/your/path/ns-allinone-2.32/nam-1.13/

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

Let it take effect immediately:

$ source ~/.bashrc

Note: the step described above is important;otherwise, you cannot run ns successfully.

(or you can restart your X windows,i.e. logout and then login, or reboot your system, to make it work.)

Now,the installation has been completed.If you try:

$ ns

Then a "%" will appear on the screen.type "exit" to quit the mode and back to "$"


Validation

After these steps, you can now run the ns validation suite with

$ cd ns-2.32 $ ./validate

1 comment:

  1. dear sir, i am getting the following error message while typing ns:-

    ns: error while loading shared libraries: libpcap.so.0.6.2: cannot open shared object file: No such file or directory

    ReplyDelete

Thanks for using my blog any queries or help please email to clickprasan@gmail.com . Please be careful from spammers .do not reply to any other email address other than mentioned above