Skip to content

Commit 8120b37

Browse files
author
Juha Heiskanen
committed
Wi-sun RPL candidate accept update
Earlier we have it static limit for accept new RPL candidate neighbours now we have in fuure possibility to add dynamic parameters to that. Default setup works like before but certificate network config accept 8 candidates and 3 selected parent. Change-Id: Ie0d2100ab0fb5c0e76a9773b518ac72c31924943
1 parent ebe0dad commit 8120b37

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,13 +1577,13 @@ static bool ws_rpl_dio_new_parent_accept(struct protocol_interface_info_entry *i
15771577
uint16_t parent_candidate_size = rpl_control_parent_candidate_list_size(interface, false);
15781578
//TODO check bootstarap state for review
15791579
//if we have enough candidates at list do not accept new multicast neighbours
1580-
if (parent_candidate_size > WS_NEIGHBOUR_MAX_CANDIDATE_PROBE) {
1580+
if (parent_candidate_size > interface->ws_info->rpl_parent_candidate_max) {
15811581
return false;
15821582
}
15831583

15841584
parent_candidate_size = rpl_control_parent_candidate_list_size(interface, true);
1585-
//If we have already enough parent selected Candidates count is bigger tahn 4
1586-
if (parent_candidate_size >= 2) {
1585+
//If we have already enough parent selected Candidates count is bigger than configured
1586+
if (parent_candidate_size >= interface->ws_info->rpl_selected_parent_max) {
15871587
return false;
15881588
}
15891589

source/6LoWPAN/ws/ws_common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,8 @@ int8_t ws_common_allocate_and_init(protocol_interface_info_entry_t *cur)
300300
cur->ws_info->hopping_schdule.operating_class = 2;
301301
ws_common_regulatory_domain_config(cur);
302302
cur->ws_info->network_size_config = NETWORK_SIZE_MEDIUM;
303+
cur->ws_info->rpl_parent_candidate_max = WS_RPL_PARENT_CANDIDATE_MAX;
304+
cur->ws_info->rpl_selected_parent_max = WS_RPL_SELECTED_PARENT_MAX;
303305
ws_common_network_size_configure(cur, 200); // defaults to medium network size
304306

305307
// Set defaults for the device. user can modify these.

source/6LoWPAN/ws/ws_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ typedef struct ws_info_s {
7272
trickle_t trickle_pan_advertisement;
7373
trickle_params_t trickle_params_pan_discovery;
7474
uint8_t network_size_config; // configuration for network size selection of application.
75+
uint16_t rpl_parent_candidate_max;
76+
uint16_t rpl_selected_parent_max;
7577
uint8_t rpl_state; // state from rpl_event_t
7678
uint8_t pas_requests; // Amount of PAN solicits sent
7779
parent_info_t parent_info[WS_PARENT_LIST_SIZE];

source/6LoWPAN/ws/ws_common_defines.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ typedef struct ws_bs_ie {
207207

208208
#define WS_ETX_MIN_WAIT_TIME 60
209209

210+
#define WS_RPL_PARENT_CANDIDATE_MAX 5
211+
#define WS_RPL_SELECTED_PARENT_MAX 2
212+
213+
#define WS_CERTIFICATE_RPL_PARENT_CANDIDATE_MAX 8
214+
#define WS_CERTIFICATE_RPL_SELECTED_PARENT_MAX 3
215+
210216
/**
211217
* Wi-sun spesific non-preferred prefix policy label
212218
*/

source/6LoWPAN/ws/ws_management_api.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ int ws_management_network_size_set(
140140
uint8_t old_setup = ws_info(cur)->network_size_config;
141141
ws_info(cur)->network_size_config = network_size;
142142

143+
uint16_t rpl_parent_candidate_max;
144+
uint16_t rpl_selected_parent_max;
145+
146+
if (network_size == NETWORK_SIZE_CERTIFICATE) {
147+
rpl_parent_candidate_max = WS_CERTIFICATE_RPL_PARENT_CANDIDATE_MAX;
148+
rpl_selected_parent_max = WS_CERTIFICATE_RPL_SELECTED_PARENT_MAX;
149+
} else {
150+
rpl_parent_candidate_max = WS_RPL_PARENT_CANDIDATE_MAX;
151+
rpl_selected_parent_max = WS_RPL_SELECTED_PARENT_MAX;
152+
}
153+
143154
if (network_size == NETWORK_SIZE_LARGE) {
144155
ws_common_network_size_configure(cur, 5000);
145156
} else if (network_size == NETWORK_SIZE_MEDIUM) {
@@ -152,6 +163,8 @@ int ws_management_network_size_set(
152163
ws_info(cur)->network_size_config = old_setup;
153164
return -2;
154165
}
166+
cur->ws_info->rpl_parent_candidate_max = rpl_parent_candidate_max;
167+
cur->ws_info->rpl_selected_parent_max = rpl_selected_parent_max;
155168
return 0;
156169
}
157170

0 commit comments

Comments
 (0)