openthread icon indicating copy to clipboard operation
openthread copied to clipboard

[child-supervision] mechanism to inform interval from child to parent

Open abtink opened this issue 3 years ago • 5 comments

This commit contains changes to child supervision feature. It adds a new mechanism for a child to inform its desired supervision interval to its parent. A new optional MLE TLV is added with type 27 and value of uint16_t indicating the supervision interval in seconds. This TLV is included in MLE Child ID Request and MLE Child Update Request (sent from the child). The parent can echo back this TLV in the corresponding responses to indicate that it supports supervision. This commit changes the parent implementation to track the supervision interval per child.

This change allows backward compatibility: If the parent does not support child supervision, it ignores the new TLV in the MLE messages and the child would fall back to periodically exchanging MLE Child Update Request with parent. If the child does not support supervision and/or does not indicate its desired child supervision interval, the parent will fall back to use the configured default interval.

This commit also updates the OT public APIs along with the related CLI commands:

  • API now allows the supervision interval to be set on a child.
  • New field in otChildInfo to indicate the child's supervision interval.
  • New counter is added to track the number of supervision check timeouts failures on a child (intended for testing and debugging).

This commit adds a test test_child_supervision to cover behavior of child supervision and its new behaviors.


This is related to SPEC-1046.

abtink avatar Aug 08 '22 02:08 abtink

Size Report of OpenThread

Merging #7993 into main(0491c8ff2c060e84f9ab4dee631e390914e6cd35).

name branch text data bss total
ot-cli-ftd_1.1 main 469320 776 63556 533652
#7993 471008 776 63836 535620
+/- +1688 0 +280 +1968
ot-cli-mtd_1.1 main 389448 776 53844 444068
#7993 390336 776 53868 444980
+/- +888 0 +24 +912
ot-ncp-ftd_1.1 main 443740 776 58912 503428
#7993 445252 776 59192 505220
+/- +1512 0 +280 +1792
ot-ncp-mtd_1.1 main 367460 776 49208 417444
#7993 367996 776 49232 418004
+/- +536 0 +24 +560
ot-rcp_1.1 main 60156 564 19964 80684
#7993 60156 564 19964 80684
+/- 0 0 0 0
libopenthread-cli-ftd.a_1.1 main 52480 0 7868 60348
#7993 52830 0 7868 60698
+/- +350 0 0 +350
libopenthread-cli-mtd.a_1.1 main 44229 0 7860 52089
#7993 44512 0 7860 52372
+/- +283 0 0 +283
libopenthread-ftd.a_1.1 main 243428 20 38246 281694
#7993 244755 20 38526 283301
+/- +1327 0 +280 +1607
libopenthread-mtd.a_1.1 main 178303 20 28542 206865
#7993 178946 20 28566 207532
+/- +643 0 +24 +667
libopenthread-ncp-ftd.a_1.1 main 31481 0 5852 37333
#7993 31663 0 5852 37515
+/- +182 0 0 +182
libopenthread-ncp-mtd.a_1.1 main 26433 0 5852 32285
#7993 26505 0 5852 32357
+/- +72 0 0 +72
libopenthread-rcp.a_1.1 main 8992 0 4988 13980
#7993 8992 0 4988 13980
+/- 0 0 0 0
libopenthread-radio.a_1.1 main 18053 0 174 18227
#7993 18053 0 174 18227
+/- 0 0 0 0
ot-cli-ftd_1.3 main 491320 776 73036 565132
#7993 493072 776 73316 567164
+/- +1752 0 +280 +2032
ot-cli-mtd_1.3 main 404384 776 55068 460228
#7993 405336 776 55092 461204
+/- +952 0 +24 +976
ot-ncp-ftd_1.3 main 464668 776 68384 533828
#7993 466244 776 68664 535684
+/- +1576 0 +280 +1856
ot-ncp-mtd_1.3 main 380932 776 50424 432132
#7993 381492 776 50448 432716
+/- +560 0 +24 +584
ot-rcp_1.3 main 62516 564 20532 83612
#7993 62516 564 20532 83612
+/- 0 0 0 0
libopenthread-cli-ftd.a_1.3 main 55381 0 7868 63249
#7993 55715 0 7868 63583
+/- +334 0 0 +334
libopenthread-cli-mtd.a_1.3 main 46531 0 7860 54391
#7993 46814 0 7860 54674
+/- +283 0 0 +283
libopenthread-ftd.a_1.3 main 261497 20 47182 308699
#7993 262888 20 47462 310370
+/- +1391 0 +280 +1671
libopenthread-mtd.a_1.3 main 189720 20 29222 218962
#7993 190379 20 29246 219645
+/- +659 0 +24 +683
libopenthread-ncp-ftd.a_1.3 main 33319 0 5852 39171
#7993 33501 0 5852 39353
+/- +182 0 0 +182
libopenthread-ncp-mtd.a_1.3 main 27797 0 5852 33649
#7993 27871 0 5852 33723
+/- +74 0 0 +74
libopenthread-rcp.a_1.3 main 9158 0 4988 14146
#7993 9158 0 4988 14146
+/- 0 0 0 0
libopenthread-radio.a_1.3 main 18938 0 206 19144
#7993 18938 0 206 19144
+/- 0 0 0 0

