This article addresses some of the obstacles that one should pass before trying to implement a custom 3D version of any localization algorithm under ns-2-Aquasim.
Of course, this installation or patching procedure is based on the one provided by Anabel Pineda Briseño1, a former PhD. Student of Computer Science, Computer Research Center, Mexican National Polytechnic Institute, Mexico City, Mexico.
In fact, such patching procedures are nothing but a standard way of incorporating a routing protocol with ns-2. So if one understands how a routing protocol is integrated with ns-2, then it will be easy for them to successfully repeat this procedure.
Since we are going to implement a 3D version of DV-Hop algorithm under the Aquasim version of ns-2, this procedure is entirely different from all other previous procedures that you may see in previous research works.
As far as I know, this article is the very first attempt of using a ‘real’ localization algorithm under the ns-2 version of Aquasim UWSN simulation.
Important Note: This article is nothing but a log of my own experiments on Aquasim. Further, this article is not meant for those who are just viewing the public part of this article.
Some Technical Aspects that Should be Addressed:
- The previous implementations of the localization algorithm (including dv-hop) are only implemented on standard wireless networking technology. So, they simply will not work under an acoustic underwater network.
- Generally, the previous implementations of localization algorithms were made to work on a physical medium model such as WirelessPhy of ns-2. But, under UWSN, we need to make it work on the physical medium model UnderwaterPhy of Aquasim.
- Under a normal wireless scenario, a propagation model such as TwoRayGround or Durkin’s propagation will be used. But, under UWSN, we need to use UnderwaterPropagation of Aquasim.
- 802_11 Mac is generally used in all the previous examples of localization algorithms. But, we have to make a localization algorithm to work on BroadcastMac of Aquasim.
- Since the previous implementations are implemented as a ‘dummy’ routing protocol, they handled the link layer and port demultiplexer in a different way. To make the localization algorithm to work under a UWSN, we have to ‘handle’ the interfaces of LL and Port_Demux as per the way in which Aquasim is handling them. In fact, it is the most important part of this new design. Otherwise, the packets transmitted by a localization node could not be actually transmitted or received by other nodes.
Note :
The main components and the logic of the dvhop3d localization protocol have been implemented in the following three files:
- dvhop.cc,
- dvhop.h,
- dvhop_packet.h
As per the original procedure, we are going to modify the following files to incorporate dvhop3d as a dummy routing protocol module under ns-2.
- $NS_ROOT/Makefile
- $NS_ROOT/queue/priqueue.cc
- $NS_ROOT/common/packet.h
- $NS_ROOT/trace/cmu-trace.h
- $NS_ROOT/trace/cmu-trace.cc
- $NS_ROOT/tcl/lib/ns-packet.tcl
- $NS_ROOT/tcl/lib/ns-lib.tcl
- $NS_ROOT/tcl/lib/ns-agent.tcl
- $NS_ROOT/tcl/lib/ns-mobilenode.tcl
For installing Aquasim under ns-2, one may see the following articles[2]:
Installing Aquasim & Aqua3D on an old Linux under VirtualBox
So, I assume that the reader already installed a working version of Aquasim as explained in the above procedure and having it ready for further experiments.
Step 1: Prepare a Folder for your new Routing Agent