ADR 0027 — A Thread Border Router over OTBR REST: ThreadBorderRouterManagement enters the scope as a server with logic; the Thread radio stays out¶
- Status: Accepted (2026-10-25; roadmap milestone 6, phase 26a — the four
open points decided by the owner on 2026-10-23, see "Decisions taken");
implemented in wave 26a (brief
notes/briefs/2026-10-27-M6-26a-thread-border-router.md, reportnotes/briefs/reports/26a.md) - Date: 2026-10-23
- Related: ADR 0024 — BLE commissioning in the controller role
(decision 4: provisioning a Thread dataset needs no Thread radio),
ADR 0016 — device-type validation,
ADR 0017 — the generated default cluster server,
ADR 0026 — architecture principles (the layers),
roadmap milestone 6 phase 26,
docs/matterjs-comparison.md(thethread-br-clientrow and the "Thread / network infrastructure (4)" row),docs/architecture.md("Boundaries that are decisions", the Thread radio row, concept v3)
Context¶
"No Thread radio" has been a scope boundary since concept v3: a Thread radio is hardware, and the stack that drives it (OpenThread: 802.15.4 MAC, 6LoWPAN, MLE, MeshCoP) runs on an MCU or, as a border router, on a Linux host with a radio co-processor. Nothing of that is Go's place, and ADR 0024 kept the boundary when the commissioner learned to hand a device a dataset.
Phase 26 nevertheless names the four Thread and network-infrastructure
clusters, the ThreadBorderRouter device type (0x91) and "Thread network
diagnostics". Served as generated stubs (ADR 0017) they would be worse than
absent: an endpoint that declares 0x91 and answers BorderAgentId with a
default claims a border router that does not exist. A controller finds
border routers by that device type.
The host that does exist is a Linux machine running ot-br-posix — the
Raspberry Pi with an RCP dongle, the usual Home Assistant set-up. Its OTBR
exposes the Thread mesh as an IPv6 interface, so Matter over Thread is
already Matter over UDP/IPv6 to this module, and it exposes a REST API.
Nothing on this side needs to be a Thread node to manage that border router.
What matter.js has at the pin. packages/thread-br-client (added
2026-07-03, matter.js #4013; 10 730 lines of src/) is a client, not a
port of OpenThread. Its README names the scope: passive _meshcop mDNS
discovery, the Operational Dataset codec, the OTBR REST adapter, MeshCoP
diagnostics over CoAP/DTLS-EC-JPAKE, "read-only Thread diagnostics", with
the mutating OTBR operations exposed but never triggered by the library.
OtbrRestClient.ts (847 lines) wraps /node, /node/state,
/node/network-name, /node/rloc, /node/ext-address, /node/ext-panid,
/node/ba-id, /node/leader-data, /node/dataset/active and
/node/dataset/pending (GET, and PUT in setActiveDataset :424 /
setPendingDataset :440), /diagnostics (:246), /api/actions (:582),
setState (:410), factoryReset (:457), setCommissionerState (:467);
OtbrRestCapability.ts:8-30 probes the key casing (pascal on older
OTBR builds, camel after 2024) and which diagnostics flavour the border
router serves. The dataset codec, packages/protocol/src/thread/
(OperationalDataset.ts, 327 lines), is already ported: controller/thread
(doc.go, at matter.js 862ad75f), used by controller/commissioner/network.go (thread.DecodeDataset).
matter.js has no server behaviour to mirror here:
ThreadBorderRouterManagementServer.ts is a 14-line generated stub, as are
ThreadNetworkDiagnosticsServer.ts and ThreadNetworkDirectoryServer.ts,
and nothing in packages/*/src wires thread-br-client into any of them
(a grep over *.ts outside dist/ for ThreadBorderRouterManagement
finds only the model, the types and the device type).
NetworkCommissioningServer.ts carries no Thread branch either.
What chip has at the harness pin (6170af84). The CSA reference serves
the cluster with logic, and CLAUDE.md makes chip the authority where
matter.js models nothing.
src/app/clusters/thread-border-router-management-server/ThreadBorderRouterManagementCluster.cpp
(330 lines) over ThreadBorderRouterManagementDelegate.h (109 lines), with
src/platform/OpenThread/GenericThreadBorderRouterDelegate.cpp (233 lines)
as the in-process OpenThread delegate of examples/thread-br-app. The rules,
each a readable line:
| Rule | ThreadBorderRouterManagementCluster.cpp |
|---|---|
commands only over CASE, else UnsupportedAccess |
:151-153 |
SetActiveDatasetRequest needs the fail-safe armed, else FailsafeRequired |
:212-214 |
undecodable dataset → InvalidCommand |
:220 |
an active dataset already configured → InvalidInState |
:224-229 |
an activation still pending → Busy |
:234 |
| sequence number per activation, breadcrumb kept until completion | :238-242, :286-288 |
SetPendingDatasetRequest only with feature PC, else UnsupportedCommand |
:253-255 |
fail-safe expiry reverts the dataset and answers Timeout |
:301-316 |
| fail-safe disarm commits it | :321 |
ActiveDatasetTimestamp / PendingDatasetTimestamp read from the dataset's Active Timestamp TLV |
:61-75 |
The delegate (ThreadBorderRouterManagementDelegate.h:63-106): Init,
GetPanChangeSupported, GetBorderRouterName, GetBorderAgentId,
GetThreadVersion, GetInterfaceEnabled, GetDataset, SetActiveDataset
with an ActivateDatasetCallback that fires once the border router is
attached (:41-45), CommitActiveDataset, RevertActiveDataset,
SetPendingDataset. The certification cases are in the harness checkout:
src/app/tests/suites/certification/Test_TC_TBRM_2_1.yaml … 2_4 and
3_1_Simulated. chip's own CI builds an otbr-agent with the simulation
RCP for its tests (.github/workflows/tests.yaml:345-346).
The device type couples two clusters. thread-border-router.ts:36-39:
ThreadBorderRouterManagement and NetworkCommissioning "shall reflect the
same underlying network configuration", MaxNetworks is 1. The module's
NetworkCommissioning has an Ethernet base and a Wi-Fi variant
(cluster/core/network_commissioning.go, network_commissioning_wifi.go);
a Thread variant does not exist yet.
The cluster surface is small: six attributes (BorderRouterName,
BorderAgentId, ThreadVersion, InterfaceEnabled,
ActiveDatasetTimestamp, PendingDatasetTimestamp;
thread-border-router-management.element.ts:25-32), four commands, one
optional feature PC (:22). The REST contract needs net/http only, which
controller/dcl already uses; no sixth-plus dependency.
Decision¶
-
The Thread radio stays out; a border-router client enters. The module never joins a Thread mesh. It manages an existing OpenThread Border Router over its REST API, as
@matter/thread-br-clientdoes. The host decides whether to attach one; a bridge without it is unchanged in composition, FeatureMap and chip-tool runs. -
The dataset codec moves down.
controller/threadbecomesthread/(layerfoundation, next totlvandschema: the codec imports nothing of the module and holds no state) so that a server incluster/may import it —serverssits belowrolesinscript/archcheck/layers.json.controller/threadforwards untilv0.12.0, the window thecontroller/<name>→client/moves use (CLAUDE.md, ADR 0026 principle 12). That window had passed when the move landed: wave 26a removedcontroller/threadat once, with a migration-guide line, instead of keeping forwarders (owner decision 2026-10-27). -
Three servers, one delegate.
cluster/threadbr/holds ThreadBorderRouterManagementwith chip's rules from the table above, cited per line, against aBorderRouterinterface that isThreadBorderRouterManagementDelegate.h:63-106in Go: name, agent id, Thread version, interface state, dataset read, active-dataset activation with completion, commit, revert, pending-dataset write;ThreadNetworkDiagnosticsread-only from the same interface: the 17 mandatory attributes (thread-network-diagnostics.element.ts: Channel … LeaderRouterId, SecurityPolicy, ChannelPage0Mask, ActiveNetworkFaultsList, the provisional ExtAddress and Rloc16) from/node,/node/leader-data, the active dataset and the border router's own/diagnosticsrecord (Route64 and child table,tlv/diag/Route64.ts,ChildTable.ts), plus the featuresMLECNTandMACCNT(:27-28) from the MLE and MAC counter TLVs of the same record (tlv/diag/MleCounters.ts,MacCounters.ts);PKTCNTandERRCNTstay off;-
the Thread variant of NetworkCommissioning next to the Wi-Fi one (
cluster/core/network_commissioning_thread.go), sharing theBorderRouterso both clusters reflect one network, asthread-border-router.ts:36-39demands;MaxNetworks1.ScanNetworksis mandatory underTH(network-commissioning.element.ts:77, conformanceWI | TH) and the OTBR REST surface has no network scan, so the server answers with what a border router knows without a radio scan: oneThreadScanResult(PanId, ExtendedPanId, NetworkName, Channel) from the active dataset, statusSuccess; an empty list while no dataset is configured. The server is a hand-written server with logic matter.js's stub does not carry;notes/parity/by_design.mdrecords it (candidateBD-Thread-TBRM-ChipLogic): mirrored from chip, not invented, with the lines above as provenance.ThreadNetworkDirectorystays a generated stub (ADR 0017); no device type of the snapshot mandates it on a border router. -
The adapter is
thread/otbr/, layersupport: stdlibnet/http, the endpoints ofOtbrRestClient.tsnamed above, the key-casing probe ofOtbrRestCapability.ts,PUT /node/dataset/active|pendingfor the writes. The REST surface has no attach callback, so the activation completion chip's delegate reports (Delegate.h:41-45) is polling of/node/stateuntil the role leavesdisabled/detached, bounded by the fail-safe. The adapter exposes the mutating operations only through the cluster's fail-safe-guarded path;factoryResetandsetCommissionerStateare not wrapped (the thread-br-client README's own warning: they "can silently partition or brick a network"). The REST link is plaintext HTTP, as ot-br-posix serves it and as matter.js'sOtbrRestClientbuilds its URLs: the operational dataset with its network key and PSKc crosses it in clear, so the border router belongs on the host's own trusted LAN segment. -
MeshCoP stays out of this ADR. CoAP over DTLS with EC-JPAKE (
dtls/,coap/,commissioner/,diagnostic/MeshCopDiagnosticSource.ts, together more than half of thread-br-client) has no stdlib DTLS, so it is a dependency decision of its own, and no cluster of the module needs it: everything the three servers read is on the REST surface._meshcopdiscovery is not needed either — the host names its border router. Amended 2026-11-08 (owner decision, issue #461, wave W8): the second sentence is overtaken. The controller's network topology needs a border router as aborder_routernode with its name, as matterjs-server'sNetworkTopologyServicedraws it, so the controller gained a passive registry,thread/brdiscovery— a port of matter.js'sBorderRouterRegistry(packages/thread-br-client/src/discovery/BorderRouterRegistry.tsatdb021da0) on the controller's DNS-SD cache, which now admits_meshcop._udpand_trel._udpbeside the three Matter names. Nothing else of this decision moves: no CoAP/DTLS, no MeshCoP commissioner;thread/otbrstays the border-router client and the registry does not feed its border-router list (a separate decision, named incontroller/topology/doc.go"Left out"). -
The reference daemon gains an optional flag (working name
--otbr http://[host]:8081) that adds oneThreadBorderRouterendpoint; without it nothing moves, so the existing chip-tool guard runs are untouched (CLAUDE.md, token rules: no run when composition and FeatureMap did not move). -
Proof, in the order ADR 0024 used: unit tests of every rule in the table, one per line; adapter tests against recorded OTBR REST fixtures in both key formats; the harness's TBRM family (
GOFABRIC_CHIP_FAMILIES=TBRM) against the daemon with a virtual OTBR, built as chip's CI builds it (otbr-agentwith the simulation RCP,tests.yaml:345-346), in a manually dispatched job first; a real OTBR in the manual test plan. Unverified until tried: that the simulation RCP runs on theubuntu-24.04runner, and whetherTBRM_2_xneeds a second Thread node (3_1_Simulatedsuggests the harness simulates it).
Consequences¶
docs/matterjs-comparison.md: thethread-br-clientrow moves from "No" to the OTBR REST subset with this ADR; the "Thread / network infrastructure (4)" row splits — three served,ThreadNetworkDirectorystub.docs/architecture.mdkeeps the "Thread radio" row and gains a row for the border-router client.docs/certifiability.md: the TBRM family and the CNET Thread cases move from (d) out of scope to (c) not yet run.CLAUDE.md's scope line names the ADR. The roadmap carries the work as its own phase 26a; phase 26 keeps the generated stubs and loses "Thread network diagnostics".script/archcheck/layers.jsongainsthread,thread/otbrandcluster/threadbr; the package move is aCHANGELOG.mdentry and anapidifffinding with its forwarders.- The host's obligation grows by one reachable port: the OTBR REST
listener (default 8081) on the host or the LAN. The adapter's errors
name the HTTP cause, and a border router that stops answering is an
InterfaceEnabledfalse, not a crash. - Nothing here is certified (ADR 0011); TBRM certifiability is tracked
in
docs/certifiability.mdlike every other family.
Decisions taken (owner, 2026-10-23)¶
The four points the draft left open, answered before it was filed:
- Phase. Its own phase 26a, after the stubs of 26: the
thread/move,cluster/threadbr, the Thread NetworkCommissioning variant,thread/otbrand the virtual OTBR in CI, with their own proof. Phase 26 keeps the generated stubs and the camera work. - ThreadNetworkDiagnostics depth. The mandatory set plus the MLE and MAC counter features, as written into decision 3; packet and error counts stay off.
ScanNetworksunderTH. The border router's own network from the active dataset, as written into decision 3.- Layer of
thread/.foundation.
Addendum (phase 34, owner decisions 2026-11-04)¶
The decisions above stand; the device side still has no Thread radio. Phase 34 adds the certification run of decision 7 and changes three points of the border-router endpoint:
- ThreadNetworkDirectory on the border router. The reference
daemon's
--otbrendpoint (device type ThreadBorderRouter, where the cluster is optional) declares ThreadNetworkDirectory over the kit's in-memory store, so the THNETDIR family runs against it, as chip runs it against its network-manager app's endpoint 1. - The four diagnostics counts. Decision 2 of 2026-10-23 is revised:
threadbr.DiagnosticsFeaturesserves PacketCounts and ErrorCounts as well, as connectedhomeip does — no element of the cluster conforms to PacketCounts (matter.jsthread-network-diagnostics.element.ts:25at862ad75f), and ErrorCounts' OverrunCount is the constant 0 chip's provider reads (DirectThreadNetworkDiagnosticsProvider.cpp:178-182at6170af84), with ResetCounts resetting it (:735-738resets the stack's counters; the REST surface has no reset, so the MLE and MAC counts stay the border router's). DGTHREAD runs against the border router's endpoint (the family's device type); no root ThreadNetworkDiagnostics is served. - The thread group's policy. TBRM, DGTHREAD and THNETDIR form the
threadgroup of.github/workflows/chiptool.yml, which that workflow never runs:.github/workflows/otbr-virtual.yml'sthread-familiesjob runs it after the agent's live test, on dispatch and weekly, never on a pull request, armed by the repository variableOTBR_THREAD_FAMILIES=armedonce oneotbr-virtualrun is green. Its agent starts withscript/otbr-virtual-test.sh(OTBR_SERVE=1); an agent that does not come up is the environment (exit 2), reported as a warning and no defect.