mirror of
https://github.com/espressif/openthread.git
synced 2026-09-04 08:10:11 +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:
@@ -69,6 +69,7 @@ do_scan_build()
|
||||
"-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1"
|
||||
"-DOPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE"
|
||||
"-DOPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT=1"
|
||||
"-DOPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE=1"
|
||||
"-DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1"
|
||||
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
|
||||
"-DOPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1"
|
||||
|
||||
Reference in New Issue
Block a user