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

[routing-manager] learn and copy M & O flags from discovered routers #9607

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

abtink
Copy link
Member

@abtink abtink commented Nov 14, 2023

This commit implements a mechanism in RoutingManager to learn the Managed Address Config (M) and Other Config (O) flags in received RA message from discovered routers on the infrastructure link and copy the same flags in the emitted RA
message from BR.

If any discovered router on the infrastructure that is not itself a stub router (i.e., does not include the Stub Router flag) includes the M or O flags, the same flag are included in the emitted RA message. If a discovered router has failed to respond to the maximum number of NS probe attempts, we consider it as offline and ignore its flags.

This commit also adds a detailed test case in test_routing_manager to validate the newly added mechanism.


Copy link

size-report bot commented Nov 14, 2023

Size Report of OpenThread

Merging #9607 into main(6f3b431).

name branch text data bss total
ot-cli-ftd main 463240 760 66212 530212
#9607 463240 760 66212 530212
+/- 0 0 0 0
ot-ncp-ftd main 433860 760 61384 496004
#9607 433860 760 61384 496004
+/- 0 0 0 0
libopenthread-ftd.a main 232533 0 40182 272715
#9607 232533 0 40182 272715
+/- 0 0 0 0
libopenthread-cli-ftd.a main 56064 0 8051 64115
#9607 56064 0 8051 64115
+/- 0 0 0 0
libopenthread-ncp-ftd.a main 31547 0 5852 37399
#9607 31547 0 5852 37399
+/- 0 0 0 0
ot-cli-mtd main 362416 760 51108 414284
#9607 362416 760 51108 414284
+/- 0 0 0 0
ot-ncp-mtd main 345420 760 46288 392468
#9607 345420 760 46288 392468
+/- 0 0 0 0
libopenthread-mtd.a main 155769 0 25086 180855
#9607 155769 0 25086 180855
+/- 0 0 0 0
libopenthread-cli-mtd.a main 39129 0 8043 47172
#9607 39129 0 8043 47172
+/- 0 0 0 0
libopenthread-ncp-mtd.a main 24427 0 5852 30279
#9607 24427 0 5852 30279
+/- 0 0 0 0
ot-cli-ftd-br main 530424 768 130812 662004
#9607 530640 768 130812 662220
+/- +216 0 0 +216
libopenthread-ftd-br.a main 294570 5 104758 399333
#9607 294714 5 104758 399477
+/- +144 0 0 +144
libopenthread-cli-ftd-br.a main 69398 0 8075 77473
#9607 69398 0 8075 77473
+/- 0 0 0 0
ot-rcp main 61912 564 20540 83016
#9607 61912 564 20540 83016
+/- 0 0 0 0
libopenthread-rcp.a main 9220 0 4988 14208
#9607 9220 0 4988 14208
+/- 0 0 0 0
libopenthread-radio.a main 18810 0 214 19024
#9607 18810 0 214 19024
+/- 0 0 0 0

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Merging #9607 (72bcfc1) into main (6f3b431) will increase coverage by 0.05%.
Report is 2 commits behind head on main.
The diff coverage is 88.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9607      +/-   ##
==========================================
+ Coverage   85.76%   85.82%   +0.05%     
==========================================
  Files         559      555       -4     
  Lines       74082    73496     -586     
==========================================
- Hits        63538    63075     -463     
+ Misses      10544    10421     -123     
Files Coverage Δ
src/core/border_router/routing_manager.hpp 63.54% <ø> (-0.38%) ⬇️
src/core/net/nd6.hpp 96.66% <100.00%> (-1.58%) ⬇️
tests/unit/test_routing_manager.cpp 100.00% <ø> (ø)
src/core/border_router/routing_manager.cpp 81.82% <88.46%> (+0.90%) ⬆️

... and 47 files with indirect coverage changes

This commit implements a mechanism in `RoutingManager` to learn the
Managed Address Config `M` and Other Config `O` flags in received RA
message from discovered routers on the infrastructure link and copy
the same flags in the emitted RA message from BR.

If any discovered router on the infrastructure that is not itself a
stub router (i.e., does not include the Stub Router flag) includes
the `M` or `O` flags, the same flag are included in the emitted RA
message. If a discovered router has failed to respond to the maximum
number of NS probe attempts, we consider it as offline and ignore its
flags.

