Installing Network Simulator 2 (ns-2.35) in Ubuntu 13.10 (64 bit)

This post will tell the installation steps for NS2 under Ubuntu 13.10.
Step 1:  Download NS2 package (ns-allinone-2.35)
Step 2:  Copy the file to /home/pradeep folder (you can use your corresponding home path).
Step 3:  Open the terminal and execute the commands one by one

  • Prompt:- sudo apt-get install build-essential autoconf automake libxmu-dev  (all these packages may not be needed, but install all the above for a safer installation of ns2)
  • Prompt:- tar zxvf ns-allinone-2.35.tar.gz
  • Prompt:- cd ns-allinone-2.35
  • Open the file (~ns-2.35/linkstate/ls.h)  using gedit or vi or vim and in line number 137 and change the following line
    void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
    to
    void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
  • Prompt:- ./install 
ns2.35 on ubuntu
ns2.35 on ubuntu

Once the installation is completed you may see the screen like the image given below.
Copy the PATH and LD_LIBRARY_PATH information in to your variable, you may use the /home/pradeep/.bashrc file and copy and paste the PATH and LD_LIBRARY_PATH as shown below.
PATH information in Ubuntu
PATH information in Ubuntu
type ns or nam in the terminal to check whether it is working or not.
For ns, a % symbol indicates the successful installation of NS2
for nam, an animator window will be popping out which indicates the sucessfull installation of NAM. 

Thats it: Try yourself to install and let you comment below for the successful installation

Tracegraph installation in Ubuntu 13.10 (64 bit)

Installing Tracegraph in Linux is always a challenge and that too in a 64 BIT operating System. This post will help the readers in installing the tracegraph comfortably in Ubuntu 13.10 (64 bit OS).

You may refer the older post too: http://www.nsnam.com/2013/02/how-to-install-tracegraph-in-64-bit.html

Ubuntu 13.10 is revamped with great features and also there are some limitations while installing 32 bit softwares in 64 bit OS.

So here are the steps in Installing Tracegraph in Ubuntu 13.10

  • Download the Tracegraph.tar.gz file and copy it to the /home/username folder
  • Enter the following commands one by one 
  • Untar it by entering the command, "tar xvzf tracegraph.tar.gz"
  • cd tracegraph202
  • ./trgraph  (if this command gives you ./trgraph command not found, the follow the next step)
  • sudo apt-get install  lib32z1 lib32ncurses5 lib32bz2-1.0 libxi6 libxtst6 libxrender1 libxtst6:i386 libXp6:i386 libXt6:i386
  • The above command will fetch various libraries from the internet sources and downloaded and then try ./trgraph (you can see three windows popping out as indicated in the figure)
Tracegraph
Tracegraph on Ubuntu 13.10

Don't forget to set the LD_LIBRARY_PATH for the shared object libraries as given below
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/username/tracegraph202/bin/glnx86/

If the path for NS2 is already set, the append this line to the existing LD_LIBRARY_PATH variable as given below
export LD_LIBRARY_PATH=/first/path:/second/path:/home/username/tracegraph202/bin/glnx86/