[ns] Reputed AODV, delete routes in the routing table with a given next-hop

Marios Anastasiou anastmarios at yahoo.gr
Fri Jul 27 19:37:32 PDT 2007


                        Dear ns-users,
 
 
 I am an Msc student. I am now working on my dissertation. I would like to ask for some help.
 
 
 I enhance AODV with a reputation based scheme. All the changes in the protocol are done in C++.
 
 
 Inside the AODV::recv(Packet *p, Handler*) I implement the selfish nodes.
 Let's  say that node[5], node[7], node[10] are selfish. If they receive a packet they always drop it. All the the other nodes are well-behaved.  
 
 
 According to the following scenario, if the packet is received by a selfish node it will drop it. Subsequently the Reputation value of the misbehaved node will be reduced in the Reputation Table of the node that forwarded the packet to the selfish node.
 The Reputation Table is created inside the constructor of the Class MobileNode.
 
 
 If the decremented Reputation value of the Misbehaved node in the Reputation Table of the node that forwarded the packet to the Misbehaved node, crosses a threshold:
 The node that forwarded the packet to the Selfish node calls the rt_lookup_next_hop_delete( insaddr_t  id )  function in order  to search inside its Routing Table and DELETE ALL the routes which have the Misbehaved node as next hop. I implemented it in Class aodv_rtable as shown below:
 
 
 
 
 void 
 aodv_rtable::rt_lookup_next_hop_delete(nsaddr_t id) 
 { 
 aodv_rt_entry *rt = rthead.lh_first; 
     for(; rt; rt = rt->rt_link.le_next) { 
        if(rt->rt_nexthop == id) { 
            LIST_REMOVE(rt, rt_link); 
            delete rt; 
            printf("DELETING ROUTES with next Hop Node[%d] because it is selfish\n\n", id); 
        } // END FOR if 
     } // END FOR for 
  } // END FOR rt_lookup_next_hop_delete()
 
 
 *******************************************************************************
 
 
 void  AODV::recv(Packet *p, Handler*) {
 // AODV code   
 ....
 
 
 // AODV_code   
 else { 
   
  //   Check the TTL.  If it is zero, then discard. 
    
    if(--ih->ttl_ == 0) { 
      drop(p, DROP_RTR_TTL); 
      return; 
    } 
  }
 
 
 
 
 // MY_code
 //forwarding node, selfish 
  if ( (index == 5) || (index == 7) || (index == 10) || ) )  {  
  
         // drop the packet, reason: "BSN" By_Selfish_Node 
          drop(p, DROP_RTR_BSN); 
              
         // Decrement Reputation of forwarding node 
        // get_mobnode_by_address(int id) takes as an argument the id of a node and returns the mobile  
        //node's instance from the static mobile node list
       //decr_rep(int neigbour) takes as an argument the id of a node and decrements its Reputation value  
        // in the reputation Table  
          MobileNode::get_mobnode_by_address(ch->prev_hop_)->decr_rep(index); 
  
          
         // If decremented Reputation of forwarding node < R1 (threshold):  
         if ((MobileNode::get_mobnode_by_address(ch->prev_hop_)->get_rep(index)) < R1 ) { 
  
      // DELETE routes which have the misbehaved node as next hop  
 MobileNode::get_mobnode_by_address(ch>prev_hop_)->POINTER_TO_INSTANCE_OF_ROUTING_TABLE->rt_lookup_next_hop_delete( index );
 
 
 } END FOR  if ( (index == 5) || (index == 7) || (index == 10) || ) , MY_code
 
 
 // AODV code   
 ....
 
 
 } END FOR: void AODV::recv(Packet *p, Handler*)  
 
 
 
 
 AODV class, MobileNode class, aodv_rtable class, aodv_rt_entry class are all friends with each other.  
 
 
 
 
 My problem is to find the  POINTER_TO_INSTANCE_OF_ROUTING_TABLE in order to call rt_lookup_next_hop_delete() correctly.
 
 
 
 
 Thanks in advance for any help
 
       
---------------------------------
 Χρησιμοποιείτε Yahoo!
 Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων 
 http://login.yahoo.com/config/mail?.intl=gr 


More information about the Ns-users mailing list