Thursday, April 22, 2010

Example to create BH node

I want to make a node behave as blackhole node, using the above technique. The above method drops all packets that go through it, but it doesn’t kind of forces a packet to go through it by sending a high sequence number.
For that, i have done this within this fn. AODV::recvRequest(Packet *p):

if(malicious==true) {
sendReply(rq->rq_src, // IP Destination
1, // Hop Count
index, // Dest IP Address
4294967295, // Max. Dest Sequence Num if the node is malicious
MY_ROUTE_TIMEOUT, // Lifetime
rq->rq_timestamp); // timestamp
}
else {
sendReply(rq->rq_src, // IP Destination
1, // Hop Count
index, // Dest IP Address
seqno, // Dest Sequence Num
MY_ROUTE_TIMEOUT, // Lifetime
rq->rq_timestamp); // timestamp
}

and removed
if(malicious == true) {
drop(p, DROP_RTR_ROUTE_LOOP);
}

from rt_resolve() fn.

Now, what changes do i need to make, so that the code can distinguish data packets and management packets, so that it could drop the data packet

if you want to drop only data packets you need to check packet type reger HDR_CMN for more info.

No comments: