User Tools

Site Tools


misc:ns2_227

Network Simulator ns2 2.27 in Ubuntu 10.04 (32bit only!)

We managed to get ns-2.27 allinone working successfully under Ubuntu GNU/Linux 10.04 LTS. You need a 32 bit (NOT 64) installation of Ubuntu 10.04.4 (the latest release), an Internet connection and about 45 minutes to compile and check this version of ns2. Our patch includes fixes by Qihe Wang and Mathieu Robin, some code backported from ns 2.29, ideas taken from forums and a few corrections suggested by our experience.

Let's start. First of all upgrade your Ubuntu installation

sudo apt-get update
sudo apt-get dist-upgrade

Now install packages and libs required for compiling ns2

sudo apt-get install build-essential autoconf libx11-dev xorg-dev

Download NS-2.27 allinone

wget ftp://ftp.isi.edu/nsnam/ns-allinone-2.27.tar.gz

Unpack NS

tar -xvf ns-allinone-2.27.tar.gz

Download our NS-2.27 patch for Ubuntu 10.04

wget http://dl.dropbox.com/u/12576285/ns-2.27-ubuntu_10.04-gcc_4.patch.tar.gz

Unpack the patch

tar -xvf ns-2.27-ubuntu_10.04-gcc_4.patch.tar.gz

Apply the patch

patch -p0 < ns-2.27-ubuntu_10.04-gcc_4.patch

Download the ns2-bashrc configuration file

wget http://dl.dropbox.com/u/12576285/ns2-bashrc.append

Edit the first line of ns2-bashrc.append and set the value of NS2_DIR to the correct path (if needed)

nano ns2-bashrc.append

Append the file to you current .bashrc file

cat ns2-bashrc.append >> ~/.bashrc

Reload .bashrc

source ~/.bashrc

Cross you fingers and compile

cd ns-allinone-2.27/
./install

You can run now the ns validation suite

cd ns-2.2.7
./validate

If everything went fine, you should see a message like

Validate overall report: all tests passed
misc/ns2_227.txt · Last modified: 2013/02/23 19:51 by lele