Added support for end-to-end DAO ACK for Contiki RPL.

This is a fix for Contiki RPL so that it fully supports DAO ACK in
an end-to-end fashion. When DAO is sent it will be forwarded upwards
as before. DAO ACK will be forwarded downwards until it reach the node
that initiated the DAO ACK and unlike before it is not a single-hop
DAO ACK but it is fully reaching the RPL ROOT before any DAO ACK is
sent back. DAO ACK also now fully support different status messages
(success / fail).
This commit is contained in:
Joakim Eriksson 2015-08-19 15:50:20 +02:00
parent 3b9fa19a66
commit 946be77248
9 changed files with 316 additions and 27 deletions

View file

@ -54,6 +54,7 @@
static void reset(rpl_dag_t *);
static void neighbor_link_callback(rpl_parent_t *, int, int);
static void dao_ack_callback(rpl_parent_t *, int);
static rpl_parent_t *best_parent(rpl_parent_t *, rpl_parent_t *);
static rpl_dag_t *best_dag(rpl_dag_t *, rpl_dag_t *);
static rpl_rank_t calculate_rank(rpl_parent_t *, rpl_rank_t);
@ -62,6 +63,7 @@ static void update_metric_container(rpl_instance_t *);
rpl_of_t rpl_mrhof = {
reset,
neighbor_link_callback,
dao_ack_callback,
best_parent,
best_dag,
calculate_rank,
@ -117,6 +119,20 @@ reset(rpl_dag_t *dag)
PRINTF("RPL: Reset MRHOF\n");
}
static void
dao_ack_callback(rpl_parent_t *p, int status)
{
/* here we need to handle failed DAO's and other stuff */
PRINTF("RPL: MRHOF - DAO ACK received with status: %d", status);
if(status >= RPL_DAO_ACK_UNABLE_TO_ACCEPT) {
/* punish the ETX as if this was 10 packets lost */
neighbor_link_callback(p, MAC_TX_OK, 10);
} else if(status == RPL_DAO_ACK_TIMEOUT) { /* timeout = no ack */
/* punish the total lack of ACK with a similar punishment */
neighbor_link_callback(p, MAC_TX_OK, 10);
}
}
static void
neighbor_link_callback(rpl_parent_t *p, int status, int numtx)
{