Skip to content

Commit ac33518

Browse files
author
Juha Heiskanen
committed
Wi-sun ETX and proping update
Removed Accelaterd Probe feature to child address registration. ETX support now dynamic init sampling count. ETX local read return configured MAX value for neighbour when no ETX sample have been done. Change-Id: I2a59b7bb52b52a24a87c9c956d252726703a275a
1 parent 11c486f commit ac33518

File tree

12 files changed

+99
-132
lines changed

12 files changed

+99
-132
lines changed

source/6LoWPAN/ND/nd_router_object.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,6 @@ static void nd_update_registration(protocol_interface_info_entry_t *cur_interfac
856856
mac_neighbor_table_entry_t *entry = mac_neighbor_table_address_discover(mac_neighbor_info(cur_interface), ipv6_neighbour_eui64(&cur_interface->ipv6_neighbour_cache, neigh), ADDR_802_15_4_LONG);
857857

858858
if (entry) {
859-
if (ws_info(cur_interface)) {
860-
ws_common_etx_validate(cur_interface, entry);
861-
}
862859

863860
if (!entry->ffd_device) {
864861
rpl_control_publish_host_address(protocol_6lowpan_rpl_domain, neigh->ip_address, neigh->lifetime);

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 21 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -663,33 +663,8 @@ uint16_t ws_etx_read(protocol_interface_info_entry_t *interface, addrtype_t addr
663663
ws_neighbor_class_entry_t *ws_neighbour = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, attribute_index);
664664
etx_storage_t *etx_entry = etx_storage_entry_get(interface->id, attribute_index);
665665

666-
if (interface->bootsrap_mode == ARM_NWK_BOOTSRAP_MODE_6LoWPAN_BORDER_ROUTER) {
667-
if (!ws_neighbour || !etx_entry) {
668-
return 0xffff;
669-
}
670-
} else {
671-
672-
if (!ws_neighbour || !etx_entry || etx_entry->etx_samples < 1 /*||
673-
!ws_neighbour->candidate_parent*/) {
674-
// if RSL value is not good enough candidate parent flag is removed and device not accepted as parent
675-
//tr_debug("ws_etx_read not valid params");
676-
return 0xffff;
677-
}
678-
679-
//If we are not following gbobal Broadcast synch
680-
if (!interface->ws_info->pan_information.use_parent_bs) {
681-
//We must know both information's here
682-
if (!ws_neighbour->broadcast_shedule_info_stored ||
683-
!ws_neighbour->broadcast_timing_info_stored) {
684-
return 0xffff;
685-
}
686-
} else {
687-
if (!ws_neighbour->broadcast_timing_info_stored) {
688-
//Global shedule is stored already
689-
tr_debug("ws_etx_read not valid NO BTI");
690-
return 0xffff;
691-
}
692-
}
666+
if (!ws_neighbour || !etx_entry) {
667+
return 0xffff;
693668
}
694669

695670
etx = etx_local_etx_read(interface->id, attribute_index);
@@ -1497,7 +1472,7 @@ static void ws_bootstrap_neighbor_table_clean(struct protocol_interface_info_ent
14971472
continue;
14981473
}
14991474

1500-
if (cur->nud_active || ws_neighbor->accelerated_etx_probe || ws_neighbor->negative_aro_send) {
1475+
if (cur->nud_active || ws_neighbor->negative_aro_send) {
15011476
//If NUD process is active do not trig
15021477
continue;
15031478
}
@@ -1657,34 +1632,28 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
16571632
}
16581633
}
16591634
nud_proces = activate_nud;
1660-
} else if (etx_entry->etx_samples < WS_NEIGBOR_ETX_SAMPLE_MAX) {
1635+
} else if (etx_entry->etx_samples < WS_NEIGHBOR_ETX_SAMPLE_MAX) {
16611636
//Take Random number for trig a prope.
16621637
//ETX Sample 0: random 1-8
16631638
//ETX Sample 1: random 2-16
16641639
//ETX Sample 2: random 4-32
1665-
if (etx_entry->etx_samples == 0 && ws_neighbor->accelerated_etx_probe) {
1666-
//Accept quick Probe for init ETX
1667-
activate_nud = true;
1668-
} else {
1669-
1670-
ws_bootsrap_create_ll_address(ll_address, entry_ptr->mac64);
1671-
if (!rpl_control_probe_parent_candidate(cur, ll_address)) {
1672-
return false;
1673-
}
1640+
ws_bootsrap_create_ll_address(ll_address, entry_ptr->mac64);
1641+
if (!rpl_control_probe_parent_candidate(cur, ll_address)) {
1642+
return false;
1643+
}
16741644

16751645

1676-
uint32_t probe_period = WS_PROBE_INIT_BASE_SECONDS << etx_entry->etx_samples;
1677-
uint32_t time_block = 1 << etx_entry->etx_samples;
1678-
if (time_from_start >= probe_period) {
1679-
//tr_debug("Link Probe test %u Sample trig", etx_entry->etx_samples);
1646+
uint32_t probe_period = WS_PROBE_INIT_BASE_SECONDS << etx_entry->etx_samples;
1647+
uint32_t time_block = 1 << etx_entry->etx_samples;
1648+
if (time_from_start >= probe_period) {
1649+
//tr_debug("Link Probe test %u Sample trig", etx_entry->etx_samples);
1650+
activate_nud = true;
1651+
} else if (time_from_start > time_block) {
1652+
uint16_t switch_prob = randLIB_get_random_in_range(0, probe_period - 1);
1653+
//Take Random from time WS_NEIGHBOR_NUD_TIMEOUT - WS_NEIGHBOR_NUD_TIMEOUT*1.5
1654+
if (switch_prob < 2) {
1655+
//tr_debug("Link Probe test with jitter %"PRIu32", sample %u", time_from_start, etx_entry->etx_samples);
16801656
activate_nud = true;
1681-
} else if (time_from_start > time_block) {
1682-
uint16_t switch_prob = randLIB_get_random_in_range(0, probe_period - 1);
1683-
//Take Random from time WS_NEIGHBOR_NUD_TIMEOUT - WS_NEIGHBOR_NUD_TIMEOUT*1.5
1684-
if (switch_prob < 2) {
1685-
//tr_debug("Link Probe test with jitter %"PRIu32", sample %u", time_from_start, etx_entry->etx_samples);
1686-
activate_nud = true;
1687-
}
16881657
}
16891658
}
16901659
}
@@ -1698,10 +1667,6 @@ static bool ws_neighbor_entry_nud_notify(mac_neighbor_table_entry_t *entry_ptr,
16981667
return false;
16991668
}
17001669
entry->neighbor_info = entry_ptr;
1701-
if (ws_neighbor->accelerated_etx_probe) {
1702-
ws_neighbor->accelerated_etx_probe = false;
1703-
entry->timer = 1;
1704-
}
17051670

17061671
entry->nud_process = nud_proces;
17071672

@@ -1737,12 +1702,13 @@ int ws_bootstrap_init(int8_t interface_id, net_6lowpan_mode_e bootstrap_mode)
17371702
if (!etx_storage_list_allocate(cur->id, buffer.device_decription_table_size)) {
17381703
return -1;
17391704
}
1740-
if (!etx_cached_etx_parameter_set(WS_ETX_MIN_WAIT_TIME, WS_ETX_MIN_SAMPLE_COUNT)) {
1705+
if (!etx_cached_etx_parameter_set(WS_ETX_MIN_WAIT_TIME, WS_ETX_MIN_SAMPLE_COUNT, WS_NEIGHBOR_FIRST_ETX_SAMPLE_MIN_COUNT)) {
17411706
etx_storage_list_allocate(cur->id, 0);
17421707
return -1;
17431708
}
17441709

17451710
etx_max_update_set(WS_ETX_MAX_UPDATE);
1711+
etx_max_set(WS_ETX_MAX);
17461712

17471713
if (blacklist_init() != 0) {
17481714
tr_err("MLE blacklist init failed.");
@@ -2597,10 +2563,7 @@ static uint16_t ws_bootstrap_routing_cost_calculate(protocol_interface_info_entr
25972563
if (etx == 0) {
25982564
etx = 0xffff;
25992565
}
2600-
if (etx > 0x800) {
2601-
// Wi-SUN section 6.2.3.1.6.1 says ETX can only be maximum of 1024 (8*128) in RPL units, ie 8.0.
2602-
etx = 0x800;
2603-
}
2566+
//Scale to 128 based ETX (local read retur 0x100 - 0xffff
26042567
etx = etx >> 1;
26052568

26062569
return ws_neighbor->routing_cost + etx;
@@ -3076,23 +3039,4 @@ void ws_secondary_parent_update(protocol_interface_info_entry_t *interface)
30763039
}
30773040
}
30783041

3079-
void ws_bootstrap_etx_accelerate(protocol_interface_info_entry_t *interface, mac_neighbor_table_entry_t *neigh)
3080-
{
3081-
ws_neighbor_class_entry_t *ws_neighbor = ws_neighbor_class_entry_get(&interface->ws_info->neighbor_storage, neigh->index);
3082-
//Enable Faster ETX probing
3083-
ws_neighbor->accelerated_etx_probe = true;
3084-
//Move Neighbor to first to for accelerate Process
3085-
mac_neighbor_table_t *table_class = mac_neighbor_info(interface);
3086-
ns_list_remove(&table_class->neighbour_list, neigh);
3087-
ns_list_add_to_start(&table_class->neighbour_list, neigh);
3088-
//Try to Generate Active NUD Immediately
3089-
if (!ws_neighbor_entry_nud_notify(neigh, interface)) {
3090-
return;//Return if NUD active is full
3091-
}
3092-
table_class->active_nud_process++;
3093-
neigh->nud_active = true;
3094-
//Push NS to send
3095-
ws_nud_active_timer(interface, 0);
3096-
}
3097-
30983042
#endif //HAVE_WS

source/6LoWPAN/ws/ws_bootstrap.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ bool ws_eapol_relay_state_active(protocol_interface_info_entry_t *cur);
7676

7777
void ws_bootstrap_eapol_parent_synch(struct protocol_interface_info_entry *cur, struct llc_neighbour_req *neighbor_info);
7878

79-
void ws_bootstrap_etx_accelerate(struct protocol_interface_info_entry *cur, mac_neighbor_table_entry_t *neigh);
80-
8179
#else
8280

8381
#define ws_bootstrap_init(interface_id, bootstrap_mode) (-1)
@@ -87,7 +85,6 @@ void ws_bootstrap_etx_accelerate(struct protocol_interface_info_entry *cur, mac_
8785
#define ws_bootstrap_aro_failure(cur, ll_address)
8886
#define ws_primary_parent_update(interface, neighbor)
8987
#define ws_secondary_parent_update(interface)
90-
#define ws_bootstrap_etx_accelerate(cur, neigh) ((void) 0)
9188

9289
#endif //HAVE_WS
9390

source/6LoWPAN/ws/ws_common.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -456,17 +456,6 @@ bool ws_common_negative_aro_mark(protocol_interface_info_entry_t *interface, con
456456
return true;
457457
}
458458

459-
void ws_common_etx_validate(protocol_interface_info_entry_t *interface, mac_neighbor_table_entry_t *neigh)
460-
{
461-
etx_storage_t *etx_entry = etx_storage_entry_get(interface->id, neigh->index);
462-
463-
if (neigh->nud_active || !neigh->trusted_device || !etx_entry || etx_entry->etx_samples) {
464-
return; //Do not trig Second NS if Active NUD already, not trusted or ETX samples already done
465-
}
466-
467-
ws_bootstrap_etx_accelerate(interface, neigh);
468-
}
469-
470459
uint32_t ws_common_version_lifetime_get(uint8_t config)
471460
{
472461
uint32_t lifetime;

source/6LoWPAN/ws/ws_common.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ void ws_common_neighbor_remove(protocol_interface_info_entry_t *cur, const uint8
142142

143143
bool ws_common_allow_child_registration(protocol_interface_info_entry_t *cur, const uint8_t *eui64);
144144

145-
void ws_common_etx_validate(protocol_interface_info_entry_t *interface, mac_neighbor_table_entry_t *neigh);
146-
147145
bool ws_common_negative_aro_mark(protocol_interface_info_entry_t *interface, const uint8_t *eui64);
148146

149147

@@ -160,7 +158,6 @@ uint32_t ws_common_version_timeout_get(uint8_t config);
160158
#define ws_common_neighbor_remove(cur, ll_address)
161159
#define ws_common_fast_timer(cur, ticks) ((void) 0)
162160
#define ws_common_allow_child_registration(cur, eui64) (false)
163-
#define ws_common_etx_validate(interface, neigh) ((void) 0)
164161
#define ws_common_negative_aro_mark(interface, eui64)(false)
165162

166163
#endif //HAVE_WS

source/6LoWPAN/ws/ws_common_defines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ typedef struct ws_bs_ie {
190190
#define WS_NEIGHBOR_TEMPORARY_LINK_MIN_TIMEOUT_SMALL 260
191191
#define WS_NEIGHBOR_NUD_TIMEOUT WS_NEIGHBOR_LINK_TIMEOUT / 2
192192

193-
#define WS_NEIGBOR_ETX_SAMPLE_MAX 3
193+
#define WS_NEIGHBOR_ETX_SAMPLE_MAX 3
194+
#define WS_NEIGHBOR_FIRST_ETX_SAMPLE_MIN_COUNT 3 //This can't be bigger than WS_NEIGHBOR_ETX_SAMPLE_MAX
194195
#define WS_NEIGHBOUR_MAX_CANDIDATE_PROBE 5
195196

196197
#define WS_PROBE_INIT_BASE_SECONDS 8
@@ -204,6 +205,7 @@ typedef struct ws_bs_ie {
204205
#define WS_ETX_MIN_SAMPLE_COUNT 4
205206

206207
#define WS_ETX_MAX_UPDATE 1024
208+
#define WS_ETX_MAX 1024
207209

208210
#define WS_ETX_MIN_WAIT_TIME 60
209211

source/6LoWPAN/ws/ws_neighbor_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ typedef struct ws_neighbor_class_entry {
3232
bool broadcast_timing_info_stored: 1;
3333
bool broadcast_shedule_info_stored: 1;
3434
bool synch_done : 1;
35-
bool accelerated_etx_probe : 1;
3635
bool negative_aro_send : 1;
3736
bool unicast_data_rx : 1;
3837
} ws_neighbor_class_entry_t;

0 commit comments

Comments
 (0)