TCP gives two programs a reliable, ordered stream of bytes over unreliable packets by numbering the bytes, acknowledging them and resending what is lost, and one connection can never move data faster than its window divided by the round-trip time. With the 65,535-byte maximum window of the basic header, a 10 ms round trip caps one connection at about 52.4 Mbps, below a 100 Mbps link, which is why long radio links need a larger window while a local network with sub-millisecond delay does not. TCP reads packet loss as congestion and slows down, so a noisy radio link gives poor throughput even when the signal is usable.

Part of Networking

The connection-based transport protocol: connection states, the window limit on speed, how it behaves on lossy links and how to read its symptoms.

TCP Hides Packet Loss From The Program At The Cost Of Delay

Protocols already describes the mechanism: the three-way handshake, a sequence number on every byte, acknowledgments, a receive window for flow control and the additive-increase, multiplicative-decrease rule for congestion. Acknowledgments explains why waiting for each acknowledgment wastes a long link, and why sliding windows fix it. This article adds the parts a settlement builder uses: the arithmetic limit on speed, what the states and errors mean, and the loss behaviour on radio.

A few details are from general knowledge, not from the other articles: a TCP header is at least 20 bytes; the flags SYN, ACK, FIN and RST open, acknowledge, close and abort a connection; and a connection passes through named states such as LISTEN, ESTABLISHED and TIME_WAIT. The window field is 16 bits, which is why the basic maximum is 65,535 bytes; an extension called window scaling lifts it.

What You Need

  • Two machines and a service to connect to — a web server will do (Web Server)
  • A way to list connections — on Linux ss -tn lists connections and ss -tln lists listening ports; the carrier Internet Infrastructure uses netstat -tlnp for the same purpose

Method: Read What TCP Is Telling You

Step 1: Name the failure by how it fails A connection that is refused immediately means a machine answered and nothing is listening on that port, or something rejected it. A connection that hangs and times out means the packets are being dropped or have no route. This distinction is general knowledge and is the quickest test in the toolbox: it separates “wrong port” from “wrong path”.

Step 2: Check the listening side first List listening ports on the server. If the service is not listed, the problem is the server program, not the network.

Step 3: Check the path with the lower layers If the port is listening and the connection still times out, work down: routes (Routing Tables), firewall rules (Firewalls), then the cable (OSI Model).

Step 4: For a slow transfer, compute the window limit before touching anything See the example below.

Worked Example: The Window Limit

A connection can have at most one window of data unacknowledged, so in one round-trip time it moves at most one window. The maximum rate is window x 8 / round-trip time.

The cap at 10 ms. Window 65,535 bytes = 65,535 x 8 = 524,280 bits. Round trip 10 ms = 0.010 s. Rate = 524,280 / 0.010 = 52,428,000 bit/s = 52.4 Mbit/s. Network Fundamentals works the same case: a 100 Mbps link with a 10 ms round trip holds 1,000,000 bits = 125,000 bytes in flight. The window of 65,535 bytes is 65,535 / 125,000 = 0.524, about 52% of that, so one connection can fill about half the link.

A local network. Network Types gives LAN latency as submillisecond. Take 1 ms: 524,280 / 0.001 = 524,280,000 bit/s = 524 Mbit/s, above 100 Mbps, so the window is not the limit; the link is.

A satellite-style 500 ms path. Acknowledgments uses a 500 ms round trip. 524,280 / 0.5 = 1,048,560 bit/s, about 1.05 Mbit/s however fast the link. A radio link between two settlements is far shorter than that, but the same arithmetic applies to any slow-to-answer path.

Loss On Radio Looks Like Congestion

Packet Switching explains that TCP backs off when it detects loss. On a wired link loss means a full queue, and slowing down is correct. On a marginal radio link packets are lost to noise, not queues, and TCP slows down anyway and then climbs back slowly. The result is a link that tests clean on signal strength and still moves data far below its rate. The remedy is on the radio side: better alignment and a stronger signal (Wireless Bridges), not a TCP setting.

Common Mistakes

  • Blaming the application for a hung connection — a timeout is a path problem more often than a server problem
  • Testing a link with many small requests — each costs a round trip; test with one large transfer (File Transfer)
  • Expecting a second connection to share the first’s window — each connection has its own, so several together can fill a link that one cannot

What’s Next

  • Learn next: UDP Protocol — the transport that does none of this
  • Combine with: HTTP — what most connections carry