contiki-os/contiki — pull request #116 by sdawans (2013-02-05 16:28:31+00:00)
Title: RPL Lifetimes

### Details

In our multi border-router scenarios we make use of route and defroute lifetimes. The first commit allows the user to configure values for **RPL_DEFAULT_LIFETIME** and **RPL_DEFAULT_LIFETIME_UNIT**. The defaults are left as they were: 0xFF and 0xFFFF respectively. I find the 'DEFAULT' to be superflous but I didn't shorten the names because it would collide with the RPL_LIFETIME() macro.

The route lifetime in the routing table is already correctly updated in dao_input (rpl-icmp6.c) and rpl_purge_routes(rpl.c). However, the default route stimer wasn't getting updated so I added this in rpl-dag.c when we receive a DIO from the preferred parent, hence the second commit.

### FYI

As a side note, in ContikiRPL, DIO and DAOs get sent roughly at the same periods because the root increments the DTSN at every DIO. I think RFC6550 states that this is optional, so in the more general case where DAOs are not triggered at every DIO it might be dangerous to use the same RPL_LIFETIME macro for both routes and default routes. This makes selecting constants for RPL_DEFAULT_LIFETIME and RPL_DEFAULT_LIFETIME_UNIT up to the user until we do more tests. In our XPs we set the max lifetime to be a certain multiple of the max DIO period (to handle sporadic losses). It should be enough in the case where DTSN gets increased at every DIO, but need rethinking otherwise.