TCP

A connection-oriented transport layer protocol that provides reliable, ordered, and error-checked delivery of a stream of octets between applications.

TCP (Transmission Control Protocol) is a fundamental transport layer protocol in the TCP/IP suite. It is connection-oriented, requiring a three-way handshake (SYN, SYN-ACK, ACK) to establish a session before data exchange begins. This ensures that both the sender and receiver are ready and synchronized.

How it works

The protocol ensures reliability by assigning sequence numbers to every segment. The receiver sends back an acknowledgment (ACK) for successfully received data. If a segment is corrupted or lost, TCP triggers a retransmission. It also implements flow control and congestion control mechanisms to prevent the sender from overwhelming the network or the receiver's buffer.

TCP is the standard choice for applications where data integrity is more critical than transmission speed:

  • Web traffic (HTTP/HTTPS);
  • File transfers (FTP, SFTP);
  • Email delivery (SMTP, IMAP);
  • Terminal access (SSH).

Technical fact: A standard TCP header is 20 bytes long. While this introduces more overhead compared to the 8-byte UDP header, it offloads the complexity of error recovery and packet reordering from the application layer to the network stack.