Skip to content

iOS client tears down the tunnel during large uploads; macOS client on the same network and same upload does not #21355

Open

Description

@Inhum

What is the issue?

On the same residential Wi-Fi, in the same tailnet, performing the same operation — sending a large photo or video from a messaging app whose traffic is routed through an app connector:

  • macOS client: the upload completes.
  • iOS client: the tunnel stops passing traffic and is then stopped by the system.

On iOS:

  • The failure happens while a large upload is in progress.
  • Small traffic continues to pass at the same time: text messages, ICMP between tailnet peers.
  • Retrying the upload usually succeeds, but noticeably slower.
  • Recovery usually requires a network change on the device (e.g. toggling airplane mode).
  • Reproduces on residential Wi-Fi and on a mobile carrier network.
  • Reproduces with an exit node selected and with exit node set to None.

What is expected?

The iOS client completes large uploads through the tunnel, as the macOS client does on the same network, and the Network Extension is not stopped.

Steps to reproduce

  1. iOS device and macOS device on the same residential Wi-Fi, same tailnet, same user; tailnet with two app connectors (configuration size below).
  2. Exit node: None (also reproduces with an exit node selected).
  3. On macOS, send a large video from the messaging app's desktop client. It completes.
  4. On iOS, send a large photo or video from the same messaging app. The upload stalls and the client logs stopTunnel with NEProviderStopReason.rawValue = 17.

Are there any recent changes that introduced the issue?

No known regression date.

OS / versions

iOS client macOS client
Device iPhone 13 MacBook Air (M1)
OS iOS 18.7.8 (22H352) macOS
Tailscale 1.102.3 when the log below was captured; now 1.102.4 1.102.4

App connectors: Linux, Tailscale 1.102.3.

Tailnet configuration (orders of magnitude)

  • 2 app connectors; 36 app connector blocks in the policy, ~230 domains, ~210 static CIDRs.
  • App connectors advertise ~2900 routes in total.
  • Routes installed on the macOS client (netstat -rn, Tailscale utun interface): ~1550 IPv4 / ~44 IPv6 in one measurement, ~1730 IPv4 / ~9 IPv6 in a later one.
  • Difference between exit node = None and an exit node selected, on the macOS client: 6 routes (~1551 vs ~1557 IPv4).

Collected data

iOS client log around the failure. Local timestamps; addresses and node identifiers replaced with placeholders.

09:22:30  control: PollNetMap: read tcp [<client-ipv6>]:57354->[<control-plane-ipv6>]:443:
          read: connection reset by peer
09:22:30  control: mapRoutine: backoff: 8 msec
09:22:30  control: controlhttp: forcing port 443 dial due to re...
09:22:31  control: controlhttp: succeeded dialing "controlplane.t..."
09:22:31  control: netmap: got new dial plan from control
09:22:31  control: new network map (periodic)
09:22:31  netmap diff: (none)
09:22:33  gui: [ipnBus] - Stopping IPN Watch Session  (x2)
09:22:34  wg: [<peer-1>] - Sending handshake initiation / Received handshake response
09:22:38  wg: [<peer-2>] - Received handshake initiation / Sending handshake response
09:22:38  Accept: ICMPv4{<peer-2-ip>:0 > <this-device-ip>:0} 84
09:22:38  Accept: ICMPv4{<this-device-ip>:0 > <peer-2-ip>:0} 84
09:22:39  open-conn-track: timeout opening (TCP <this-device-ip>:57365 => ...)
09:22:41  swiftNetMon: Path evaluated - unchanged
09:22:43  stopTunnel: "unhandled reason, NEProviderStopReason.rawValue = 17"
09:22:43  Persistency maintained for stop reason unhandled reason
09:22:43  LinkChange: minor
09:22:43  swiftNetMon: Path evaluated - unchanged
09:22:43  network update from Swift: connected=true, expensive=false
09:22:43  wg: Failed to write packets to TUN device: write /dev/tun: destination address required
09:22:44  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
09:22:45  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
09:22:46  wg: Failed to write packets to TUN device: write /dev/tun: bad file descriptor
09:22:48  wg: [<peer-2>] - Receiving keepalive packet
  • Sequence: control connection reset → successful re-dial, netmap diff empty → WireGuard handshakes → ICMP through the tailnet accepted in both directions → open-conn-track timeout → stopTunnel.
  • 17 is NEProviderStopReasonInternalError (per NEProvider.h in the iOS SDK; available since iOS 18.1 / macOS 15.1). The client logs it as an unhandled reason.
  • swiftNetMon reports the path unchanged before and after the stop.
  • Extension memory in this log: 32.0–32.5 MB throughout.
  • A full bug report can be provided on request.

