Search This Blog

[ns-3] Cloning MANET Routing Protocols in ns-3

Labels: , , , , , , ,

Reactions: 

This post provides a "python script" to clone AODV, DSDV, OLSR or DSR in ns-3. By cloning, we mean that an identical copy of an existing protocol is created in ns-3, but with a different name. 

Once the clone is created, you can modify it for your research work without affecting the original code of existing protocols in ns-3.

Warning: DSR cloning will work only for ns-3.25 and higher versions of ns-3!

Contributed by: Kriti Nagori and Meenakshy Balachandran, Wireless Information Networking Group (WiNG), NITK Surathkal.

Steps to create a clone:

1. Download the python script: clone-manet-routing.py

2. Place it in ns-allinone-3.xx/ns-3.xx/src directory

3. Go to ns-allinone-3.xx/ns-3.xx/src via terminal and give the following command:

chmod 777 clone-manet-routing.py

4. Give the following command to create a clone of AODV:

./clone-manet-routing.py aodv myaodv

5. Go to ns-allinone-3.xx/ns-3.xx/ via terminal and give the following commands:

./waf configure --enable-examples

./waf

You are done with it!

Note: Replace aodv by dsdv, olsr or dsr in Step 4 to clone DSDV, OLSR or DSR respectively.

Verifying the working of a clone:

1. Copy myaodv.cc from ns-allinone-3.xx/ns-3.xx/src/myaodv/examples

2. Paste it in ns-allinone-3.xx/ns-3.xx/scratch

3. Give the following command from ns-3.xx directory to run it:

./waf --run scratch/myaodv

If the command succeeds, you have successfully cloned AODV to MYAODV.

Hope it helps.

Regards,
Mohit P. Tahiliani

Comments (5)

Hello Sir,
Thanks for this script.I had been trying hard to duplicate AODV in ns3 for a while.

I had one more query about clustering in ns3.I got a sample from github on VANET clustering.will i be able to use that against MANET BlackholeAttack.

nice blog post

Thanks,

HNI Tips in Silver

Respected Sir

when i have run myaodv.cc using clone-manet-routing.py , i found following error please help me to b uild a file.
Waf: Leaving directory `/home/neelam/Downloads/ns-allinone-3.25/ns-3.25/build'
Build commands will be stored in build/compile_commands.json
'build' finished successfully (46.274s)
Creating 10 nodes 100 m apart.
assert failed. cond="m_endPoint == 0", msg="Endpoint already allocated (maybe you used BindToNetDevice before Bind).", file=../src/internet/model/udp-socket-impl.cc, line=254
terminate called without an active exception
Command ['/home/neelam/Downloads/ns-allinone-3.25/ns-3.25/build/scratch/myaodv'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run --command-template="gdb --args %s ")


neelam

Hello Sir,
Really great post, Thank you for sharing this knowledge. Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Streamline business processes. Please keep it up.

Guest Book...!!!