To define malicious nodes as well as create wormhole links what commands should be used in wireless sensor networks (for NS2 in TCL Code) ? I've used the following commands in the program, but I'm not getting any output. Please guide me.

# ns-2.35/aodv/aodv.cc 

**********************************

tcl.resultf("%d", index);

return TCL_OK;

}

if(strcmp(argv[1], "malicious") == 0) {

malicious = true;

return TCL_OK;

}

if(strncasecmp(argv[1], "start", 2) == 0) {

btimer.handle((Event*) 0);

index = id;

seqno = 2;

bid = 1;

 malicious = false;

LIST_INIT(&nbhead);

LIST_INIT(&bihead);

struct hdr_ip *ih = HDR_IP(p);

aodv_rt_entry *rt;

if (malicious == true ) {

drop(p, DROP_RTR_ROUTE_LOOP);

// DROP_RTR_ROUTE_LOOP is added for no reason.

}

**************************************************************************

#ns-2.35-orig/aodv/aodv.h

double PerHopTime(aodv_rt_entry *rt);

bool malicious;

*******************************************************

#in tcl file :

$ns at $t "[$node_($malicious) set ragent_] malicious"

More Maryam Iman's questions See All
Similar questions and discussions