From 343c2743599f8b88ad53c4335551496dd39afd6c Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 3 Jun 2016 21:17:05 +0200 Subject: [PATCH] RPL: re-enable RPL_DIO_REFRESH_DAO_ROUTES by default as it is needed with DAO-ACK disabled. Now increments the DTSN only at the root --- core/net/rpl/rpl-conf.h | 11 ++++++----- core/net/rpl/rpl-icmp6.c | 4 +++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/net/rpl/rpl-conf.h b/core/net/rpl/rpl-conf.h index 6479dd374..97ab8f49d 100644 --- a/core/net/rpl/rpl-conf.h +++ b/core/net/rpl/rpl-conf.h @@ -257,15 +257,16 @@ #endif /* RPL_CONF_RPL_REPAIR_ON_DAO_NACK */ /* - * Setting the DIO_REFRESH_DAO_ROUTES will make RPL always increase - * the DTSN (Destination Advertisement Trigger Sequence Number) when - * sending broadcast DIO. This is to get all children to re-register - * their DAO route. + * Setting the DIO_REFRESH_DAO_ROUTES will make the RPL root always + * increase the DTSN (Destination Advertisement Trigger Sequence Number) + * when sending multicast DIO. This is to get all children to re-register + * their DAO route. This is needed when DAO-ACK is not enabled to add + * reliability to route maintenance. * */ #ifdef RPL_CONF_DIO_REFRESH_DAO_ROUTES #define RPL_DIO_REFRESH_DAO_ROUTES RPL_CONF_DIO_REFRESH_DAO_ROUTES #else -#define RPL_DIO_REFRESH_DAO_ROUTES 0 +#define RPL_DIO_REFRESH_DAO_ROUTES 1 #endif /* RPL_CONF_DIO_REFRESH_DAO_ROUTES */ /* diff --git a/core/net/rpl/rpl-icmp6.c b/core/net/rpl/rpl-icmp6.c index b900c6d5b..5bf4fc3d1 100644 --- a/core/net/rpl/rpl-icmp6.c +++ b/core/net/rpl/rpl-icmp6.c @@ -479,6 +479,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) { unsigned char *buffer; int pos; + int is_root; rpl_dag_t *dag = instance->current_dag; #if !RPL_LEAF_ONLY uip_ipaddr_t addr; @@ -499,6 +500,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) buffer = UIP_ICMP_PAYLOAD; buffer[pos++] = instance->instance_id; buffer[pos++] = dag->version; + is_root = (dag->rank == ROOT_RANK(instance)); #if RPL_LEAF_ONLY PRINTF("RPL: LEAF ONLY DIO rank set to INFINITE_RANK\n"); @@ -519,7 +521,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr) buffer[pos++] = instance->dtsn_out; - if(RPL_DIO_REFRESH_DAO_ROUTES && uc_addr == NULL) { + if(RPL_DIO_REFRESH_DAO_ROUTES && is_root && uc_addr == NULL) { /* Request new DAO to refresh route. We do not do this for unicast DIO * in order to avoid DAO messages after a DIS-DIO update, * or upon unicast DIO probing. */