Skip to content
Tutorials Center
My learning

Topics

Lesson 23 of 37 ยท Troubleshooting Networks

TCP Windows, Resets and Stalled Connections

Understand TCP flow control and connection errors in Wireshark: zero window, window full, RST packets, refused connections and half-open sessions.

Not every slow or broken TCP connection is caused by loss. Sometimes the receiver tells the sender to stop, a firewall kills a session, or a service is simply not listening. These cases look different in Wireshark, and each one has a precise meaning.

This lesson builds on Slow Networks and TCP Retransmissions. Output is read-only example text; the Python blocks are stand-ins working on sample records.

Flow control: the receive window

Every TCP segment carries a window size: how many more bytes the sender of that segment can accept. If the application on the receiving side reads slowly, its buffer fills and it advertises a smaller window. At zero, the other side must wait.

Wireshark labels this:

Label Filter Meaning
TCP Window Full tcp.analysis.window_full The sender has used the whole window the receiver offered
TCP ZeroWindow tcp.analysis.zero_window The receiver advertised a window of 0
TCP ZeroWindowProbe tcp.analysis.zero_window_probe The sender asks whether space opened
TCP Window Update tcp.analysis.window_update The receiver announces more space
TEXT
 801  4.100  10.0.0.20 -> 10.0.0.5   TCP  [TCP ZeroWindow] 51200 > 445 [ACK] Win=0
 802  4.600  10.0.0.5  -> 10.0.0.20  TCP  [TCP ZeroWindowProbe] 445 > 51200 [ACK]
 803  4.600  10.0.0.20 -> 10.0.0.5   TCP  [TCP ZeroWindowProbe ACK] Win=0
 ...
 818  9.100  10.0.0.20 -> 10.0.0.5   TCP  [TCP Window Update] Win=262144

A zero window means the receiver's application is the bottleneck, not the network. The machine advertising it (here 10.0.0.20) is too slow, short on memory, or busy. Fixing the network will not help.

Python Find zero-window stalls

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

If the window is small but never zero, the receiver may have a small buffer or the sender is limited by "window full". Check whether window scaling was negotiated in the SYN. Without it the maximum window is 64 KB and fast, long-distance links are throttled. The option is visible in the handshake: tcp.options.wscale.

Resets

A packet with the RST flag ends a connection abruptly. Filter with tcp.flags.reset == 1. Who sent it and when it was sent tell the story:

flowchart TD
    A["RST seen"] --> B{"Reply to a SYN?"}
    B -->|Yes| C["Port closed or service not running"]
    B -->|No| D{"Mid-conversation?"}
    D -->|"Yes, after idle time"| E["Firewall or NAT timed out the session"]
    D -->|"Yes, right after data"| F["App crashed, restarted, or closed with unread data"]
    D -->|"Source IP/TTL differs"| G["A middlebox injected the reset"]

A quick decision guide for resets.

  • SYN followed by RST, ACK: the host is reachable but nothing listens on that port. That is a "connection refused", and it is a fast, clear answer.
  • SYN with no answer at all: a firewall silently drops the packet (or the host is down). The client retries the SYN with growing delays.
  • RST after a long idle period: a firewall or NAT forgot the session. Keep-alives or longer timeouts fix it.
  • RST from a TTL different to the rest of that server's packets: likely sent by a device in the middle, for example a security appliance or filtering box. Compare ip.ttl between the RST and normal packets.
Python Classify what happened to each connection attempt

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Half-open and idle sessions

If one side crashes without sending FIN or RST, the other keeps a session that no longer exists. When the survivor sends data, the rebooted machine answers with RST because it has no record of the connection. TCP keep-alive packets (a segment with one byte less than the current sequence number, flagged tcp.analysis.keep_alive) are how long-lived connections check the peer.

Handshake clues in one place

  • Slow SYN-ACK: server busy or far away.
  • SYN retransmissions: path or firewall drop.
  • Different options in SYN and SYN-ACK: only the options both sides send are enabled, so a missing wscale in the SYN-ACK disables scaling.
  • MSS smaller than expected (for example 1360 instead of 1460): a tunnel or VPN reduced the packet size.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A host advertises a TCP window of zero. Where does the bottleneck lie?

    Zero window means the receiver's buffer is full, because its application is not reading data fast enough.
  2. 2. A SYN is answered immediately with RST, ACK. What does this mean?

    The operating system answers closed ports with a reset, which is fast and explicit.
  3. 3. Repeated SYN packets with no reply most likely indicate what?

    Silence is typical of dropped packets, while refused connections return an RST.
  4. 4. Why compare ip.ttl of a RST with other packets from the same server?

    A different TTL suggests the packet started from a different hop than the server.

Summary

  • Window size controls flow; a zero window blames the receiving application.
  • Window scaling must be negotiated in the SYN exchange, or throughput is capped at about 64 KB per RTT.
  • RST answers to SYN mean "refused"; silence means "dropped".
  • Who sent a reset and when decides whether it is the app, a timeout, or a middlebox.

Next: Spotting Port Scans in Captures