Frequent sleep and wake events in the Tunnel Provider

Hi!

We are investigating the power consumption of our VPN app on iOS. We noticed that while the VPN tunnel is started, we frequently experience sleep and wake events. Depending on the device it varies somewhere between 60 - 600 times during an overnight test where the device is just laying around and doing absolutely nothing.

I looked into the system logs, and the wake reason is always this one:

2024-03-01 03:09:00.836588+0200 0x35e96 Default 0x0 50 7 wifid: (WiFiPolicy) [com.apple.WiFiPolicy:] System wake reason: SMC.OutboxNotEmpty smc.70070000 baseband

I googled what OutboxNotEmpty means, but I only found several macOS-related topics. Interestingly, when I leave the same phone without a VPN running, I don't see the above log even once during an overnight test.

I also tested a different VPN app and saw the above log in the system logs. This makes me think this is either some iOS feature I don't understand or some bug that causes frequent wakeups.

I'd appreciate any feedback if this is a known issue or if we need to do something differently within our tunnel implementation.

I'm not an expert on the sleep wake cycles of the device but it looks like these are events that are available for processing. Does this happen when the device is not connected to power? Is this causing a power impact for the device? For example, are you able to measure some sort of battery drain that you believe is caused by this?

Hey!

Does this happen when the device is not connected to power?

Yes, it does. I'm not worried about the scenario when the device is connected to the power. I checked, and the wakeups happen in both scenarios. More often when connected to the power source and less often when disconnected.

For example, are you able to measure some sort of battery drain that you believe is caused by this?

Yes, I can measure the battery drain caused by this, and the impact is evident when the device is on the cellular network. Example results came from overnight tests when the device was just lying untouched and being on cellular:

iPhone 13 mini:

  • 13 mA of average power consumption with VPN off
  • 35 mA of average power consumption with VPN on and hundreds of wake/sleep cycles

iPad Air 5th gen:

  • 22 mA of average power consumption with VPN off
  • 38 mA of average power consumption with VPN on and hundreds of wake/sleep cycles

This is a significant increase, and I'm concerned about what can cause such wake/sleep cycles on the device. Also, the results do not come from a single test; I realize that the device might do some updates, indexing, and other things like that overnight. I couldn't believe my results, so I repeated those tests many times, and the results were unequivocal.

Interesting, thank you for that report. I would capture this in a bug report and make sure to include those numbers in your report as well as the test conditions. Since this is more of a power and performance bug than Networking, any power traces with Instruments or sysdiagnoses that you have with the tests above would also be helpful to attach to your bug report.

Frequent sleep and wake events in the Tunnel Provider
 
 
Q