Академический Документы
Профессиональный Документы
Культура Документы
04
Installation of Network Simulator (NS-2.35) in Ubuntu 14.04.
2. Run the following to install some essential packages required by the NS commands before
installing the NS:
1 sudo apt-get install build-essential autoconf automake
2 sudo apt-get install tcl8.5-dev tk8.5-dev
3 sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev
4 sudo apt-get install gcc-4.4
2. After extracting the "ns-allinone-2.35" folder, open up the file "/ns-allinone-2.35/ns2.35/linkstate/ls.h" in an editor. You can do it from the terminal. We have to make some changes
in the ls.h file else it will show an error while installing the NS. Once you have opened the file
move to the line 137 and replace the erase with this->erase and save the file.
NOTE: If you don't make the above stated change then you will see an error while
installing the NS (image 3 below).
3. Now its time to finally install the NS. Open up a terminal and move to the directory where you
have extracted the package, in our case its /home/sois/Desktop/ns2/ns2.35/ and install NS using
the following commands:
1 cd /home/ sois/Desktop/ns2/ns2.35/ns-allinone-2.35
2 sudo ./install
export PATH=$PATH:$XGRAPH:$NS:$NAM
# LD_LIBRARY_PATH
OTCL_LIB=/path_to/ns-allinone-2.35/otcl-1.14/
NS2_LIB=/path_to/ns-allinone-2.35/lib/
USR_Local_LIB=/usr/local/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:
$USR_Local_LIB
# TCL_LIBRARY
TCL_LIB=/path_to/ns-allinone-2.35/tcl8.5.10/library/
USR_LIB=/usr/lib/
export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/path_to/ns-allinone-2.35/xgraph-12.2/:/path_to/ns-allinone2.35/bin/:/path_to/ns-allinone-2.35/tcl8.5.10/unix/:/path_to/ns-allinone2.35/tk8.5.10/unix/
NS=/path_to/ns-allinone-2.35/ns-2.35/
NAM=/path_to/ns-allinone-2.35/nam-1.15/
export PATH=$PATH:$XGRAPH:$NS:$NAM
3. Save the file and restart the system, alternatively you can just reload the .bashrc as:
1 source ~/.bashrc
source ~/.profile
check
ns
should give %
check nam
should display nam window
if it is not working
copy nam file from ns-2.35/nam folder to bin folde
./validate
That is it ! You can now run ns from a terminal window by executing: ns
If you received the % sign, it means that NS is running. Congratulations !!
Referrence:
http://installwithme.blogspot.in/2014/05/how-to-install-ns-2.35-in-ubuntu-13.10-or-14.04.html
---------------------------------------------end-----------------------------------------------------------------------
Uninstalling the NS
If you want to remove the NS from your system then follow these steps:
installation.
4 Restart the system and run following commands one by one:
5 sudo apt-get autoremove
6 sudo apt-get clean
If you get this error then kindly ensure that you have set the path (as in step 3) correctly
and try restarting the system. If the error persists then try running the ns from '/nsallinone-2.35/ns-2.35/bin/'.