MDNS Peer to Peer + Network Extension

I have an app that utilizes the Network Extension ( Packet Tunnel Provider ), but also uses MDNS to find local devices for data transfer via Network Extensions.

However, once connected over Peer to Peer using AWDL0 or NWConnections, it works as expected until a user shuts the screen down. It looks like there's a difference in behavior when the device is plugged in vs when it's on just battery alone.

So we can be happily sending data over p2p ( awdl0 ) then a screen shuts off and it kills the connection.

Is this expected behavior and if so is there documentation?

Also, Network Extensions do not appear to be able to discover over P2P, they can only connect to endpoints directly. Is this expected behavior?

My thoughts; If a user allows both the Network Extension Permission and Local Network Permissions that the Network Extension should be able to discover peers via p2p. The connections ( if not asleep ) should stay active while in use.

I’m not sure about expected behaviour, but this doesn’t surprise me. With infrastructure Wi-Fi we typically disassociate from the network on screen lock, with the expectation that background services will use WWAN.

My thoughts …

I don’t think there are any current APIs that’ll let you achieve that goal. My advice is that you file a bug [1] that describes your requirements. It would help if you also explained the big picture architecture of your product, because most NE packet tunnel providers don’t need to do peer-to-peer stuff.

Please post your bug number, just for the record.

Share and Enjoy

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

[1] Or is it an enhancement request? Yeah, that line can be blurry but it probably doesn’t matter.

MDNS Peer to Peer + Network Extension
 
 
Q