macOS client, same residential Wi-Fi:

  • Tunnel interface MTU: 1280. Largest DF ICMP packet through the tunnel to an app connector's tailnet address: 1280 bytes (1281 fails).
  • Physical path MTU: DF ping (ping -D) with 1300, 1400 and 1500-byte packets succeeds to the app connector's public address and to two unrelated public hosts; 1500 bytes passes to all three.
  • Peer connection: both app connectors reached via DERP relay; tailscale ping reports direct connection not established.
  • tailscale netcheck: UDP: true, IPv4: yes, IPv6: no, but OS has support, MappingVariesByDestIP: false, CaptivePortal: false, nearest DERP ~65 ms.
  • Control upload: a ~14 MB video sent from the messaging app's desktop client, routed via the same app connector. Sampled every ~2 s: ~16.7 MB of tunnel tx to the connector in ~12 s, no ICMP loss to the connector, backend state Running throughout. The upload completed.

iOS client, not collected: tunnel interface MTU and peer connection type (direct vs relay).

  • iOS client tunnel MTU: not visible in client logs; the shared Go default (net/tstun) is 1280, the value applied by the iOS app was not verified.

What was ruled out (measurements)

  • Network Extension crash: no IPNExtension-*.ips entries in device analytics since 2026-08-01, while failures occur daily.
  • Jetsam kill: 14 JetsamEvent-* files over ~9.5 months (about one per 20 days). No jetsam event at the time of the failure shown above. In the two parsed events (2026-09-06, 2026-09-14) the killed process was SpringBoard (per-process-limit); nesessionmanager (7–10 MB) and IPNExtension (21–32 MB) were alive.
  • Route count difference between modes: exit node vs None differs by 6 routes out of ~1551; both modes reproduce.
  • Physical path MTU on the shared residential Wi-Fi: 1500 bytes (measured from the macOS client).
  • Other VPN configuration on iOS: VPN On Demand disabled in the client; no other VPN profile on the device.

