How does Mesh pub sub work?

I didn’t find any docs that answer this… How does the Mesh pub sub function at the RF/protocol level? I read that there is no broker. Does that mean that every publish results in a packet that is broadcast to all nodes? Or is there some filtering done at the thread-router level? Or are subscriptions broadcast and then publishes are targeted multicasts? Or… ?

Mesh publish uses UDP multicast. There’s a private IPv6 network created for the mesh network that the devices are connected to, and the data doesn’t leave this network.

The mesh network itself is Thread mesh, which is 6LoWPAN over 802.15.4.

I believe the subscription filtering is done on the receiving node; there’s a single multicast address for mesh publish and subscribe.

2 Likes

Multicast = broadcast in this context, right? So every “publish” message will traverse all radio links and reach all nodes. Whoa!

Not exactly. It will only reach the nodes that subscribe the the multicast.

So, for example, in the case where most of the nodes do a Mesh.publish and only the gateway subscribes, for example to upload the data to a service on the Internet, the individual nodes won’t get the other publishes.

If you do set up a multidirectional publish-subscribe mesh then yes there could be a lot of packets flying around.