Since the latest aodv-uu version (aodv-uu-0.9.6) only support till ns-2.32, I have to make my own patch aodv-uu-0.9.6 for ns-2.34.
1. Installing NS-2.34
This is my experience when I was installing ns-2.34 on Ubuntu 10.4. Make sure that before you perform installation, the following packages installed:
~$ sudo apt-get install libxt-dev libx11-dev libxmu-dev
I noticed that ns-2.34 did not build on the new version Ubuntu such as 9.10 – 10.10, due to this error when linking:
otcl.o: In function `OTclDispatch': /home/abdusy/ns-allinone-2.34/otcl-1.13/otcl.c:495: undefined reference to `__stack_chk_fail_local' otcl.o: In function `Otcl_Init': /home/abdusy/ns-allinone-2.34/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local' ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined ld: final link failed: Nonrepresentable section on output make: *** [libotcl.so] Error 1 otcl-1.13 make failed! Exiting ... See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
The problem is that otcl is trying to use the ld linker instead of the gcc linker to build a shared library. I have read that this problem can occur with gcc versions 4 and greater. There is a one line fix to otcl-1.13/configure file that is posted here: NS-2 Ubuntu Installation Guide
It means that we have to edit one line in otcl-1.13/configure as follows:
Linux*) SHLIB_CFLAGS="-fpic" #SHLIB_LD="ld -shared" //disabled this line SHLIB_LD="gcc -shared" // add this line SHLIB_SUFFIX=".so" DL_LIBS="-ldl" SHLD_FLAGS="" ;;
And rerun install, it should work.
2. Patch AODV-UU-0.9.6
Before we installing aodv-uu into ns-2, we need to patch aodv-uu. The following files need to modify :
To define new routing protocol packet type such as aodv-uu we have to modify ~/ns-allinone-2.34/ns-2.34/common/packet.h file. We change PT_NTYPE to 63, and for aodv-uu PT_AODVUU = 62. . Just make sure PT_NTYPE is the last, and protocol number is ordered sequentially. So from line 185 changes would be as follows :
#ifdef AODV_UU // AODV packets in AODV-UU // PT_AODVUU; static const packet_t PT_AODVUU = 62; #endif /* AODV_UU */ // insert new packet types here static packet_t PT_NTYPE = 63; // This MUST be the LAST. The original value = 62
That is the different part from the previous patch. Because since modified ns-2.33, it adding support for dynamic libraries. ‘packet_t’ is changed from enum to unsigned int in order to allow dynamic definition of new packet types within dynamic libraries. Pre-defined packet types are implemented as static const.
If we are installing aodv-uu-0.9.6 into an existing already compiled ns-2.34
installation, ns-2.34 needs to be recompiled before the changes take
> cd ~/ns-allinone-2.34/ns-2.34 > ./configure > make distclean > ./configure > make