Reply
Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

iOS disconnect headache

[ Edited ]

Scenario:

Existing customer moved to location where cellular service is non-existent.  No calls go in or out.  I quoted/installed him a 4 AP Unifi system and confirmed that WiFi calling did work on his iPhone's.  As he worked there getting ready he reported it worked great.  Then they moved and he called soon after saying he could never ring his wife on her iPhone.  It just didn't go through to the phone.  I started digging.  Read all the junk on the web.  Tried every solution I could find.  No dice.

 

I have 2 outdoor mesh AP's in the yard, 1 AC-Lite in the shop and 1 in the house.  Flawless handoff on my Android device in testing.  Initially the outdoor unit's ran dual band and the indoor units ran 5 Ghz only.

 

The wife's phone in all this stays in the house and so roaming/hopping to other AP's isn't in the picture.  This may as well be a single AP system I'm debugging/explaining.

 

Tonight I finally got really desperate.  I disabled the 5G on the AP, enabled the 2.4, and then started monitoring a few things. 

 

I got on the AP cli and ran 'watch -n 1 wlanconfig ath0 list sta' so I could see in real time if the phone was connected.

I connected another terminal to the AP and ran 'tcpdump -i ath0 host <ip-of-iphone>' so I could monitor traffic.  Users are all in bed, nothing but idle traffic going on.

I connected another terminal to the AP and started pinging the iPhone.  Incidentally the multi hour ping test came out at exactly 50% packet loss, from AP to iPhone.

 

3 hours later it's still connected.  Previous record for over a week is just over 2 hours, with the average connection time being around 20 minutes I'd guess.

 

I'm suspicious this all comes down to the iPhone turning it's WiFi off when it goes to sleep but really?  Do I have to tell my client that his iPhone just sucks and I can't fix it? (regardless of the fact that it's true...)

 

What I'd like to know is a little more about the information I've gathered.  There are 2 devices connected to this AP.  The problem iPhone and a computer.  The iPhone occasionally will disappear from the wlanconfig list for a second or 2 without showing a disconnect in the Unifi controller.  Might be an anamoly with wlanconfig.

 

Here is the wlanconfig output showing the computer (first line) and the iPhone (second line)

wlanconfig1.png

