When adding a new spinel property or updating the existing spinel
property, it may cause the host can't work with the old RCP. The
host can be updated independently on some of our products. If the
compatibility issue happens, it causes the host dies after the
host is updated.
To reduce the compatibility issues between the host and RCP, this
commit updates the guideline of updating/adding RCP spinel properties.
This commit introduces `otBorderRoutingCounters` which contains the
number of packets and bytes forwarded via border routing.
The counters have 4 categories: inbound unicast, inbound multicast,
outbound unicast, outbound multicast.
I've verified this feature locally on a BR device by ping command in
following scenarios:
- A host pings an ED's OMR.
- An ED pings a host's onlink address.
- A host pings a multicast address which an ED subscribes to.
- An ED pings a multicast address which a host subscribes to.
This commit adds mechanism to save deprecating old on-link prefixes
in non-volatile `Settings`. With this, if the BR is restarted, it
will remember the old prefixes and keep deprecating them (advertising
them in emitted RA and publish them in Thread Network Data).
This commit also adds `TestSavedOnLinkPrefixes()` test case in
`test_routing_manager` to cover the behavior of the newly added
mechanism.
This commit adds a new mechanism in `RoutingManager` to periodically
check that discovered routers are still active and operational, so
that if the router providing the favored on-link prefix becomes
offline, we can detect it more quickly (instead of waiting for the
prefix lifetime to expire) and then the BR can start advertising its
own on-link prefix.
Receiving a Router or Neighbor Advertisement message from a router
indicates that it is active. After a timeout interval passes from the
last receive from a router we start sending Neighbor Solidification
(NS) probes to it. This timeout interval can be specified by newly
added build-time OT config parameter (default value is set to one
minute). If no response is received after multiple NS attempts, the
router is considered to be inactive and the discovered prefix entries
associated with the router are removed or deprecated.
This commit also updates the unit test for routing manager to validate
the behavior of the newly added mechanism.
A useful metric for a device is the amount of time it spends in each
mle role. This could help to identify connectivity issues on SED with
weak signal and frequent detaches by checking the time spent in
detached mode. It would also be useful to know the time spent in
leader state when having multiple FTDs frequently joining and
splitting in different partitions.
This information is not available from the role counters, since time
spent in each state is not related to the number of entries to that
state.
This commit adds mle counters to track time spent in each role, when
uptime feature is enabled (`OPENTHREAD_CONFIG_UPTIME_ENABLE=1`).
This commit adds `OT_TOOL_PRINTF_STYLE_FORMAT_ARG_CHECK` macro in
`toolchain.h`. It specifies that a function or method takes `printf`
style args. It asks the compiler to check the args for consistency
with the passed-in format string.
The commit uses the new macro in `String::Append()` and its uses are
updated to ensure consistency between format string and the args.
For various reasons, we're not able to use `<` and `>` in our Doxygen
descriptions. I made some minor edits, LMKWYT. In the HTML, it renders
similar to this:
The IPv6 socket address string is formatted as [`address`]:`port`
where `address` is shown as 16 hex values separated by `:` and `port`
is the port number in decimal format, for example "[%x:%x:...:%x]:%u".
This commit add a new feature in `Srp::Client` to allow user to
specify the lease and/or key lease intervals explicitly per service.
The lease intervals in a service can be left unspecified(set to zero)
in which case the default lease intervals will be used.
In an SRP Update message, the lease info is included in additional
section in an Update Lease Option record. Therefore the lease values
are applicable to the entire message and all its records. If we have
services with different lease intervals, they need to be registered
in separate messages. This commit updates `Srp::Client` to implement
such a mechanism. When preparing an SRP message, we first determine
the lease and key lease intervals and ensure the services using
matching intervals are included in the message.
This commit also updates and simplifies the "single service mode"
functionality to use the newly added mechanism for tracking which
services are included in the message.
This commit adds `test_srp_register_services_diff_lease` which covers
the behavior of the newly added mechanisms.
This commit updates `Dns::Client` so that when reading service info
`otDnsServiceInfo` if the received TXT data does not fit in the given
buffer, it is read partially. A new field `mTxtDataTruncated` is added
in `otDnsServiceInfo` to indicate that TXT data was not fully read.
This commit also updates `dns` related commands in CLI so to output
the partially read TXT data and add a new config specifying the max
TXT data size used by CLI.
This commit adds new APIs and mechanisms to support `AutoEnableMode`
in SRP server. This mode allows us to delegate the control of SRP
server (when it is enabled or disabled) to the Border Routing
Manager.
Under this mode, SRP sever is auto-enabled if/when `RoutingManager` is
done with the initial prefix and route setup, i.e., when the OMR and
on-link prefixes are determined, advertised in the emitted Router
Advert message on infrastructure side and published in the Thread
Network Data. This ensures that bi-directional connectivity is set up
before allowing service registration and discovery to start. The SRP
server is auto-disabled if/when BR is stopped, for example, when the
infrastructure network interface is brought down or when the BR gets
detached.
This commit also adds CLI commands for the new APIs and adds a
test-case in `test_routing_manager` to test and validate the newly
added mechanism.
This commit introduces `nat64` command and 4 new subcommands
(`configuredcidr`, `configuredprefix`, `mappings`, `counters`)
nat64 cidr -- Get the configured CIDR for NAT64 translator.
nat64 mappings -- Get the mappings of NAT64 translator.
nat64 counters -- Get the packet counters and error counters of NAT64
translator.
This commit also introduces related API for the above commands, and
`otIp4AddressToString` & `otIp4CidrToString` for the CLI to format the
IPv4 address and CIDR.
This commit updates `otSrpClientEnableAutoStartMode` documentation
to describe how the preferred server is determined from Network Data
entries (different Network Data entry categories, their order of
preference, and how to handle when there are multiple options within
the same category).
We decided to rename BORDER_ROUTING_NAT64 to NAT64_BORDER_ROUTING so
the flag won't be confusing since we have NAT64_TRANSLATOR which does
not depends on the border routing manager.
This commit:
- implements the core logic for translating packets for NAT64,
including the public APIs exposed to platform daemons.
- includes changes for POSIX platform, use `OT_POSIX_NAT64_CIDR`,
`OPENTHREAD_POSIX_CONFIG_NAT64_CIDR` for setting the CIDR for NAT64
during build time.
- exposes `otNat64Send(otInstance *aInstance, otMessage *aMessage)`
and `void otNat64SetReceiveIp4Callback(otInstance *aInstance,
otNat64ReceiveIp4Callback aCallback, void *aContext)`.
This commit adds `otThreadSearchForBetterParent()` to start the
process on a child to search for a better parent while staying
attached to its current parent. This commit also adds a related CLI
command `parent search`.
This commit fetches the NAT64 prefix on infrastructure interface and
advertise it to Network Data at medium preference.
- Use `getaddrinfo_a()` function to asynchronously lookup the ipv6
address of the special domain `ipv4only.arpa`. The infrastructure
NAT64 prefix is extracted from the domain answer.
- `mInfraIfNat64PrefixStaleTimer` is scheduled to monitor the presence
and change of infrastructure NAT64 prefix.
- `EvaluateNat64Prefix` evaluates whether to advertise the
infrastructure prefix or the local ULA prefix or neither. When there
is a new infrastructure prefix, it will withdraw the legacy one and
add the new one. When the infrastructure prefix no longer exists, it
will withdraw the legacy one and add the local ULA prefix. When the
infrastructure prefix presents again, it will add the infrastructure
prefix and withdraw the local ULA prefix.
New tests are added to test the scenarios when infrastructure NAT64
prefix exists. `DNS64` on OTBR is turned on to enable `bind9` with
NAT64 prefix on infrastructure interface for these tests. `bind9` is
explicitly turned off when testing local ULA prefix. Since bind9 is
conflict with other components like dnssd, all nat64 tests are moved
under /nat64 directory and configured separately.
The case that two or more BRs have same infrastructure NAT64 prefix is
not covered by this commit and will be followed up later.
This commit extends the Thread API to allow a CSL Receiver application
to adjust its CSL parameters depending on the parent capabilities.
Specifically, it might decide to switch to polling operation instead
of CSL synchronization when the attached parent does not support CSL
Transmitter role (Thread Version 2) or it advertises poor CSL accuracy
or uncertainty.
This commit updates the code to allow the config combination of
`OPENTHREAD_CONFIG_MESSAGE_USE_HEAP_ENABLE` along using external heap
`OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE`. This commit updates `Message`
`GetFreeBufferCount()` and `GetTotalBufferCount()` methods to return
special value `0xffff` under this config combo indicating the numbers
cannot be estimated.
This commit also updates `check-simulation-build-autotools` to add
such a build config so to be covered as part OT CI tests.
This commit updates `RoutingManager` to remember the currently favored
OMR prefix (which can be an OMR prefix discovered from Network Data
or device's local OMR prefix). It adds a new public API to retrieve
this prefix and adds a related CLI sub-command.
With NAT64, we need to handle the IPv4 packets inside the border
router functions in OpenThread core.
This commit introduces a few new classes for NAT64:
- Add `Ip4::Cidr` (for specifying CIDR block of translated packets)
- Updated Ip4 address format -- use a union of (m8[4], m16[2], m32)
instead of 4 bytes.
- Extend `Checksum` for supporting ICMP in Ip4 (and TCP4 / UDP4) and
IPv4 header.
This commit adds new public OT APIs to iterate over the Border Router
discovered prefix table from received Router Advertisement messages.
It also adds new CLI command to output the prefix table. The new APIs
are primary intended for testing.
This commit adds `<openthread/border_routing.h`> header and moves
all the `otBorderRouting` APIs (which are related to Border Routing
Manager) into this header. It also adds a note that these APIs are
available when `OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE` is enabled.
It also adds `border_routing_api.cpp` source file for the API
implementation.
This commit adds new mechanism in `RoutingManager` to allow user to
get or set the preference level to use when advertising Rout Info
Options (e.g., for discovered OMR prefixes) in RA messages sent on
infra netif. By default 'medium' preference is used. As an example,
user can choose to set the preference to 'low' when the device is
acting as a temporary BR (a mobile or battery-powered BR) to indicate
that other BRs should be preferred over this BR on the infra link.
This commit also adds CLI sub-commands for newly added APIs and
updates the documentation.
This commit moves the definitions of constants related to min/max
number of IPv6 addresses that can be included in an IP6 Addresses TLV
to `Ip6AddressesTlv` class. It also adds a public OT constant in
`ip6.h` related to this for MLR feature which is then used in `cli`
and `ncp` modules so to avoid the use of OT core internal constant
from CLI/NCP.
This commit updates `NetworkData::Publisher` so that a call to
`PublishOnMeshPrefix()` or `PublishExternalRoute()` replaces a
previous request for the same prefix. In particular, if the new call
only changes the flags (e.g., preference level) and the prefix is
already added in the Network Data, the change to flags is immediately
reflected in the Network Data. This ensures that existing entries in
the Network Data are not abruptly removed. Note that a change in the
preference level can potentially later cause the entry to be removed
from the Network Data after determining there are other nodes that
are publishing the same prefix with the same or higher preference.
This commit also updates `test_netdata_publisher.py` to test the newly
added behavior.
The `otOperationalDataset#mActiveTimestamp` should represent the full
Active Timestamp TLV value but not only the seconds. The same for
`otOperationalDataset#mPendingTimestamp`.
This commit adds a "auto host address mode" in SRP client. When
enabled, host IPv6 addresses are automatically set by SRP client
using all the unicast addresses on Thread netif excluding the
link-local and mesh-local addresses. If there is no valid address,
then Mesh Local EID address is added. The SRP client will
automatically re-register when/if addresses on Thread netif are
updated (e.g., new addresses are added or existing addresses are
removed).
This commit updates CLI to add support for new SRP client APIs related
to the new feature. It also adds `test_srp_auto_host_address` test to
cover the behavior of this feature.
This commit adds an API `otThreadDetachGracefully` to notify other
nodes in the network (if any) and then stop Thread protocol
operation. It sends an Address Release if it's a router, or sets its
child timeout to 0 if it's a child.