A lot of people dread having to install ns2. Well here is a simple tutorial to get you through in just a single go. Mostly people fail at installing ns2 in the first go because of the missing libraries and dependencies.
Here is what you do to install ns2 in the first go.
1. Download ns-allinone-2.35
2. cd into the directory where you have downloaded the ns-allinone-2.35.tar.gz file.
3. Next you need to install the required libraries
6. Now cd into the ns-allinone-2.35 directory and do ./install , hopefully everything will go smoothly and you ns-2 will be installed. But before you can proceed you need to set the environment variables.
copy the following lines at the end of the file, be sure to change /your/path to the path where ns is installed on your system.
for instance on my system i would replace /your/path with /home/z3d
9. source ~/.bashrc to have the changes take effect or you can simply reopen terminal.
10. Now cd into the folder /ns-allinone-2.35/ns-2.35/ and type the command ./validate
it will take a considerably longer time than it did to install and in almost an hour you should get a message all tests successful.
11. Now you can type ns and begin doing your work :)
Here is what you do to install ns2 in the first go.
1. Download ns-allinone-2.35
2. cd into the directory where you have downloaded the ns-allinone-2.35.tar.gz file.
tar -xvzf ns-allinone-2.35.tar.gz
3. Next you need to install the required libraries
sudo apt-get install autoconf automake gcc g++ build-essential libxmu-dev libtool libxt-dev
6. Now cd into the ns-allinone-2.35 directory and do ./install , hopefully everything will go smoothly and you ns-2 will be installed. But before you can proceed you need to set the environment variables.
gedit ~/.bashrc
# LD_LIBRARY_PATH OTCL_LIB=/your/path/ns-allinone-2.35/otcl-1.14 NS2_LIB=/your/path/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=/your/path/ns-allinone-2.35/tcl8.5.10/library USR_LIB=/usr/lib export TCL_LIBRARY=$TCL_LIB:$USR_LIB # PATH XGRAPH=/your/path/ns-allinone-2.35/bin:/your/path/ns-allinone-2.35/tcl8.5.10/unix:/your/path/ns-allinone-2.35/tk8.5.10/unix NS=/your/path/ns-allinone-2.35/ns-2.35/ NAM=/your/path/ns-allinone-2.35/nam-1.15/ PATH=$PATH:$XGRAPH:$NS:$NAM
for instance on my system i would replace /your/path with /home/z3d
9. source ~/.bashrc to have the changes take effect or you can simply reopen terminal.
10. Now cd into the folder /ns-allinone-2.35/ns-2.35/ and type the command ./validate
it will take a considerably longer time than it did to install and in almost an hour you should get a message all tests successful.
11. Now you can type ns and begin doing your work :)