Network Framework

Environment - Monterey 12.0.1, Xcode 13.1, iOS 15.1

We have been using the Network Framework successfully until now, where on iOS 15.1 the network connection goes to the 'preparing' state and takes more than a minute to move to the 'ready' state. Our app is supporting minimum iOS 14.1 and this issue only occurs on some of our devices [iPhone X]. Is there anything that we need to change/update in order to resolve this issue.

Is there anything that we need to change/update in order to resolve this issue.

Nothing springs to mind. What protocol are you using? Is it on device? Off device but to the local network? Off device to the wider Internet? And what does a packet trace show?

ps For more information about packet traces, see Recording a Packet Trace.

Share and Enjoy

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

We are using TCP. The connection is off iDevice to our hardware device.

I tried to do a packet trace but after running the 'rvictl -s ' command the connection succeeds to the iPhone but drops after 10-15 secs.

It shows up in the list and then disappears. I use 'ifconfig -l' to check.

Also, the issue is intermittent. Sometimes, the socket connection works without any failures and at other times it just refuses to connect or takes an unreasonably long time to succeed [upto 60 secs].

We are using TCP. The connection is off iDevice to our hardware device.

So, just to be clear:

  • You have a Wi-Fi based accessory.

  • And an app on an iOS device.

  • Both the iOS device and your accessory are on the same Wi-Fi network.

  • You are using NWConnection to make a TCP connection from your app to your accessory.

Is that correct?

Is the Wi-Fi network provided by your accessory? Or are both STAs [1] on the same Wi-Fi provided by an unrelated AP?

Share and Enjoy

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

[1] Using terms from Wi-Fi Fundamentals here.

Yes. Those 4 points are correct.

We have the Wi-Fi network provided by our accessory. It is using an ESP32 to provide the AP and Wi-Fi services.

We first started noticing the issue after upgrading to iOS 15.1. We notice different results across 3 iPhone X's.

We have the Wi-Fi network provided by our accessory.

OK.

There are a bunch of possibilities here:

  • Things could be breaking down at the link layer. For example, the iOS device could be falling off your accessory’s network.

  • Things could be breaking down at the IP layer. For example, something is blocking IP (or ARP [1]).

  • Things could be failing at the application layer on either your client and server.

You need to find a way to tease these apart. RVI is a key weapon in your arsenal here. Earlier you wrote:

I tried to do a packet trace but after running the rvictl -s command the connection succeeds to the iPhone but drops after 10-15 secs.

Can you clarify what you mean by “the connection”? Are you referring to the RVI connection? Or the TCP connection? I suspect the former, but I just want to be sure.

Also, when you make your TCP connection, what type of endpoint do you target? A Bonjour service type? A DNS name? An IP address? And is this running over IPv4 or IPv6?

Can you run a Wi-Fi level packet trace on your accessory?

If not, can you set the accessory to use no password and pin it to a specific channel? If so, you should be able to run an Wi-Fi level packet trace on your Mac. See Recording a Wi-Fi Packet Trace.

Share and Enjoy

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

[1] Technically not IP but I’m going to gloss over that for the moment.

RVI is a key weapon in your arsenal here.

And it seems that this weapon is a tad blunt on current systems. Fortunately we’re in the process of resharpening it (-: See this post for the details.

Share and Enjoy

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

Network Framework
 
 
Q