Bug: Wi-Fi Aware (NAN) Subscriber Mode: nwPath.availableInterfaces Does Not Include nan0 Interface After Successful Peer Connection

When using the official Wi-Fi Aware demo app on iOS, with the iOS device configured as a NAN Subscriber, after successfully establishing a peer-to-peer connection with another device via Wi-Fi Aware (NAN), the network path object nwPath.availableInterfaces does not list the nan0 virtual network interface. The nan0 interface is the dedicated NAN (Neighbor Aware Networking) interface used for Wi-Fi Aware data communication. Its absence from availableInterfaces prevents the app from correctly identifying/using the NAN data path, breaking expected Wi-Fi Aware data transmission logic.

log: iOS works as subscriber: [onPathUpdate] newPath.availableInterfaces: ["en0"]

iOS works as publisher: [onPathUpdate] newPath.availableInterfaces: ["nan0"]

Answered by DTS Engineer in 880281022
we need to establish multiple additional NWConnection instances … over the Wi‑Fi Aware network

I don’t think you can do this on currently shipping systems. However, we’ve added support for it in iOS 26.4 beta. This is sufficiently ‘bleeding edge’ that the docs haven’t hit the Developer website yet. But the APIs are in the iOS 26.4 beta SDK (I’m using Xcode 26.4b3, build 17E5179g) and there’s documentation in Xcode itself.

To set up a listener:

let devices: WAPublisherListener.Devices = … specific devices …
let listener = try NetworkListener(for:
   .wifiAware(.addingConnections(from: devices)),
using: .parameters({
   TCP()
}).localPort(12345))

On the client side, do this:

let connection: NetworkConnection<TCP> = … original connection …
guard let wifiAwareEndpoint = connection.currentPath?.remoteEndpoint?.wifiAware(port: 12345) else {
    // … handle the failure …
}
// … connect to that endpoint …

If you option click on addingConnections and wifiAware, you’ll get docs for each.

Oh, and you don’t want to hard code the port number here. Rather, let the listener choose an ephemeral port and then pass the port number to the client via your initial Wi-Fi Aware connection.


As you might imagine, I haven’t actually test this for myself yet. But it’s in the SDK and AFAIK it should work.


send URLSession requests

How does URLSession fit into this? AFAIK you can’t configure URLSession to run over a specific interface, let alone Wi-Fi Aware.

Share and Enjoy

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

breaking expected Wi-Fi Aware data transmission logic.

Breaking whose logic. Logic within the system frameworks? Or your own app’s logic?

Share and Enjoy

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

Sorry for the typo earlier. To clarify: after connecting via Wi‑Fi Aware, we need to establish multiple additional NWConnection instances and send URLSession requests over the Wi‑Fi Aware network. However, we’re encountering a system "Nexus assignment error" when attempting to create NWConnections using the nan0 interface. Could you please demonstrate how to properly establish these extra NWConnections and send URLSession data through them?

we need to establish multiple additional NWConnection instances … over the Wi‑Fi Aware network

I don’t think you can do this on currently shipping systems. However, we’ve added support for it in iOS 26.4 beta. This is sufficiently ‘bleeding edge’ that the docs haven’t hit the Developer website yet. But the APIs are in the iOS 26.4 beta SDK (I’m using Xcode 26.4b3, build 17E5179g) and there’s documentation in Xcode itself.

To set up a listener:

let devices: WAPublisherListener.Devices = … specific devices …
let listener = try NetworkListener(for:
   .wifiAware(.addingConnections(from: devices)),
using: .parameters({
   TCP()
}).localPort(12345))

On the client side, do this:

let connection: NetworkConnection<TCP> = … original connection …
guard let wifiAwareEndpoint = connection.currentPath?.remoteEndpoint?.wifiAware(port: 12345) else {
    // … handle the failure …
}
// … connect to that endpoint …

If you option click on addingConnections and wifiAware, you’ll get docs for each.

Oh, and you don’t want to hard code the port number here. Rather, let the listener choose an ephemeral port and then pass the port number to the client via your initial Wi-Fi Aware connection.


As you might imagine, I haven’t actually test this for myself yet. But it’s in the SDK and AFAIK it should work.


Coming back to this:

send URLSession requests

How does URLSession come into this? AFAIK you can’t configure URLSession to run over a specific interface, let alone Wi-Fi Aware.

Share and Enjoy

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

we need to establish multiple additional NWConnection instances … over the Wi‑Fi Aware network

I don’t think you can do this on currently shipping systems. However, we’ve added support for it in iOS 26.4 beta. This is sufficiently ‘bleeding edge’ that the docs haven’t hit the Developer website yet. But the APIs are in the iOS 26.4 beta SDK (I’m using Xcode 26.4b3, build 17E5179g) and there’s documentation in Xcode itself.

To set up a listener:

