RPL allows for automated setup and maintenance of the routing tree for a meshed network using a common objective, such as energy preservation or most stable routes.In RPL follows DODAG routing techniques.The route information maintained and stored in a DODAG table by nodes in network.
The definition is declared in
at location contiki/core/net/ip/
tcpip.c
Declared and maintains routing
information table.
Code
if(uip_ds6_is_addr_onlink(destination addr)){
nexthop = destination;
} else {
uip_ds6_route_t *route;
// Check if we have a route to the destination address.
route = uip_ds6_route_lookup(destination address);
// No route was found – we send to the default route instead.
if(route == NULL) {
///no route found, using default route
nexthop = uip_ds6_defrt_choose();
}
}
Run the simulation.