Dear All,
I just tried to modify the C++ code of AODV such that one node tries
to flood rreq to a destination that doesn't exist based on some
information I got on the web. let me explain what I did.

I added a class FloodTimer to aodv.h as follows.
class FloodTimer : public Handler {
public:
FloodTimer(AODV* a): agent(a){}
void handle(Event*);
private:
AODV *agent;
Event intr;
};
and added this too:
FloodTimer ftimer;

Then i made the following modification to aodv.cc file:
-Added ftimer(this) to the constructor of AODV class and
-defined the following function to flood RREQ.

void FloodTimer::handle(Event*) {
if(agent->index==1)
{
//node 1 will be the attacker sending request to node 100
agent->sendRequest((nsaddr_t)100);
#ifdef DEBUG
fprintf(stderr, "(%2d) - %2d FLOODING ATTACK, dst: %d\n",
++route_request, index, 100);
#endif
}
printf("Node 1 is flooding rreq\n");
#define FLOOD_INTERVAL 0.1
Scheduler::instance().schedule(this, &intr, FLOOD_INTERVAL);
}

But when I recompile ns2, and run a simulation of AODV network, there
is no effect of flooding. I tried to printf from the above function
and didn't print any output. Can any one help me how to fix this, i.e
Enabling node 1 to send RREQs to node 100(which doesn't exist in the
network) every 0.1 sec? Or is there any other way to implement rreq
flooding attack in AODV?
Thank you in advance,
Tek

Reply via email to