Skip to content

Commit fc644f5

Browse files
author
Juha Heiskanen
committed
RPL new parent accept update and NUD operation
Accept only Max value to list and NUD max value number of candidates. Added Chance to learn shorter path if it is enough good.
1 parent f5920e2 commit fc644f5

File tree

1 file changed

+15
-38
lines changed

1 file changed

+15
-38
lines changed

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
18211821
return false;
18221822
}
18231823

1824-
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, 0)) {
1824+
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, cur->ws_info->cfg->gen.rpl_parent_candidate_max)) {
18251825
//NUD Not needed for if neighbour is not parent candidate
18261826
return false;
18271827
}
@@ -2381,7 +2381,7 @@ static bool ws_rpl_candidate_soft_filtering(protocol_interface_info_entry_t *cur
23812381
{
23822382
//Already many candidates
23832383
uint16_t candidate_list_size = rpl_control_candidate_list_size(cur, instance);
2384-
if (candidate_list_size > cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
2384+
if (candidate_list_size >= cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
23852385
return false;
23862386
}
23872387

@@ -2427,6 +2427,19 @@ static bool ws_rpl_new_parent_callback(uint8_t *ll_parent_address, void *handle,
24272427
ws_neighbor_temp_class_t *entry = ws_llc_get_multicast_temp_entry(cur, mac64);
24282428

24292429
if (!ws_rpl_candidate_soft_filtering(cur, instance)) {
2430+
2431+
//Acept only better than own rank here
2432+
if (candidate_rank >= rpl_control_current_rank(instance)) {
2433+
//Do not accept no more siblings
2434+
return false;
2435+
}
2436+
2437+
uint16_t candidate_list_size = rpl_control_candidate_list_size(cur, instance);
2438+
if (candidate_list_size > cur->ws_info->cfg->gen.rpl_parent_candidate_max + 1) {
2439+
//Accept only 1 better 1 time
2440+
return false;
2441+
}
2442+
24302443
if (!neigh_buffer.neighbor) {
24312444
//Do not accept any new in that Place
24322445
return false;
@@ -2459,42 +2472,6 @@ static bool ws_rpl_new_parent_callback(uint8_t *ll_parent_address, void *handle,
24592472
if (neigh_buffer.neighbor) {
24602473
return true;
24612474
}
2462-
#if 0
2463-
if (!rpl_control_find_worst_neighbor(cur, instance, replacing)) {
2464-
return false;
2465-
}
2466-
2467-
// +2 Is for PAN ID space
2468-
memcpy(mac64 + 2, replacing + 8, 8);
2469-
mac64[2] ^= 2;
2470-
2471-
if (ws_etx_read(cur, ADDR_802_15_4_LONG, mac64) == 0xffff) {
2472-
//Not proped yet because ETX is 0xffff
2473-
return false;
2474-
}
2475-
2476-
uint16_t etx = 0;
2477-
if (neigh_buffer.neighbor) {
2478-
etx = etx_local_etx_read(cur->id, neigh_buffer.neighbor->index);
2479-
}
2480-
2481-
// Accept now only better one's when max candidates selected and max candidate list size is reached
2482-
if (!rpl_possible_better_candidate(cur, instance, replacing, candidate_rank, etx)) {
2483-
return false;
2484-
}
2485-
//TODO if replacing has poor ETX, put it in blacklist as "poor ETX" to prevent reselection
2486-
//Mark That We can try remove replaced link
2487-
replace_ok = true;
2488-
2489-
neigh_create:
2490-
2491-
2492-
if (neigh_buffer.neighbor) {
2493-
//Use Already discovered entry
2494-
create_ok = true;
2495-
goto neigh_create_ok;
2496-
}
2497-
#endif
24982475

24992476
if (!entry) {
25002477
//No Multicast Entry Available

0 commit comments

Comments
 (0)