RPL is working rank based transfer, that is node’s individual position relative to other nodes with respect to DODAG root.Nodes who transferring control data packets called parent and receiver is child.(parent & child is based shortest range transfer).In RPL, the immediate parent is selected by a child (Child node) determined by the quality of transmission channel and Rank.
Step 1: Open a source code file
in a following location.
Contiki/core/net/ip/tcpip.c
Function tcpip_ipv6_output
handling, add below code.
Code:
int i=0;
if (num1 != 0) {
for (i = 1; i <= num1; i++) { if (neid[i] == src_id->u8
[sizeof(src_id->u8) – 1]) {
if (mark1[src_id->u8
[sizeof(src_id->u8) – 1]] == 0) {
nch = nch + 1;
chn[nch] = neid[i];
mark1[src_id->u8
[sizeof(src_id->u8) – 1]] = 1;
printf(“ChildN %d ChildC %d Cid
%d\n”,neid[i],nch,node_id);
}
}
}
}
Step 2: Run in cooja