Tool/software:
Hi All,
I'm working on a system which runs on a linux host with a CC1312R7 based radio for communication with a Wi-SUN network. I would like to use multicast CoAP messages to trigger behaviour in my fleet of devices.
My FAN devices support multicast and have successfully received and processed multicasts sent using pyspinel. The `udp` command worked out of the box for multicast. I was able to get the `coap` command to send a multicast GET after porting some multicast handling logic from the the `udp` command. Specifically, I needed to add the following code block and add the resulting _extension_headers to the generated packet.
if ipaddress.IPv6Address(dst).is_multicast: # Tunnel the IPv6 header + frame (containing the multicast address) _extension_headers = [ipv6.HopByHop(options=[ ipv6.HopByHopOption(ipv6.HopByHopOptionHeader(_type=0x6d), ipv6.MPLOption(S=3, M=0, V=0, sequence=self._get_next_mpl_seq_number(), seed_id=ipaddress.ip_address(src).packed))])] _extension_headers.append(ipv6.IPv6Header(source_address=src, destination_address=dst, hop_limit=hop_limit)) dst = "ff03::fc" # Use the realm-all-forwarders address for the outer ipv6 header
Next, I tried to switch to `wfantund` so that I can use network sockets from various user space applications. When I do this, the devices do not receive the multicast messages. I've tried multicast pings (`ping6 -I wfan0 ff03::1` for example) as well as CoAP using libcoap and aiocoap in python. In the case of the ping, I also get a response from the BR, but none of the connected devices. In all cases, I can see the multicast packet in wireshark on the wfan0 interface. This indicates that the packet is being sent to the linux side of the interface. I can also see this in the logs when I set the log level to `all`. I don't seem to see code in wfantund that handled this either.
When I reference other vendors documentation on sending multicast through their border router implementations they set the IPV6_MULTICAST_HOPS and SO_BINDTODEVICE socket options. I've also tried IPV6_MULTICAST_IF instead of SO_BINDTODEVICE. I've also tried joining the multicast group I'm sending to before I send the message.
What is the right way to enable an application to send multicasts via the linux socket interface (raw sockets aren't an option here as we need to be able to use libraries on top). Is there a change that should happen to wfantund or some other utility like a multicast routing daemon that I'm missing?
Thanks