Two Problems That Look Similar but Are Not
When a file transfer crawls or a session hangs, Wireshark will usually tell you why. The two most common culprits are a TCP zero window and packet loss triggering congestion avoidance. They produce similar symptoms at the application layer but completely different causes.
A zero window is a receiver problem. The sender is fine. The network is fine. The receiving application can't keep up with the data arriving.
Congestion avoidance is a network problem. The receiver might be fine. The network is dropping packets, and TCP is backing off to avoid making it worse.
Knowing which one you're looking at cuts your troubleshooting time in half.
TCP Zero Window
How the Receive Window Works
Every TCP segment carries a window size field. The receiver sets this value to tell the sender how much buffer space it has available. The sender can't exceed that limit without getting an ACK back.
This is flow control. It's separate from congestion control. The window size tells the sender what the receiver can handle, not what the network can handle.
Under normal conditions you'll see the window size fluctuate. It shrinks as data arrives and fills the buffer, grows as the application reads from the socket and frees space. As long as it's nonzero, the sender keeps pushing data.
When the Window Hits Zero
If the application stops reading from the socket, the receive buffer fills completely. The window size field drops to zero. The sender must stop. It can't send any more data, even if the network can handle it.
Wireshark shows this as [TCP ZeroWindow] in the info column. It's hard to miss.
The sender doesn't just sit idle. It starts sending window probes: small segments that carry no new data, sent at increasing intervals (usually 1 second, then backing off). The purpose is to find out when the receiver's window opens back up.
The Window Update
When the application finally reads from the socket and frees buffer space, the receiver sends a [TCP Window Update] segment. This tells the sender the window is open again and it can resume.
In Wireshark you'll see the sequence: ZeroWindow, then a series of window probes, then a Window Update, then data flow resuming. The gap between ZeroWindow and Window Update is the application stall time.
Common Causes of Zero Window
Slow application reading from the socket (the most common cause)
JVM garbage collection pauses on the receiver
Full disk on the receiver slowing writes
CPU saturation on the receiver causing socket reads to stall
Misconfigured receive buffer sizes (too small for the connection's bandwidth-delay product)
The fix is almost never on the network. If you see zero windows, look at the receiving host's CPU, memory, disk, and application behavior. The network is usually innocent.
TCP Congestion Avoidance
Why TCP Backs Off
TCP assumes that packet loss means congestion. This was true in 1988 when Van Jacobson designed the original algorithms, and it's still mostly true today (with the exception of wireless links where loss is random, not congestion-related).
When TCP detects loss, it reduces its sending rate aggressively. Left unchecked, every sender would transmit as fast as possible, the network would collapse, and nothing would get through. TCP's congestion control algorithms prevent that.
The Four Algorithms
Slow Start: When a connection opens (or recovers from a timeout), the sender starts with a congestion window (cwnd) of 1 MSS (maximum segment size). Every ACK received doubles cwnd. This is exponential growth, not slow at all. It's called slow start because it starts with 1 MSS rather than flooding the pipe immediately.
Slow start continues until cwnd reaches ssthresh (slow start threshold), or until loss is detected, whichever comes first.
Congestion Avoidance: Once cwnd passes ssthresh, growth slows to linear. For every RTT's worth of ACKs received, cwnd increases by 1 MSS. This is the steady-state behavior for a stable connection with no loss.
Fast Retransmit: If the sender receives 3 duplicate ACKs for the same sequence number, it doesn't wait for the retransmission timeout (RTO). It immediately retransmits the missing segment. Three dupacks is a strong signal that one segment was lost but the ones after it arrived.
Fast Recovery: After fast retransmit fires, TCP halves ssthresh and sets cwnd to ssthresh + 3 (the 3 accounts for the three dupacks). Then it continues sending new data while waiting for the retransmit to be ACKed. This is less aggressive than a full reset to 1 MSS.
Timeout vs Duplicate ACKs
How loss is detected matters. The two mechanisms produce very different responses.
Three duplicate ACKs means the segment after the gap arrived. Loss was isolated. Fast retransmit fires, cwnd is halved, the connection recovers quickly.
A retransmission timeout (RTO) means nothing arrived for a full timeout period. The network might be severely congested or the path might be down. TCP resets cwnd to 1 MSS and goes back to slow start. Recovery is much slower.
In a Wireshark capture: dupacks and fast retransmits are mild. RTO events are severe. If you see the sender go quiet for a full second or more and then restart with one segment at a time, that's an RTO.
Reading the Sawtooth Pattern
If you graph cwnd over time for a connection experiencing periodic loss, you get a sawtooth pattern. Cwnd grows linearly, hits a loss event, drops sharply, grows again, hits loss again. The peaks show the maximum throughput the network allows before it starts dropping.
You can't see cwnd directly in Wireshark. What you can see is the pattern of segment sizes and ACKs that reveals it. Look for bursts of data, then a cluster of duplicate ACKs, then a retransmit, then smaller bursts resuming. That's the sawtooth in packet form.
Modern Algorithms: CUBIC and BBR
CUBIC is the default in Linux. It uses a cubic function to control cwnd growth rather than the linear increase of Reno. It recovers more aggressively after loss events, which matters on high-bandwidth links where linear growth takes too long to reach line rate.
BBR (Bottleneck Bandwidth and RTT) is different in kind. It doesn't use loss as its primary congestion signal. Instead it continuously estimates the bottleneck bandwidth and minimum RTT, and targets a sending rate just below the estimated capacity. BBR can maintain higher throughput on paths with some random loss, like wireless, because it doesn't cut cwnd on every lost packet.
For most data center and campus networks, CUBIC is fine. For WAN connections with significant RTT or wireless segments, BBR can help significantly.
Reading a Bad Connection
When a connection is performing badly, Wireshark's expert info panel is your first stop. It categorizes events by severity: errors (red), warnings (yellow), notes (cyan).
Retransmissions and duplicate ACKs in the warnings column point to network-side packet loss. Zero window events point to receiver-side problems.
Seeing both together means both problems exist. The receiver can't keep up and the network is also dropping packets. That's usually a heavily loaded server on a congested link, and you need to fix both sides.
A quick way to separate them: filter on the destination IP. If the zero window segments are coming from the receiver and the retransmits are coming from the sender, they're independent problems. If the retransmits start appearing right after the zero window clears, the sender may be overrunning the receiver again after the window update and triggering network congestion simultaneously.
The Practical Takeaway
Zero window means the receiver is overwhelmed. Fix the application or the host, not the network.
Retransmits and duplicate ACKs mean the network is dropping packets. Fix the network, check for congestion, check for mismatched MTU or duplex settings.
If you see both: the host is slow and the network is also dropping. Prioritize the network fix first because zero windows will go away on their own once the application catches up, but packet loss won't fix itself.
Watch the videos
See these patterns live in Wireshark captures on the YouTube channel.
TCP Zero Window explained → TCP Congestion Avoidance in Wireshark →
Comments (0)
Please sign in to comment.