TIPS: Installing OAR/RBAR protocol in NS2

               Nov 28, 2006

 

  1. Install Red Hat 9 (complete installation is the best; otherwise include all ‘development tools’, ‘kernel development tools’, development programs (tk, gcc etc) ). Othewrwise, during NS installation, tck./tk etc can’t/fail to install.

 

 

  1. Put ns-allinone 2.29/30  into /usr/src and use ‘tar xzvf ……tar.gz’ to unzip and get into the unzipped folder and press ‘./install’

 

 

 

 

Note: In all recent Linux, GCC is 3+.

Hence NS 2.1b7a (http://www.isi.edu/nsnam/dist/ns-allinone-2.1b7a.tar.gz) cannot be installed ??!!!

 

Therefore, I installed gcc 2.95.c  (http://gcc.gnu.org/releases.html)  [Note:

 

 

Put gcc 2.95.3.tar.gz into /usr/src. Untar ir (tar xzvftar.gz) and type

Ø      ./configure

Ø      make

Ø      make install

 

 

Now, check after installation, >> gcc –v

 

If it shows gcc 2.95.3 then its OK (new ready to install ns-allinone2.1b7a

]

 

 

Put  ns-allinone 2.1b7a into /usr/src

Type tar xzvf ………tar.gz to unzip it

Get into the unzipped folder and type

./install

 

After installation edit the ‘gedit .bashrc

-------------------------------------------------------------------------------

 

# .bashrc

 

# User specific aliases and functions

 

alias rm='rm -i'

alias cp='cp -i'

alias mv='mv -i'

 

# Source global definitions

if [ -f /etc/bashrc ]; then

            . /etc/bashrc

fi

export PATH=$PATH:/usr/src/ns-allinone-2.1b7a/bin:/usr/src/ns-allinone-2.1b7a/tcl8.3.2/unix:/usr/src/ns-allinone-2.1b7a/tk8.3.2/unix

 

 

 export LD_LIBRARY_PATH=/usr/src/ns-allinone-2.1b7a/otcl-1.0a6:/usr/src/ns-allinone-2.1b7a/lib

 

 export TCL_LIBRARY=/usr/src/ns-allinone-2.1b7a/tcl8.3.2/library

 

 

---------------------------------------------------------------------------------

 

 

 

 

 

 

 

You can download  any version of NS from http://www.isi.edu/nsnam/dist/ and install it.

 

Copy the OAR tool (http://www.ece.rice.edu/networks/software/OAR/OAR.html)

accordingly

 

Now it works fine J

==========================

 

In recv() function if (tx_active_ && hdr->error() == 0) { hdr->error()=1; } Use randomize function (fading) --> hdr->error()=1 Req: #include #include e.g. /* initialize random seed: */ srand ( time(NULL) ); /* generate secret number: */ iSecret = rand() % 10 + 1; --> rand() generates a number between 0 and RAND_MAX (32767)