ns2 FANET preparation guide
⚠ Warning ⚠: Make sure you have ns2-2.35 properly installed locally. Follow this example guide if needed: https://filfreire.com/ns2/.
Adding 3D support to NS2
To add 3D support we will use M2ANET, following what was mentioned in https://www.math.unipd.it/~cpalazzi/FANET-routing.html:
# Backup previous ns-allinone-2.35 folder just in case
cp -r ~/ns-allinone-2.35 ~/ns-allinone-2.35-backup
# Download and setup the M2ANET patch:
wget -nc https://www.math.unipd.it/~cpalazzi/resources/M2ANET.zip
unzip M2ANET.zip
cd ~/ns-allinone-2.35/ns-2.35/ && patch -p 1 < ~/M2ANET/ns2_3D.patch
cd ~/ns-allinone-2.35 && ./install
To see if it worked, running the script wireless3D.tcl that comes with M2ANET folder should not return any errors:
ns ~/M2ANET/wireless3D.tcl
Things to keep in mind for simulating FANETs
- Be sure to set the appropriate queue type for DSR routing protocol
CMUPriQueue
, exampleset val(ifq) CMUPriQueue;
- Be sure to set the propagation as
Propagation/FreeSpace
- Be sure to use
load_cube
instead ofload_flatgrid
(requires the M2ANET patch of ns2 mentioned above) - Also similar to previous point, you will need to use
setdest3d
instead ofsetdest
method (which also requires M2ANET patch installed) - Be sure to set Z coordinate / altitude to the mobile nodes
Extra: Adding OLSR support to NS2
To add OLSR routing protocol support we will be applying Francisco J. Ros’s UM-OLSR patch https://sourceforge.net/projects/um-olsr/:
#backup previous step
cp -r ~/ns-allinone-2.35 ~/ns-allinone-2.35-backup-3d
wget -nc https://downloads.sourceforge.net/project/um-olsr/um-olsr/1.0/um-olsr-1.0.tgz
tar zxvf um-olsr-1.0.tgz -C ~/
mkdir ~/ns-allinone-2.35/ns-2.35/olsr
cp -r ~/um-olsr/* ~/ns-allinone-2.35/ns-2.35/olsr/.
cd ~/ns-allinone-2.35/ns-2.35/ && patch -p 1 < ~/um-olsr/um-olsr_ns-2.35_v1.0.patch
cd ~/ns-allinone-2.35 && ./install
Things to keep in mind for simulating with OLSR protocol
Besides setting routing protocol you will need to configure some Agent/OLSR
configuration parameters for the simulation to work:
# Initialize ns-2 Global Variables
set ns_ [new Simulator]
Agent/OLSR set use_mac_ true
# ...
More notes on these can be found over at https://github.com/wevertoncordeiro/olsr-ns2
References
- N. Mahmood, J. DeDourek and P. Pochec, “M2ANET simulation in 3D in ns2”, SIMUL 2014, The Sixth International Conference on Advances in System Simulation SIMUL 2014, October 12 - 16, 2014, Nice, France, pp. 24-28.
- https://www.math.unipd.it/~cpalazzi/FANET-routing.html
- A. Bujari, C. E. Palazzi, D. Ronzani, “A Comparison of Stateless Position-based Packet Routing Algorithms for FANETs”, IEEE Transactions on Mobile Computing, 2018. DOI: 10.1109/TMC.2018.2811490
- A. Bujari, O. Gaggi, C. E. Palazzi, D. Ronzani, “Would Current Ad Hoc Routing Protocols be Adequate for the Internet of Vehicles? A Comparative Study”, IEEE Internet of Things Journal, 2018. DOI: 10.1109/JIOT.2018.2812727.