From 8ae00caea8b6674a5a05013b97893dd55b1549a9 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 3 Jun 2016 12:51:39 +0200 Subject: [PATCH] RPL: more robust configuration of mrhof in the squared ETX case --- core/net/rpl/rpl-mrhof.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/core/net/rpl/rpl-mrhof.c b/core/net/rpl/rpl-mrhof.c index b997b9efa..a818d1c36 100644 --- a/core/net/rpl/rpl-mrhof.c +++ b/core/net/rpl/rpl-mrhof.c @@ -70,16 +70,23 @@ #define RPL_MRHOF_SQUARED_ETX 0 #endif /* RPL_MRHOF_CONF_SQUARED_ETX */ +#if !RPL_MRHOF_SQUARED_ETX /* Configuration parameters of RFC6719. Reject parents that have a higher * link metric than the following. The default value is 512 but we use 1024. */ -#define MAX_LINK_METRIC 1024 /* Eq ETX of 8 */ -/* Reject parents that have a higher path cost than the following. */ -#define MAX_PATH_COST 32768 /* Eq path ETX of 256 */ +#define MAX_LINK_METRIC 1024 /* Eq ETX of 8 */ /* Hysteresis of MRHOF: the rank must differ more than PARENT_SWITCH_THRESHOLD_DIV * in order to switch preferred parent. Default in RFC6719: 192, eq ETX of 1.5. * We use a more aggressive setting: 96, eq ETX of 0.75. */ -#define PARENT_SWITCH_THRESHOLD 96 +#define PARENT_SWITCH_THRESHOLD 96 /* Eq ETX of 0.75 */ +#else /* !RPL_MRHOF_SQUARED_ETX */ +#define MAX_LINK_METRIC 2048 /* Eq ETX of 4 */ +#define PARENT_SWITCH_THRESHOLD 160 /* Eq ETX of 1.25 (results in a churn comparable +to the threshold of 96 in the non-squared case) */ +#endif /* !RPL_MRHOF_SQUARED_ETX */ + +/* Reject parents that have a higher path cost than the following. */ +#define MAX_PATH_COST 32768 /* Eq path ETX of 256 */ /*---------------------------------------------------------------------------*/ static void