This commit also adds a detailed test case in `test_routing_manager`
to validate the newly added mechanism.
@jwhui jwhui merged commit 34dd612 into openthread:main Nov 21, 2023
105 checks passed
wgtdkp pushed a commit to wgtdkp/openthread that referenced this pull request Jan 16, 2024
* github/main:
  [meshcop-tlvs] update name style in `DiscoveryResponseTlv` (openthread#9671)
  [dataset] introduce `WriteTlv()` methods (openthread#9664)
  [posix] fix a few compiler warnings around nat64 (openthread#9666)
  [test] update `channel-announce-recovery` test to check router recovery (openthread#9670)
  [link-metrics] add Subject status check when getting link metrics data (openthread#9665)
  [github-actions] cover NCP build with `OT_OPERATIONAL_DATASET_AUTO_INIT` (openthread#9663)
  [dataset] introduce `ContainsTlv()` method (openthread#9663)
  [srp-client] exclude non-preferred addresses in `AutoAddress` mode (openthread#9642)
  [tlvs] add `ReadValueAs()` & `WriteValueAs()` to simplify `MeshCop::Tlv` (openthread#9661)
  [bbr-local] smaller enhancements (openthread#9657)
  [spinel] fix multipan rcp enable config (openthread#9659)
  [cli] add Doxygen for SRP server (openthread#9653)
  [posix] unify the infra netif and backbone netif (openthread#9638)
  [border-router] add missing `otBorderRoutingDhcp6PdGetState()` declaration (openthread#9654)
  [dataset-updater] fix possible use of uninitialized `Timestamp` (openthread#9658)
  [spinel] add support for multiple spinel interfaces (openthread#9360)
  [spinel] fix compiling issue of enum multiplication (openthread#9649)
  [dataset] simplify saving/reading of TLVs in/from secure storage (openthread#9626)
  [dhcp6-pd] stop `PrefixManager` when `RoutingManager` is stopped (openthread#9608)
  [tests] fix the check of external routes in `test_multi_thread_networks.py` (openthread#9648)
  [csl] fix `TimerMicro::GetNow()` call in `sub_mac.cpp` (openthread#9639)
  [posix] fix unused private variables (openthread#9644)
  github-actions: bump step-security/harden-runner from 2.6.0 to 2.6.1 (openthread#9650)
  [mlr] use shorter variable/method names (openthread#9635)
  [config] define `OPENTHREAD_CONFIG_TLS_UPDATE` in all cases (openthread#9630)
  [ip6] update Ip6::SelectSourceAddress() to prefer non-deprecated addresses (openthread#9634)
  [mlr-manager] define `AddressArray` which uses `Array<Ip6::Address>` (openthread#9633)
  [typo] fix error message of link metrics option dependency (openthread#9646)
  [platform] fix compiling issue when use `SuccessOrDie` (openthread#9640)
  [continuous-integration] fix bootstrap issue for ot-commissioner (openthread#9643)
  [docs] update Code of Conduct to Contributor Covenant v2.1 (openthread#9627)
  [spinel] expose RestoreProperties as a public method within RadioSpinel (openthread#9501)
  [cli] make linkmetrics cli as a separate module (openthread#9619)
  [message] add API functions to enable multicast looping of a message (openthread#9524)
  [simulation] SIGHUP when parent dies (openthread#9624)
  [routing-manager] learn and copy `M` & `O` flags from discovered routers (openthread#9607)
  [cli] add Doxygen tags to SRP commands (openthread#9615)
  [lint] explicitly initialize failedAddresses (openthread#9622)
  [routing-manager] new API to get list of discovered routers (openthread#9601)
  [posix] clear SPI tx buffer after usage (openthread#9567)
  github-actions: bump actions/upload-artifact from 3.1.2 to 3.1.3 (openthread#9625)
  [encoding] avoid the use of `using` for `Big/LittleEndian` functions (openthread#9621)
  [num-limits] add `kBitsPerByte`, `BitSizeOf()`, and `BytesForBitSize()` (openthread#9618)
  [core] add missing platform function for `OT_PLATFORM_KEY_REF` (openthread#9620)
  [dns] support longer key length in `otDnsTxtEntryIterator` (openthread#9616)
  [test] define all unit tests in `ot` namespace (openthread#9617)
  [joiner-router] enhance & fix appending TLVs to Joiner Entrust msg (openthread#9614)
  [posix] more robust netlink message handler (openthread#9613)
  [mle] add `ChannelTlvValue` to use in `ChannelTlv` & `CslChannelTlv` (openthread#9612)
  [cli] remove extra line in `trel peers` docs in `README.md` (openthread#9611)
  [mle] remove `MleRouter` class definition under `MTD` build (openthread#9610)
  [mle] fix responding to "Child Update Request" from non-parent device (openthread#9609)
  [cli] adding set ipv4 CIDR for NAT64 in README (openthread#9511)
  [test] ensure to `FinalizeTest()` in `TestProcessPlatfromGeneratedNd()` (openthread#9606)
  [radio] add `OT_RADIO_CAPS_RX_ON_WHEN_IDLE` capability (openthread#9554) (openthread#9554)
  [mle] define `IsRouterIdValid()` helper in `mle_types.hpp` (openthread#9598)
  github-actions: bump docker/setup-buildx-action from 2.9.1 to 3.0.0 (openthread#9600)
  [test] address occasional failure of `test_routing_manager` (openthread#9603)
  [toranj] update config header to use `OT_LOG_LEVEL_INFO` (openthread#9595)
  [routing-manager] check `mIsRunning` in `ScheduleRoutingPolicyEvaluation()` (openthread#9594)
  [multi-radio] perform tag duplication check for first fragment (openthread#9590)
  [routing-manager] use `Heap::Array` for `OnMeshPrefixArray` (openthread#9592)
  [cli] TCP readme corrections (openthread#9593)
  [posix] allow OT process to run when infra netif gets lost (openthread#9583)
  [slaac] simplify adding/removing addresses and other enhancements (openthread#9579)
  [csl] add `OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_LOCAL_TIME_SYNC` option (openthread#9568) (openthread#9568)
  [docs] TCP Commands - add Doxygen tags (openthread#9578)
  [dataset] returns OT_ERROR_REJECTED when MGMT_SET is rejected by leader (openthread#9582)
  github-actions: bump ossf/scorecard-action from 2.2.0 to 2.3.1 (openthread#9584)
  [build] move `radio_spinel.cpp` to new lib `openthread-radio-spinel` (openthread#9530)
  [netdata] simplify `Leader` class (openthread#9563)
  [mac] validate received ack frame PSDU in `ProcessEnhAckSecurity()` (openthread#9565)
  github-actions: bump github/codeql-action from 2.22.3 to 2.22.5 (openthread#9571)
  [api] add API to reset to bootloader mode (openthread#9523)
  [core] define `core/instance` folder for `instance` modules (openthread#9561)
  [posix] fix uninitialized pointer read (openthread#9562)
  [log] add `otLogGenerateNextHexDumpLine()` to generate hex dump (openthread#9555)
  [posix] add `otSysSetInfraNetif` API (openthread#9528)
  [mle] add `TxMessage::AppendSteeringData()` (openthread#9559)
  [posix] addressing coverity warning: resource leak (openthread#9472)
  [mac] update the cached supported channel mask when the region code changes (openthread#9418)
  [docs] added xrefs from UDP CLI to UDP Concepts Guide (openthread#9558)
  [ip6] log checksum error from `Checksum::VerifyMessageChecksum()` (openthread#9556)
  [nedata] add API to retrieve Commissioning Dataset (openthread#9551)
  github-actions: bump actions/checkout from 4.1.0 to 4.1.1 (openthread#9557)
  [netdata] simplify and update `HandleTmf<kUriCommissionerSet>()` (openthread#9550)
  [netdata] resign active commissioner on NetData restore on leader (openthread#9549)
  [tests] fix verification in `test_routing_manager.cpp`  (openthread#9548)
  [udp] remove `aIpProto` from `Ip6::Udp::SendDatagram()` (openthread#9547)
  ...

Change-Id: I4623d2a0bcba3f1880071d9efd91ca6d2bb6ad1b
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