Fine tuning of link stats and RPL OFs

This commit is contained in:
Simon Duquennoy 2016-02-04 22:43:34 +01:00
parent 0d7e1e8be4
commit 6349019384
3 changed files with 18 additions and 28 deletions

View file

@ -55,13 +55,13 @@
/* EWMA (exponential moving average) used to maintain statistics over time */ /* EWMA (exponential moving average) used to maintain statistics over time */
#define EWMA_SCALE 100 #define EWMA_SCALE 100
#define EWMA_ALPHA 10 #define EWMA_ALPHA 15
#define EWMA_BOOTSTRAP_ALPHA 30 #define EWMA_BOOTSTRAP_ALPHA 30
/* ETX fixed point divisor. 128 is the value used by RPL (RFC 6551 and RFC 6719) */ /* ETX fixed point divisor. 128 is the value used by RPL (RFC 6551 and RFC 6719) */
#define ETX_DIVISOR LINK_STATS_ETX_DIVISOR #define ETX_DIVISOR LINK_STATS_ETX_DIVISOR
/* Number of Tx used to update the ETX EWMA in case of no-ACK */ /* Number of Tx used to update the ETX EWMA in case of no-ACK */
#define ETX_NOACK_PENALTY 16 #define ETX_NOACK_PENALTY 10
/* Initial ETX value */ /* Initial ETX value */
#define ETX_INIT 2 #define ETX_INIT 2

View file

@ -71,8 +71,8 @@
#endif /* RPL_MRHOF_CONF_SQUARED_ETX */ #endif /* RPL_MRHOF_CONF_SQUARED_ETX */
/* Configuration parameters of RFC6719. Reject parents that have a higher /* Configuration parameters of RFC6719. Reject parents that have a higher
* link metric than the following. We use the default values from the RFC. */ * link metric than the following. The default value is 512 but we use 1024. */
#define MAX_LINK_METRIC 512 /* Eq ETX of 4 */ #define MAX_LINK_METRIC 1024 /* Eq ETX of 8 */
/* Reject parents that have a higher path cost than the following. */ /* Reject parents that have a higher path cost than the following. */
#define MAX_PATH_COST 32768 /* Eq path ETX of 256 */ #define MAX_PATH_COST 32768 /* Eq path ETX of 256 */
/* Hysteresis of MRHOF: the rank must differ more than PARENT_SWITCH_THRESHOLD_DIV /* Hysteresis of MRHOF: the rank must differ more than PARENT_SWITCH_THRESHOLD_DIV
@ -187,19 +187,14 @@ best_parent(rpl_parent_t *p1, rpl_parent_t *p2)
int p1_is_acceptable; int p1_is_acceptable;
int p2_is_acceptable; int p2_is_acceptable;
if(p1 == NULL || p2 == NULL) { p1_is_acceptable = p1 != NULL && parent_is_acceptable(p1);
/* Return non-null parent if any */ p2_is_acceptable = p2 != NULL && parent_is_acceptable(p2);
return p1 == NULL ? p2 : p1;
}
p1_is_acceptable = parent_is_acceptable(p1); if(!p1_is_acceptable) {
p2_is_acceptable = parent_is_acceptable(p2); return p2_is_acceptable ? p2 : NULL;
/* Is only one parent is acceptable, select it. If both are acceptable, or }
* both non-acceptable, proceed to traditional parent comparison. This is a if(!p2_is_acceptable) {
* slight departure from the standard but allows to keep connectivity even return p1_is_acceptable ? p1 : NULL;
* all neighbors appear to have a bad link. */
if(p1_is_acceptable != p2_is_acceptable) {
return p1_is_acceptable ? p1 : p2;
} }
dag = p1->dag; /* Both parents are in the same DAG. */ dag = p1->dag; /* Both parents are in the same DAG. */

View file

@ -145,19 +145,14 @@ best_parent(rpl_parent_t *p1, rpl_parent_t *p2)
int p1_is_acceptable; int p1_is_acceptable;
int p2_is_acceptable; int p2_is_acceptable;
if(p1 == NULL || p2 == NULL) { p1_is_acceptable = p1 != NULL && parent_is_acceptable(p1);
/* Return non-null parent if any */ p2_is_acceptable = p2 != NULL && parent_is_acceptable(p2);
return p1 == NULL ? p2 : p1;
}
p1_is_acceptable = parent_is_acceptable(p1); if(!p1_is_acceptable) {
p2_is_acceptable = parent_is_acceptable(p2); return p2_is_acceptable ? p2 : NULL;
/* Is only one parent is acceptable, select it. If both are acceptable, or }
* both non-acceptable, proceed to traditional parent comparison. This is a if(!p2_is_acceptable) {
* slight departure from the standard but allows to keep connectivity even return p1_is_acceptable ? p1 : NULL;
* all neighbors appear to have a bad link. */
if(p1_is_acceptable != p2_is_acceptable) {
return p1_is_acceptable ? p1 : p2;
} }
dag = p1->dag; /* Both parents are in the same DAG. */ dag = p1->dag; /* Both parents are in the same DAG. */