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

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