Receiving multicast UDP paquets on an iPad with ethernet adapter

Hi,

I am struggling to receive multicast UDP packets on an iPad Pro (iOS 15.5) in the context of an ethernet-only lab network.

The packet reception code uses a NWConnectionGroup configured with a NWMulticastGroup, as described in https://developer.apple.com/news/?id=0oi77447.

This code works well on a Mac connected to the lab network with a USB ethernet adapter, provided the ethernet adapter interface has the highest priority among connected network interfaces.

To make it work on iOS, I have successfully added the com.apple.developer.networking.multicast to the app, following the process detailed by @eskimo in https://developer.apple.com/forums/thread/663271

However, on the iPad, the app doesn't receive any data packet on the configured connection group, although no error shows on the console.

I suspected that the issue may be related to a question of network interface selection by the receiving NWConnectionGroup, but disabling the wifi on the iPad doesn't seem to help.

Searching in the dev forums, I found this message where @meaton wrote You will want to make sure that you test this on a physical device connected to Wi-Fi to know that the Multicast feature is actually working. This makes we wonder if using the Wi-Fi network is mandatory here…

Hence my question: is there a way to receive multicast UDP packets on an ethernet network on an iPad?

Thanks.

NWMulticastGroup should work on Ethernet on iOS, just like it does on macOS. Having said that, I’ve not actually tried this myself. Unfortunately I don’t have time to do that in the context of DevForums. If no one else chimes in, I recommend that you open a DTS tech support incident and I can pick things up in that context.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Searching in the dev forums, I found this message where @meaton wrote You will want to make sure that you test this on a physical device connected to Wi-Fi to know that the Multicast feature is actually working. This makes we wonder if using the Wi-Fi network is mandatory here…

Right, my recommendation here was based on what I typically see a user's device running in, i.e., a physical device running on a local Wi-Fi network. Having said that, I have not actually ran this test this with an ethernet adapter, but I don't see any reason why this shouldn't work. Please update the thread with your findings.

A quick update on this.
It turns out that reception of multicast UDP packets on the iPad over ethernet works as expected using NWMulticastGroup. I can't really explain what caused the issue I ran into last week.

Interesting point, it seems that the com.apple.developer.networking.multicast entitlement is not needed in this case. When the multicast entitlement is not set and a first multicast connection is created, the app shows a one-time alert asking for permission to use (listen on?) the local network, and then udp stream reception works.

So the exact use cases and platforms where this entitlement is necessary are still quite mysterious to me. :-)

Anyway, now, our video stream receiver app works well on iOS, tvOS and macOS.

Thanks @eskimo and @meaton for your help!

I'm glad to hear that everything is working, but quick point about:

 it seems that the com.apple.developer.networking.multicast entitlement is not needed in this case.

You will need the multicast entitlement, i.e., com.apple.developer.networking.multicast to use the API for NWMulticastGroup on iOS. If you test this with a new iOS device that has never run your app before, I suspect that the NWMulticastGroup API would not work without this entitlement. Just wanted to put that out there for anyone following along.

Receiving multicast UDP paquets on an iPad with ethernet adapter
 
 
Q