top of page
Search

How to install NS-2.35 in Ubuntu / any Linux OS

  • Writer: Hitesh Sharma
    Hitesh Sharma
  • Mar 30, 2019
  • 1 min read

Updated: Jul 25, 2019


Step 1 : Download NS-2.35 and extract the folder .


Step 2 : Open a terminal and type the following command one by one. Wait until the process gets complete and then types another command. Also, make sure have an active internet connection.

sudo apt-get update

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


Step 3 : At the time of writing this tutorial, gcc-4.9 was the latest version. So first check the gcc version .


sudo apt-get install gcc-4.9



Step 4 : Now open ns-allinone-2.35/ns-2.35/linkstate/ls.h

In line 137, change the following line

void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

to

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }


Step 5 : Now open ns-allinone-2.35/otcl-1.14/Makefile.in

Change the following line

change Change CC= @CC@ to CC=gcc-4.9


Step 6 : Now open Navigate to the ns-allinone-2.35 folder:

Open terminal and then type the following

cd /ns-allinone-2.35

./install


That's it. . . Now wait for NS2 it will take 10 to 15 minutes or maybe more.


Step 7 : Open terminal and then type the following

gedit .bashrc

And then Paste the following code at the END but don't forget to change your User-Name


# LD_LIBRARY_PATH

OTCL_LIB=/home/hitesh/Downloads/ns-allinone-2.35/otcl-1.14

NS2_LIB=/home/hitesh/Downloads/ns-allinone-2.35/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/hitesh/Downloads/ns-allinone-2.35/tcl8.5.10/library

USR_LIB=/usr/lib

export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/hitesh/Downloads/ns-allinone-2.35/bin:/home/hitesh/Downloads/ns-allinone-2.35/tcl8.5.10/unix:/home/hitesh/Downloads/ns-allinone-2.35/tk8.5.10/unix

#the above two lines beginning from xgraph and ending with unix should come on the same line

NS=/home/hitesh/Downloads/ns-allinone-2.35/ns-2.35/

NAM=/home/hitesh/Downloads/ns-allinone-2.35/nam-1.15/

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



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

cd ns-2.35; ./validate




 
 
 

Recent Posts

See All

Comments


123-456-7890

  • twitter
  • linkedin
  • youtube

©2019 by Network Simulation. Proudly created with Wix.com

bottom of page