Networking
VERIFIED FIXES

SSH sessions and long TCP transfers hang after enabling TCP window scaling on edge Linux router

techtony
4w ago
Environment

Environment

Edge Linux router (custom distro, kernel 5.x) sitting between LAN and ISP modem. net.ipv4.tcp_window_scaling was enabled system-wide via sysctl. Clients are Linux/macOS machines running OpenSSH; transfers use scp/rsync over SSH.

Symptoms

Symptoms

Interactive SSH sessions become unresponsive during large file transfers or extended output; transfers stall mid-stream with zero progress but pings remain responsive. Short commands complete. Bypassing the router or disabling window scaling immediately restores normal behavior.

Observations

Observations

tcpdump captured repeated zero-window or window-probe packets on affected flows during stalls. Changing TCP offload settings (TSO/GSO) on the router had no effect. Disabling net.ipv4.tcp_window_scaling=0 on the router immediately removed stalls for test clients. Directly connecting the client to the ISP modem (bypassing router) also avoided the issue.

Already attempted

Already attempted

Disabled TCP offloads with ethtool on the router, toggled tcp_mtu_probing, updated router kernel packages, and restarted network stacks. Each change failed to resolve stalls until window scaling was disabled. Collected packet traces for analysis.

Question

Question

Why does enabling TCP window scaling on the router cause SSH sessions and long TCP transfers to hang, and what is a safe, reversible mitigation that preserves throughput for other traffic?

COMMUNITY RESPONSES

Verified community troubleshooting

1 reply
0
emmahacks Answer
user
Posted 4w ago • 0 confirmations

First, confirm it's window scaling by disabling it on the router: sudo sysctl -w net.ipv4.tcp_window_scaling=0. If that immediately fixes SSH hangs, capture tcpdump on both WAN and LAN sides to show zero-window probes and option negotiation so you can present evidence to your ISP or vendor. As a safe, reversible mitigation keep scaling off until you can put the ISP modem into bridge mode or update the modem/router firmware. When vendor patches arrive, re-enable scaling and retest; roll back if stalls return.

Showing 1 of 1 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

Upstream modem or router NAT device incorrectly handling TCP window scaling option (middlebox mangling) 80%
Router TCP stack or NAT implementation bug interacting with window scaling 50%
NIC offload/firmware bug on router causing broken TCP option negotiation 20%

Summary

Immediate resolution by disabling window scaling and tcpdump evidence of zero-window probes strongly indicate a middlebox or router-level mishandling of TCP window scaling options. Either the router's TCP stack/NAT implementation or an upstream ISP modem/box (when combined with the router) is incorrectly processing/tampering with TCP options, causing peers to advertise or honor zero windows. Less likely causes include NIC firmware bugs or client-side issues since bypassing the router or disabling scaling resolves it.

Suggested Fixes

Diagnostic step 1
Confirm with tcpdump: capture a failing flow and check TCP option negotiation and zero-window behavior (capture at both router WAN and LAN interfaces).
Diagnostic step 2
Temporarily disable window scaling on the router (sysctl -w net.ipv4.tcp_window_scaling=0) to restore service while you investigate; this is reversible.
Diagnostic step 3
Test bypassing the ISP modem (put it in bridge mode) or move the router to a different upstream to isolate whether ISP gear is mangling options.

Continue troubleshooting

Matched from the title, description and tags