Install NS2 (ns-allinone-2.35) on Ubuntu 12.04/14.04 for beginners@DP Project Development

Step by step

#======================
Part I: Introduction
#======================

This installation guide is on Linux Ubuntu 12.04/13.10 / 14.04

I assume that you have already install Ubuntu, so I skip this process, and focus on the installation of NS2 (step-by-step with commands).

#========================
Part II: Installation
#========================

[Step 1]

Now we have to update the Ubuntu with its latest components. Open up a terminal and run these commands.

sudo apt-get update

Before install NS2, you have to install some essential softwares for required NS2, so run the following commands.

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 2]

Download NS2 source file from this link.Download here
Then you will get a file named “ns-allinone-2.35.tar.gz

[Step 3]

Unpack ns-allinone-2.35.tar.gz to your home directory. (/home/user_name/Documents, it is my home directory, you SHOULD change user_name by your own user.!)

 

[Step 4]

cd      /home/user_name/Documents

tar -zxvf ns-allinone-2.35.tar.gz

Install NS2:

cd /home/user_name/Documents/ns-allinone-2.35
sudo ./install

————————At the End it will show like this——————–
Please put /home/user_name/Documents/ns-allinone-2.35/bin:/home/user_name/Documents/ns-allinone-2.35/tcl8.5.10/unix:/home/user_name/Documents/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you’ll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES: Modify .bahrc

open a new terminal and open a file using given command.

sudo gedit .bashrc

Add the following lines AT THE END of the file. Be sure to change “/user_name” to the path of where you have extracted the NS (e.g. ‘/home/user_name/Documents’).

#========================

#LD_LIBRARY_PATH

OTCL_LIB=/home/user_name/Documents/ns-allinone-2.35/otcl-1.14/

NS2_LIB=/home/user_name/Documents/ns-allinone-2.35/lib/

USR_Local_LIB=/usr/local/lib/

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR_Local_LIB

# TCL_LIBRARY

TCL_LIB=/home/user_name/Documents/ns-allinone-2.35/tcl8.5.10/library/

USR_LIB=/usr/lib/

export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/user_name/Documents/ns-allinone-2.35/xgraph-12.2/:/home/user_name/Documents/ns-allinone-2.35/bin/:/home/user_name/Documents/ns-allinone-2.35/tcl8.5.10/unix/:/home/user_name/Documents/ns-allinone-2.35/tk8.5.10/unix/

NS=/home/user_name/Documents/ns-allinone-2.35/ns-2.35/

NAM=/home/user_name/Documents/ns-allinone-2.35/nam-1.15/

export PATH=$PATH:$XGRAPH:$NS:$NAM

#========================

[Step 5]

Save the file and restart the system, alternatively you can just reload the .bashrc as:

source ~/.bashrc
#======================

Validate the Installation

You need to validate NS to check if everything is OK but keep in mind that it will take a lot of time (about 1:30 hrs). Open up a terminal and move to the directory “/home/user_name/Documents/ns-allinone-2.35/ns-2.35/” and run:

./validate

—————————————–
It shows like this
—————————————
INITIALIZE THE LIST xListHead
Loading connection pattern…
Loading scenario file…
Load complete…
Starting Simulation…
channel.cc:sendUp – Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS …DONE!
NS EXITING…
finishing..
Test output agrees with reference output
All test output agrees with reference output.
Wed Sep 5 22:10:33 IST 2012
These messages are NOT errors and can be ignored:
warning: using backward compatibility mode
This test is not implemented in backward compatibility mode
validate overall report: some tests failed:
./test-all-newreno ./test-all-tcpOptions ./test-all-tcpVariants ./test-all-aimd ./test-all-frto ./test-all-quickstart ./test-all-manual-routing ./test-all-links
to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s