Skip to content

Installing ns2.28

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:

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]



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


– 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

For Assistance in Protocol Implementation, Simulations & Analysis of Industrial as well as Scholarly Research Works, you may Contact Us.

WhatsApp chatDiscuss Through WhatsApp

Call 91 9843779735

Send an e-Mail Message.

This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.

WhatsApp Discuss Through WhatsApp