T

TCP (Transmission Control Protocol)

TCP is a core internet transport protocol that ensures reliable, ordered, and error-checked delivery of data between systems.

What is TCP?

Transmission Control Protocol (TCP) is a transport-layer protocol used to transmit data reliably over IP networks. TCP establishes a connection between two endpoints and guarantees that data is delivered in order, without loss, and without duplication.

TCP is one of the fundamental protocols of the internet.

Why TCP matters

TCP is critical because it:

  • Ensures reliable data transmission
  • Handles packet loss and retransmission automatically
  • Preserves data order
  • Supports flow and congestion control
  • Enables stable application communication

Most business-critical applications depend on TCP.

How TCP works (simplified)

TCP communication follows these steps:

  1. Connection establishment (three-way handshake)
  2. Data transfer with acknowledgments
  3. Flow control to avoid overwhelming the receiver
  4. Congestion control to adapt to network conditions
  5. Connection termination

This design prioritizes reliability over speed.

TCP three-way handshake

Before data is sent, TCP establishes a session using:

  1. SYN - client requests a connection
  2. SYN-ACK - server acknowledges and agrees
  3. ACK - client confirms

Only after this handshake does data transmission begin.

TCP ports

TCP uses ports to identify services:

  • Port numbers range from 0 to 65535
  • Well-known ports (e.g., 80, 443, 25)
  • Allows multiple services on the same IP address

Firewalls often filter traffic based on TCP ports.

TCP vs UDP

AspectTCPUDP
ReliabilityGuaranteedBest-effort
OrderingYesNo
SpeedSlowerFaster
OverheadHigherLower
Use casesWeb, email, file transferStreaming, VoIP, DNS

TCP trades performance for reliability.

TCP and applications

TCP is used by many common protocols:

  • HTTP / HTTPS
  • SMTP, IMAP, POP3
  • FTP, SFTP
  • SSH
  • RDP

Any application requiring data integrity typically uses TCP.

TCP and security

From a security perspective:

  • TCP enables encrypted protocols (TLS over TCP)
  • Connection state can be inspected by firewalls
  • Susceptible to attacks like SYN floods if unprotected
  • Often protected by firewalls, rate limiting, and IDS/IPS

TCP itself does not encrypt data.

Performance considerations

TCP performance can be affected by:

  • Latency and packet loss
  • Congestion window behavior
  • Network Quality of Service (QoS)
  • Long-distance or unstable links

High-latency networks may experience reduced throughput.

Common misconceptions

  • "TCP encrypts data"
  • "TCP is always slower than UDP"
  • "All internet traffic uses TCP"
  • "TCP guarantees security"