Saturday, November 6, 2010

How to Install Ns2.28 with mobiwan in Ubuntu 8.04

To install ns 2.28 and mobiwan 2.28 you should follow these steps

Download the following packages :
ns-allinone-2.28.tar.gz
ns-2.28-gcc410.patch
ns-228-mobiwan-102.diff.gz or ns-228-mobiwan-102.diff


Type the following :
$ sudo apt-get install build-essential autoconf automake libxmu-dev
$ tar zxvf ns-allinone-2.28.tar.gz
$ patch -p0 < ns-2.28-gcc410.patch
$ cd ns-allinone-2.28
$ ./install

This should take a while after it finishes it should ask you to compile your gt-itm & sgb2ns separately. And tell you that Ns-allinone package has been installed successfully.

Now at the prompt type
$ cd ~
$ gedit .bashrc

Copy and paste the folloing to .bashrc

#______________________________________________________________________________

# LD_LIBRARY_PATH
OTCL_LIB=~/ns-allinone-2.28/otcl-1.9
NS2_LIB=~/ns-allinone-2.28/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=~/ns-allinone-2.28/tcl8.4.5/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=~/ns-allinone-2.28/bin:~/ns-allinone-2.28/tcl8.4.5/unix:~/ns-allinone-2.28/tk8.4.5/unix
NS=~/ns-allinone-2.28/ns-2.28/
NAM=~/ns-allinone-2.28/nam-1.11/
PATH=$PATH:$XGRAPH:$NS:$NAM

#______________________________________________________________________________

Save and exit.

Copy ns-228-mobiwan-102.diff.gz to /ns-allinone-2.28/ns-2.28 and type

$ cd ns-allinone-2.28/ns-2.28
$ zcat ns-228-mobiwan-102.diff.gz |patch -p1 or patch -p1 -u < ns-228-mobiwan-102.diff
$ ./configure
$ make clean
$ make



Now download simple-mipv6.tcl and edit it replacing the "BASEDIR/ns-allinone-2.26/ns-2.26" with "~/ns-allinone-2.28/ns-2.28", there are 7 of them.

Now Type

$ ns simple-mipv6.tcl

The result should be like this

#______________________________________________________________________________

num_nodes is set 5
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead

>-------------------- NS Addressing --------------------<
Domains (domain_num) : 2
Clusters (cluster_num) : 1 5
Nodes (nodes_num) : 1 1 3 1 1 1
>-------------------------------------------------------<

SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
31.902 get_coa for BS 1.2.0:4198400
Simulation finished

|Binding Cache for node 1.1.0 at 100 --------------------------------------- |
|Node COA Type Info Flag Last Time Life Expire Nb|
|1.1.1 1.2.6 7 MN 1 22 96.9075 10 0 12 |


|Binding Cache for node 0.0.0 at 100 --------------------------------------- |
|Node COA Type Info Flag Last Time Life Expire Nb|
|1.1.1 1.2.6 7 MN 1 23 96.9096 10 0 11 |


|Binding Update List for node 1.1.1 at 100 --------------------------------------- |
|Node COA Type Info Flag Last Time Life Expire Nb|
|0.0.0 1.2.6 5 CN 1 23 96.902 10 109.964 11 |
|1.1.0 1.2.6 3 HA 1 22 96.902 10 2.68435e+08 12 |


|Base Station List for node 1.1.1 at 100 --------------------------------------- |
|Node COA Type Info Flag Last Time Life Expire Nb|
|1.2.0 1.2.6 8 BS 1 -1 99.5647 1 0 135 |

#______________________________________________________________________________

DONE!!!!!!!