From 6aa17cce95c1f084af9cb2786c51ee71ccb7dbd1 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Wed, 9 May 2018 15:29:41 -0700 Subject: [PATCH 1/2] RPL Lite: disable MRHOF ETX squaring by default --- os/net/routing/rpl-classic/rpl-mrhof.c | 17 +++++++++++------ os/net/routing/rpl-lite/rpl-mrhof.c | 19 ++++++++++++------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/os/net/routing/rpl-classic/rpl-mrhof.c b/os/net/routing/rpl-classic/rpl-mrhof.c index 4f5189384..f3c75985b 100644 --- a/os/net/routing/rpl-classic/rpl-mrhof.c +++ b/os/net/routing/rpl-classic/rpl-mrhof.c @@ -56,14 +56,19 @@ /* RFC6551 and RFC6719 do not mandate the use of a specific formula to * compute the ETX value. This MRHOF implementation relies on the value - * computed by the link-stats module. It has an optional feature, + * computed by the link-stats module.It has an optional feature, * RPL_MRHOF_CONF_SQUARED_ETX, that consists in squaring this value. - * This basically penalizes bad links while preserving the semantics of ETX + * + * Squaring basically penalizes bad links while preserving the semantics of ETX * (1 = perfect link, more = worse link). As a result, MRHOF will favor - * good links over short paths. Recommended when reliability is a priority. - * Without this feature, a hop with 50% PRR (ETX=2) is equivalent to two - * perfect hops with 100% PRR (ETX=1+1=2). With this feature, the former - * path obtains ETX=2*2=4 and the former ETX=1*1+1*1=2. */ + * good links over short paths. Without this feature, a hop with 50% PRR (ETX=2) + * is equivalent to two perfect hops with 100% PRR (ETX=1+1=2). With this + * feature, the former path obtains ETX=2*2=4 and the former ETX=1*1+1*1=2. + * + * While this feature helps achieve extra relaibility, it also results in + * added churn. In networks with high congestion or poor links, this can lead + * to poor connectivity due to more parent switches, loops, Trickle resets, etc. + */ #ifdef RPL_MRHOF_CONF_SQUARED_ETX #define RPL_MRHOF_SQUARED_ETX RPL_MRHOF_CONF_SQUARED_ETX #else /* RPL_MRHOF_CONF_SQUARED_ETX */ diff --git a/os/net/routing/rpl-lite/rpl-mrhof.c b/os/net/routing/rpl-lite/rpl-mrhof.c index a0b2546eb..5504f4fda 100644 --- a/os/net/routing/rpl-lite/rpl-mrhof.c +++ b/os/net/routing/rpl-lite/rpl-mrhof.c @@ -56,18 +56,23 @@ /* RFC6551 and RFC6719 do not mandate the use of a specific formula to * compute the ETX value. This MRHOF implementation relies on the value - * computed by the link-stats module. It has an optional feature, + * computed by the link-stats module.It has an optional feature, * RPL_MRHOF_CONF_SQUARED_ETX, that consists in squaring this value. - * This basically penalizes bad links while preserving the semantics of ETX + * + * Squaring basically penalizes bad links while preserving the semantics of ETX * (1 = perfect link, more = worse link). As a result, MRHOF will favor - * good links over short paths. Recommended when reliability is a priority. - * Without this feature, a hop with 50% PRR (ETX=2) is equivalent to two - * perfect hops with 100% PRR (ETX=1+1=2). With this feature, the former - * path obtains ETX=2*2=4 and the former ETX=1*1+1*1=2. */ + * good links over short paths. Without this feature, a hop with 50% PRR (ETX=2) + * is equivalent to two perfect hops with 100% PRR (ETX=1+1=2). With this + * feature, the former path obtains ETX=2*2=4 and the former ETX=1*1+1*1=2. + * + * While this feature helps achieve extra relaibility, it also results in + * added churn. In networks with high congestion or poor links, this can lead + * to poor connectivity due to more parent switches, loops, Trickle resets, etc. + */ #ifdef RPL_MRHOF_CONF_SQUARED_ETX #define RPL_MRHOF_SQUARED_ETX RPL_MRHOF_CONF_SQUARED_ETX #else /* RPL_MRHOF_CONF_SQUARED_ETX */ -#define RPL_MRHOF_SQUARED_ETX 1 +#define RPL_MRHOF_SQUARED_ETX 0 #endif /* RPL_MRHOF_CONF_SQUARED_ETX */ /* Configuration parameters of RFC6719. Reject parents that have a higher From 73bc179cebf6acaac4fc9bae42438767ce5b46b3 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Wed, 9 May 2018 23:49:15 -0700 Subject: [PATCH 2/2] link-stat: increase penalty applied in case of no-ack --- os/net/link-stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/net/link-stats.c b/os/net/link-stats.c index 60b107aec..fbb7677da 100644 --- a/os/net/link-stats.c +++ b/os/net/link-stats.c @@ -64,7 +64,7 @@ /* ETX fixed point divisor. 128 is the value used by RPL (RFC 6551 and RFC 6719) */ #define ETX_DIVISOR LINK_STATS_ETX_DIVISOR /* Number of Tx used to update the ETX EWMA in case of no-ACK */ -#define ETX_NOACK_PENALTY 16 +#define ETX_NOACK_PENALTY 20 /* Initial ETX value */ #define ETX_DEFAULT 2