Skip to content

Commit a2b8491

Browse files
author
Juha Heiskanen
committed
Wi-sun Border router and NUD process updates
Define RPL version number update time to 5 hours NUD time update to support multiplse 100ms ticks. Some minor code clean. Change-Id: I8659ce1eab7dafe5f812a825602701dfa62ce762
1 parent 60e1545 commit a2b8491

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

source/6LoWPAN/ws/ws_bbr_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ void ws_bbr_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t seconds
207207
// We update the RPL version in same time to allow nodes to reselect parent
208208
// As configuration is made so that devices cant move downward in dodag this allows it
209209
// TODO think the correct rate for this
210-
if (cur->ws_info->pan_information.pan_version % 3 == 0) {
211-
// Third the rate of configuration version change at default 12 minutes
212-
//rpl_control_increment_dodag_version(protocol_6lowpan_rpl_root_dodag);
210+
if ( cur->ws_info->pan_information.pan_version && cur->ws_info->pan_information.pan_version % RPL_VERSION_LIFETIME / PAN_VERSION_LIFETIME == 0) {
211+
// Third the rate of configuration version change at default 5 hours
212+
rpl_control_increment_dodag_version(protocol_6lowpan_rpl_root_dodag);
213213
}
214214
}
215215

source/6LoWPAN/ws/ws_bootstrap.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static bool ws_nud_message_build(protocol_interface_info_entry_t *cur, mac_neigh
244244
memcpy(ll_target, ADDR_LINK_LOCAL_PREFIX, 8);
245245
memcpy(ll_target + 8, neighbor->mac64, 8);
246246
ll_target[8] ^= 2;
247-
tr_debug("NUD generate NS %u", neighbor->index);
247+
tr_info("NUD generate NS %u", neighbor->index);
248248
buffer_t * buffer = icmpv6_build_ns(cur, ll_target, NULL, true, false, NULL);
249249
if (buffer) {
250250
protocol_push(buffer);
@@ -253,11 +253,17 @@ static bool ws_nud_message_build(protocol_interface_info_entry_t *cur, mac_neigh
253253
return false;
254254
}
255255

256-
void ws_nud_active_timer(protocol_interface_info_entry_t *cur, uint16_t time_in_ms)
256+
void ws_nud_active_timer(protocol_interface_info_entry_t *cur, uint16_t ticks)
257257
{
258+
//Convert TICKS to real milliseconds
259+
if (ticks > 0xffff / 100) {
260+
ticks = 0xffff;
261+
} else {
262+
ticks *= 100;
263+
}
258264

259265
ns_list_foreach_safe(ws_nud_table_entry_t, entry, &cur->ws_info->active_nud_process) {
260-
if (entry->timer <= time_in_ms) {
266+
if (entry->timer <= ticks) {
261267
//TX Process or timeout
262268
if (entry->wait_response) {
263269
//Timeout for NUD or Probe
@@ -293,7 +299,7 @@ void ws_nud_active_timer(protocol_interface_info_entry_t *cur, uint16_t time_in_
293299
}
294300
}
295301
} else {
296-
entry->timer -= time_in_ms;
302+
entry->timer -= ticks;
297303
}
298304
}
299305
}
@@ -1878,7 +1884,6 @@ void ws_bootstrap_network_scan_process(protocol_interface_info_entry_t *cur)
18781884
return;
18791885
}
18801886

1881-
//ws_bootstrap_primary_parent_set(cur, &neighbor_info);
18821887
ws_bootstrap_network_information_learn(cur);
18831888
ws_bootstrap_fhss_activate(cur);
18841889
ws_bootstrap_event_authentication_start(cur);

source/6LoWPAN/ws/ws_bootstrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ws_primary_parent_update(protocol_interface_info_entry_t *interface, mac_ne
5858

5959
void ws_nud_entry_remove_active(protocol_interface_info_entry_t *cur, void *neighbor);
6060

61-
void ws_nud_active_timer(protocol_interface_info_entry_t *cur, uint16_t time_in_ms);
61+
void ws_nud_active_timer(protocol_interface_info_entry_t *cur, uint16_t ticks);
6262

6363
#else
6464

source/6LoWPAN/ws/ws_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void ws_common_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t seco
174174
void ws_common_fast_timer(protocol_interface_info_entry_t *cur, uint16_t ticks)
175175
{
176176
ws_bootstrap_trickle_timer(cur, ticks);
177-
ws_nud_active_timer(cur, 100);
177+
ws_nud_active_timer(cur, ticks);
178178
}
179179

180180

source/6LoWPAN/ws/ws_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838

3939
#define PAN_VERSION_LIFETIME 240
4040

41+
#define RPL_VERSION_LIFETIME 5*3600
42+
4143
/* Border router connection lost timeout
4244
*
4345
* Interval within which a node expects to detect a change in PAN Version

0 commit comments

Comments
 (0)