Published on

What is TCP?

Authors
  • avatar
    Name
    Skip2 Networks
    Title
    Content Manager
    Twitter

TCP

What is TCP?

Transmission Control Protocol (TCP) is a fundamental communication protocol that provides reliable, ordered, and error-checked delivery of data between applications running on networked devices. As one of the core protocols of the Internet Protocol Suite, TCP operates at the Transport Layer of the OSI model and establishes a connection-oriented communication channel that guarantees data integrity through sophisticated error detection, correction, and retransmission mechanisms. Unlike simpler protocols that send data without confirmation, TCP creates a virtual circuit between sender and receiver, ensuring that every piece of transmitted data arrives at its destination in the correct order and without corruption.

TCP's reliability comes through a complex handshaking process and continuous monitoring of data transmission quality. Before any data exchange occurs, TCP performs a three-way handshake to establish the connection, negotiate parameters, and synchronize sequence numbers between communicating parties. During data transmission, TCP breaks information into manageable segments, assigns sequence numbers to each segment, and requires acknowledgment receipts from the receiving end. If acknowledgments don't arrive within specified timeframes or if corrupted data is detected, TCP automatically retransmits the affected segments. This robust approach makes TCP ideal for applications where data accuracy is critical, such as web browsing, email, file transfers, and database communications.

TCP Connection Example

When a user downloads a software update from a company's website, TCP ensures the entire file arrives perfectly intact. The browser initiates a TCP connection to the server using the three-way handshake process. As the server begins transmitting the 500MB file, TCP breaks it into thousands of smaller segments, each numbered sequentially. If network congestion causes segment #1,247 to be lost during transmission, the user's computer detects the gap in sequence numbers and requests retransmission of that specific segment. Meanwhile, TCP's flow control mechanisms automatically adjust transmission speed based on network conditions, ensuring optimal performance without overwhelming the connection. The download completes only after TCP confirms that every single segment has been received and reassembled in the correct order.

TCP Three-Way Handshake

StepDirectionFlagPurpose
1Client → ServerSYNRequest connection establishment
2Server → ClientSYN-ACKAcknowledge request and respond
3Client → ServerACKConfirm connection established

TCP Features and Mechanisms

  • Sequence Numbers - Track order of data segments for proper reassembly
  • Acknowledgments - Confirm successful receipt of transmitted data
  • Flow Control - Prevent overwhelming receiver with too much data
  • Congestion Control - Adjust transmission rate based on network conditions
  • Error Detection - Checksums identify corrupted data during transmission
  • Retransmission - Automatically resend lost or damaged segments

TCP vs UDP Comparison

AspectTCPUDP
ReliabilityGuaranteed deliveryBest-effort delivery
ConnectionConnection-orientedConnectionless
SpeedSlower due to overheadFaster with minimal overhead
Use CasesWeb, email, file transferGaming, streaming, DNS
Data OrderMaintains sequenceNo ordering guarantee

CDN and TCP Optimization

  • Connection Pooling - Reuse TCP connections for multiple requests
  • TCP Fast Open - Reduce handshake overhead for repeat connections
  • Window Scaling - Optimize buffer sizes for high-bandwidth connections
  • Congestion Algorithms - Use advanced algorithms like BBR for better performance
  • Keep-Alive - Maintain connections to reduce establishment overhead

TCP Performance Considerations

  • Latency Impact - High latency networks suffer from TCP overhead
  • Bandwidth Utilization - TCP's conservative approach may underutilize fast networks
  • Connection Limits - Servers have finite capacity for concurrent TCP connections
  • Firewall Traversal - Stateful firewalls track TCP connection states
  • Mobile Networks - TCP struggles with frequent network changes and interruptions

Learn more

Explore the entire CDN Glossary

Skip2 CDN Glossary

Sign up for our newsletter

Get Started