Several data senderstransmitting data packets towards the sink or root. After sometime one of the senders stops forwarding data to parent node because we assumed the parent node is suspicious(distrustful). Instead of forwarding the data packet via suspicious node, we need to forwards the data packet through an alternative pathby using alternative parent that is in parent list.
Open a file at location->
Home/user/contiki/core/
net/rpl/
rpl-mrhof.c
This file handling the parent selection
we need to create the suspicious parent
in it’s function block called,
best_parent().
Finally, re-trigger the parent
selection for every time suspicious
status changes of a parent.
If the parent node is
attacker node block the parent
node.
Attacker status accessed from
neighbor address
if (attacker status == 0) {
return p1_metric < p2_metric ? p1 : p2;
Lowest rank node selected as best parent
}
Now create and run the simulation
in contiki cooja network simulator.
In terminal, cd "home/user/contiki/
tools/cooja"
-->ant run.