From 259c47337272b0b4c9a8230c07bf615625a6b33e Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sun, 10 May 2015 13:40:56 +0200 Subject: [PATCH 1/3] Disable RA and NA by default when RPL is used --- core/contiki-default-conf.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/contiki-default-conf.h b/core/contiki-default-conf.h index df7fe9e6d..698b48286 100644 --- a/core/contiki-default-conf.h +++ b/core/contiki-default-conf.h @@ -192,10 +192,16 @@ #define NBR_TABLE_CONF_MAX_NEIGHBORS 8 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */ +/* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement. + * This is unneeded when RPL is used. */ +#ifndef UIP_CONF_ND6_SEND_RA +#define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) +#endif /* UIP_CONF_ND6_SEND_RA */ + /* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol. - This is unneeded when RPL is used. Disable to save ROM and a little RAM. */ + This is unneeded when RPL is used. */ #ifndef UIP_CONF_ND6_SEND_NA -#define UIP_CONF_ND6_SEND_NA 1 +#define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) #endif /* UIP_CONF_ND6_SEND_NA */ /*---------------------------------------------------------------------------*/ From 1ac5d85042ab7474f75cd2643e78303de3a9270d Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Sun, 10 May 2015 19:51:16 +0200 Subject: [PATCH 2/3] Enable NA in examples that need it --- examples/cc2530dk/udp-ipv6/project-conf.h | 1 + examples/cc2538dk/udp-ipv6-echo-server/Makefile | 1 + examples/sensinode/udp-ipv6/project-conf.h | 1 + examples/udp-ipv6/Makefile | 1 + regression-tests/11-ipv6/code/receiver/project-conf.h | 3 ++- regression-tests/11-ipv6/code/sender/project-conf.h | 3 ++- 6 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/cc2530dk/udp-ipv6/project-conf.h b/examples/cc2530dk/udp-ipv6/project-conf.h index fb37ebfc3..adb4fc0f0 100644 --- a/examples/cc2530dk/udp-ipv6/project-conf.h +++ b/examples/cc2530dk/udp-ipv6/project-conf.h @@ -45,5 +45,6 @@ #define BUTTON_SENSOR_CONF_ON 1 #define UIP_CONF_ICMP6 1 #define RIMESTATS_CONF_ENABLED 1 +#define UIP_CONF_ND6_SEND_NA 1 #endif /* PROJECT_CONF_H_ */ diff --git a/examples/cc2538dk/udp-ipv6-echo-server/Makefile b/examples/cc2538dk/udp-ipv6-echo-server/Makefile index 32b3ca79f..4988d0b52 100644 --- a/examples/cc2538dk/udp-ipv6-echo-server/Makefile +++ b/examples/cc2538dk/udp-ipv6-echo-server/Makefile @@ -4,4 +4,5 @@ all: $(CONTIKI_PROJECT) CONTIKI = ../../.. CONTIKI_WITH_IPV6 = 1 +CFLAGS += -DUIP_CONF_ND6_SEND_NA=1 include $(CONTIKI)/Makefile.include diff --git a/examples/sensinode/udp-ipv6/project-conf.h b/examples/sensinode/udp-ipv6/project-conf.h index 4e74d406e..bb755aee9 100644 --- a/examples/sensinode/udp-ipv6/project-conf.h +++ b/examples/sensinode/udp-ipv6/project-conf.h @@ -47,5 +47,6 @@ #define BUTTON_SENSOR_CONF_ON 1 #define RIMESTATS_CONF_ENABLED 1 #define VIZTOOL_CONF_ON 0 +#define UIP_CONF_ND6_SEND_NA 1 #endif /* PROJECT_CONF_H_ */ diff --git a/examples/udp-ipv6/Makefile b/examples/udp-ipv6/Makefile index 62118cb49..7a38bdbc5 100644 --- a/examples/udp-ipv6/Makefile +++ b/examples/udp-ipv6/Makefile @@ -2,4 +2,5 @@ all: udp-server udp-client CONTIKI = ../.. CONTIKI_WITH_IPV6 = 1 +CFLAGS += -DUIP_CONF_ND6_SEND_NA=1 include $(CONTIKI)/Makefile.include diff --git a/regression-tests/11-ipv6/code/receiver/project-conf.h b/regression-tests/11-ipv6/code/receiver/project-conf.h index 877ed0ac4..17a25e129 100644 --- a/regression-tests/11-ipv6/code/receiver/project-conf.h +++ b/regression-tests/11-ipv6/code/receiver/project-conf.h @@ -1,4 +1,5 @@ - +#undef UIP_CONF_ND6_SEND_NA +#define UIP_CONF_ND6_SEND_NA 1 #ifdef BUFSIZE #undef UIP_CONF_BUFFER_SIZE diff --git a/regression-tests/11-ipv6/code/sender/project-conf.h b/regression-tests/11-ipv6/code/sender/project-conf.h index 877ed0ac4..17a25e129 100644 --- a/regression-tests/11-ipv6/code/sender/project-conf.h +++ b/regression-tests/11-ipv6/code/sender/project-conf.h @@ -1,4 +1,5 @@ - +#undef UIP_CONF_ND6_SEND_NA +#define UIP_CONF_ND6_SEND_NA 1 #ifdef BUFSIZE #undef UIP_CONF_BUFFER_SIZE From 7ce817ab4cc6a9fc43e1692e0286dd9f7e5cfa1f Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 6 Oct 2015 16:40:53 +0200 Subject: [PATCH 3/3] Better documentation of the UIP_CONF_ND6_SEND_NA flag. --- core/contiki-default-conf.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/contiki-default-conf.h b/core/contiki-default-conf.h index 698b48286..0083f7e10 100644 --- a/core/contiki-default-conf.h +++ b/core/contiki-default-conf.h @@ -193,13 +193,21 @@ #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */ /* UIP_CONF_ND6_SEND_RA enables standard IPv6 Router Advertisement. - * This is unneeded when RPL is used. */ + * We enable it by default when IPv6 is used without RPL. */ #ifndef UIP_CONF_ND6_SEND_RA #define UIP_CONF_ND6_SEND_RA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) #endif /* UIP_CONF_ND6_SEND_RA */ /* UIP_CONF_ND6_SEND_NA enables standard IPv6 Neighbor Discovery Protocol. - This is unneeded when RPL is used. */ + We enable it by default when IPv6 is used without RPL. + With RPL, the neighbor cache (link-local IPv6 <-> MAC address mapping) + is fed whenever receiving DIO and DAO messages. This is always sufficient + for RPL routing, i.e. to send to the preferred parent or any child. + Link-local unicast to other neighbors may, however, not be possible if + we never receive any DIO from them. This may happen if the link from the + neighbor to us is weak, if DIO transmissions are suppressed (Trickle + timer) or if the neighbor chooses not to transmit DIOs because it is + a leaf node or for any reason. */ #ifndef UIP_CONF_ND6_SEND_NA #define UIP_CONF_ND6_SEND_NA (NETSTACK_CONF_WITH_IPV6 && !UIP_CONF_IPV6_RPL) #endif /* UIP_CONF_ND6_SEND_NA */