Tuesday, April 28, 2009

NS2.33 installation in Linux Ubuntu

It may be a frustrated experience during the installation of NS2, the following provides useful steps to help install Network Simulator 2.33 in Ubuntu.

1. download ns-allinone-2.33.tar.gz
2. copy ns-allinone-2.33.tar.gz to /home/username.
3. sudo apt-get install build-essential (for gcc)
sudo apt-get install g++
sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
sudo apt-get install libxmu-dev.

4. cd /home/username
tar xvfz ns-allinone-2.33.tar.gz

5. cd ns-allinone-2.33.tar.gz
./install


6. Add environment variables by typing "gedit .bashrc"

export PATH=$PATH:/home/username/ns-allinone-2.33/bin:/home/username/ns-allinone-2.33/tcl8.4.18/unix:/home/username/ns-allinone-2.33/tk8.4.18/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/username/ns-allinone-2.33/otcl-1.13:/home/username/ns-allinone-2.33/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/username/ns-allinone-2.33/tcl8.4.18/library

7. Activate the new environment variables by directly typing
"source ~/.bashrc" or log-out Ubuntu to reload the environment variable

8. cd /ns-allinone-2.33/ns-2.33
./validate

9. sudo apt-get install gawk gnuplot if you prefer.

10. type command "ns" in the terminal. If it shows "%", then you are done.

For those who are interested in ns2 tcl scripts, the following is a link useful for novices http://www.isi.edu/nsnam/ns/tutorial/
 
Delicious Bookmark this on Delicious