Skip to content

Add Thread mesh networking and border router support#7

Open
dmonagle wants to merge 1 commit into
mainfrom
openthread
Open

Add Thread mesh networking and border router support#7
dmonagle wants to merge 1 commit into
mainfrom
openthread

Conversation

@dmonagle
Copy link
Copy Markdown
Collaborator

Summary

Introduces comprehensive Thread mesh networking capabilities with a new border router implementation.

Changes

Package Configuration

  • Added MatterThread and MatterThreadBorderRouter library targets
  • Introduced trait-based conditional compilation for Thread features
  • Added dependency on openthread-swift package (local path for development)

MatterThread Module

  • ThreadNetworkManager: High-level API for forming, joining, and monitoring Thread networks
  • ThreadInstance: Wrapper around OpenThread C APIs (assumed in openthread-swift)
  • ThreadTransport: MatterUDPTransport implementation routing UDP through the Thread mesh
  • ThreadDiscovery: ServiceDiscovery implementation using SRP server and mesh-local mDNS
  • ThreadCommissioning: Thread-specific commissioning with dataset provisioning support

MatterThreadBorderRouter Module

  • BorderRouter: Coordinates border routing services between Thread and infrastructure networks
  • IPv6Routing: Manages IPv6 prefix delegation and on-mesh prefixes
  • SRPProxy: Proxies Thread SRP registrations to infrastructure mDNS
  • DNSProxy: Forwards DNS queries from Thread devices to infrastructure
  • NAT64Translator: Enables IPv6-only Thread devices to reach IPv4 hosts

Usage Example

let manager = try ThreadNetworkManager(radioURL: "spinel+hdlc+uart:///dev/ttyACM0")
try await manager.formNetwork(name: "MyHome")

let borderRouter = BorderRouter(networkManager: manager)
try borderRouter.start()

Introduces MatterThread and MatterThreadBorderRouter targets for
joining Thread mesh networks and bridging Thread devices to IP,
enabling Acumen to commission and control Thread devices directly.

Architecture:
- openthread-swift (separate package): COpenThread systemLibrary +
  OpenThread Swift wrapper (ThreadInstance, ThreadDataset, etc.)
- MatterThread: ThreadTransport (MatterUDPTransport over Thread mesh),
  ThreadDiscovery (ServiceDiscovery via SRP), ThreadNetworkManager
  (form/join/scan), ThreadCommissioner (dataset provisioning)
- MatterThreadBorderRouter: BorderRouter actor, IPv6Routing, SRPProxy,
  DNSProxy, NAT64Translator

All Thread sources guarded with #if canImport(OpenThread) so they
compile as empty modules without the pre-built OpenThread libraries.
Package traits ("Thread", "ThreadBorderRouter") declared for future
conditional dependency resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant