Go To Sleep, Go To Sleep, Go To Sleep Little iPhone

In some circles, Apple Wi-Fi devices are knows to have problems with lost connections.  iPhones and iPads will unexpectedly miss incoming calls, have delays in receiving push notifications and even be forced to reauthenticate.

There is a solution to Apple devices' connection problems, and as with most "device problems", the fix resides on the infrastructure.  The DTIM setting needs to be increased.  (Apple recommends a setting of 3 or higher.)  Here's why:

Some Apple Wi-Fi connection problems stem from Apple iOS devices' use of 802.11 power management.  To understand what Apple devices are doing with power management, one must first understand how 802.11 power management works.

Let's start with unicast data.  The 802.11 standard allows devices' Wi-Fi radios to enter the Doze state in order to conserve battery life.  Wi-Fi radios in the Doze state are unable to receive data from the AP, so APs buffer all unicast data that has a destination MAC address of a device that's in the Doze state.

This works just fine on Apple iOS devices, as my seen in a capture of my iPhone 6S:

Broadcast and multicast data is different from unicast data.  APs send broadcasts and multicasts once for the entire basic service set (BSS, which means all of the devices that are connected to any single SSID on any single AP).  

The 802.11 standard handles the transmission of broadcasts and multicasts to sleeping device radios by giving devices a timer for waking up.  This timer is called the DTIM (delivery traffic indication message).  Every AP beacon indicates how much time is expected to elapse before the next DTIM.  Immediately after sending a DTIM, the AP will send all broadcasts and multicasts that have been held in the AP's buffer.  Devices have the option of waking their Wi-Fi radios in time to receive the DTIM and the broadcast & multicast data that follows.  Devices can then go back to sleep after receiving broadcasts and multicasts.

The problem, at least as Apple sees it, is that battery life is more important than broadcast/multicast latency.  Apple doesn't want iOS devices to have to wake up for every DTIM because waking requires more power than sleeping.  If an iPhone's Wi-Fi radio wakes up ten times per second, that drains more of the iPhone's battery than if the radio wakes up three times per second.

Apple has chosen to preserve battery life for iOS devices by waking up less often, but there is a cost.  If an AP sends DTIMs and empties its buffer of broadcasts & multicasts more often than an iPhone wakes up, then the iPhone will miss some broadcast and multicast traffic.  

You can see my iPhone 6S missing broadcasts & multicasts in Wireshark.  

Here's my iPhone's wake/sleep pattern:

Before my iPhone goes to sleep, it sends a Null Data frame to the AP.  Wireshark labeled this frame number 18392.  When my iPhone wakes up, it sends another Null Data frame to the AP.  The wake-up frame was labeled by Wireshark as number 18494.  (I filtered out everything except for Null Data frames for the screenshot above.)

While my iPhone was sleeping, the AP sent out a broadcast:

Notice how the broadcast is labeled by Wireshark as number 18493.  My phone indicated that it was awake with frame 18494.  So, my phone probably* missed that broadcast.

(*I say "probably" because it's impossible to tell the exact microsecond that my phone stopped sleeping.  It's possible that my phone woke up and then waited to send a Null Data frame telling the AP that it was awake.  It wouldn't make any sense for a Wi-Fi device to wait to tell the AP that it's awake, but it's possible.)

All of this is red meat to the Wi-Fi community's populace of device-blamers (of which I am most certainly not a member).  If you love blaming your bad Wi-Fi on devices, feel free to print out this blog and frame it.  The AP is explicitly telling the iPhone when DTIMs (followed by broadcasts and multicasts) will be transmitted, as seen here:

Every single Beacon with a DTIM count of 0 is a DTIM Beacon.  Every Beacon with a DTIM count of 1 is telling my iPhone that the next Beacon will be a DTIM Beacon.  The iPhone 6S surely sees all of this, but it decides to sleep through broadcasts and multicasts anyway.

I look at the iPhone's sleep patterns a different way.  I love long battery life.  (Because I think that users love long battery life.)  If Apple wants to have iPhone sleep through DTIMs -- which is permitted in the 802.11 Standard, mind you -- then I say let them do it.  We, as Wi-Fi folks, need to adjust our infrastructure to allow these iPhones to maximize battery life without missing too many broadcasts and multicasts.

If you want to minimize the likelihood of iOS devices missing broadcast and multicast data, you can raise the DTIM setting on your APs.  Apple recommends a DTIM setting of at least 3 (thanks to Andrew Von Nagy of Revolution Wi-Fi for tipping me off to that on Twitter), which would give devices the ability to sleep for up to 300 kilo-microseconds without missing and broadcast or multicast data.  Raising the DTIM setting could prevent users from experiencing missed Wi-Fi calls, repeated re-authentications and other known connection issues on Apple iOS devices.

If you like my blog, you can support it by shopping through my Amazon link.  You can also donate Bitcoin to 1N8m1o9phSkFXpa9VUrMVHx4LJWfratseU 

Twitter: @Ben_SniffWiFi
ben at sniffwifi dot com


  1. Ben, do you have the source of where Andrew found the information on Apples' recommendation?


  2. Regarding the comment - "Before my iPhone goes to sleep, it sends a Null Data frame to the AP. Wireshark labeled this frame number 18392. When my iPhone wakes up, it sends another Null Data frame to the AP. The wake-up frame was labeled by Wireshark as number 18494"

    I just wanted to clarify one thing - Data Null (PM=1) and Data Null (PM=0) should not be considered precise markers of when Phone is asleep or awake. They are really the markers for when Phone is asking the AP to start/stop buffering unicast data. A phone could very well be awake in between to receive the MCAST/BCAST traffic. A Data Null (PM=0) needs to sent only when Phone wants AP to start delivering any buffered unicast data.

    But In general , I agree with core message here which is IPhone sleeps for a longer interval to save battery at the cost of missing some of the BCAST/MCAST traffic

    1. Absolutely, Kumar. Still, I would say that it is unlikely that Apple is keeping iPhone Wi-Fi radios awake in between Null data frames. Why lose all of that battery life?

  3. This comment has been removed by a blog administrator.

  4. So, current issues with iPhone and other iOS devices with newer versions continue. I set DTIM at 3 and phones still dropped Internet (although still connected to network and getting DHCP). Tried it all the way to 125 and connectivity is better, but will eventually drop again. There has to be a magic number where the timing between the iOS sleep and the ACK request are in sync. Anyone figured this out yet?

    1. Depending on the app you need to run, keeping iPhones connected can be more complicated than adjusting the DTIM.

  5. This comment has been removed by a blog administrator.

  6. Have you ever used services from https://idsbuddy.com/how-to-take-fake-id-photo? A really easy format to get passport picture and very fast response to my questions via email.

  7. The blog was absolutely fantastic. Keep updating the blog, looking forward for more content...Great job, keep it up. but let me introduce an organization named Lifecare Solutions is a NDIS registered service provider. Life care solutions offer the best quality of NDIS services in Melbourne, Adelaide, Coburg, Victoria, Brunswick, Carlton, Fawkner, Reservoir, Preston, Broad meadows and Craigieburn to ensure a better quality of life for everyone fighting unique challenges.

  8. Actually I read it yesterday I looked at most of your posts but I had some ideas about it . This article is probably where I got the most useful information for my research and today I wanted to read it again because it is so well written.
    Data Science Course in Bangalore

  9. Every human being can sleep in peace except to students, they can't sleep in peace until they have assurance about the completion of their scholarly tasks. In such a situation, there is no attraction for students in electronic devices. Experts of Assignment Writing Services are the best helper that can complete students' academic writing tasks.

  10. Compre documentos en línea, documentos originales y registrados.
    Acerca de Permisodeespana, algunos dicen que somos los solucionadores de problemas, mientras que otros se refieren a nosotros como vendedores de soluciones. Contamos con cientos de clientes satisfechos a nivel mundial. Hacemos documentos falsos autorizados y aprobados como Permiso de Residencia Español, DNI, Pasaporte Español y Licencia de Conducir Española. Somos los fabricantes y proveedores de primer nivel de estos documentos, reconocidos a nivel mundial.

    Comprar permiso de residencia,
    permiso de residenciareal y falso en línea,
    Compre licencia de conducir en línea,
    Compre una licencia de conducir española falsa en línea,
    Comprar tarjeta de identificación,
    Licencia de conducir real y falsa,
    Compre pasaporte real en línea,

    Visit Here fpr more information. :- https://permisodeespana.com/licencia-de-conducir-espanola/
    Address: 56 Guild Street, London, EC4A 3WU (UK)
    Email: contact@permisodeespana.com
    WhatsApp: +443455280186

  11. Plumbing & HVAC Services San Diego
    Air Star Heating guarantees reliability and quality for all equipment and services
    Air Star Heating is specializing in providing top-quality heating, ventilating, air conditioning, and plumbing services to our customers and clients.
    Our company is leading the market right now. By using our seamless and huge array of services. Our customers can now have the privilege of taking benefit from our services very easily and swiftly. To cope up with the desires and needs of our clients we have built an excellent reputation. We are already having a huge list of satisfied customers that seem to be very pleased with our services.

    Plumbing & HVAC Services in San Diego. Call now (858) 900-9977 ✓Licensed & Insured ✓Certified Experts ✓Same Day Appointment ✓Original Parts Only ✓Warranty On Every Job.
    Visit:- https://airstarheating.com

  12. Thanks for posting the best information and the blog is very helpful.data science institutes in hyderabad

  13. I see some amazingly important and kept up to a length of your strength searching for in your on the site

    Best Data Science courses in Hyderabad

  14. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.
    Data Science Course in Bangalore

  15. i am glad to discover this page : i have to thank you for the time i spent on this especially great reading !! i really liked each part and also bookmarked you for new information on your site.
    best data science courses in bangalore

  16. Very awesome!!! When I searched for this I found this website at the top of all blogs in search engines.
    digital marketing courses in hyderabad with placement


Post a Comment

Popular posts from this blog

Why Are You Slowing Down My WiFi, Apple? To Make Things Better?

Why You Should Stop Disabling Low Wi-Fi Rates, Illustrated