Skip to main content

TCP

TCP is a connection-oriented transport protocol providing reliable, ordered, error-checked delivery of a byte stream between hosts.

TCP, the Transmission Control Protocol, is one of the foundational protocols of the internet. It provides reliable, ordered, and error-checked delivery of a stream of bytes between applications running on networked hosts.

How It Works

TCP is connection-oriented. Before data flows, the two endpoints establish a connection through a three-way handshake (SYN, SYN-ACK, ACK). During the connection, TCP breaks data into segments, numbers them, and the receiver acknowledges what it has received. Lost or corrupted segments are retransmitted, and segments are reassembled in order, so the application sees a clean, continuous stream.

TCP also manages the rate of sending. Flow control prevents a fast sender from overwhelming a slow receiver, while congestion control adapts the sending rate to network conditions to avoid collapse. The connection ends with an orderly shutdown.

Why It Matters

Most application protocols, including HTTP up to version 2, email, and database connections, rely on TCP because they need every byte delivered correctly and in order. Its reliability guarantees let application developers ignore packet loss and reordering.

Those guarantees have a cost. The handshake adds latency to new connections, and reliable in-order delivery can cause head-of-line blocking, where one lost packet delays everything behind it. Applications that prize low latency over completeness, such as live media, often choose UDP instead, and HTTP/3 moves to a UDP-based transport for similar reasons.

Related Terms

TCP is contrasted with UDP, carries protocols like HTTP/2 and TLS, and works alongside DNS to enable internet communication.