Here is an identical iPhone, same iOS version, same AP, (I had swapped AP's to test for a bad one, took it home to my test iPhone)

wlanconfig2.png

 

Why does the computer and my test iPhone have PSMODE numbers in hours and the problem iPhone keep resetting?

What is the state column?  Computer is always at "f", test iPhone is always at "1000000b", and problem iPhone cycles between "f" and "4001f".

MODE column is:   computer: PM, test iphone: AWQS,  problem iPhone: AP

 

At a connection time of 3 hours and 42 minutes, just now, I saw the wlanconfig list drop the iPhone for about 5 seconds.  Then with a burst of data on the tcpdump, it came back.

 

The same length ping test to my iPhone was 0% packet loss.  I think it missed 1 packet out of multiple thousand.  Same AP (before swap out), same iOS version.

 

I've spent way to many nights past midnight already on this problem.  I'd just love it if someone could skim through this and tell me, yeah, the iPhone is just going to sleep, nothing you can do about it.  What makes me nervous is I started looking at our other Unifi systems out there and seeing more iPads and iPhones doing this.  I'm desparately hoping it's just an iPhone issue, but then that still leaves me in the rough with this customer.  He has no other option.  Cellular is dead.  I guess we could go with a cellular booster but I hate the cheap ones and this $1k+ Unifi system was supposed to avoid that...

 

That saddest thing of all is that Apple and their users will never know the magic that we pull off just to keep their mistakes working.

 

i guess if it comes down to this, I'll create a separate SSID on 2.4 only just for that phone and hope I can balance the power right so it still works.  Leave all the rest of his devices on the dual band SSID.

 

I don't really expect anyone to answer this.  I just needed something to do while passing the hours away watching little black screens with white letters.  Svengo

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

Customer called, he's getting upset... 

New Member
Posts: 2
Registered: ‎03-09-2016
Kudos: 1

Re: iOS disconnect headache

I haven't seen any issues with the iPhones in my new setup (just cot over to a complete Unifi stack with an AP-HD).  Only one AP right now.  My iPad was showing similar symptoms (seemingly random protocol disconnects, while it still showed connected on the device).  I was not monitoring at the AP like you are, so I can't say if it's exactly the same problem.

 

After all the reading I did, I came to 2 conclusions, that I still don't completely understand (wireless is a new skillset for me).

 

1. Apple devices work well with a DTIM of 3.  Default value on Unifi is 1.  

2. Fast Roaming does not appear to be properly implemented in iOS.  Single AP, I understand - I'm in the same boat.  

 

So I changed the DTIM value on both the 2G and 5G bands, and disabled fast roaming on my wireless network, and the issues I was seeing with my iPad Pro went away.

 

If I only change the DTIM, the issue comes back, although not quite as frequently.

 

If I only change fast roaming, the issue comes back, although not quite as frequently. (could be that I've got band steering enabled on the AP)

 

It took changing both to resolve the symptom.  

 

*shrug* it might help

 

-jk

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

Fast roaming is off, DTIM is on 3, Band Steering is off.

 

Last night I dropped a test iPhone 6 running iOS 11.2.6 there (same iOS version as client).  It's been connected for 14 hours without a disconnect.  It even cycled from one AP to another as I upgraded the APs.

 

There is a Windows PC, printer, Android phone, and now this iPhone there that do not have connection issues.  The clients 2 iPhones won't stay connected for more than a few minutes on average.  Longest uptime is ~2 hours.

 

We've reached the end here.  I'm going to have to tell the customer it's his devices.  Which won't make him happy but I don't know what else to do.  Price you pay for having the best (gag).

 

 

Only thing that worries me is our other Unifi sites I've looked at where the clients are Apple users.  I see a couple more that are dealing with this.  But I also see sites where there are no issues, iOS connections last for 12+ hours, until the clients actually leaves the site.  Same iOS devices and versions.

New Member
Posts: 2
Registered: ‎03-09-2016
Kudos: 1

Re: iOS disconnect headache

That really blows.  The great thing about standards is that there are so many to choose from :-)

 

I've had to deal with interop for a long time (as I'm sure you have, as well).  It's always frustrating to run into brick walls like this.  It's unfortunate that some devices just don't play well with others.

Established Member
Posts: 1,945
Registered: ‎01-30-2016
Kudos: 995
Solutions: 244

Re: iOS disconnect headache

Luckily I've yet to see this issue at my site. Almost only Apple stuff.

Found this:

http://www.iphonehacks.com/2017/09/fix-ios-11-wifi-problems.html

 

Someone reports that a complete restore of iOS has helped.

 

Please give kudo's to the people who have helped you and mark your thread as solved when you receive a solution to your issue.
For a deeper understanding on how WiFi works.
Certified UEWA, ACSP, ACTC
Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache


@osunifiwrote:

Luckily I've yet to see this issue at my site. Almost only Apple stuff.

Found this:

http://www.iphonehacks.com/2017/09/fix-ios-11-wifi-problems.html

 

Someone reports that a complete restore of iOS has helped.

 


Thanks.  I've been there to that very link.  Done everything but the complete restore.  It's the clients phone so I'm not doing that for them.  Only suggested it needed to be done before we closed the case.

New Member
Posts: 2
Registered: ‎04-09-2016

Re: iOS disconnect headache

Hi Trendal,

 

I read your message, and remembered a setting of a DrayTek accesspoint (AP900) I used for yours.

The setting was called 'Apple iOS Keep Alive'.

 

Description of this setting in the user manual:

'To keep the wireless connection (via Wi-Fi) on iOS device in alive, VigorAP 900 will send the UDP packets with 5353 port to the specific IP every five seconds.'

 

There were several IOS devices connected to the AP900, but I never activated this setting. I had no issues.

 

Hope it helps,

Peter

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache


@PeterHofstedewrote:

Hi Trendal,

 

I read your message, and remembered a setting of a DrayTek accesspoint (AP900) I used for yours.

