Search This Blog

Saturday, 21 February 2015

How to avoid flooding node in my route and choose alternate path in ns2 ?

Avoid packets through Flooding/Malicious/Blackhole node and choose alternate path:

Flooding node/malicious node/blackhole node, the answer is same. Delete the destination node from your route table and restrict adding these node to your route table. Thats it. After the hello period, aodv automatically finds a new route to your destination excluding the malicious/flooder/malicious node.

i)  Delete the route in your rt_table.
In forward function,  
   if(dest is blockhole)    
     rtable.rt_delete(ih->daddr());


ii) Drop ROUTE_REP from blockhole node and restrict them by not adding to your rt_table
In recvReply function  
if(rt == 0)   {    
  if( ! blockhole_node)    
      rt = rtable.rt_add(rp->rp_dst);  
}

It will work. This is just one way. If you have a better way in mind, feel free to comment.

P.S: Guys the above logic is for avoiding packets through the flooding/malicious/blackhole node and finding an alternative path (not meant for flooding prevention).