Installing ns2.28
Here we assume that the student is a PG level/research level student with an elementary knowledge of Linux and ns2.
The given procedure is for ns2.28 only.
If you are installing a higher version, then the version number on ns/tcl/nam/xgraph will also change accordingly
1. Download ns2.28 from the following link:
http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz
login as root copy the ns-allinone-2.28.tar.gz file in / (the root of the filesystem)
#cd /
#gunzip –d ns*.gz this will extract ns-allinone-2.28.tar in the / file system
#tar –xvf ns*.tar this will extract ns.28 under the directory /ns-allinone-2.28
First install ns2.28
# cd /ns-allinone-2.28/
#./ install – to install ns2.
After successful installation, edit the /root/.bash_profile with the following values – then only the following commands will work from any project directory) [/.bash_profile is a hidden file]
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ns-allinone-2.28/otcl-1.9:/ns-allinone-2.28/lib:/root/bin/glnx86/
TCL_LIBRARY=/ns-allinone-2.28/tcl8.4.5/library
PATH=$PATH:$HOME/bin:/ns-allinone-2.28/bin:/ns-allinone-2.28/tcl8.4.5/unix:/ns-allinone-2.28/tk8.4.5/unix
export USERNAME BASH_ENV PATH LD_LIBRARY_PATH TCL_LIBRARY
Reboot the system and login again
Check the good working of ns2 by just typing the following command.
#ns – this will produce % prompt (Ctrl+C to exit)
#nam – This will start nam
#xgraph
– it should wait for input (Ctrl+C to exit)
If all the above three commands are working, then only you may proceed with any experiments on ns2.
#ns program.tcl
This will run a simulation script named as “program.tcl “
# nam out.nam
This will show an animation that is logged in the file “out.nam”
You may start learning ns2 by reading the following post of our ns2 forum
http://www.projectguideline.com/modules.php?name=Forums&file=viewtopic&t=13