Installing Network Simulator(ns2.34) in Ubuntu10.10

Download the following installation steps as a pdf manual <here>. This manual also contains the steps to install ns2.34 in Fedora 12.

Read this article in Scribd <here>


PROCEDURE 1:

The nightmare days are over!

Now you dont have to spend hours on your linux distro(ubuntu) installing and validating ns2.x

Ubuntu 10.10 has greatly simplified things. You can now install ns,nam and xgraph by just a single command in the Terminal:

 $ sudo apt-get install ns2  nam xgraph 

You will be prompted for the user password. Enter it and watch Ubuntu 10.10 do the things for You!

Happy Ubuntuing ;)

PROCEDURE 2:

On heeding to my  blog visitors requests, I would like to update this post with the steps to install ns2.34, the traditional way.

Step1: Download ns-allinone-2.34 package from this <site>. I will be using ns version 2.34.

Step2: Place the ns-allinone-2.34.tar.gz file in your home folder(/home/micman in my case). Right click on the package and extract the contents in the same home folder.

Step3: Next, open the Terminal(Applications–>Accessories–>Terminal in ubuntu)

Step4: Change to ns-allinone-2.34 directory

 $ cd /home/micman/ns-allinone-2.34

Step5: First, Install the dependencies

  $ sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 

Note that we are downgrading the gcc version, as ns2.34 works well with gcc4.3

Edit Makefile.in found at this location ns-allinone-2.34/otcl-1.13/Makefile.in as follows:

Find the line that says:
CC= @CC@
and change it to:
CC= gcc-4.3

Step6: Begin ns2.34 installation

 $ sudo su

 

  # ./install 

Step7: Once the installation is successful i.e. without any errors, we need to add the path information to the file ~/.bashrc

  $ gedit   ~/.bashrc 

Step8: Append the following lines to the file ~/.bashrc

# LD_LIBRARY_PATH
OTCL_LIB=/home/micman/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/micman/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY

TCL_LIB=/home/micman/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH

XGRAPH=/home/micman/ns-allinone-2.34/bin:/home/micman/ns-allinone-2.34/tcl8.4.18/unix:/home/micman/ns-allinone-2.34/tk8.4.18/unix

# Note: the above two lines starting from XGRAPH should come in the same line

NS=/home/micman/ns-allinone-2.34/ns-2.34/
NAM=/home/micman/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

Here replace /home/micman with the path to your home folder.

Step9: For the changes to take effect immediately, do the following:

$ source      ~/.bashrc 

Thats all!

type ns to see % and type nam to show the nam startup window. This shows your installation has been successful.

Troubleshooting

  • If the tk compilation failed, especially for tk3d.c, make sure you have installed libx11-dev package.
  • If the otcl configuration failed, make sure you have installed x-dev and xorg-dev packages.

Error:

nsbash: ns: command not found

Solution:

This could be because you have not set the $PATH variable. Therefore, the OS does not know where to look for the command “ns“. more detailed solution <here>

Error:

Segmentation Fault

Solution:

found here

Error:

Undefined reference to vtable

Solution:

found here

This article is sponsored by Evansys Technologies.

Was this post helpful? Then thank me by clicking <this link>

You may also be interested in:

Rapidshare alternative

After being annoyed by Rapidshares policy  of  doing anything to make me pay up for its services , i set out on a quest in the vast Internet village to find a good alternative to Rapidshare.

I was surprised to find few  file sharing sites that had no restrictions and which did not prohibit or delay certain the services by categorizing users into Premium users and free users.

First , http://ifile.it (earlier known as  mihd.net) , a simple and clean looking site that offers an upload capacity of 100MB per file for Guest users and 250MB per file for Free Registered Users :)

Other features include :

  • There are no download limits .
  • Download accelerators could be used .
  • Downloads can be resumed.
  • No annoying Ads .
  • No waiting times.

Read their FAQs to know more about them .

Second , http://www.ziddu.com/ .

All free accounts! No Premium accounts!!

This is their motto !

Highlighted features :

  • The  maximum file upload  size is 200 MB.
  • Accepts parallel downloads! no waiting !!
  • No waiting time.
  • And one more special mention about ziddu ,
  • For each unique download, you will get $0.001 !!!
  • Redeemed cash will be transferred via PayPal or Moneybookers once it reaches $10.


10000 Unique Downloads: $10 USD

50000 Unique Downloads: $50 USD

100000 Unique Downloads: $100 USD

500000 Unique Downloads: $500 USD

1000000 Unique Downloads: $1000 USD

  • You will get $0.10 Referral Bonus, when someone joins with Ziddu through your referral link and uploads his first file.

One annoying feature i found in ziddu is the advertisements in their site . Also at times , you are prompted of  a wrong entry even if you enter the correct CAPTCHA code displayed there.

On the whole , i see iFile and Ziddu as excellent alternatives to Rapidshare.

And if you are still not convinced , then read < this >.

Additional readings :