Skip to content

Commit 0b84299

Browse files
author
Juha Heiskanen
committed
Source route handler call Wi-Sun border router alive function.
Calling at SRC route handling by update border router alive state will help Wi-SUN to scale at big network and with longer DAO lifetime it will decrease DAO traffic.
1 parent c8343b1 commit 0b84299

File tree

6 files changed

+28
-5
lines changed

6 files changed

+28
-5
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ static void ws_bootstrap_pan_config_analyse(struct protocol_interface_info_entry
17581758
// restart PAN version timer
17591759
//Check Here Do we have a selected Primary parent
17601760
if (!cur->ws_info->configuration_learned || cur->ws_info->rpl_state == RPL_EVENT_DAO_DONE) {
1761-
cur->ws_info->pan_timeout_timer = cur->ws_info->cfg->timing.pan_timeout;
1761+
ws_common_border_router_alive_update(cur);
17621762
}
17631763

17641764
cur->ws_info->pan_information.pan_version = pan_version;
@@ -2645,9 +2645,7 @@ static void ws_bootstrap_rpl_callback(rpl_event_t event, void *handle)
26452645
}
26462646

26472647
// After successful DAO ACK connection to border router is verified
2648-
cur->ws_info->pan_timeout_timer = cur->ws_info->cfg->timing.pan_timeout;
2649-
2650-
2648+
ws_common_border_router_alive_update(cur);
26512649
}
26522650

26532651
if (!cur->ws_info->trickle_pa_running || !cur->ws_info->trickle_pc_running) {
@@ -3171,7 +3169,7 @@ static void ws_bootstrap_rpl_scan_start(protocol_interface_info_entry_t *cur)
31713169
* Router for an interval of PAN_TIMEOUT, a node MUST assume failure of the PAN Border Router and MUST
31723170
* Transition to Join State 1
31733171
*/
3174-
cur->ws_info->pan_timeout_timer = cur->ws_info->cfg->timing.pan_timeout;
3172+
ws_common_border_router_alive_update(cur);
31753173
}
31763174

31773175
/*

source/6LoWPAN/ws/ws_common.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,4 +690,14 @@ void ws_common_secondary_parent_update(protocol_interface_info_entry_t *interfac
690690
ws_bootstrap_secondary_parent_update(interface);
691691
}
692692

693+
void ws_common_border_router_alive_update(protocol_interface_info_entry_t *interface)
694+
{
695+
if (interface->bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
696+
return;
697+
}
698+
699+
// After successful DAO ACK connection to border router is verified
700+
interface->ws_info->pan_timeout_timer = interface->ws_info->cfg->timing.pan_timeout;
701+
}
702+
693703
#endif // HAVE_WS

source/6LoWPAN/ws/ws_common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ void ws_common_primary_parent_update(protocol_interface_info_entry_t *interface,
173173
void ws_common_secondary_parent_update(protocol_interface_info_entry_t *interface);
174174

175175
uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size);
176+
void ws_common_border_router_alive_update(protocol_interface_info_entry_t *interface);
177+
176178
#define ws_info(cur) ((cur)->ws_info)
177179
#else
178180
#define ws_info(cur) ((ws_info_t *) NULL)
@@ -189,6 +191,7 @@ uint8_t ws_common_temporary_entry_size(uint8_t mac_table_size);
189191
#define ws_common_network_size_estimate_get(cur) 0
190192
#define ws_common_primary_parent_update(interface, neighbor)
191193
#define ws_common_secondary_parent_update(interface)
194+
#define ws_common_border_router_alive_update(interface) ((void) 0)
192195

193196

194197
#endif //HAVE_WS

source/RPL/rpl_data.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "RPL/rpl_structures.h"
4747
#include "RPL/rpl_policy.h"
4848
#include "RPL/rpl_data.h"
49+
#include "6LoWPAN/ws/ws_common.h"
4950

5051
#define TRACE_GROUP "RPLa"
5152

@@ -1054,6 +1055,11 @@ buffer_t *rpl_data_process_routing_header(buffer_t *buf, protocol_interface_info
10541055

10551056
buf->options.ip_extflags |= IPEXT_SRH_RPL;
10561057

1058+
if (ws_info(cur)) {
1059+
//Call SRC route header handler hook to Wi-SUN refresh border router alive
1060+
ws_common_border_router_alive_update(cur);
1061+
}
1062+
10571063
uint16_t hlen = (ptr[1] + 1) * 8;
10581064
uint8_t segs_left = ptr[3];
10591065

test/nanostack/unittest/rpl/rpl_data/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ TEST_SRC_FILES = \
2525
../../stub/ipv6_routing_table_stub.c \
2626
../../stub/rpl_downward_stub.c \
2727
../../stub/rpl_upward_stub.c \
28+
../../stub/ws_common_stub.c \
2829

2930
include ../../MakefileWorker.mk
3031

test/nanostack/unittest/stub/ws_common_stub.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,8 @@ void ws_common_primary_parent_update(protocol_interface_info_entry_t *interface,
124124
void ws_common_secondary_parent_update(protocol_interface_info_entry_t *interface)
125125
{
126126
}
127+
128+
void ws_common_border_router_alive_update(protocol_interface_info_entry_t *interface)
129+
{
130+
131+
}

0 commit comments

Comments
 (0)