mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 05:10:25 +00:00
a40b42e299
This commit adds new network data service entry definitions to indicate presence of DNS/SRP servers within the Thread mesh and provide info about them. Two service TLV formats are added: `NetworkData::Service::DnsSrpAnycast` indicates that DNS/SRP client on a device can use the associated anycast address with this service TLV to reach the DNS/SRP server. The use of anycast address ensures that the messages are routed to the nearest node which has added such a service entry in the network data. The service TLV data in this model contains a one byte sequence number which is used to notify the SRP clients if they need to re-register with the server(s) (e.g., due server reset/reboot and/or loss of previous registrations). `NetworkData::Service::DnsSrpUnicast` directly provides the IPv6 address and port info for a DNS/SRP server which can be included as part of the service TLV data and/or the server TLV data. Using service TLV data allows the info about a common infrastructure SRP/DNS server to be added by multiple BRs. In the case of server TLV, the IPv6 address info can be optionally omitted (i.e. just a port number is provided) which then causes the associated RLOC/ALOC address of the node who added the service entry to be used as the server's IPv6 address. This commit updates the `Srp::Client` to use the new service entries to discover/select the SRP sever when auto-start mode is enabled. The client prefers and uses a `DnsSrpAnycast` over `DnsSrpUnicast` entries. The `Srp::Server` is also updated to publish its info as `DnsSrpAnycast` entry (using mesh-local address). This commit also updates the `test_network_data` unit test to cover the behavior of newly methods which iterate and parse different service entry formats.
OpenThread Certification Tests
Inspector
Inspect nodes status by the following modification:
- Insert the inspector to where you want to inspect.
import debug
debug.Inspector(self).inspect()
- Run the test and it will stop at the line above and prompt
#.
./script/test clean build cert tests/scripts/thread-cert/Cert_5_1_01_RouterAttach.py
- Inspect
#
# 1
> state
leader
> exit
# 2
> panid
face
> exit
# exit
CLI reference
# mode
This is selection mode. You may select the node to inspect here.
list- list available nodes.exit- end inspecting, continue running test case.- <number> - select the node with id <number>. This will result in entering
>mode.
> mode
This is node mode. You may run OpenThread CLI here.
exit- go back to#mode.