The setting was called 'Apple iOS Keep Alive'.

 

Description of this setting in the user manual:

'To keep the wireless connection (via Wi-Fi) on iOS device in alive, VigorAP 900 will send the UDP packets with 5353 port to the specific IP every five seconds.'

 

There were several IOS devices connected to the AP900, but I never activated this setting. I had no issues.

 

Hope it helps,

Peter


Thanks.

 

I tried ICMP and that didn't work.  The iPhone continued to disconnect.  I hit it with ICMP for a couple hours.  50% packet loss.  I think I mentioned it in the OP.

Member
Posts: 151
Registered: ‎02-23-2012
Kudos: 76
Solutions: 5

Re: iOS disconnect headache

Is the problem that the wife cannot receive (as well as place?) any calls via the Wi-Fi calling feature on her iPhone? When the place was being built, was the husband the only person on the site using the Wi-Fi calling service?

 

I'm wondering if they are provisioned on the same cellular carrier and whatever your gateway device is cannot manage NAT traversal for both of the tunnels (ports used are here https://support.apple.com/et-ee/HT202944).

 

Are you seeing UDP traffic outbound to port 500 and 4500 from both devices? Try NATing each to a different public IP if you have that option.

 

I think looking at what the devices do while they're asleep is throwing you off here - if the phone is awake (screen on), connected to Wi-Fi, the Wi-Fi calling feature is registered, and calls don't work then I don't think this is a wireless problem.

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache


@JonnyMwrote:

Is the problem that the wife cannot receive (as well as place?) any calls via the Wi-Fi calling feature on her iPhone? When the place was being built, was the husband the only person on the site using the Wi-Fi calling service?

 

I'm wondering if they are provisioned on the same cellular carrier and whatever your gateway device is cannot manage NAT traversal for both of the tunnels (ports used are here https://support.apple.com/et-ee/HT202944).

 

Are you seeing UDP traffic outbound to port 500 and 4500 from both devices? Try NATing each to a different public IP if you have that option.

 

I think looking at what the devices do while they're asleep is throwing you off here - if the phone is awake (screen on), connected to Wi-Fi, the Wi-Fi calling feature is registered, and calls don't work then I don't think this is a wireless problem.


Appreciate the suggestions but the only reason I used the nighttime to diagnose was because then I know they are not actually leaving the location.  The disconnects continue night and day regardless.

 

I'm willing to consider there may be issues with WiFi calling but if I can't maintain a connection between the AP and the WiFi radio in the phone then no amount of diagnostics on the WiFi calling protocol is going to fix the issue.  You gotta start with the deepest level of failure and work out from there.

Member
Posts: 151
Registered: ‎02-23-2012
Kudos: 76
Solutions: 5

Re: iOS disconnect headache

It wasn't clear from your response that the device was struggling to maintain a Wi-Fi connection while it was in use - just that you were running pings to it overnight while it was idle and some of them were dropping. That isn't unexpected behaviour for a portable device.

Can you run a ping to both users phones at the same time overnight when they are just sat there not being used? If you can observe different behaviour then this is surely the evidence you need to push back to your customer to let them know that you've isolated the issue to the phone and are confident it's not your Wi-Fi installation.

What's the U-APSD status of your radios?
Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache


@JonnyMwrote:
It wasn't clear from your response that the device was struggling to maintain a Wi-Fi connection while it was in use - just that you were running pings to it overnight while it was idle and some of them were dropping. That isn't unexpected behaviour for a portable device.

Can you run a ping to both users phones at the same time overnight when they are just sat there not being used? If you can observe different behaviour then this is surely the evidence you need to push back to your customer to let them know that you've isolated the issue to the phone and are confident it's not your Wi-Fi installation.

What's the U-APSD status of your radios?

@JonnyM

No worries.  I'm sure there is a lot not clear when I post.

 

Pinging both devices at once might show something but the wife leaves her phone on at night, he doesn't.  So I have to do that during the day and he is in and out a lot.  

Just from observing they go off at random times.  Not related to each other.

Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 394
Solutions: 51

Re: iOS disconnect headache

