An interactive guide to the backbone of the internet. Explore headers, state machines, and congestion control algorithms.
Ensures data delivery via acknowledgments (ACK) and retransmissions.
Guarantees byte sequence order using Sequence and Acknowledgment numbers.
Prevents sender overflow using the Sliding Window mechanism.
Hover over fields to understand their purpose.
Hover over any field in the packet structure to see a detailed explanation. The TCP header is typically 20 bytes (without options) and contains the control information necessary for reliable transmission.
The 3-Way Handshake
Client sends a SYN (synchronize) packet to the server to request a connection. Indicates the client's initial sequence number (ISN).
Server responds with SYN-ACK. Acknowledges client's SYN (ISN + 1) and sends its own ISN.
Client sends ACK. Acknowledges server's SYN (Server ISN + 1). Connection is established.
The Sliding Window Mechanism
Increasing the window size allows the sender to "fill the pipe" more effectively, improving throughput on high-latency links.
AIMD (Additive Increase / Multiplicative Decrease)
Exponential growth. Starts with cwnd = 1 MSS. For every ACK received, cwnd increases by 1. Effectively doubles every RTT. Continues until ssthresh is hit or packet loss occurs.
Linear growth. Once cwnd > ssthresh, cwnd increases by roughly 1 MSS per RTT (Additive Increase). This is cautious probing for available bandwidth.
If 3 duplicate ACKs are received, packet loss is inferred. ssthresh is set to cwnd/2, and cwnd is set to ssthresh + 3 (Reno) or 1 (Tahoe).
If RTO (Retransmission Timeout) expires, severe congestion is assumed. ssthresh = cwnd/2, and cwnd is reset to 1 MSS. Re-enters Slow Start.