Activity

  1. added
    OS-ios
    bug
    on Sep 17, 2026
  2. added theissue type on Sep 17, 2026
  3. Inhum commented on Sep 18, 2026

    @Inhum
    Author

    Additional observation: the failure is direction-specific.

    Downloading large files (photos and videos, hundreds of MB) over the
    tunnel from the same app works reliably — the tunnel stays up for the
    whole transfer. Sending fails: the tunnel is torn down after the second
    photo, usually within seconds of starting the upload.

    Same device, same app, same tunnel, same session — only the direction
    of the transfer differs.

    I have not tested whether the threshold is the number of files or the
    total size; I will follow up once I have.

  4. Inhum commented on Nov 3, 2026

    @Inhum
    Author

    Update: fresh reproduction on iPhone 13, iOS 18.7.8 (22H352), Tailscale 1.104.4 on November 3, 2026.

    The earlier statement in this issue that jetsam was ruled out was incorrect. It relied on the absence of a separate JetsamEvent report. The upload/direction-specific framing was also incomplete: I can reproduce the tunnel drop by opening the stock Camera app, without sending anything.

    This time I captured the iPhone's live Console log and a subsequent sysdiagnose. During the Camera reproduction, the kernel killed nesessionmanager three times:

    22:53:31.009686 kernel: memorystatus: killing_highwater_process pid 27116 [nesessionmanager] (highwater 140 282s rf:-) 8224KB
    22:53:31.701781 kernel: memorystatus: killing_highwater_process pid 27161 [nesessionmanager] (highwater 10 0s rf:-) 7280KB
    22:53:44.109234 kernel: memorystatus: killing_highwater_process pid 27164 [nesessionmanager] (highwater 140 2s rf:-) 7088KB
    

    All times are local, UTC+5. The lines above are shortened; the original messages also contain available-page/compressor counts. nehelper was also killed twice. IPNExtension logged stopTunnel with raw value 17. After an intermediate reconnection followed by another kill, Tailscale reached connected at 22:53:54.150907, about 23 seconds after the first kill.

    Following the discussion with @luben93 in #17967, I checked the provider lifecycle in the same sysdiagnose. The archive contains:

    22:48:37.579 IPNExtension[26335]: Persistency maintained for stop reason unhandled reason, NEProviderStopReason.rawValue = 17
    22:53:31.072 IPNExtension[27117]: Persistency maintained for stop reason unhandled reason, NEProviderStopReason.rawValue = 17
    22:53:44.119 IPNExtension[27166]: Persistency maintained for stop reason unhandled reason, NEProviderStopReason.rawValue = 17
    

    The later process snapshot still contains all three of those PIDs as suspended. A new provider, PID 27171, was started for the restored tunnel. In total there are eight IPNExtension processes, all identified as io.tailscale.ipn.ios.network-extension, version 1.104.4: those three suspended providers, four older non-suspended instances launched on October 31–November 1, and the latest provider. Their roles beyond the observed lifecycle are not established; I am not treating this as proof of a leak or eight active tunnels.

    After more than five minutes with Camera closed and the tunnel connected, jetsam_priority.csv at 23:11:04 shows:

    • nesessionmanager PID 27169: footprint 8464 KB, peak 11584 KB.
    • No new nesessionmanager starts/kills or DNS-driven settings-reapply messages were found in the filtered 23:05–23:11 archive interval.

    This establishes the system-daemon highwater kill for this reproduction, but does not explain why its footprint is elevated. It also does not prove that the retained extensions cause the daemon's memory usage, or that their Go backends remain running while suspended.

    Could the iOS team clarify:

    1. Is retaining persistency for .internalError (17) expected after the system daemon dies?
    2. Is it expected for the stopped provider processes above to remain suspended while a replacement provider runs, and for older non-suspended instances to remain present?
    3. What targeted data would distinguish an iOS NetworkExtension lifecycle issue from Tailscale's stop/recovery handling?

    The public Go shutdown paths exist, but I cannot verify whether the closed iOS wrapper invokes them for this stop reason. I am not assuming the UDP receive recovery in #22084 fixes this highwater/stopTunnel case.

  5. Inhum commented on Nov 4, 2026

    @Inhum
    Author

    Retested on November 4, 2026 after the automatic update to Tailscale 1.104.5 on the same iPhone 13 (iOS 18.7.8). The Camera-triggered tunnel drop still occurs. No settings were changed for this test.

    I opened the stock Camera app once, without taking a photo or sending anything. The live iPhone Console log shows:

    10:00:41.576122 kernel: memorystatus: killing_highwater_process pid 158 [nesessionmanager] (highwater 140 1925s rf:-) 9328KB
    10:00:41.658988 IPNExtension: [sysext] - Persistency maintained for stop reason unhandled reason, NEProviderStopReason.rawValue = 17
    10:00:41.664154 IPNExtension: stopTunnel: "unhandled reason, NEProviderStopReason.rawValue = 17"
    

    Times are UTC+5; the kernel line is shortened. The replacement IPNExtension logged version 1.104.5, and the Tailscale VPN session returned to connected at 10:00:44.519742, about 2.94 seconds after the highwater kill. This is the interval between log messages; traffic recovery was not measured.

    So the same nesessionmanager highwater kill / stop reason 17 sequence is still reproducible on 1.104.5. This test does not establish the cause of the daemon's memory usage or whether old providers accumulate on this version. I captured a short Console session only, with no new sysdiagnose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-iosbug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions