Wednesday, 11 February 2015

Installing NS-2.35 in Ubuntu 14.04

This post will tell you how to install NS-2.35 in Ubuntu 14.04 64-bit operating system.

NS-2 is a discrete event simulator targeted at networking research. NS-2 provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.

Step 1 : Download NS-2.35 from here.

Step 2 : Copy the downloaded file from the Download folder to your home directory /home/sai folder ( in my case )

Step 3 : Open your Terminal and execute these commands one by one

sudo apt-get update

sudo apt-get install build-essential automake autoconf libxmu-dev

Step 4 : Untar ns-allinone-2.35.tar.gz using the command below

tar zxvf ns-allinone-2.35.tar.gz

Step 5 : Once the file is unzipped, here you need to make a small change in the source file . Go to the folder ns-2.35/linkstate/ and open ls.h using any editor ( gedit or nano or vi). Now go to line number 137 and make the following changes

Just add this-> before erase

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

Once this is done save your ls.h file and close the editor

Now you can install NS-2.35 in your system

Step 6 : Go inside ns-allinone-2.35 by using the command cd ns-allinone-2.35 from your terminal and enter the command ./install

Your installation will start and it will take some time for complete installation

Once the installation is over, you need to set the path for NS-2.35

Step 7 : As I am using Ubuntu, I need to paste the path in .bashrc file. Open .bashrc by entering the following command from your terminal

gedit .bashrc

Once the file is opened, you need to paste your path

export PATH=$PATH:/home/sai/ns-allinone-2.35/bin:/home/sai/ns-allinone-2.35/tcl8.5.10/unix:/home/sai/ns-allinone-2.35/tk8.5.10/unix

Now save your file and close it

From your terminal run the following command to save your changes in the file

source .bashrc

The installation is over, now you need to check whether NS2 is working or not. In order to check type the following commands in your terminal

Enter ns in your terminal, if % symbol comes after you press enter, your installation is successful.

Enter nam in your terminal, if a Nam window pops out, Nam is installed successfully.

For video tutorial click here.

Share your experience with us, Any queries please comment below

No comments:

Post a Comment