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

[low-power] resync SSED with its parent after retransmission #6342

Merged
merged 20 commits into from Apr 13, 2021

Conversation

brianljt
Copy link
Contributor

@brianljt brianljt commented Mar 24, 2021

Per 15.4 spec, transmitter cannot modify frame content in retransmission which will leads to out-of-date CSL IE being sent to CSL transmitter. This PR fixes this issue by,

  1. Send a follow up data poll with CSL IE to resync the CSL transmitter.
  2. Send periodic data poll with CSL IE to keep SSED's parent in sync.
  3. Move PrepareDataRequest to data_poll_sender.
  4. Add test cases to cover.

IEEE Std 802.15.4 - 6.7.4.3 Retransmission,

When not using TSCH mode and a frame with the Security Enabled field set to one is retransmitted, the frame shall be retransmitted without changes and without passing through the outgoing frame security procedure, as defined in 9.2.1.

Thread Spec V1.2 - 4.6.5.1.1 Communication between Parent and SSED Child

A SSED Device MUST include IEEE 802.15.4 CSL Information Elements (CSL Phase, CSL Period) in all the IEEE 802.15.4 Commands, ACKs, and Data frames unicast to its Parent router, as defined in [IEEE 802.15.4-2015] and Table 3-7.

@size-report
Copy link

size-report bot commented Mar 24, 2021

Size Report of OpenThread

Merging #6342 into main(62ae1a1).

name branch text data bss total
ot-cli-ftd_1.1 main 427168 780 56216 484164
#6342 427200 780 56216 484196
+/- +32 0 0 +32
ot-cli-mtd_1.1 main 344944 780 46096 391820
#6342 344992 780 46096 391868
+/- +48 0 0 +48
ot-ncp-ftd_1.1 main 416024 780 59048 475852
#6342 416056 780 59048 475884
+/- +32 0 0 +32
ot-ncp-mtd_1.1 main 337148 780 48936 386864
#6342 337196 780 48936 386912
+/- +48 0 0 +48
ot-rcp_1.1 main 56780 564 19940 77284
#6342 56780 564 19940 77284
+/- 0 0 0 0
libopenthread-cli-ftd.a_1.1 main 43042 0 452 43494
#6342 43042 0 452 43494
+/- 0 0 0 0
libopenthread-cli-mtd.a_1.1 main 35083 0 444 35527
#6342 35083 0 444 35527
+/- 0 0 0 0
libopenthread-ftd.a_1.1 main 228260 20 38352 266632
#6342 228264 20 38352 266636
+/- +4 0 0 +4
libopenthread-mtd.a_1.1 main 159940 20 28240 188200
#6342 159964 20 28240 188224
+/- +24 0 0 +24
libopenthread-ncp-ftd.a_1.1 main 31236 0 5852 37088
#6342 31236 0 5852 37088
+/- 0 0 0 0
libopenthread-ncp-mtd.a_1.1 main 26084 0 5852 31936
#6342 26084 0 5852 31936
+/- 0 0 0 0
libopenthread-rcp.a_1.1 main 8703 0 4988 13691
#6342 8703 0 4988 13691
+/- 0 0 0 0
libopenthread-radio.a_1.1 main 14303 0 150 14453
#6342 14303 0 150 14453
+/- 0 0 0 0
ot-cli-ftd_1.2 main 449724 780 65060 515564
#6342 449852 780 65068 515700
+/- +128 0 +8 +136
ot-cli-mtd_1.2 main 359892 780 46628 407300
#6342 360052 780 46636 407468
+/- +160 0 +8 +168
ot-ncp-ftd_1.2 main 437472 780 67900 506152
#6342 437584 780 67908 506272
+/- +112 0 +8 +120
ot-ncp-mtd_1.2 main 350416 780 49476 400672
#6342 350544 780 49484 400808
+/- +128 0 +8 +136
ot-rcp_1.2 main 58032 564 20000 78596
#6342 58016 564 20000 78580
+/- -16 0 0 -16
libopenthread-cli-ftd.a_1.2 main 45862 0 452 46314
#6342 45862 0 452 46314
+/- 0 0 0 0
libopenthread-cli-mtd.a_1.2 main 37402 0 444 37846
#6342 37402 0 444 37846
+/- 0 0 0 0
libopenthread-ftd.a_1.2 main 247624 20 47008 294652
#6342 247720 20 47016 294756
+/- +96 0 +8 +104
libopenthread-mtd.a_1.2 main 172001 20 28584 200605
#6342 172115 20 28592 200727
+/- +114 0 +8 +122
libopenthread-ncp-ftd.a_1.2 main 32960 0 5852 38812
#6342 32960 0 5852 38812
+/- 0 0 0 0
libopenthread-ncp-mtd.a_1.2 main 27344 0 5852 33196
#6342 27344 0 5852 33196
+/- 0 0 0 0
libopenthread-rcp.a_1.2 main 8703 0 4988 13691
#6342 8703 0 4988 13691
+/- 0 0 0 0
libopenthread-radio.a_1.2 main 15225 0 182 15407
#6342 15217 0 182 15399
+/- -8 0 0 -8

@brianljt brianljt linked an issue Mar 24, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #6342 (a184271) into main (5bc74b7) will decrease coverage by 0.20%.
The diff coverage is 85.10%.

❗ Current head a184271 differs from pull request most recent head 0f271fe. Consider uploading reports for the commit 0f271fe to get more accurate results

@@            Coverage Diff             @@
##             main    #6342      +/-   ##
==========================================
- Coverage   86.55%   86.35%   -0.21%     
==========================================
  Files         428      429       +1     
  Lines       54746    55018     +272     
==========================================
+ Hits        47388    47509     +121     
- Misses       7358     7509     +151     
Impacted Files Coverage Δ
src/cli/cli.hpp 100.00% <ø> (ø)
src/core/api/channel_manager_api.cpp 86.66% <0.00%> (-13.34%) ⬇️
src/core/api/channel_monitor_api.cpp 57.14% <ø> (-28.58%) ⬇️
src/core/api/child_supervision_api.cpp 100.00% <ø> (ø)
src/core/api/coap_api.cpp 67.20% <ø> (ø)
src/core/api/coap_secure_api.cpp 70.42% <ø> (ø)
src/core/api/commissioner_api.cpp 93.75% <ø> (ø)
src/core/api/dataset_api.cpp 83.33% <ø> (ø)
src/core/api/dataset_ftd_api.cpp 100.00% <ø> (ø)
src/core/api/dataset_updater_api.cpp 40.00% <ø> (ø)
... and 164 more

@brianljt brianljt requested a review from abtink March 25, 2021 04:03
Copy link
Contributor

@Irving-cl Irving-cl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Some small issues.

src/core/mac/data_poll_sender.cpp Show resolved Hide resolved
src/core/mac/data_poll_sender.cpp Outdated Show resolved Hide resolved
src/core/mac/data_poll_sender.cpp Outdated Show resolved Hide resolved
src/core/mac/data_poll_sender.hpp Outdated Show resolved Hide resolved
src/core/mac/data_poll_sender.hpp Outdated Show resolved Hide resolved
src/core/mac/data_poll_sender.hpp Outdated Show resolved Hide resolved
@brianljt brianljt requested a review from Irving-cl April 6, 2021 05:04
@brianljt brianljt force-pushed the issue/csl/csl_retransmission branch from 3849885 to 20ea399 Compare April 6, 2021 05:25
Copy link
Contributor

@Irving-cl Irving-cl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@brianljt brianljt requested review from jwhui and removed request for abtink April 9, 2021 01:51
@jwhui jwhui requested a review from abtink April 9, 2021 20:39
Copy link
Member

@abtink abtink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall. Thanks. 👍

One suggestion below to check and protect if the calculation may roll-over on default period (just to be safe with all config values).

src/core/mac/data_poll_sender.cpp Outdated Show resolved Hide resolved
src/core/mac/data_poll_sender.cpp Show resolved Hide resolved
src/core/mac/data_poll_sender.hpp Show resolved Hide resolved
src/core/thread/mle.cpp Outdated Show resolved Hide resolved
@brianljt brianljt requested a review from jwhui April 13, 2021 07:32
Copy link
Member

@abtink abtink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@jwhui jwhui merged commit d514373 into openthread:main Apr 13, 2021
Abhayakara pushed a commit to Abhayakara/openthread that referenced this pull request Oct 6, 2021
…ead#6342)

Per 15.4 spec, transmitter cannot modify frame content in
retransmission which will leads to out-of-date CSL IE being sent to
CSL transmitter. This commit fixes this issue by,
1. Send a follow up data poll with CSL IE to resync the CSL
   transmitter.
2. Send periodic data poll with CSL IE to keep SSED's parent in sync.
3. Move PrepareDataRequest to data_poll_sender.
4. Add test cases to cover.
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.

[low-power] retransmission frame CSL IE handling
6 participants