Skip to main content

Aqua Sim for NS2 - Underwater Sensor Networks


Sensor nodes deployed inside water are known to be underwater sensor networks. These network is helpful in fish cultivation, habitat monitoring, predicting ptusami, etc.

Updated 9th April 2016 : the link to download the Aquasim is updated, the regular link is not working

This network uses different MAC protocol, routing protocol, etc. Real test bed are costlier and one cannot afford it. Simulators are the ultimate solution to know about these networks. Aquasim is one such tool that is integrated in ns2 for handling underwater sensor networks. This simulator supports new mac layer, new protocols that are helpful in routing inside water. There are examples also to simulate these networks.

Here is the installation steps of Aquasim.  Some points to be taken care of
  • ns-allinone-2.30 is used in creating the underwater sensor networks 
  • nam misbehaves (or does not work) in recent Ubuntu and Mint distributions. 
  •  Need to have the X11, automake and build essential tools to install Aquasim. 
Installation of AquaSim
OS Tested:  Ubuntu 14.04+ and Linux Mint 17+
AquaSim: 1.0 Version (It does not have a 3D version)

Download the aquasim simulator
Here are steps to install the libraries needed to install Aquasim

pradeep@localhost $] sudo apt-get update
pradeep@localhost $] sudo apt-get install libxmu-dev build-essential autoconf automake 

Create a folder called aquasim/ and extract the Aquasim-1.0.tgz inside this folder

pradeep@localhost $] mkdir aquasim 
pradeep@localhost $] cd aquasim/
copy the Aquasim-1.0.tgz in aquasim folder and extract it using 
pradeep@localhost $] tar zxvf Aquasim-1.0.tgz
pradeep@localhost $] ./install 

You may get an error as stated below: to clear this error, do the following step

Open the file (~aquasim/ns-2.30/linkstate/ls.h)  using gedit or vi or vim 

In line number 137, change the following line
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
to
void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

and again issue the command ./install . After successful installation, some paths will be provided. You need to paste those paths in the /home/pradeepkumar/.profile or .bashrc (/home/pradeepkumar/ is my home, you have to use your corresponding directory where the software is installed)

Here is the sample path in my .profile file

export PATH=$PATH:/home/pradeepkumar/aquasim/bin:/home/pradeepkumar/aquasim/tcl8.4.13/unix:/home/pradeepkumar/aquasim/tk8.4.13/unix
export LD_LIBRARY_PATH=/home/pradeepkumar/aquasim/otcl-1.12:/home/pradeepkumar/aquasim/lib
export TCL_LIBRARY=/home/pradeepkumar/aquasim/tcl8.4.13/library


After setting these paths, you logout and login back and aquasim works well now.

Open the terminal and type ns, if it indicates a %, then aquasim was installed successfully.

Nam as i said earlier, may not work well, here is a workaround - please follow the link - http://www.nsnam.com/2015/07/nam-installation-segmentation-fault.html

Once installed, you can explore the folder /home/pradeepkumar/aquasim/ns-2.30/underwatersensor

This folder contains all the source codes relevant to the under water sensor networks. The above folder has five sub folders like uw_common/, uw_routing/, uw_mac/, uw_mobility_pattern/ and uw_tcl/ 

pradeep@localhost $] cd uw_tcl/ 
will give you the examples of under water sensor networks. 

pradeep@localhost $] ns vbf_example_5.tcl 
pradeep@localhost $] nam vbf_example_5.nam 
Here is the screenshot of the example run using nam
aquasim
Aquasim
This post does not handle the Aqua 3d where you have the option of viewing the nodes inside a water using a 3D view. Users are requested to try themselves for installing Aqua 3D. 

Comment below for any queries related to this installation.

 T S Pradeep Kumar

Comments

Popular posts from this blog

AWK Scripts for NS2 to process data from Trace Files

AWK Scripts are very good in processing the data from the log (trace files) which we get from NS2. If you want to process the trace file manually, here is the detailHere is a sample of trace file from NS2 (However ns2 supports a new type of trace file also), but this post will make you understand the old trace format only.r 0.030085562 _0_ MAC  --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] r 0.030110562 _0_ RTR  --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] s 1.119926192 _0_ RTR  --- 1 message 32 [0 0 0 0] ------- [0:255 -1:255 32 0]
AWK Scripts are very good in processing the data column wise. For example
the first column in the above trace file represents r, s which indicates receive, sent respectively. If we want to trace the entire r and s alone from this trace file we can represent it as $1
So
$1 represents ACTION
$2 Time
$3 Node ID
$4 Layer
$5 Flags
$6 seqno
$7 type
$8 Size
$14 Energy (if the network nodes includes EnergyModel)To run the awk script in Li…

nam installation - Segmentation Fault (Solved)

If you are encountering "Segmentation Fault" error while running nam in Ubuntu 14.04 or Linux Mint 17+ editions, this post will be helpful for you.

Download the nam file from this link

First, remove the nam which was installed earlier using the following command 

pradeep@localhost $] sudo apt-get remove nam

and install the new nam which was downloaded just now. go to the folder where the file was downloaded and issue the following command

pradeep@localhost $]  sudo dpkg --install nam_1.15-10_i386.deb

See the screenshot below to install and use nam

 T S Pradeep Kumar

Installation of ns2 in Ubuntu 18.04 - NS2 Tutorial # 2

ns2 installation in Ubuntu 18.04

Unlike earlier version of ubuntu, the 18,04 version does not support the direct installation of ns2, because of the latest C/C++ compiler (7.x), but the latest C/C++ compiler supported by ns2 is gcc-4.8. So this post and video tells you about the installation of gcc-4.8 version, then ns2 and then configuration.
Here are the steps, Please follow the video given below for more information.

$] tar zxvf ns-allinone-2.35.tar.gz


$] sudo apt install gcc-4.8 g++-4.8

if you have installed ubuntu just now, you can try these commands also in the beginning

$] sudo apt update
$] sudo apt install build-essential autoconf automake libxmu-dev

$] cd ns-allinone-2.35/ns-2.35
$] gedit Makefile.in
$] gedit linkstate/ls.h

line number 137, change erase to this->erase
$] cd ..
$] ./install

export PATH=$PATH:/home/pradeepkumar/ns-allinone-2.35/bin:/home/pradeepkumar/ns-allinone-2.35/tcl8.5.10/unix:/home/pradeepkumar/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$L…