Make RPL DIS transmission interval random in the interval [0, INTERVAL/2]. This is needed to avoid synchronization in large RPL networks.
This commit is contained in:
parent
2396f9b8ea
commit
2a2175a214
1 changed files with 3 additions and 1 deletions
|
@ -168,7 +168,9 @@ handle_dio_timer(void *ptr)
|
|||
void
|
||||
rpl_reset_periodic_timer(void)
|
||||
{
|
||||
next_dis = RPL_DIS_INTERVAL - RPL_DIS_START_DELAY;
|
||||
next_dis = RPL_DIS_INTERVAL / 2 +
|
||||
((uint32_t)RPL_DIS_INTERVAL * (uint32_t)random_rand()) / RANDOM_RAND_MAX -
|
||||
RPL_DIS_START_DELAY;
|
||||
ctimer_set(&periodic_timer, CLOCK_SECOND, handle_periodic_timer, NULL);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue