mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 20:20:04 +00:00
[netdata] adding NetworkData::Publisher (#6768)
This commit implements a new feature "Network Data Publisher" which provides mechanisms to limit the number of similar entries (service and/or prefix) in the Thread Network Data by monitoring the Network Data and managing if or when to add or remove entries. This feature is enabled using `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE` config, or `NETDATA_PUBLISHER` in autoconf, or `OT_NETDATA_PUBLISHER` cmake option. This commit adds support for publishing DNS/SRP anycast/unicast service, on-mesh prefix, and external route prefix entries. When there is a request to publish an entry, the `Publisher` monitors the Network Data and counts the number of similar entries. If there are fewer entries than a desired target number, the entry is added after a short random delay. If there are too many similar entries, `Publisher` starts the process of removing its own entry (again after some random wait time). When removing entries, certain entries are preferred over others (e.g., an entry from a router over one from an end-device or if they are from the same type of node, the one with smaller RLOC16). If `Publisher` determines that its own entry is a preferred one, it adds an extra wait time before removing its entry. This gives higher chance for a non-preferred entry from another device to be removed before removing a preferred entry which helps towards quicker convergence of the process to the desired number of entries. On-mesh prefix and external route entries have a "preference" field. When publishing such an entry, a matching entry in the network data is counted only if its preference is same or higher than the entry's preference. This ensures that a device with a higher preference entry publishes its entry even when there are many lower preference similar entries in the network data (potentially causing a lower preference entry to be removed). This commit also adds `test_netdata_publisher.py` to verify the behavior of the `Publisher`.
This commit is contained in:
@@ -108,6 +108,7 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
|
||||
'-DOT_LINK_METRICS_SUBJECT=ON'
|
||||
'-DOT_MAC_FILTER=ON'
|
||||
'-DOT_MTD_NETDIAG=ON'
|
||||
'-DOT_NETDATA_PUBLISHER=ON'
|
||||
'-DOT_PING_SENDER=ON'
|
||||
'-DOT_REFERENCE_DEVICE=ON'
|
||||
'-DOT_SERVICE=ON'
|
||||
|
||||
Reference in New Issue
Block a user