Skip to content

Commit 5a32f4a

Browse files
author
Juha Heiuskanen
committed
Update changelog, random_early_detection_congestion_check nameupdate and minor comment fix.
1 parent b818f12 commit 5a32f4a

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44

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

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

1416
### Bugfix
1517
* Prevent sending broadcast frames on unicast channel

source/6LoWPAN/adaptation_interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ int8_t lowpan_adaptation_interface_tx(protocol_interface_info_entry_t *cur, buff
10541054

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

1057-
if (random_early_detection_packet(cur->random_early_detection, interface_ptr->directTxQueue_size)) {
1057+
if (random_early_detection_congestion_check(cur->random_early_detection, interface_ptr->directTxQueue_size)) {
10581058
protocol_stats_update(STATS_AL_TX_CONGESTION_DROP, 1);
10591059
goto tx_error_handler;
10601060
}

source/Service_Libs/random_early_detection/random_early_detection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static uint16_t random_early_detetction_aq_calc(red_info_t *red_info, uint16_t s
8282
//If sum is ODD add 1 this will help to not stuck like 1,99 average to -> 2
8383
averageSum++;
8484
}
85-
//Store new average//If sum is ODD add 1 this will
85+
//Store new average
8686
red_info->averageQ = averageSum;
8787
//Return always same format scaled than inn
8888
return red_info->averageQ / 256;
@@ -91,7 +91,7 @@ static uint16_t random_early_detetction_aq_calc(red_info_t *red_info, uint16_t s
9191

9292

9393

94-
bool random_early_detection_packet(red_info_t *red_info, uint16_t sampleLen)
94+
bool random_early_detection_congestion_check(red_info_t *red_info, uint16_t sampleLen)
9595
{
9696
//Calulate Average queue size
9797
sampleLen = random_early_detetction_aq_calc(red_info, sampleLen);

source/Service_Libs/random_early_detection/random_early_detection_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void random_early_detection_free(struct red_info_s *red_info);
9696
* \return true Drop packet
9797
* \return false Packet can be added to queue
9898
*/
99-
bool random_early_detection_packet(struct red_info_s *red_info, uint16_t sampleLen);
99+
bool random_early_detection_congestion_check(struct red_info_s *red_info, uint16_t sampleLen);
100100

101101
#ifdef __cplusplus
102102
}

test/nanostack/unittest/service_libs/random_early_detetction/randomEarlyDetection_test.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_create)
6565

6666
}
6767

68-
TEST(RandomEarlyDetection, test_random_early_detection_packet)
68+
TEST(RandomEarlyDetection, test_random_early_detection_congestion_check)
6969
{
7070
//Test first malloc failure
7171
nsdynmemlib_stub.returnCounter = 1;
@@ -75,7 +75,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
7575
}
7676
bool bool_val;
7777
//Test uder threshold
78-
bool_val = random_early_detection_packet(info, 63);
78+
bool_val = random_early_detection_congestion_check(info, 63);
7979

8080
CHECK_EQUAL(false, bool_val);
8181
BYTES_EQUAL(0, info->count);
@@ -86,14 +86,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
8686
uint16_t compare_count = 1;
8787
for (uint16_t i = test_val; i < 89; i++) {
8888
//printf("%u aQ %u count\r\n", i,compare_count);
89-
bool_val = random_early_detection_packet(info, i);
89+
bool_val = random_early_detection_congestion_check(info, i);
9090
CHECK_EQUAL(false, bool_val);
9191
BYTES_EQUAL(compare_count, info->count);
9292
compare_count++;
9393
BYTES_EQUAL(i * 256, info->averageQ);
9494
}
9595

96-
bool_val = random_early_detection_packet(info, 89);
96+
bool_val = random_early_detection_congestion_check(info, 89);
9797
CHECK_EQUAL(true, bool_val);
9898
BYTES_EQUAL(0, info->count);
9999
BYTES_EQUAL(89 * 256, info->averageQ);
@@ -104,14 +104,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
104104
compare_count = 1;
105105
for (uint16_t i = test_val; i < 105; i++) {
106106
//printf("%u aQ %u count\r\n", i,compare_count);
107-
bool_val = random_early_detection_packet(info, i);
107+
bool_val = random_early_detection_congestion_check(info, i);
108108
CHECK_EQUAL(false, bool_val);
109109
BYTES_EQUAL(compare_count, info->count);
110110
compare_count++;
111111
BYTES_EQUAL(i * 256, info->averageQ);
112112
}
113113

114-
bool_val = random_early_detection_packet(info, 105);
114+
bool_val = random_early_detection_congestion_check(info, 105);
115115
CHECK_EQUAL(true, bool_val);
116116
BYTES_EQUAL(0, info->count);
117117
BYTES_EQUAL(105 * 256, info->averageQ);
@@ -121,13 +121,13 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
121121
compare_count = 1;
122122
for (uint16_t i = test_val; i < 118; i++) {
123123
//printf("%u aQ %u count\r\n", i,compare_count);
124-
bool_val = random_early_detection_packet(info, i);
124+
bool_val = random_early_detection_congestion_check(info, i);
125125
CHECK_EQUAL(false, bool_val);
126126
BYTES_EQUAL(compare_count, info->count);
127127
compare_count++;
128128
BYTES_EQUAL(i * 256, info->averageQ);
129129
}
130-
bool_val = random_early_detection_packet(info, 118);
130+
bool_val = random_early_detection_congestion_check(info, 118);
131131
CHECK_EQUAL(true, bool_val);
132132
BYTES_EQUAL(0, info->count);
133133
BYTES_EQUAL(118 * 256, info->averageQ);
@@ -136,19 +136,19 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
136136
compare_count = 1;
137137
for (uint16_t i = test_val; i < 128; i++) {
138138
//printf("%u aQ %u count\r\n", i,compare_count);
139-
bool_val = random_early_detection_packet(info, i);
139+
bool_val = random_early_detection_congestion_check(info, i);
140140
CHECK_EQUAL(false, bool_val);
141141
BYTES_EQUAL(compare_count, info->count);
142142
compare_count++;
143143
BYTES_EQUAL(i * 256, info->averageQ);
144144
}
145145

146-
bool_val = random_early_detection_packet(info, 128);
146+
bool_val = random_early_detection_congestion_check(info, 128);
147147
CHECK_EQUAL(true, bool_val);
148148
BYTES_EQUAL(0, info->count);
149149
BYTES_EQUAL(128 * 256, info->averageQ);
150150

151-
bool_val = random_early_detection_packet(info, 129);
151+
bool_val = random_early_detection_congestion_check(info, 129);
152152
CHECK_EQUAL(true, bool_val);
153153
BYTES_EQUAL(0, info->count);
154154
BYTES_EQUAL(129 * 256, info->averageQ);
@@ -179,7 +179,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_weight)
179179

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

206206
for (uint16_t i = 0; i < 10; i++) {
207-
bool_val = random_early_detection_packet(info, i + 1);
207+
bool_val = random_early_detection_congestion_check(info, i + 1);
208208
CHECK_EQUAL(false, bool_val);
209209
BYTES_EQUAL(AQList[i], info->averageQ / 256);
210210
//printf("%u Size %x AQraw, %u AQ\r\n", i+1, info->averageQ, info->averageQ / 256);

test/nanostack/unittest/stub/random_early_detection_stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void random_early_detection_free(struct red_info_s *red_info)
4343

4444

4545

46-
bool random_early_detection_packet(red_info_t *red_info, uint16_t sampleLen)
46+
bool random_early_detection_congestion_check(red_info_t *red_info, uint16_t sampleLen)
4747
{
4848

4949
return random_early_detetction_stub.bool_value;

0 commit comments

Comments
 (0)