Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mac] remove consecutive data polling for reduced power consumption #9763

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CodingRays
Copy link
Contributor

@CodingRays CodingRays commented Jan 10, 2024

Currently in thread if a sleepy end device receives a frame with the frame pending bit set it must send a data poll to receive the next frame. This adds significant latency and as a result increased power consumption. This PR adds an experimental feature which if enabled removes the data polling after receiving a frame with the frame pending bit set. In testing this reduced the power consumption of a 512 byte UDP packet by 25% on a SED.

For testing purposes if the feature is enabled it assumes that all connected devices support the feature. This should be adjusted in the future depending on thread standardization.

The FTD will simply send all queued fragments until one fails to be transmitted. The end device will upon receiving a frame with the frame pending bit set switch to the waiting for data mode. If it times out it sends a data poll to continue receiving data.

We tested this by sending a 512byte UDP packet to a SED using the nrf52840 platform. The receive power on standard openthread was 1.19mC while with our feature enabled it was 0.9mC. This reduction arises almost entirely out of the reduced transmit time 66ms vs 50ms. This is a high current as we had some peripherals running, however this is a constant factor for this test. To eliminate external influences the test was performed within a Faraday cage.

Openthread:
poll_baseline_nobug

Our feature:
poll_enh

Previous claims of higher power savings were due to a bug #9820 which our code avoided.

Copy link

size-report bot commented Jan 10, 2024

Size Report of OpenThread

Merging #9763 into main(ce8bbfe).

name branch text data bss total
ot-cli-ftd main 464752 760 66284 531796
#9763 464752 760 66284 531796
+/- 0 0 0 0
ot-ncp-ftd main 434828 760 61496 497084
#9763 434828 760 61496 497084
+/- 0 0 0 0
libopenthread-ftd.a main 234084 0 40230 274314
#9763 234084 0 40230 274314
+/- 0 0 0 0
libopenthread-cli-ftd.a main 56861 0 8075 64936
#9763 56861 0 8075 64936
+/- 0 0 0 0
libopenthread-ncp-ftd.a main 31839 0 5916 37755
#9763 31839 0 5916 37755
+/- 0 0 0 0
ot-cli-mtd main 363928 760 51180 415868
#9763 363928 760 51180 415868
+/- 0 0 0 0
ot-ncp-mtd main 346556 760 46408 393724
#9763 346556 760 46408 393724
+/- 0 0 0 0
libopenthread-mtd.a main 157470 0 25142 182612
#9763 157470 0 25142 182612
+/- 0 0 0 0
libopenthread-cli-mtd.a main 39720 0 8059 47779
#9763 39720 0 8059 47779
+/- 0 0 0 0
libopenthread-ncp-mtd.a main 24719 0 5916 30635
#9763 24719 0 5916 30635
+/- 0 0 0 0
ot-cli-ftd-br main 533088 768 130964 664820
#9763 533088 768 130964 664820
+/- 0 0 0 0
libopenthread-ftd-br.a main 297031 5 104886 401922
#9763 297031 5 104886 401922
+/- 0 0 0 0
libopenthread-cli-ftd-br.a main 70494 0 8099 78593
#9763 70494 0 8099 78593
+/- 0 0 0 0
ot-rcp main 62232 564 20604 83400
#9763 62232 564 20604 83400
+/- 0 0 0 0
libopenthread-rcp.a main 9534 0 5052 14586
#9763 9534 0 5052 14586
+/- 0 0 0 0
libopenthread-radio.a main 18815 0 214 19029
#9763 18815 0 214 19029
+/- 0 0 0 0

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (36133b9) 85.67% compared to head (9b72e25) 85.69%.
Report is 31 commits behind head on main.

❗ Current head 9b72e25 differs from pull request most recent head f039245. Consider uploading reports for the commit f039245 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9763      +/-   ##
==========================================
+ Coverage   85.67%   85.69%   +0.01%     
==========================================
  Files         557      557              
  Lines       74080    74081       +1     
==========================================
+ Hits        63471    63484      +13     
+ Misses      10609    10597      -12     
Files Coverage Δ
src/core/mac/data_poll_handler.cpp 83.89% <ø> (+7.38%) ⬆️
src/core/mac/data_poll_handler.hpp 100.00% <ø> (ø)
src/core/mac/data_poll_sender.cpp 94.07% <100.00%> (ø)
src/core/mac/mac.cpp 89.06% <100.00%> (-0.09%) ⬇️
src/core/thread/neighbor.hpp 100.00% <ø> (ø)

... and 9 files with indirect coverage changes

@CodingRays CodingRays changed the title Remove consecutive data polling for reduced power consumption [mac] remove consecutive data polling for reduced power consumption Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants