Skip to content

Commit

Permalink
RPL new parent accept update and NUD operation
Browse files Browse the repository at this point in the history
Accept only Max value to list and NUD max value number of candidates.

Added Chance to learn shorter path if it is enough good.
  • Loading branch information
Juha Heiskanen committed May 27, 2020
1 parent f5920e2 commit fc644f5
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions source/6LoWPAN/ws/ws_bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
return false;
}

if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, 0)) {
if (!rpl_control_is_dodag_parent_candidate(cur, ll_address, cur->ws_info->cfg->gen.rpl_parent_candidate_max)) {
//NUD Not needed for if neighbour is not parent candidate
return false;
}
Expand Down Expand Up @@ -2381,7 +2381,7 @@ static bool ws_rpl_candidate_soft_filtering(protocol_interface_info_entry_t *cur
{
//Already many candidates
uint16_t candidate_list_size = rpl_control_candidate_list_size(cur, instance);
if (candidate_list_size > cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
if (candidate_list_size >= cur->ws_info->cfg->gen.rpl_parent_candidate_max) {
return false;
}

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

if (!ws_rpl_candidate_soft_filtering(cur, instance)) {

//Acept only better than own rank here
if (candidate_rank >= rpl_control_current_rank(instance)) {
//Do not accept no more siblings
return false;
}

uint16_t candidate_list_size = rpl_control_candidate_list_size(cur, instance);
if (candidate_list_size > cur->ws_info->cfg->gen.rpl_parent_candidate_max + 1) {
//Accept only 1 better 1 time
return false;
}

if (!neigh_buffer.neighbor) {
//Do not accept any new in that Place
return false;
Expand Down Expand Up @@ -2459,42 +2472,6 @@ static bool ws_rpl_new_parent_callback(uint8_t *ll_parent_address, void *handle,
if (neigh_buffer.neighbor) {
return true;
}
#if 0
if (!rpl_control_find_worst_neighbor(cur, instance, replacing)) {
return false;
}

// +2 Is for PAN ID space
memcpy(mac64 + 2, replacing + 8, 8);
mac64[2] ^= 2;

if (ws_etx_read(cur, ADDR_802_15_4_LONG, mac64) == 0xffff) {
//Not proped yet because ETX is 0xffff
return false;
}

uint16_t etx = 0;
if (neigh_buffer.neighbor) {
etx = etx_local_etx_read(cur->id, neigh_buffer.neighbor->index);
}

// Accept now only better one's when max candidates selected and max candidate list size is reached
if (!rpl_possible_better_candidate(cur, instance, replacing, candidate_rank, etx)) {
return false;
}
//TODO if replacing has poor ETX, put it in blacklist as "poor ETX" to prevent reselection
//Mark That We can try remove replaced link
replace_ok = true;

neigh_create:


if (neigh_buffer.neighbor) {
//Use Already discovered entry
create_ok = true;
goto neigh_create_ok;
}
#endif

if (!entry) {
//No Multicast Entry Available
Expand Down

0 comments on commit fc644f5

Please sign in to comment.