Monday, 12 August 2013

Welcome to Learning blog of NS-2.34 in 1 Hour....

Steps for installation of ns 2.34 in ubuntu(10.X and above)
(Note : all bold sentences are used here for commands)
1. Download the ns-allinone-2.34.tar.gz from genuine source
2. Copy the downloaded ns-allinone-2.34 into Desktop directory.
3. Now you need to update and install some required packages----
      a. open terminal (Ctrl+Alt+T)
            type command         sudo apt-get update
      b. Required Libraries
           type command on terminal             sudo apt-get install build-essential autoconf automake libxmu-dev
           press enter
     type command    sudo apt-get install xorg-dev g++ xgraph

4. Extract the ns-allinone-2.34.tar.gz (Note: type the below mentioned commands on terminal)
       cd Desktop/ press enter
       tar zxvf ns-allinone-2.34.tar.gz    press enter
5. You need to modify some codes---
     a. In ns-allionone-2.34/otcl-1.13/configure
                      replace     SHLIB_LD="Id-shared"      by  SHLIB_LD="gcc-shared"

6. Installation required
      on terminal directory cd Desktop/ns-allinone-2.34/      press enter
      type            ./install  
7. Path setting required-----
     a. in terminal sudo gedit ~/.bash_nav       (Note: bash_nav is only a file name, you can use anything like this  ./bash_X) where X is any word or letter.
8. Then copy the following path into .bash_nav and modify according to ns-2.34 folder

      #LD_LIBRARY_PATH
     OTCL_LIB=/home/naveen/Desktop/ns-allinone-2.34/otcl-1.13  (Note: here naveen is my system name)
     NS@_LIB= /home/naveen/Desktop/ns-allinone-2.34/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/naveen/Desktop/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

#PATH
XGRAPH=/home/naveen/Desktop/ns-allinone-2.34/bin:/home/naveen/Desktop/ns-allinone-2.34/tcl8.4.18/unix:/home/naveen/Desktop/ns-allinone-2.34/tk8.4.18/unix
NS=/home/naveen/Desktop/ns-allinone-2.34/ns-2.34
NAM=/home/naveen/Desktop/ns-allinone-2.34/nam-1.14
PATH=$PATH:$XGRAPH:$NS:$NAM 

8. now type the command source ~/.bashrc  on terminal
9. now move to directory cd Desktop/ns-allinone-2.34/ns-2.34/   press enter
    type   ./validate    (Note: validation takes 20-30 mints)
10. if you type ns in your terminal % should be displayed..