Skip to main content


Showing posts from February, 2014

MANET Routing Protocols using ns3


Download the Code here:

Check the Video for Detailed instruction and how to use the plots, graphs and source code.

Comparison of MANET routing Protocols 1. AODV
3. DSR
using NS3 (Network Simulator 3)
B.Tech, M.Tech, PhD...
1. Reactive Vs Proactive routing
2. PErformance comparison of MANET protocols
3. AODV Vs DSDV Comparison and also at my channel.

What Version: ns-3.29
My Ubunut OS is: Ubuntu 18.04

This file we are going to use for our simulation:

Once you under stand the code, now lets run this example

Step 1: Copy the above file in to ~ns-3.29/scratch/ folder

Step 2: Understand this code.
Step 3: Run this code
Open the terminal, Go to ns-3.29 and run the following command

$] ./waf --run scratch/manet-routing-compare

enable the following header file

#include "ns3/flo…

Adding a malicious node in NS2 in AODV Protocol

Adding a malicious node is ns2 using aodv protocol. The node which is declared as malicious will simply drop the router packet (DROP_RTR_ROUTE_LOOP).

Two files have to be modified.
1. aodv.h

aodv.h file changes
Declare a boolean variable malicious as shown below in the protected scope in the class AODV

bool malicious; file changes
1. Initialize the malicious varible with a value "false". Declare it inside the constructor as shown below
AODV::AODV(nsaddr_t id):Agent(PT_AODV)...
malicious = false;

2. Add the following statement to the file in the "if(argc==2)" statment.

if(strcmp(argv[1], "malicious") == 0) {
    malicious = true;
   return TCL_OK;

3. Implement the behavior of the malicious node by setting the following code in the rt_resolve(Packet *p) function. The malicious node will simply drop the packet as indicated below.


Once done, recompile ns2 as given below
Open …