Skip to content

Commit

Permalink
Update changelog, random_early_detection_congestion_check nameupdate …
Browse files Browse the repository at this point in the history
…and minor comment fix.
  • Loading branch information
Juha Heiuskanen committed Dec 2, 2020
1 parent b818f12 commit 5a32f4a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

### Features
* Use high priority for Wi-SUN maintenance messages to improve network stability under heavy load.
* Limit network TX queue size under heavy load by using Random Early Detection for congestion avoidance.

### Changes
* Nanostack now indicates connection down on RPL local repair start
* Added trace for mbed TLS errors
* Optimized medium size network MPL parameters for 40 seconds multicast interval
* Added traces to EAPOL TX failure
* New Network statitis info for Randon early detetction dropped packet at Adaptation layer.

### Bugfix
* Prevent sending broadcast frames on unicast channel
Expand Down
2 changes: 1 addition & 1 deletion source/6LoWPAN/adaptation_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ int8_t lowpan_adaptation_interface_tx(protocol_interface_info_entry_t *cur, buff

if (cur->random_early_detection && buf->priority == QOS_NORMAL) {

if (random_early_detection_packet(cur->random_early_detection, interface_ptr->directTxQueue_size)) {
if (random_early_detection_congestion_check(cur->random_early_detection, interface_ptr->directTxQueue_size)) {
protocol_stats_update(STATS_AL_TX_CONGESTION_DROP, 1);
goto tx_error_handler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static uint16_t random_early_detetction_aq_calc(red_info_t *red_info, uint16_t s
//If sum is ODD add 1 this will help to not stuck like 1,99 average to -> 2
averageSum++;
}
//Store new average//If sum is ODD add 1 this will
//Store new average
red_info->averageQ = averageSum;
//Return always same format scaled than inn
return red_info->averageQ / 256;
Expand All @@ -91,7 +91,7 @@ static uint16_t random_early_detetction_aq_calc(red_info_t *red_info, uint16_t s



bool random_early_detection_packet(red_info_t *red_info, uint16_t sampleLen)
bool random_early_detection_congestion_check(red_info_t *red_info, uint16_t sampleLen)
{
//Calulate Average queue size
sampleLen = random_early_detetction_aq_calc(red_info, sampleLen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void random_early_detection_free(struct red_info_s *red_info);
* \return true Drop packet
* \return false Packet can be added to queue
*/
bool random_early_detection_packet(struct red_info_s *red_info, uint16_t sampleLen);
bool random_early_detection_congestion_check(struct red_info_s *red_info, uint16_t sampleLen);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_create)

}

TEST(RandomEarlyDetection, test_random_early_detection_packet)
TEST(RandomEarlyDetection, test_random_early_detection_congestion_check)
{
//Test first malloc failure
nsdynmemlib_stub.returnCounter = 1;
Expand All @@ -75,7 +75,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
}
bool bool_val;
//Test uder threshold
bool_val = random_early_detection_packet(info, 63);
bool_val = random_early_detection_congestion_check(info, 63);

CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(0, info->count);
Expand All @@ -86,14 +86,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
uint16_t compare_count = 1;
for (uint16_t i = test_val; i < 89; i++) {
//printf("%u aQ %u count\r\n", i,compare_count);
bool_val = random_early_detection_packet(info, i);
bool_val = random_early_detection_congestion_check(info, i);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(compare_count, info->count);
compare_count++;
BYTES_EQUAL(i * 256, info->averageQ);
}

bool_val = random_early_detection_packet(info, 89);
bool_val = random_early_detection_congestion_check(info, 89);
CHECK_EQUAL(true, bool_val);
BYTES_EQUAL(0, info->count);
BYTES_EQUAL(89 * 256, info->averageQ);
Expand All @@ -104,14 +104,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
compare_count = 1;
for (uint16_t i = test_val; i < 105; i++) {
//printf("%u aQ %u count\r\n", i,compare_count);
bool_val = random_early_detection_packet(info, i);
bool_val = random_early_detection_congestion_check(info, i);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(compare_count, info->count);
compare_count++;
BYTES_EQUAL(i * 256, info->averageQ);
}

bool_val = random_early_detection_packet(info, 105);
bool_val = random_early_detection_congestion_check(info, 105);
CHECK_EQUAL(true, bool_val);
BYTES_EQUAL(0, info->count);
BYTES_EQUAL(105 * 256, info->averageQ);
Expand All @@ -121,13 +121,13 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
compare_count = 1;
for (uint16_t i = test_val; i < 118; i++) {
//printf("%u aQ %u count\r\n", i,compare_count);
bool_val = random_early_detection_packet(info, i);
bool_val = random_early_detection_congestion_check(info, i);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(compare_count, info->count);
compare_count++;
BYTES_EQUAL(i * 256, info->averageQ);
}
bool_val = random_early_detection_packet(info, 118);
bool_val = random_early_detection_congestion_check(info, 118);
CHECK_EQUAL(true, bool_val);
BYTES_EQUAL(0, info->count);
BYTES_EQUAL(118 * 256, info->averageQ);
Expand All @@ -136,19 +136,19 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
compare_count = 1;
for (uint16_t i = test_val; i < 128; i++) {
//printf("%u aQ %u count\r\n", i,compare_count);
bool_val = random_early_detection_packet(info, i);
bool_val = random_early_detection_congestion_check(info, i);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(compare_count, info->count);
compare_count++;
BYTES_EQUAL(i * 256, info->averageQ);
}

bool_val = random_early_detection_packet(info, 128);
bool_val = random_early_detection_congestion_check(info, 128);
CHECK_EQUAL(true, bool_val);
BYTES_EQUAL(0, info->count);
BYTES_EQUAL(128 * 256, info->averageQ);

bool_val = random_early_detection_packet(info, 129);
bool_val = random_early_detection_congestion_check(info, 129);
CHECK_EQUAL(true, bool_val);
BYTES_EQUAL(0, info->count);
BYTES_EQUAL(129 * 256, info->averageQ);
Expand Down Expand Up @@ -179,7 +179,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_weight)

bool bool_val;
for (uint16_t i = 0; i < 10; i++) {
bool_val = random_early_detection_packet(info, i + 1);
bool_val = random_early_detection_congestion_check(info, i + 1);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(AQList[i], info->averageQ / 256);
//printf("%u Size %x AQraw, %u AQ\r\n", i+1, info->averageQ, info->averageQ / 256);
Expand All @@ -204,7 +204,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_weight)
AQList[9] = 8;

for (uint16_t i = 0; i < 10; i++) {
bool_val = random_early_detection_packet(info, i + 1);
bool_val = random_early_detection_congestion_check(info, i + 1);
CHECK_EQUAL(false, bool_val);
BYTES_EQUAL(AQList[i], info->averageQ / 256);
//printf("%u Size %x AQraw, %u AQ\r\n", i+1, info->averageQ, info->averageQ / 256);
Expand Down
2 changes: 1 addition & 1 deletion test/nanostack/unittest/stub/random_early_detection_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void random_early_detection_free(struct red_info_s *red_info)



bool random_early_detection_packet(red_info_t *red_info, uint16_t sampleLen)
bool random_early_detection_congestion_check(red_info_t *red_info, uint16_t sampleLen)
{

return random_early_detetction_stub.bool_value;
Expand Down

0 comments on commit 5a32f4a

Please sign in to comment.