Commit Graph

475 Commits

Author SHA1 Message Date
kangping fa8ec6ded0 [tests] give more time for SRP client to upgrade to router (#6694) 2021-05-31 21:44:54 -07:00
Abtin Keshavarzian 1796f50264 [srp-client] support saving selected server info (by auto-start) (#6672)
This commit adds support for a new feature in SRP client which allows
it to save the selected server info (by the auto-start feature) in
non-volatile settings. On SRP client restart (e.g., due to a device
reset) the client will select the same server when searching to
discover and pick one from the Thread Network Data service entries.
Config `OPENTHREAD_CONFIG_SRP_CLIENT_SAVE_SELECTED_SERVER_ENABLE` can
be used to enable/disable this feature.

The server info is saved only after the host info is successfully
registered with the server and if it is selected by auto-start from a
network data SRP *unicast* service entry.

This commit also adds `test_srp_client_save_server_info.py` test-case
which verifies the behavior of the new feature.
2021-05-25 18:34:07 -07:00
kangping f1ab57bb66 [border-router] add vicarious router solicitation (#6514)
This commit adds vicarious router solicitation which is described in
https://www.ietf.org/archive/id/draft-lemon-stub-networks-02.html#section-3.1.1
2021-05-20 12:32:59 -07:00
kangping 9eff7616b3 [srp-server] fix removing services when the host is expired (#6649)
The SRP server tries to notify the advertising proxy when a service is
expired.  The expired service is firstly removed from the service list
and later added back to the head of the service list if the service
name should be retailed. This will result in deadloop when there are
two or more services on the same host.

This commit fixes this issue by keeping the expired service in the
service list by simply mark the service deleted and pass all services
of the host to the advertising proxy. The advertising proxy will
republish those services that are not expired but this should be fine
since service expiration is not a common case.

Also update the advertising proxy test case to cover multiple
services.
2021-05-20 09:07:39 -07:00
whd 53b50577d4 [github-actions] fix MATN_16_LargeNumberOfMulticastGroupSubscriptionsToBBR (#6576) 2021-05-12 19:27:41 -07:00
Simon Lin 9347b290e1 [cli] make command output consistent (#6592)
This commit makes the CLI command output consistent under all cases:

- Output Error 6: Parse when the command line is too long (no output
  originally).

- Output Error 7: InvalidArgs when the command line has too many
  arguments. The original output is Error: too many args (max %d),
  which does not strictly follow the Error <code>: <msg> pattern.

- Output Error 13: InvalidState for running non-diag command in
  diagnosis mode to follow Error <code>: <msg> pattern.
2021-05-12 18:50:03 -07:00
Simon Lin e0a1987336 [ip6] set Mesh Local IID for Reference Devices (#6599) 2021-05-11 21:38:14 -07:00
Abtin Keshavarzian a40b42e299 [network-data] add new DNS/SRP anycast/unicast service definitions (#6501)
This commit adds new network data service entry definitions to
indicate presence of DNS/SRP servers within the Thread mesh and
provide info about them. Two service TLV formats are added:

`NetworkData::Service::DnsSrpAnycast` indicates that DNS/SRP client on
a device can use the associated anycast address with this service TLV
to reach the DNS/SRP server. The use of anycast address ensures that
the messages are routed to the nearest node which has added such a
service entry in the network data. The service TLV data in this model
contains a one byte sequence number which is used to notify the SRP
clients if they need to re-register with the server(s) (e.g., due
server reset/reboot and/or loss of previous registrations).

`NetworkData::Service::DnsSrpUnicast` directly provides the IPv6
address and port info for a DNS/SRP server which can be included as
part of the service TLV data and/or the server TLV data. Using service
TLV data allows the info about a common infrastructure SRP/DNS server
to be added by multiple BRs. In the case of server TLV, the IPv6
address info can be optionally omitted (i.e. just a port number is
provided) which then causes the associated RLOC/ALOC address of the
node who added the service entry to be used as the server's IPv6
address.

This commit updates the `Srp::Client` to use the new service entries
to discover/select the SRP sever when auto-start mode is enabled. The
client prefers and uses a `DnsSrpAnycast` over `DnsSrpUnicast`
entries. The `Srp::Server` is also updated to publish its info as
`DnsSrpAnycast` entry (using mesh-local address).

This commit also updates the `test_network_data` unit test to cover
the behavior of newly methods which iterate and parse different
service entry formats.
2021-05-11 13:44:29 -07:00
Simon Lin c1e2e168d6 [tests] set default node parameters (#6593)
This commit set default node parameters and remove unnecessary
parameters in topologies.
- router selection jitter to 1s
- panid to 0xface
2021-05-11 12:56:33 -07:00
whd f97d9c7de5 [github-actions] fix MATN_15_ChangeOfPrimaryBBRTriggersRegistration.py (#6608)
The test case failed because pktverify failed to find an ACK packet
sent to TD. However, TD_RLOC has changed during the test while we were
using the latter RLOC to verify the packet. Therefore it wasn't able
to find the packet.

For this test case, we can verify the existence of that ACK packet
using the source address of its according CON packet.
2021-05-11 12:54:28 -07:00
Simon Lin 8dc9a53cc7 [tests] fix bbr_5_11_01 random fails (#6589)
Set default BBR registration delay to 2. Defining a smaller BBR jitter
can help all TCs to be more robust.
2021-05-07 21:31:05 -07:00
Simon Lin 5b425a1b58 [tests] fix dig output TXT parsing (#6577) 2021-05-07 12:37:56 -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
whd 9de2134f67 [tests] fix MATN_09_DefaultBRMulticastForwarding.py (#6579)
The second to the last packet verification statement expects a ping
request sent by Router_1 after BR_2 becomes the PBBR.  However, this
statement wrongly matches a ping request sent by Router_1 before BR_2
becomes the PBBR.  Added a restriction of the echo identifier to make
sure the packet verification statement doesn't match the previous ping
request.
2021-05-06 10:10:36 -07:00
kangping 217727ec62 [border-router] send RA immediately when RA parameters are updated (#6565) 2021-05-06 10:08:07 -07:00
whd 26cdf63231 [github-actions] fix MATN_15_ChangeOfPrimaryBBRTriggersRegistration (#6535) 2021-05-05 19:52:42 -07:00
Li Cao f1fd52b9ef [tests] fix v1_2_LowPower_7_1_01_SingleProbeLinkMetricsWithEnhancedAcks (#6537)
Extend ping timeout.
2021-04-29 18:05:39 -07:00
kangping 5db938dbed [border-router] learn RA header and parameters from infra interface (#6431)
The commit enhances the Routing Manager to learn RA header and
parameters from RA messages initiated from infra interface. This
addresses the issue that the BR may be using different RA header
against another RA daemon which is working on the same infra interface
(Have BR and another RA daemon working on the same interface is common
for Wi-Fi + Thread routers).

We also changed to accept RS messages initiated from the infra
interface: this is for case that multiple Border Routers run on the
same host (as we are trying to support multiple ot-daemons on the same
host).
2021-04-29 12:56:12 -07:00
whd 7620e59e7a [scripts] MATN-TC-09: Failure of Primary BBR – Outbound Multicast (#6463) 2021-04-27 18:56:34 -07:00
whd b5ec673e2f [scripts] MATN-TC-16: Large number of multicast group subscriptions to BBR (#6507) 2021-04-26 09:14:10 -07:00
Simon Lin 27d1e9d65a [backbone-router] fix incorrect PBBR ALOC (#6505) 2021-04-26 09:09:39 -07:00
whd 0656fbc9ed [scripts] MATN-TC-15: Change of Primary BBR triggers a re-registration (#6504) 2021-04-26 07:04:15 -07:00
Simon Lin ccedef530e [github-actions] add more packet verification tests (#6508)
Packet verification of some test scripts were not executed. This
commit runs these tests in packet verification checks.
2021-04-25 21:36:01 -07:00
whd c8902e9419 [scripts] MATN-TC-05: Re-registration to same Multicast Group (#6444) 2021-04-22 22:17:03 -07:00
whd e8ec349ce0 [scripts] MATN-TC-12: Hop limit processing (#6496)
- Implement test case MATN-TC-12
- Also implement a fake layer: 'ipv6inner'. It is useful for fetching
  data in the inner IPv6 layer from a packet.
2021-04-22 19:27:20 -07:00
whd 7a2465f751 [cli] support -I {src-addr} for ping command (#6470) 2021-04-22 12:43:26 -07:00
Yakun Xu 8467a3d522 [border-agent] use ephemeral port (#6450)
This commit changes border agent service to use ephemeral port by
default. This change makes it easier to support multiple Thread
interfaces on a single host.
2021-04-20 22:32:07 -07:00
Jintao Lin b091b1ff02 [scripts] remove CSL ping timeout constraint (#6480) 2021-04-19 07:32:08 -07:00
Jintao Lin d8926baa71 [scripts] increase CSL ping timeout value (#6468)
Sometimes CSL cannot be sent out at the sample windows following the
ping command and may need to wait for one or more CSL periods. Use the
default ping timeout which covers several CSL periods.
2021-04-16 07:13:45 -07:00
whd 58419376bf [scripts] MATN-TC-04: Removal of multicast listener by timeout expiry (#6441) 2021-04-15 13:54:08 -07:00
whd bb142df1a5 [scripts] MATN-TC-03: Thread device incorrectly attempts Commissioners (de)registration functions (#6435) 2021-04-15 13:51:57 -07:00
Simon Lin 796bc8e507 [scripts] fix parsing TXT RR containing " (#6443)
This commit fixes parsing dig TXT RR that contains `"`.
2021-04-15 13:45:13 -07:00
kangping 423575fceb [meshcop] support Thread 1.2 Security Policy flags (#6320) 2021-04-14 08:16:08 -07:00
whd 3e833c120f [scripts] MATN-TC-02: Multicast listener registration and first use (#6409) 2021-04-13 21:14:44 -07:00
Jonathan Hui fa99680f02 [mesh-forwarder] add support for Neighbor Discovery Agent Anycast (#6423) 2021-04-13 21:12:41 -07:00
Jonathan Hui 8959216641 [tests] add test for anycast forwarding (#6423) 2021-04-13 21:12:41 -07:00
Jintao Lin d514373832 [low-power] resync SSED with its parent after retransmission (#6342)
Per 15.4 spec, transmitter cannot modify frame content in
retransmission which will leads to out-of-date CSL IE being sent to
CSL transmitter. This commit fixes this issue by,
1. Send a follow up data poll with CSL IE to resync the CSL
   transmitter.
2. Send periodic data poll with CSL IE to keep SSED's parent in sync.
3. Move PrepareDataRequest to data_poll_sender.
4. Add test cases to cover.
2021-04-13 13:02:00 -07:00
Simon Lin 62ae1a1c36 [thread-cert] specify MAX_JOBS via env (#6419) 2021-04-12 22:52:58 -07:00
Simon Lin a89c73b370 [scripts] fix dig txt RR parsing (#6433)
This commit fixes parsing dig TXT RR that contains whitespace.
2021-04-12 18:49:49 -07:00
Simon Lin d5855ab74b [style] bump yapf version to 0.31.0 (#6434) 2021-04-12 07:30:27 -07:00
Simon Lin 5a39566f81 [dnssd] implement DNS-SD Discovery Proxy (#6191)
This commit implements DNS-SD Discovery Proxy.
- Implemented DNS-SD Discovery Proxy functionalities - OT part
- Fixed an memory issue of NameCompressInfo (introduced in #6155 , but
  somehow revealed by this commit)

Some implementation details:
- Discovery Proxy subscribes to services/service instances/hosts
  through callbacks set by a public OT API. It is up to the platform
  mDNS implementation to collect service instance/host information and
  notify OT via a public OT API.
- Discovery Proxy can handle DNS browsing of one service or DNS
  resolving of one service instance/host. We leave browsing multiple
  services or resolving multiple service instances/hosts for future
  enhancements if necessary.
2021-04-08 18:21:23 -07:00
kangping 39e6172304 [border-router] accept RA initiated from the infra interface (#6348)
Accept RA initiated from the infra interface so that we can detect the
existence of another RA daemon which is working on the same infra
interface.

Also enhance the test_single_border_router.py test script to make it
more readable.
2021-04-07 11:01:29 -07:00
whd a145d24352 [ping-sender] let ping return statistics in OTCI (#6370)
- Ping command in CLI will print Done in the end, after printing
  replies and statistics. The old behavior is, ping command prints
  Done before any replies.
- In OTCI, let ping function return statistics.
- Support timeout parameter in ping command.
- Fix a bug that the arguments are not properly passed to ping in
  node.py.
- Adjust timeouts in tests.
2021-04-07 08:40:18 -07:00
Simon Lin 5bc74b7113 [scripts] add Backbone DUA routes test (#5644) 2021-04-05 21:28:38 -07:00
Simon Lin 09c95f9a32 [scripts] make BMLR test more reliable (#6387)
In BMLR test, the commissioner may fail to start because the /c/ps
COAP message failed to reach Leader due to unstable links.  This
commit makes sure the links are established before starting the
commissioner.
2021-04-02 18:25:12 -07:00
Simon Lin 51035f564e [scripts] fix multicast routing test false fails (#6388) 2021-04-01 08:13:59 -07:00
whd a274ddea71 [tests] fix wrong usage of ping timeouts (#6381)
In tests/scripts/thread-cert/node.py, the timeout parameter of ping()
function is in seconds. However, in some test cases they called ping()
with a timeout in milliseconds.

I used the following command to list ping() usages with a specified
timeout: grep -rn "ping.*timeout=" tests/scripts/thread-cert/*
2021-03-31 22:22:34 -07:00
whd bbbeee17fb [ping-sender] show ping reply statistics (#6341) 2021-03-30 09:54:14 -07:00
kangping fbdafacbc7 [srp-server] do not use platform UDP for SRP server (#6322)
This commit binds SRP Server to Thread netif.

This also adds a configuration option for the SRP server UDP port to
allow using a specific/static port.
2021-03-23 12:45:53 -07:00
Jintao Lin f38ec1ed8a [tests] add allowlist after reset to restore same network topology (#6309) 2021-03-18 08:15:10 -07:00