node-zwave-js icon indicating copy to clipboard operation
node-zwave-js copied to clipboard

S2 Multicast

Open mbbush opened this issue 2 years ago • 3 comments

I recently migrated my entire zwave network from hubitat to zwavejs. One of the main features I was looking forward to was multicast. I included most of my devices with S2, which my (old) hubitat didn't support, mostly for the message encapsulation and reliability benefits; I'm not worried about the security of my zwave network. Unfortunately, after setting everything up, I leaned that zwavejs doesn't (yet) support multicast to S2 devices.

Describe the solution you'd like S2 multicast is clearly on the roadmap. I tried to find an issue tracking progress, or describing the challenges involved, and didn't find one. So maybe this can be that issue?

Describe alternatives you've considered I could exclude and re-include every device in my network without security. I'd really rather not have to do that, especially if S2 Multicast is coming soon-ish.

Additional context I imagine the steps needed to send a S2 multicast would be, for each multicast message,

  1. Partition the target nodes by security class (none, S0, S2 Unauthenticated, S2 Authenticated, S2 Access Control)
  2. For each security class with at least one target node in it, send one multicast message to those nodes, except for S0 which needs individual messages.

Are there other significant complications I'm not aware of? Is S2 encryption of multicast messages qualitatively different than S2 encryption of unicast messages?

mbbush avatar Jul 22 '22 01:07 mbbush

S2 multicast messaging is a bit more involved than singlecast, because the singlecast followup that is done by the firmware for "normal" commands must now be handled by the driver.

If you want to read a bit further: https://github.com/zwave-js/specs/blob/master/ZWA_Z-Wave%20Transport-Encapsulation%20Command%20Class%20Specification.pdf, section 3.6.5.2

AlCalzone avatar Jul 22 '22 07:07 AlCalzone

I see the mention of the the S2 SC-Followup messages in that specification, but I didn't find any mention of

the singlecast followup that is done by the firmware for "normal" commands

in either the network layer or MAC/PHY layer specifications. Where is that specified?

This does indeed seem like a lot of work. In addition to the recommendation for the followup message, it seems like managing the MPANs in addition to the SPANs is indeed a qualitative difference from singlecast S2. I did notice that the singlecast followup message is a "SHOULD" not a "MUST" in the specification, so perhaps it's worth starting with just the multicast nonces?

Is it just a matter of finding the time to do it? Are there any design questions that are still outstanding, or will you not know that until you get deep into the weeds of actually implementing it? I don't want to interfere unhelpfully, but I'm both curious about how this works under the hood, and experienced in designing software in general. My javascript skills in particular, however, are approximately zero.

mbbush avatar Jul 22 '22 18:07 mbbush

Where is that specified?

That is always the key question when it comes to Z-Wave. For this, it is hidden in the description for the TRANSMIT_OPTION_ACK of the ZW_SendDataMulti function in the 500 series appl. programmers Guide:

The multicast frame will be followed by a number of single cast frames to each of the destination nodes and request acknowledge from each destination node.

Since multicast frames are not routed, this makes sure that each addressed device got the request, even those out of direct range. The initial multicast frame avoids waterfall effects due to latency in communication.

Is it just a matter of finding the time to do it?

Mostly this

AlCalzone avatar Jul 25 '22 09:07 AlCalzone