Skip to content

Commit

Permalink
Adjusted stagger random to [min,min+max] and for small nw set the sta…
Browse files Browse the repository at this point in the history
…gger value to 10 seconds

Adjusted stagger random from [min,max] to [min,min+max] and for small networks
set the stagger value to 10 seconds.
  • Loading branch information
Mika Leppänen committed Jun 16, 2021
1 parent 02bc33a commit 3b3010a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Changes
* Statistics for MAC data request latencies. Separated to adaptation layer and MAC queueing delays.
* Changed initial EAPOL-key retries from trickle to exponential backup.
* Adjusted stagger random from [min,max] to [min,min+max] and for small networks set the stagger value to 10 seconds.

### Bug fixes
* Added ignoring of retry messages from RADIUS server when waiting EAP-TLS
Expand Down
9 changes: 7 additions & 2 deletions source/6LoWPAN/Bootstraps/Generic/protocol_6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,12 @@ bool protocol_6lowpan_stagger_estimate_get(int8_t interface_id, uint32_t data_am
datarate = STAGGER_DATARATE_FOR_APPL(datarate);
}

stagger_value = 1 + ((data_amount * 1024 * 8 * network_size) / datarate);
// For small networks sets 10 seconds stagger
if (network_size <= 100 && ws_info(cur_interface)) {
stagger_value = 10;
} else {
stagger_value = 1 + ((data_amount * 1024 * 8 * network_size) / datarate);
}
/**
* Example:
* Maximum stagger value to send 1kB to 100 device network using data rate of 50kbs:
Expand All @@ -882,7 +887,7 @@ bool protocol_6lowpan_stagger_estimate_get(int8_t interface_id, uint32_t data_am
if (stagger_value > 0xFFFF) {
*stagger_max = 0xFFFF;
} else {
*stagger_max = (uint16_t)stagger_value;
*stagger_max = (uint16_t)stagger_value + *stagger_min;
}

// Randomize stagger value
Expand Down

0 comments on commit 3b3010a

Please sign in to comment.