You are on page 1of 2

Network Simulator (ns2) is a very popular simulation software.

Most of the peopl


e face difficulties in installing ns2 on ubuntu, however I am here posting step
by step installation procedure through which I installed ns2 on my ubuntu OS.
#======================
#Part I: Introduction
#======================
This installation guide is on Linux Ubuntu 12.04 LTS and uses ns-allinone-2.35
source file for NS2. I assume that you have the skill to install Ubuntu, so I sk
ip this process, and focus on the installation of NS2 (step-by-step with command
s).
#========================
#Part II: Installation
#========================
[Step 1]
First open the Terminal (Ctrl+Alt+T) and write the following command for necessa
ry updates.
sudo apt-get update
[Step 2]
After installing updates , you have to install some essential softwares for inst
alling ns2:
sudo apt-get install tcl8.5-dev tk8.5-dev
sudo apt-get install build-essential autoconf automake
sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev
[Step 3]
Download NS2 source file from from here.
Then you will get a file named ns-allinone-2.35.tar.gz
[Step 4]
Unpack ns-allinone-2.35.tar.gz to your home directory. (/home/megha is my home d
irectory, you SHOULD change it to your own!)
tar -zxvf ns-allinone-2.35.tar.gz
[Step 5]
Install NS2:
cd /home/megha/ns-allinone-2.35
sudo ./install
[Step 6]
==> Modify .bahrc
gedit /home/megha/.bashrc
==> Go to the last line and add the scripts below:
export PATH=$PATH:/home/megha/ns-allinone-2.35/bin:/home/megha/ns-allinone-2.35/
tcl8.5.10/unix:/home/megha/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/megha/ns-allinone-2.35/otcl-1.14:/
home/megha/ns-allinone-2.35/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/megha/ns-allinone-2.35/tcl8.5.10/library

==> Enable the path setting:


cd /home/megha
source .bashrc
#======================
# Part III: Verifying
#======================
which ns
If it shows /home/megha/ns-allinone-2.35/bin/ns, voila it works!
Alternatively, you can check by typing ns in your Terminal.
If it returns %, then you are good to go.

You might also like