Skip to content

Testing the New Semi Random Circular Mobility Model of ns-3.

SRCM – Semi Random Circular Mobility Model of ns-3

While trying to raise my own merge request for my Simple Circle Mobility Model, on GitLab, I saw another merge request with an interesting, new mobility model called SRCM – Semi Random Circular Mobility Model[1]. Even though this model may be available with the future ns-3-dev version (that merge request is still in progress as on 21-12-2021).

The original concept of this model can be found in [2].

In this article, we will test this interesting mobility model in a FANET simulation scenario. 

For the better visualization of 3D capabilities of this model, I hereby use NetSimulyzer 3D Visualization Tool. I used my own customized version of NetSimulyer so that the heading of the aircraft can be understood in a better way to validate the aspect “how far these movements are realistic”. I used an airplane model to understand the aspects of ‘heading’. If we visualize the same scenario with a quadcopter model as UAV, then it will not be possible to perceive the performance in terms of change in heading in a better way.

The changes that I made on NetSimulyzer were done for an in-house testing developed for another industrial project. Those aspects of visualization are not discussed here. So,  those who try to repeat this simulation will not able to visualize the change in the heading of the aircraft over time. So, one may use a simple “Sphere Model” to represent the UAV node.

Requirements

For repeating this experiment, we will need the current ns-3-dev version (as of 21-12-2021), and the NetSimulyzer ns-3 extension as well as NetSimulyzer 3D Tool. (I successfully complied it on ns-3.33 also; but showing outputs that I generated with ns-3-dev version)

You may follow any installation procedure for installing ns-3-dev version or simply follow my chroot installation procedure below. And then install NetSimylyzer Support in it.

Installing ns3.35 in Debian 10 chroot Jail Under Debian 11 Host OS or any Version of Linux Host

 

Since we are going to visualize the outputs of SRCM model using NetSimulyer, we need to learn the way of implementing it.

The following two articles[2][3] explain the way to set up the Netsimulyzer 3D visualization support.

 

The following article explains the way of implementing and visualizing our Spring Mobility Model using NetSimulyzer tool.

Implementation of Spring Mobility Model for ns-3 and Visualizing it in 3D along with Circle Mobility

 

Note :

Since I am already having a NetSimuyzer install on an  ns-3-dev version, I  decided to use that for this experiment.  I decided to use the version of  SRCM that was found at [5]. So that, I have to patch that particular version with the files needed for implementing the current version of SRCM in it. For this, mainly we need to add files under “src/mobility/model” and  we do the necessary patching on wscript to make it work on that particular ns-3-dev version. So I downloaded the following files from [5] and merged them with  ns-3-dev and recompiled it.

  1. semi-random-circular-mobility-model.h
  2. semi-random-circular-mobility-model.cc
  3. constant-velocity-helper.h
  4. constant-velocity-helper.cc

And of course, we will need the SRCM example simulation in which we have to add the necessary code for 3D visualization with NetSimulyzer.

  1. srcm-example.cc

SRCM Example Simulation With NetSimulyzer 3D Visualization

The Components of the Simple 3D FANET ns-3 Simulation Script

The following code segment presents the important components of the ns-3 simulation script which is used to simulate and test SRCM mobility model. In this simulation, the aeroplane node will use SemiRandomCircularMobilityModel. 

Include the header files Needed

The following lines include the necessary header files. The Netsimulyzer ns-3 module should be installed in the ns-3 directory tree. 

#include
#include
#include
#include “ns3/netanim-module.h”
#include “ns3/netsimulyzer-module.h”

The following lines show the creation of a node for this FANET/UAV simulation.

NodeContainer SRCM_UAV;
SRCM_UAV.Create (1);

Simulate SemiRandomCircularMobilityModel

The following section of code will do the important part of adding mobility model in the nodes.

ObjectFactory pos;
pos.SetTypeId (“ns3::RandomRectanglePositionAllocator”);
pos.Set (“X”, StringValue (“ns3::UniformRandomVariable[Min=-200.0|Max=200.0]”));
pos.Set (“Y”, StringValue (“ns3::UniformRandomVariable[Min=-200.0|Max=200.0]”));
Ptr pa = pos.Create ()->GetObject ();

MobilityHelper mobility;
mobility.SetPositionAllocator (pa);
mobility.SetMobilityModel (“ns3::SemiRandomCircularMobilityModel”,
“Angle”,StringValue (“ns3::UniformRandomVariable[Min=0.0|Max=180.0]”),
“TuringRadius”,StringValue (“ns3::UniformRandomVariable[Min=0.1|Max=200.0]”),
“Pause”,StringValue (“ns3::ConstantRandomVariable[Constant=0.25]”),
“FlyingHeight”,StringValue (“ns3::UniformRandomVariable[Min=150.0|Max=200.0]”),
“Speed”,StringValue (“ns3::UniformRandomVariable[Min=200.0|Max=200.0]”));
mobility.InstallAll ();
MakeCallback (&CourseChange));

Specify the output File and Set Different 3D models for the Simulated FANET nodes

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

Add a Background Decoration

Hidden Section! Contact Charles  

The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

WhatsApp chatDiscuss Through WhatsApp
 

 

The 3D View of the simulated FANET in NetSimulyzer.

 

The 3D FANET/UV Output of the Simulation.

The following gif animation shows the output o the simulation.  Even though the aircraft is abnormally jumping, twisting, moving with the used default parameters of the simulation, I hope that its movement can be customized well after experimenting with the parameters that we discussed in the next paragraph.

The following is the output of ‘srcm-example.cc’ with a single node.

 

The following is the output of ‘srcm-example.cc’ with three nodes.

Final Note: For getting the above simulation output, we used the initial default parameters as follows.

“Speed” – A random variable to control the speed (m/s); Default Value : Randomly Chosen between 1m/s and 2m/s.
“Pause”, A random variable to control the pause (s); Default Value: 2s
“Angle”, A random variable to control the angle (degree); Default Value -Randomly Chosen 0.0 to 180.0 Degree
“TuringRadius”, A random variable to control the radius (m); Default Value: Randomly Chosen Between- 0.01m to 200.0m
“FlyingHeight”, A random variable to control the flying height (m).Default Value – Randomly Chosen 80.0m to 100.0m

During the run of the simulation, these parameters will change over time with respect to the algorithm. Refer [2]  for more details.

Conclusion:

This mobility model seems to be having sufficient potential to simulate some kind of FANET/UAV scenarios. I didn’t experiment with it further by changing the above-mentioned parameters. But, I hope that it is possible to tweak the above-mentioned parameters and get somewhat smooth movements.

References

  1. https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/631
  2. Wei Wang, Xiaohong Guan , Beizhan Wang, Yaping Wang, A novel mobility model based on semi-random circular movement in mobile ad hoc networks, Elsevier- Information Sciences 180 (2010) 399-413, doi:10.1016/j.ins.2009.10.001
  3. Installing NetSimulyzer 3D Visualization Support Add-on Module in ns-3 under Debian/Ubuntu
  4. Installing NetSimulyzer 3D Visualization Tool under Debian/Ubuntu
  5. https://gitlab.com/dlwlr3ma/ns-3-dev/-/tree/branch-cbl
WhatsApp Discuss Through WhatsApp