let devices: WAPublisherListener.Devices = … specific devices …
let listener = try NetworkListener(for:
   .wifiAware(.addingConnections(from: devices)),
using: .parameters({
   TCP()
}).localPort(12345))

On the client side, do this:

let connection: NetworkConnection<TCP> = … original connection …
guard let wifiAwareEndpoint = connection.currentPath?.remoteEndpoint?.wifiAware(port: 12345) else {
    // … handle the failure …
}
// … connect to that endpoint …

If you option click on addingConnections and wifiAware, you’ll get docs for each.

Oh, and you don’t want to hard code the port number here. Rather, let the listener choose an ephemeral port and then pass the port number to the client via your initial Wi-Fi Aware connection.


As you might imagine, I haven’t actually test this for myself yet. But it’s in the SDK and AFAIK it should work.


send URLSession requests

How does URLSession fit into this? AFAIK you can’t configure URLSession to run over a specific interface, let alone Wi-Fi Aware.

Share and Enjoy

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

Thanks for your reply!We have successfully connected an iOS device with a non-iOS device via Wi-Fi Aware, and established multiple TCP connections.

However, we still have a throughput issue: when the iOS device acts as a Subscriber, and sends an HTTP request over an already-established TCP connection to download resources from the non-iOS device, we observe slow download speeds — only around 20 MB/s.

We compared iOS system logs and found: When the non-iOS device connects to iOS, the timeslot bitmap used is ff ff 00 00 ff ff.

When iOS connects to iOS, all timeslots are used. Could this be the reason for the large difference in transmission rates? Is this caused by configuration, or what leads to the reduced timeslot allocation?

Log 1: Non-iOS device connecting to iOS

default 16:33:33.204715+0800 kernel wlan0:com.apple.p2p.nan0: Availability: map 0, channel 6 (20M), timeBmap: 1111 1111 1111 1111 0000 0000 0000 0000 1111 1111 1111 1111 ( ff ff 00 00 ff ff )
default 16:33:33.204792+0800 kernel wlan0:com.apple.p2p.nan0: Availability: map 1, channel 149 (80M), timeBmap: 1111 1111 1111 1111 0000 0000 0000 0000 1111 1111 1111 1111 ( ff ff 00 00 ff ff )

Log 2: iOS connecting to iOS

default 17:49:12.767874+0800 kernel 
wlan0:com.apple.p2p: Availability: map 0, channel 6 (20M), timeBmap: 1111 1111 1111 1111

To supplement:

iOS connecting to iOS log```

default	17:49:12.767874+0800	kernel	wlan0:com.apple.p2p: Availability: map 0, channel   6 (20M), timeBmap: 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 ( ff ff ff ff ff ff ff ff  )
default	17:49:12.767894+0800	kernel	wlan0:com.apple.p2p: Availability: map 1, channel 149 (80M), timeBmap: 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 1111 ( ff ff ff ff ff ff ff ff  )
We have successfully connected an iOS device with a non-iOS device via Wi-Fi Aware

Nice!

I know lots of folks have struggled to get that working, so I’m glad to hear of a success story.

we still have a throughput issue … sends an HTTP request over an already-established TCP connection

So, just to be clear, are you using URLSession for this? Or have you implemented your own HTTP protocol on top of Network framework?

Share and Enjoy

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

It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.

We implemented your own HTTP protocol on top of NetworkConnection.

OK, cool, that’s kinda what I expected but I’m glad you confirmed it.

We are very eager to send HTTP requests over Wi‑Fi Aware using URLSession — is this achievable?

No. I recommend that you file an enhancement request for that. Please post your bug number, just for the record.


Coming back to your throughput issue, I don’t have an immediate answer to that. I’m gonna do some digging and get back to you.

Share and Enjoy

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

Coming back to your throughput issue, let me start with a general comment and then return to the specifics of your case.

In general, the on-the-wire behaviour is going to vary based on the performance mode:

  • Realtime
  • Bulk

In the realtime mode (WAPerformanceMode.realtime), the behaviour is described by Figure 53-1 and its associated text in the Accessory Design Guidelines for Apple Devices, available from Developer > Accessories.

In bulk mode (.bulk) the behaviour is adaptive, with allocations ramping up as there’s more traffic.


Regarding your specific case, my understanding is that you’re in conversation with other folks at Apple about your product. I can’t discuss those details here on the forums, because this is a public environment. However, those folks asked me to remind you that the were hoping to get some logs from you. The best way to submit those is via Feedback Assistant.

Once your done, post your bug number here and I’ll pass it along.


Oh, and I also wanted to remind you about filing an ER against URLSession.

Share and Enjoy

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

Bug: Wi-Fi Aware (NAN) Subscriber Mode: nwPath.availableInterfaces Does Not Include nan0 Interface After Successful Peer Connection
 
 
Q