5. TCP
One-liner. Reliable, ordered, congestion-controlled byte stream — with a handshake before any data.
Memorize
- Three-way handshake: SYN → SYN/ACK → ACK; costs 1 RTT before the first byte.
- Sequence/ack numbers give reliability; the receive window gives flow control.
- MSS is negotiated; window scaling allows large bandwidth-delay products.
- Congestion control (CUBIC default on Linux, BBR optional) adapts to loss/delay; slow start doubles per RTT.
- TIME_WAIT (~60 s) after the active close prevents late duplicates; port exhaustion is a real failure mode.
- RST means "abort now" — often a firewall, a closed port, or an app crash.
- Retransmissions, duplicate ACKs and zero-window probes are the signatures you look for in a capture.
Trap. Blaming "the network" for latency that is handshake + TLS + server time. Measure each phase. Do this. Break the request into DNS, connect, TLS, TTFB, transfer.
Check
What does a TCP RST usually indicate?
Why
Graceful close uses FIN; RST tears the connection down immediately and discards state.