NS2 Black Hole Attack


What is Black Hole Attack?How Black Hole attack is implemented using NS2?

In Routing Protocol,a malicious node advertise itself as a shortest path routing protocol. NS2 is best suited for implementing black hole attack.

Types of black hole attack:

  • Collaborative black hole mechanism.
  • Single black hole.
  • External black hole attack.
  • Internal black hole attack.

 

Detection mechanisms for Implementing NS2 Black Hole Attack :

Time based threshold detection method.

DPRAODV.

BDSR.

Neighborhood based and routing discovery.

Random two-hop ACK and Bayesians detection scheme.

Redundant route and unique sequence number scheme.

REAct.

IDS based on ADM.

Hash based hashed base.

 

 

Architecture of black hole attack:

 

Journal Support for NS2 Projects:

 

NS2-Projects-Journal-Support

 

 

Download Sample Source Code for Black Hole Attack using NS2

else if(index==malicious1)
 {
seqno = max(seqno, rq->rq_dst_seqno)+1;
if (seqno%2) seqno++;

sendReply(rq->rq_src,           // IP Destination
             1,                    // Hop Count
rq->rq_dst,  seqno, MY_ROUTE_TIMEOUT,
rq->rq_timestamp);    // timestamp
 //rt->pc_insert(rt0->rt_nexthop);
   Packet::free(p);
 }      
else if(index==malicious2)
 {
seqno = max(seqno, rq->rq_dst_seqno)+1;
if (seqno%2) seqno++;

sendReply(rq->rq_src,           // IP Destination
             1,                    // Hop Count
rq->rq_dst, seqno, MY_ROUTE_TIMEOUT,
rq->rq_timestamp);    // timestamp
 //rt->pc_insert(rt0->rt_nexthop);
   Packet::free(p);
 }
else if(index==malicious3)
 {
seqno = max(seqno, rq->rq_dst_seqno)+1;
if (seqno%2) seqno++;

sendReply(rq->rq_src,           // IP Destination
             1,                    // Hop Count
rq->rq_dst,
                             seqno,
                              MY_ROUTE_TIMEOUT,
rq->rq_timestamp);    // timestamp
 //rt->pc_insert(rt0->rt_nexthop);
   Packet::free(p);
 }