Is there any chance at all that the phone's picking up a cellular signal, no matter how weak or short lived? The reason I ask is that a locked iPhone will turn WiFi off soon after it gets a cellular signal.

 

On my iPhone if I leave a ping going it will stop a few seconds after the iPhone's screen turns off, tapping the screen to wake the phone will bring the ping replies back for a while until it sleeps again.

 

If I turn off the cellular radio the ping replies keep coming indefinitely. A tcpdump also shows 'isakmp-nat-keep-alive' packets to port 4500 every 20 seconds coming from the WiFi-calling system.

 

If your client's cooperative I'd be tempted to ask them to switch off the cellular radio and see if you notice a change in behaviour.

 

I've also noticed iPhones aren't fond of short DHCP leases - things like ActiveSync email stops working. It does have to be very short (less than 2 hours) before this happens, but that might be something to check.

If you found this post helpful feel free to sprinkle some Kudos!
Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache


@AndyWrightUKwrote:

Is there any chance at all that the phone's picking up a cellular signal, no matter how weak or short lived? The reason I ask is that a locked iPhone will turn WiFi off soon after it gets a cellular signal.

 

On my iPhone if I leave a ping going it will stop a few seconds after the iPhone's screen turns off, tapping the screen to wake the phone will bring the ping replies back for a while until it sleeps again.

 

If I turn off the cellular radio the ping replies keep coming indefinitely. A tcpdump also shows 'isakmp-nat-keep-alive' packets to port 4500 every 20 seconds coming from the WiFi-calling system.

 

If your client's cooperative I'd be tempted to ask them to switch off the cellular radio and see if you notice a change in behaviour.

 

I've also noticed iPhones aren't fond of short DHCP leases - things like ActiveSync email stops working. It does have to be very short (less than 2 hours) before this happens, but that might be something to check.


Thanks, that is something I hadn't thought about.  My test iPhone is not on a cellular carrier.  I'll see if I can get them to turn their iPhone onto airplane mode tonight and see what it does.

Established Member
Posts: 860
Registered: ‎09-01-2014
Kudos: 394
Solutions: 51

Re: iOS disconnect headache

ok - Airplane mode but they'll then need to separately re-enable WiFi 

 

Or on iOS11's control panel there's an icon just for cellular that doesn't affect WiFi.

If you found this post helpful feel free to sprinkle some Kudos!
Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

Got it, thanks, I wasn't sure what iOS had for options but figured airplane mode + WiFi would be one of them. 

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

To be clear, this area is in Verizon's "full coverage" area.  But like so many places out here, this is a hole that has nothing.  If you stand exactly in the right place in a couple acre area you can make a call sometimes.   So it's very possible the phones are getting signal. 

 

Thanks for the port info, I'll trap some data so I can see if the WiFi calling is behaving when it is connected. 

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

@AndyWrightUK

 

So much for that.  Turned on airplane mode, made sure the phone was connected to WiFi and about 5 minutes later it disconnected.  It was off for 8 minutes before it reconnected on it's own.  

 

iPhone is at 71 dBm, 144/78 Mbps rates, not being used, just sitting there.

 

Maybe that disconnect was a fluke, we left it on WiFi only and we'll see how it acts through the night.  But I give it less than a 1% chance of working.

Established Member
Posts: 1,741
Registered: ‎03-23-2013
Kudos: 265
Solutions: 57

Re: iOS disconnect headache

So, tcpdump on the AP it's connected to shows the iPhone pushing some UDP every ~20 seconds to port ...myvzw.com:4500,  for a while.  Then it quits.  

 

Several minutes later it comes back on.   wlanconfig continous scan going on the AP confirms that the iPhone disconnected for that same interval.

 

The confusing part is, the iPhone will randomly not respond to ICMP.  It of course won't when it's not connected but in between times it goes for many minutes not replying to ICMP.  I would say 75% of the time it shows connected to the AP it won't respond to ICMP.  But then suddenly it decides to for a while.  When it's connected to the AP it's connected (currently) on channel 153 at -68 dB, rates are 144/57.  Plenty good enough connection to respond to ICMP.

 

 

Reply