Skip to content

Installing Castalia on OmNet++ for WSN and BAN  Simulations.

Body  Sensor Network

A body area network (BAN), also referred to as a wireless body area network (WBAN) or a body sensor network (BSN) or a medical body area network (MBAN), is a wireless network of wearable computing devices[4].

 

Castalia

Castalia is a simulator for Wireless Sensor Networks (WSN), Body Area Networks (BAN) and generally networks of low-power embedded devices[1]. It is based on an old OmNet++ version. The most recent version of Castalia (3.3) works with old versions of OmNet++ versions between 4.3 and 4.6 . Note that the the higher versions of OmNet++ are not compatible with Castalia.  It can be used by researchers and developers who want to test their distributed algorithms and/or protocols in realistic wireless channel and radio models, with a realistic node behaviour especially relating to access of the radio.[1].

This article shows the way of installing old version of OmNet++ with Castalia 3.3 on a chrooted 64 bit Debian 8 (Jessie) on Debian 11 Host OS.

If you wish to do the installation on chroot environment, then you may first learn the way of setting  the “chroot” Jail by reading the following post. Instead of installing Debian 9, you install Debian 8 under chroot.  Instead of installing OmNet++ 5, you insall OmNet++ 4.6.

 

Installing Omnet++ in Debian 9 chroot Jail Under Debian 11 Host OS

Features of Castalia

According to Documentation found in [1], the main features of Castalia are:

Channel model 

  • Model defines a map of path loss, not simply connections between nodes
  • Complex model for temporal variation of path loss
  • Fully supports mobility of the nodes
  • Interference is handled as received signal strength, not as separate feature

Radio model

  • Probability of reception based on SINR, packet size, modulation type. PSK FSK supported, custom modulation allowed by defining SNR-BER curve
  • Multiple TX power levels with individual node variations allowed
  • States with different power consumption and delays switching between them
  • Flexible carrier sensing (polling-based and interrupt-based)

Extendable Capabilities

  • Highly flexible physical process model
  • Sensing device noise, bias, and power consumption
  • Node clock drift, CPU power consumption.
  • Designed for adaptation and expansion.

Availability of MAC and routing protocols

  • In Castalia four main MAC modules were implemented: 1) TunableMAC, 2)  TMAC,  3) IEEE 802.15.4 MAC.  4) IEEE 802.15.6 MAC (draft proposal for Body Area Networks).
  • simpleTreeRouting and multipathRingsRouting were available in old versions and multipathRingsRouting only available in new versions.

  • The default mac is “BypassMAC” and routing is “BypassRouting

Installation of OmNet++

You can download the required old version of OmNet++ from [2].

Step 1: Install Dependencies

Install the necessary dependencies of OmNet++

# refresh the database of available packages
$ apt-get update

#install the dependencies – if you only wish to use Castalia, then your will not require some of the following packages
$ apt-get install wget build-essential gcc g++ bison flex perl python python3 qt5-default libqt5opengl5-dev tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-3.0-0

# If needed, add extra GIS repo – the osg related installation may fail – just ignore it
$ apt install software-properties-common
$ apt-get update
$ add-apt-repository ppa:ubuntugis/ppa
$ apt-get update
# install osgearth development package and OpenSceneGraph
$ apt-get install openscenegraph-plugin-osgearth libosgearth-dev

# for parallel simulation support 
$ apt-get install openmpi-bin libopenmpi-dev

Step 2: Download OmNet++ 4.6

Step 3: Extract the compressed file

$ cd /home/your_home/
$ tar -xvf omnetpp-4.6-src.tgz
The following screenshot shows the extracted files (displayed using the file manager of the Host OS)

Step 3: Compilin OmNet++

$ cd /home/your_home/omnetpp-4.6
#configure make file according to the environment
$ ./configure
The following screenshot shows the successful configure operation. (do not forget to set the path in .bashrc before running make and OmNet++)
 
Now set the path 
# export the OmNet++ path (make it permanent by adding this line in .bashrc file
$ export PATH=/home/omnetpp-4.6/bin:$PATH
And now you can compile OmNet++.
 
#speeding the make using multiple processors ( the -j option)
$ make -j9
The following terminal shows the successful compile of OmNet ++.

Step 4: Running OmNet ++

To test the OmNet++ installation, we can run the omnetpp GUI from chroot jail  using the host OSs display.

The following screenshots of the guest OS (Debian 11) show the starting of OmNet++ gui from the chrooted Debian 8.

$omnetpp

Step 5: Downloading Castalia

 

$ cd /home/your_home/omnetpp-4.6
$ git clone https://github.com/boulis/Castalia.git

Step 6: Compiling Castalia in Command line mode (terminal)

$ cd /home/your_home/omnetpp-4.6/Castalia/Castalia
$ ./makemake
 

Now you will see a output similar to the following one (under chroot environment only) – just ignore the warnings.

 

Now compile Castalia as follows:

$ cd /home/your_home/omnetpp-4.6/Castalia/Castalia
$ make -j9
At the end of the compile you will see the following outputs:
 

Step 6: Compiling Castalia in OmNet++ GUI 

Alternatively, we can compile Castalia under OmNet++ GUI after importing the project in to an existing or new workspace.

The following section Explains the GUI mode Import and Compile:

Sorry!!!. Some sections are hidden; because, you are only having restricted access to this article.

While getting paid support/assistance for your research from Charles, you may get an access key/password to some articles. If you are having the access key/password to this particular article, then please enter it below to unlock the restricted section of this article.

If your research is related to this area, and you want to get paid support/assistance from Charles, then you may start a 'free' research discussion with Charles.

The following Screenshot shows the example BAN simulation

 

The following animation shows the animated output of that simple BAN simulation:

 

We will see a more realistic BSN simulation in another atricle.

Limitations of Catalia

Castalia is not sensor platform-specific. Castalia is meant to provide a generic reliable and realistic framework for the first order validation of an algorithm before moving to implementation on a specific sensor platform and not useful if one would like to test code compiled for a specific sensor node platform[1].  And hopefully, making it work on recent versions of OmNet++ is not possible or may require a complete rewire of the entire module.

References :

  1. https://github.com/boulis/Castalia
  2. https://omnetpp.org/download/old.html
  3. https://www.projectguideline.com/installing-OmNet-in-debian-9-chroot-jail-under-debian-11-host-os/
  4. https://en.wikipedia.org/wiki/Body_area_network

For Assistance in Protocol Implementation, Simulations & Analysis of Industrial as well as Scholarly Research Works, you may Contact Us.

WhatsApp chatDiscuss Through WhatsApp

Call 91 9843779735

Send an e-Mail Message.




This site is protected by reCAPTCHA and the Google
Privacy Policy and
Terms of Service apply.

WhatsApp Discuss Through WhatsApp