Commit Graph

230 Commits

Author SHA1 Message Date
gabekassel 1811ac763f
[cmake] add build option to configure outgoing beacon payload (#7782) 2022-06-02 19:08:08 -07:00
alexandru-porosanu-nxp 5eb973ce00
[build] enable coexistence parameter build (#7540)
This commit enables defining
OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE, which can be used by
external build system (i.e. Matter) to override the platform
defaults. This is useful for platforms having transceivers that also
support coexistence between multiple protocols (WiFi/BLE etc.)`
2022-03-30 22:13:39 -07:00
Yakun Xu bdec466cee
[build] remove unnecessary config files (#7414)
This commit removes unnecessary OPENTHREAD_CONFIG_FILE by only
including it when it's defined.
2022-02-22 12:44:06 -08:00
Abtin Keshavarzian 564982c818
[log] implement new logging model with module name support (#7385)
This commit implements new logging model in OpenThread. Each core
module can specify its own module name using `RegisterLogModule()`.
The registered log module name is then included in the all the log
messages emitted from the specific file. This model replaces and
enhances the log region model.
2022-02-17 15:50:45 -08:00
Jonathan Donald afc55a384b
[docker] remove `codelab_otsim` Dockerfile (#7396)
* Delete obsolete codelab_otsim Dockerfile
* Remove codelab_otsim from git Docker Action
2022-02-07 21:55:41 -08:00
Jonathan Donald 297a880324
[docker] fix ot-daemon build in environment Dockerfile (#7378) 2022-01-31 20:39:07 -08:00
Jonathan Donald 7339a68684
[docker] modified environment Dockerfile to support Docker OT simulation (#7368)
* added inetutils-ping (provides ping6)

* modified Dockerfile to add binaries required by Docker OT simulation codelab
2022-01-27 22:04:04 -08:00
Yi 37f9d171c0
[routing-manager] generate random nat64 prefix and add it to netdata (#7232)
This commit generates a random NAT64 prefix and adds the prefix to
NetworkData if none exits. The prefix will be saved in Settings for
recovery.

It also adds a new CLI command `br nat64prefix` to show the local
nat64 prefix.

A new config OPENTHREAD_CONFIG_BORDER_ROUTING_NAT64_ENABLE is defined
and used to guard the change.

This initial implementation only supports a single BR.
2022-01-19 00:35:10 -08:00
Eduardo Montoya 0b3f87c588
[cmake] make TCP configurable with `OT_TCP` option (#7306) 2022-01-18 11:31:39 -08:00
Abtin Keshavarzian 5b9a1c0467
[net] add support for DNS Stateful Operations (DSO) (#7081)
This commit adds support for DNS Stateful Operations (DSO) as
specified in RFC 8490.

It adds `platform/dso_transport.hpp` header file which defines the
platform APIs/callbacks for DSO transport layer (e.g., DSN-over-TLS
or DNS-over-TCP).

The `Dso` module handles establishing connection with a peer, acting
either as a DSO client or server, establishing a DSO session over a
connection, and then sending and processing DSO request, response,
and unidirectional messages (including support for DSO TLV formats).
The `Dso` module also manages the session life cycle and timeouts,
namely the "Inactivity" and "Keep Alive" timeouts (including sending
and processing of Keep Alive messages when needed). It also handles
adding encryption padding before sending a message. It implements the
padding policy "Random-Block-Length Padding" from RFC 8467.

This commit also adds a detailed unit test `test_dso` covering the
behavior (including corner cases) of the `Dso` implementation. The
unit test provides an implementation of the DSO platform APIs which
emulate the DSO transport layer. It also includes a simplified alarm
platform implementation (emulating timers and allowing time to
advance in the unit test). These allow the unit test to cover more
complicated situations and behaviors (timeouts, failures, etc).
2022-01-14 16:25:16 -08:00
Jonathan Donald 26acccc105
[docker] add ping6 to codelab_otsim (#7313) 2022-01-13 10:33:31 -08:00
whd 299a512c8b
[firewall] disable firewall by default (#7305)
The firewall feature should not be enabled on some targets,
e.g. ot-daemon. Although leaving it enabled does not break the
behavior, it creates confusing logs.
2022-01-11 21:24:07 -08:00
Abtin Keshavarzian 95fa6220d7
[tmf] add `AnycastLocator` module (#6513)
This commit adds a new class `AnycastLocator` which can be used to
locate the closest destination of an anycast IPv6 address (i.e., find
the related mesh local EID and RLOC16). The closest destination is
determined based on the the current routing table and path costs
within the Thread mesh.

The implementation uses a CoAP confirmable post request to a newly
added URI path ("a/yl"). The destination IPv6 address of such as
request message is set to the anycast address to be located. The
receiver of the request message sends a CoAP response which includes
the "Mesh Local EID"  and "Thread RLOC16" TLVs.

This commit also adds support this new feature in CLI (adding a new
`locate <anycast-addr>` command).

Finally this commit adds `test_anycast_locator.py` to test behavior of
the new feature.
2021-09-17 08:04:44 -07:00
Abtin Keshavarzian ca3830fac2 [uptime] new feature to track OT instance uptime (in msec) (#6968)
This commit adds a new module `Uptime` which tracks the number of
milliseconds since OpenThread stack initialization as an `uint64_t`
value. It also adds public OT APIs to get the current uptime value
(either as the number of milliseconds or in human-readable string
format like "2 days 12:45:12.762"). A CLI `uptime` command is also
added. This feature can be enabled using the newly added config
option `OPENTHREAD_CONFIG_UPTIME_ENABLE` (or the related CMake
`OT_UPTIME` option).
2021-09-02 13:44:40 -07:00
Abtin Keshavarzian 2798cc9c05
[utils] adding `HistoryTracker` module (#6807)
This commit adds History Tracker feature and its CLI support. This
feature records history of different events as the Thread network
operates (e.g., history of RX and TX IPv6 messages or network info
changes).

Recorded entries are timestamped. When the history list is read, the
timestamps are given as the entry age relative to the time the list
is being read. For example in CLI a timestamp can be shown as
`02:31:50.628 ago` indicating the entry was recorded 2 hours, 31 min,
50 sec, and 628 msec ago. Number of days is added for events that are
older than 24 hours, e.g., `31 days 03:00:23.931 ago`. Timestamps use
millisecond accuracy and are tacked up to 49 days. If an event is
older than 49 days, the entry is still tracked in the list but the
timestamp is shown as old or `more than 49 days ago`.

The `HistoryTracker` currently maintains 3 lists. The Network Info
history tracks changes to Device Role, Mode, RLOC16 and Partition ID.
The RX/TX history list records information about the received/sent
IPv6 messages:
- Message type (UDP, TCP, ICMP6 (and its subtype), etc.)
- Source and destination IPv6 addresses and port numbers
- IPv6 payload length
- The message checksum (for UDP, TCP, or ICMP6).
- Whether or not the link-layer security was used
- Message priority: low, norm, high, net (for control messages)
- Short address (RLOC16) of neighbor who send/received the msg
- Received Signal Strength (in dBm) for RX only
- Radio link info (15.4/TREL) on which msg was sent/received
  (useful when `OPENTHREAD_CONFIG_MULTI_RADIO` is enabled)

Config `HISTORY_TRACKER_EXCLUDE_THREAD_CONTROL_MESSAGES` can be used
to configure `HistoryTracker` to exclude Thread Control message
(e.g., MLE, TMF) from TX and RX history.

The number of entries recorded for each history list is configurable
through a set of OpenThread config options, e.g., number of entries
in Network Info history list is specified by OpenThread config option
`OPENTHREAD_CONFIG_HISTORY_TRACKER_NET_INFO_LIST_SIZE`. The
`HistoryTracker` will keep the most recent entries overwriting oldest
ones when the list gets full.

This commit also adds support for `HistoryTracker` in CLI. The CLI
commands provide two style for printing the history information: A
table format (more human-readable) and list style (better suited for
parsing by machine/code). `README_HISTORY.md` is added to document
the commands and the info provided by each history list entry.

This commit also adds `test_history_tracker.py` test-case which
covers the behavior of `HistoryTracker`.
2021-08-12 15:47:26 -07:00
canisLupus1313 f99f206bea
[csl] allow to configure the CSL auto synchronization (#6913)
This commit allows configuration of auto synchronisation of CSL,
with data poll mechanism.
2021-08-12 10:51:21 -07:00
Abtin Keshavarzian 2e625bfe39
[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`.
2021-08-10 22:32:33 -07:00
canisLupus1313 126e232ad5
[link-metrics] split OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro (#6716)
This commit splits OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro
into two subsequent ones:
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
- OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
2021-06-22 10:49:53 -07:00
Jonathan Hui 649e8e1756
[cmake] always use git hash for default package version (#6717) 2021-06-17 10:01:02 -07:00
Yakun Xu 1b72b2d82e [docker] correct commit to build otsim (#6634) 2021-05-14 23:43:56 -07:00
Jonathan Hui 550c2056de
[nrf528xx] move to openthread/ot-nrf528xx (#6585) 2021-05-11 16:53:13 -07:00
Jonathan Hui 9432e9a659
[cmake] add OT_POSIX_SETTINGS_PATH option (#6603) 2021-05-10 21:17:36 -07:00
Abtin Keshavarzian 5b6654d0bc
[doc] update the BR name in comments/documentations (#6581)
This commit updates the BR name in comments and documentation
(removes the uses of "duckhorn")
2021-05-06 19:28:54 -07:00
Jonathan Hui 5078323d35
[efr32] move to openthread/ot-efr32 (#6403) 2021-05-06 14:28:28 -07:00
Yakun Xu bf422ee8b3
[cmake] add OT_DOC option (#6527) 2021-04-29 07:49:10 -07:00
Jonathan Hui fa99680f02 [mesh-forwarder] add support for Neighbor Discovery Agent Anycast (#6423) 2021-04-13 21:12:41 -07:00
Mason Tran 7b3c2ae66b
[efr32] add CMake support (#6302)
This commit adds CMake support for the efr32 platforms and Silicon
Labs gecko_sdk_suite. It also adds the option to build the efr32
sleepy-demo apps.

Other changes:
- jlinkrtt: remove NordicSemi specific options/definitions/includes
  from default build
- Remove old include dirs that don't exist anymore from efr32 automake
  files
2021-03-19 16:06:54 -07:00
Abtin Keshavarzian 06ca5d855c
[utils] add 'Utils::PingSender' (#6284)
This commit adds a new module `Utils::PingSender`. This module
is then used by CLI to support ping command.
2021-03-19 16:04:55 -07:00
Yakun Xu db1b980e57
[api] remove UART from in cli/ncp API (#6243)
This commit removes application library CLI/NCP dependency on platform
layer UART APIs. Instead, application layer provides callbacks sending
CLI/NCP data.

With this change, platforms with native support for formatted output
can simply implement the CLI output callback with something like
`vprintf()`.
2021-03-18 22:13:05 -07:00
Abtin Keshavarzian 0f7401b866
[build] add config for SRP client feature under BUILD.gn (#6308) 2021-03-18 08:35:28 -07:00
Yakun Xu 93c994723e
[posix] detect POSIX in source (#6259) 2021-03-14 17:27:16 -07:00
Zhanglong Xia 96fe3dd59f
[android] remove Android.bp (#6266)
Android.bp is unable to be checked by github actions. This commit
removes the Android.bp. The Android.bp will be added to the Android
repo.
2021-03-11 12:05:55 -08:00
Abtin Keshavarzian 7deab4a916
[trel] add 'OT_TREL' CMake option & 'TREL' autoconf switch (#6239)
This commit adds `OT_TREL` as a CMake option and 'TREL' as an autoconf
switch option to enable support for TREL radio link for Thread over
Infrastructure feature.
2021-03-08 08:49:20 -08:00
Torsten Tejlmand Rasmussen 32257403b0
[cmake] using cmake -E echo instead of shell echo command (#6175)
The echo command of the host system may have slight variations between
shell built-in echo and the echo command provided by the OS.

Especially the Windows OS echo command is different from practical any
other echo command.

This means that the currently used `COMMAND echo -e "<text>"` does not
work universally.

This commit introduces `etc/cmake/print.cmake` which allow to print a
CMake list where each item is printed on a new line, to get the desired
behavior on the `print-ot-config` target.

Using `cmake -E echo <text>` ensures identical behaviour across
different systems.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-02-16 11:30:01 -08:00
Simon Lin 89aacf5dd7
[dns-sd] DNS-SD server implementation (#6103)
This commit implements the DNS-SD server:
- Handle Standard DNS Query from clients
  - Supported resource records: PTR, SRV, TXT, AAAA
- Query services from SRP server
- Add tests
  - simulation test using DNS client (only test AAAA query)
  - OTBR test using dig command to verify all resource records can be
    queried successfully
2021-02-09 20:25:26 -08:00
Łukasz Maciejończyk 8bbbe194f1
[cmake] add support for nrf528xx (#6109) 2021-01-27 13:29:49 -08:00
Aurelio Schellenbaum 02d6d49a5e
[coap] add CoAP(s) block-wise transfer support to CoAP(s) client and server (#4247)
Implemented CoAP/-s block-wise transfer according to RFC 7959. The
implementation includes methods and functions available to the
application layer to add Block1 and Block2 option values to a coap
message and an automatic block-wise transfer enabled by the compile
switch "COAP_BLOCK".
2021-01-26 13:27:32 -08:00
Simon Lin a3b5e370be
[logging] refine FULL_LOGS option (#6084)
This commits refine the FULL_LOGS option (OT_FULL_LOGS for cmake):
- remove configuration of log regions since they should be 1 by
  default
- set PLATFORM log region to ON by default
2021-01-26 10:19:07 -08:00
kangping 1ec9fd525d [net] SRP server implementation (#5986)
This PR includes the initial implementation of the SRP server
defined in https://tools.ietf.org/html/draft-ietf-dnssd-srp-07.

- SRP server Service TLV propagation: Includes only the 2-bytes
  dynamic listening port in the Server TLV.
- SRP request processing (parsing & validation)
- LEASE & KEY-LEASE management
- SIG(0) verification
- Interface for advertising proxy
- CLI commands for testing
- Support removing indivitual SRP service
2021-01-22 13:19:21 -08:00
Abtin Keshavarzian 966baf5e6b [net] SRP client implementation (#6038)
This commit adds support for SRP (Service Registration Protocol)
client in OpenThread. The implementation allows a user to provide host
info (host name and a list of host IPv6 addresses) along with a list
of services to be registered with an SRP server. Services and/or host
addresses can be added or removed during operation of client.

Users can get the list of services and host info and their current
state (indicating, for example, if service is registered with server,
being registered or being removed, etc). Users can also provide a
callback to get notified whenever there is change or an error.

When there is a new request (e.g., a new service is added/removed)
that requires an update, the SRP client will wait for a short delay
before preparing and sending an SRP update message to server. This
allows user to provide more changes that are then all sent in the same
update message. The implementation handles retries in case of
different errors and failures. An exponentially increasing retry wait
interval (with configurable min, max, and growth factor) is
implemented.

The implementation also manages the lease renew time for each service
and refreshes (re-registers) services with server before lease is
expired. It supports "opportunistic early refresh" mechanism such that
when sending an SRP update, the services that are not yet expired but
are close, are allowed to refresh early and are included in the SRP
update. This helps place more services on the same lease refresh
schedule reducing number of messages sent to the SRP server. This
behavior (whether to allow early refresh or not, and its related
parameters) can be controlled through a set of OT config definitions.
2021-01-22 13:19:21 -08:00
Simon Lin a8e5d11e23
[logging] add logging region DNS (#6069)
This commit adds the DNS logging region to be used by OT DNS features.
2021-01-14 21:01:50 -08:00
Zhanglong Xia 36b16be3a4
[build] add Android.bp support (#6039)
Since Android 7.0, the Soong build system was introduced in Android to
replace Make. This commit adds the Android.bp to support Soong build
system.
2021-01-14 10:16:31 -08:00
Abtin Keshavarzian b179cf21be [logging] add log support for new region SRP (#6048)
This commit adds a new log region and the related definitions for
Service Registration Protocol (SRP).
2021-01-10 08:31:14 -08:00
kangping 995ad66846
[border-router] initial implementation of prefix/route management (#5856)
This is the initial implementation of Thread Border Router
prefix/route management with:

- Create & publish off-mesh routable (OMR) prefix for Thread network
  - configure the BR as default route.
  - converge to the smallest OMR prefix if multiple prefixes are
    present at the same time.
- Create & advertise on-link prefix for infrastructure network
  - monitor RA messages on infra link and stops myself if there is
    someone else advertising an on-link prefix.

It currently supports single infrastructure link with possibly
multiple BRs. Support for multiple infrastructure links is left for
future.
2020-12-23 15:19:12 -08:00
Simon Lin 82eee1f8d3
[backbone-router] add build options for Backbone Router features (#5891)
This commit introduces two configurations for Backbone Router to turn
off corresponding features:

- OPENTHREAD_CONFIG_BACKBONE_ROUTER_DUA_NDPROXYING_ENABLE: 1 by
  default, set to 0 to disable Backbone Router DUA ND Proxying

- OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE: 1 by
  default, set to 0 to disable Backbone Router Multicast Routing

Both configuration requires OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE.

NOTE: At least one of these two configurations must be ON if
OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE=1(otherwise it's meaningless
to turn on OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE).
2020-12-04 08:11:35 -08:00
Moandor 9d9646afaa
[spinel] RCP restoration on failures (#5694)
This commit implements the RCP restoration on failure feature. It
keeps the host process running while resetting and initializing the
RCP.
2020-11-26 08:57:13 -08:00
Abtin Keshavarzian 1cac116526
[utils] adding 'DatasetUpdater' (#5807)
This commit adds a new module `DatasetUpdater` which provides
easy-to-use APIs for user to request an update to any component (a
subset of components) in Operational Dataset of the Thread network.
The change can be requested from any node in the network. The
implementation uses `MGMT_PENDING_SET` command and takes care of
preparing the Pending Dataset and updating timestamps and monitoring
for the Dataset to be updated and possibly retrying. It reports the
outcome (success or failure status) back to the user in a callback.

This commit also updates the `ChannelManager` module is to use the
`DatasetUpdater` to change the channel.
2020-11-23 16:27:54 -08:00
Yakun Xu 8367f00923
[memory] use heap for messages (#5792)
This commit adds an option to allow share heap memory with message
buffer pool.

For MTD, there is usually no border agent or commissioner service. This
change allows the heap for meshcop to be used by application or network
management data after the device is attached. Thus the total memory
usage can be reduced.
2020-11-12 18:37:51 -08:00
Yakun Xu f83d1ff999
[cmake] add external platform support (#5693)
This commit adds external platform support into cmake build system.
2020-10-23 07:23:00 -07:00
Jonathan Hui 115e04f435 [cmake] add build options for FTD, MTD, and RCP (#5622) 2020-10-11 11:08:43 -07:00