Here we assume that the student is a Graduate level/research level student with an elementary knowledge of Linux/Cygwin and ns2.
(The given procedure is for ns2.26 only – refer to the internet for the procedure for installing Linux and installing )
1. Download ns2.26 from the following link
http://www.isi.edu/nsnam/dist/ns-allinone-2.26.tar.gz
login as root copy the ns-allinone-2.26.tar.gz file in / (the root of the filesystem)
#cd /
#gunzip –d ns*.gz this will extract ns-allinone-2.26.tar in the / file system
#tar –xvf ns*.tar this will extract ns.28 under the directory /ns-allinone-2.26
First, install ns2.26
# cd /ns-allinone-2.26/
If you are using ns2.26 on Cygwin, you have to patch it first. See the note at the bottom for patching ns2.26 for the Cygwin environment. After the Cygwin patch, you may proceed with the following.
#./ install – to install ns2.
After successful installation, edit the /yourhomedirectory/.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.26/otcl-1.0a8:/ns-allinone-2.26/lib:/root/bin/glnx86/
TCL_LIBRARY=/ns-allinone-2.27/tcl8.3.2/library
PATH=$PATH:$HOME/bin:/ns-allinone-2.26/bin:/ns-allinone-2.26/tcl8.3.2/unix:/ns-allinone-2.26/tk8.3.2/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 the following.
If you are trying this under Cygwin :
After installing Cygwin, and extracting a fresh copy of ns2, before installing ns2, first, patch it as follows:
# cd /ns-allinone-2.26/
Patching ns2.26 for cygwin.
Download Cygwin patch for ns2.26 from the following link
http://www.isi.edu/nsnam/dist/ns-allinone-2.26-cygwin.patch
copy the file ns-allinone-2.26-cygwin.patch to ns-allinone-2.26 folder.
run terminal window and change to ns-allinone-2.26 folder.
apply ns-allinone-2.26-cygwin.patch as follows
#patch –p0 < ./ ns-allinone-2.26-cygwin.patch
(here we are keeping the patch file ns-allinone-2.26-cygwin.patch under ns-allinone-2.26 directory)
# ./install
That’s it. It successfully installed ns2.26 on Cygwin.
Just see the following screen showing the successful installation.