TCP Protocol Référence
Référence pour TCP: three-way handshake, flow control, congestion control, et state machine.
Connection Management
TCP establishes connections via a three-way handshake: SYN, SYN-ACK, ACK. Connection teardown uses FIN-ACK sequences, with TIME_WAIT state lasting 2*MSL. The state machine includes LISTEN, SYN_SENT, SYN_RCVD, ESTABLISHED, FIN_WAIT, CLOSE_WAIT, and TIME_WAIT states. Sequence numbers track byte positions; acknowledgments confirm receipt. TCP options negotiate MSS, window scaling, timestamps, and SACK during handshake.
- handshake
- SYN, SYN-ACK, ACK
- TIME_WAIT
- 2*MSL duration
- options
- MSS, SACK, window scale
3-way resource cleanup handshake negotiation Flow and Congestion Control
Flow control uses a sliding window advertised by the receiver to prevent overwhelming it. Congestion control (Cubic, BBR, Reno) probes for bandwidth and backs off on loss. Slow start, congestion avoidance, fast retransmit, and fast recovery are the classic phases. SACK (Selective ACK) improves loss recovery by acknowledging non-contiguous ranges. ECN (Explicit Congestion Notification) signals congestion without packet loss. Nagle's algorithm coalesces small segments.
- flow control
- Sliding window
- congestion
- Cubic/BBR/Reno
- SACK
- Selective ACK
receiver-driven sender-driven non-contiguous ranges