Wrong TCP window size when using Network Extensions.

We develope local vpn service. which developes own TCP network stack.

While network stack pushing packets into NEPacketTunnelFlow, we found some very odd behavior from apps.


Huge Window size

The window size that recived from app seems very huge, unlike other OS(like Android, Windows)

Calculated window size that we recived from Safari was almsot 2MBs




Dropped Packets

For unknown reasons, the app is dropping packets even we didn't sent over (even less than half) window size.

event the packet we sent over the window size. but app still does not emit any Zero-Windows. just dropping packets and sending dup-ACK


Have any ideas from this issues?


The testing environment was

iOS Version : 13.1.3

Device : IPhone XS Max

Replies

iOS, and Apple platforms in general, will often advertise very large windows. The exact approach used is… well… complex, and I must admit that I don’t fully understand it myself.

However, if you’re seeing iOS drop packets without closing the window, that’s somewhat strange and definitely needs investigation. Does this happen only when your packet tunnel provider is in play? Or does it happen without VPN?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"