mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 13:50:28 +00:00
d87be657c6
This commit improves the `Srp::Client` mechanism for applying random
jitter delays before sending update messages to the server. It now
supports different jitter ranges based on specific triggers. Since
trigger events are often network-wide, potentially causing
simultaneous SRP re-registration from many nodes, longer jitter
intervals are used to distribute the resulting SRP update
transmissions and avoid congestion.
The following triggers are covered:
- Server switch: Client switching to a new server while already
connected to a discovered server. This occurs when a new server
entry appears in Network Data which is preferred over the current
selection.
- Server restart: Client was previously connected to a server that
disappeared from Network Data. Later, the same or a new server is
discovered in Network Data.
- SLAAC address add or remove: This is generally triggered by updates
to SLAAC prefixes in Network Data (e.g., OMR prefix changes).
- First registration after attach:
- If the device is attaching to an established Thread mesh
(e.g., after a reboot or initial pairing), the Network Data it
receives should already include a server entry, leading to a
quick server selection after attach. If server selection occurs
within a short window, a shorter TX jitter is used, allowing the
device to register quickly and become discoverable.
- If server discovery takes longer, a longer TX jitter is used. This
situation can indicate a server/BR starting up or a network-wide
restart of many nodes (e.g., due to a power outage).
This commit introduces `TxJitter` class to manage the requested TX
jitter based on a trigger reason. It tracks the time of the event
that triggered a longer jitter request. If the update message is sent
immediately after the trigger event, the requested maximum jitter is
applied. However, if the update message is sent later, the maximum
jitter is adjusted proportionally to the time elapsed since the
trigger event. If the elapsed time exceeds the requested maximum
jitter interval, the default short jitter is applied to avoid
unnecessary registration delay.
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.