thought it would be helpful to explain what works for network configuration related to Thread. Specifically we saw Eve devices which is an early adopter of Thread and Matter behave erratically within HA but solid to Apple.
The focus of this discussion is limited to getting your Matter devices to work reliably on a local subnet if you are having problems.
The Theory
Matter is a relatively high level device interoperability protocol that can work over Thread which is a lower level IPv6-based protocol largely using mDNS which is itself based on UDP. Matter can also work over WiFi and therefore IPv6 and mDNS as well.
For Thread, a border router is used to communicate with Thread devices and anything else on your network like HA. A Thread border router may be an AppleTV, and Apple HomePod, a SkyConnect device, Google devices, or any anything implementing the Thread border router protocol. You may have more than one Thread border router and these can talk to other Thread border routers.
A border router may use or support services in a dual stack network that are IPv4 in addition to supporting the IPv6 Thread/Matter network (for example supplying a means for some app on the IPv4 network to control a Thread device through the border router). The communication here isnât direct of course between IPv4 app and Thread device.
The network requirements
HA documentation states that the HA instance and the border router must be on the same subnet/VLAN. The underlying mDNS traffic is âlink-localâ which means it is not routable between subnets/VLANs.
Router Traffic
So letâs look at this mDNS traffic from a network routerâs perspective and then the HA/router firewall.
The network router normally supports broadcast traffic on the local subnet in which HA, the border router and the Thread devices reside (via L2 on the inferface definition). Some routers will allow mDNS broadcast to cross subnets; some routers will have a checkbox and some routers will allow plug-ins, e.g., Avahi.
The following rules depict the case where Avahi is broadcasting traffic for mDNS:
Source Addresses:
- VLAN69_IOT net = the local subnet interface network, i.e., any device address (IPv4 or IPv6) on this subnet as the source address, i.e., those assigned by DHCP/RA/SLAAC.
- link_local_IPv6 = fe80::/10 (link-local), fd00::/8 (ULA) as the source address
- link_local_IPv4 = 169.254.0.0/16 (also known as APIPA/self-assigned as source address; disabled if you donât allow IPv4 self-assigned addresses as this is an edge case for brain dead devices).
mDNS_broadcastScope as the following IPv6 and IPv4 destination addresses
- ff02::fb (IPv6 mDNS broadcast, typically Thread or any other IPv6 mDNS implementation)
- 224.0.0.251 (IPv4 relates to HA mDNS broadcast for things like IPP)
mdns_Port = 5353, 5540 (mDNS port and Matter operational discovery port)
Note that these rules only address traffic on this subnet, not traffic entering the subnet/VLAN because the traffic is link-local by definition. One could say these rules are superfluous in that L2 handles them but a router may or may not implement them because the broadcast scopes are not strictly within a subnet address.
The second two rules relate specifically to Apple HomeKit and HA services , not Thread or Matter, although your network implementation may also require this traffic.
UnprivilegedPorts = 1024:65535
HA Firewall
Aside from those router rules, the HA host firewall on your HA instance or Host/HA network must allow that local mDNS/Matter traffic in addition to its own limited subset of unprivileged ports like 8123 TPC (the HA portal).
Limitations
Does all of this mean that you canât separate your IOT devices from your trusted network where HA would otherwise reside?
The constraint is that that Thread devices, Border Routers, and HA need to be on the same subnet. The issue here is credential sharing which is not currently supported for Apple.
As far as I know there is no such single subnet limitation with Matter over WiFi. I personally am able to spread Matter/WiFi across subnets.