size-report[bot] avatar Aug 08 '22 02:08 size-report[bot]

Codecov Report

Merging #7993 (7f73cd4) into main (ccf8ea6) will decrease coverage by 0.23%. The diff coverage is n/a.

:exclamation: Current head 7f73cd4 differs from pull request most recent head 26ebb1e. Consider uploading reports for the commit 26ebb1e to get more accurate results

@@            Coverage Diff             @@
##             main    #7993      +/-   ##
==========================================
- Coverage   85.41%   85.18%   -0.24%     
==========================================
  Files         511      511              
  Lines       70410    70988     +578     
==========================================
+ Hits        60144    60469     +325     
- Misses      10266    10519     +253     
Impacted Files Coverage Δ
src/core/mac/mac_types.cpp 75.22% <0.00%> (-15.40%) :arrow_down:
src/core/mac/data_poll_handler.hpp 88.23% <0.00%> (-11.77%) :arrow_down:
src/core/thread/link_metrics_tlvs.hpp 91.95% <0.00%> (-8.05%) :arrow_down:
src/core/meshcop/timestamp.cpp 87.23% <0.00%> (-4.44%) :arrow_down:
src/core/mac/mac_links.cpp 79.01% <0.00%> (-3.49%) :arrow_down:
src/core/thread/csl_tx_scheduler.cpp 94.07% <0.00%> (-2.95%) :arrow_down:
src/core/thread/link_metrics.cpp 91.90% <0.00%> (-2.94%) :arrow_down:
src/cli/cli.cpp 78.90% <0.00%> (-2.08%) :arrow_down:
src/core/api/dns_api.cpp 75.00% <0.00%> (-2.05%) :arrow_down:
src/core/thread/router_table.cpp 93.28% <0.00%> (-1.63%) :arrow_down:
... and 116 more

codecov[bot] avatar Aug 08 '22 17:08 codecov[bot]

@abtink , is there a specific problem/issue that triggered adding this new feature?

AlanLCollins avatar Aug 17 '22 18:08 AlanLCollins

@abtink , is there a specific problem/issue that triggered adding this new feature?

@AlanLCollins , there is some background at https://openthread.io/guides/build/features/child-supervision

To provide an energy-efficient mechanism for a sleepy end device (SED) to verify that it is still connected to its parent router (listed in the parent router's child table), enable the Child Supervision feature.

The Thread Specification requires an SED to periodically perform an MLE Child Update Request and Response exchange with its parent router to verify connectivity. Child Supervision is an alternate solution for verification of SED-router connectivity that places the burden of message transmission on the parent router instead of on the energy-constrained SED.

Note: Most 802.15.4 radios generate an AUTO ACK in response to a received MAC frame. An SED cannot solely rely on the 802.15.4 ACKs it receives from a parent router as an indication that it is still connected to that router and listed in its child table.

jwhui avatar Aug 17 '22 19:08 jwhui

@abtink , is there a specific problem/issue that triggered adding this new feature?

@AlanLCollins This is related to SPEC-1046. The idea is to add mechanism in Thread spec (new TLV) to allow child to specify what supervision interval it wants.

abtink avatar Aug 17 '22 19:08 abtink