Transmission Control Protocol (TCP)

The Transmission Control Protocol (TCP) is a network communication protocol designed to send data packets over the Internet. It is a transport layer protocol in the OSI model. It creates a connection between remote computers by transporting and ensuring the delivery of messages over supporting networks and the Internet.

When the application layer requires sending a large amount of data, it sends the data to the transport layer for Transmission Control Protocol or User Datagram Protocol (UDP) to transport it across the network.

The Transmission Control Protocol first establishes a connection between the source and destination in a three-way handshake process. After connection establishment, it breaks the data into segments, adds a header to each segment, and sends them to the Internet layer. The transmission control protocol header is 20 to 24 bytes in size, and the format is shown in the Figure below.

Transmission Control Protocol
Transmission Control Protocol (TCP) 4

When the Application layer sends data to the transport layer, Transmission Control Protocol sends the data across using the following sequence:

Transmission Control Protocol three-way handshake

Transmission Control Protocol uses a three-way handshake to establish a connection between client and server. The three-way handshake has three steps. It uses the SYN and ACK flags in the Code Bits section of the header. This process is necessary to start the sequence and acknowledgment number fields, which are essential for Transmission Control Protocol. A three-way handshake is also known as a TCP handshake. The following figure illustrates the TCP three-way handshake.

TCP
Transmission Control Protocol (TCP) 5

As shown in the above figure, the source starts the three-way handshake by sending a Transmission Control Protocol header to the destination with the SYN flag set. The destination responds with the SYN and ACK flags sent. Examine that the destination uses the received sequence number plus 1 as the Acknowledgement number. This is because it is assumed that 1 byte of data was contained in the exchange. The source responds with only the ACK bit set in the final step. After this, the data flow can commence.

Data Segmentation

The protocol used in a single Internet layer PDU limits the data size transmitted across that layer. This limit is called the maximum transmission unit (MTU). The application layer may send data much larger than this limit; hence, Transmission Control Protocol has to break down the data into smaller segments. Each segment is limited in size to the MTU. Sequence numbers are used to identify each byte of data. The sequence number in each header signifies the byte number of the first byte in that segment.

Flow Control

Flow control ensures that the rate at which a sender is transmitting is proportional to the receiver’s receiving capabilities.  It manages the flow of data/packets among two different nodes, especially in cases where the sending device can send data much faster than the receiver can take in.

The Transmission Control Protocol process initializes when the source sends data in groups of segments. The Window bit in the Transmission Control Protocol header (Check-in TCP header Image) determines the number of segments that can be sent simultaneously to avoid an irreducible destination. At the start of the session, the window is small, but it increases over time.

The destination host can also decrease the window to slow down the flow. Hence, the window is called the sliding window. When the source has finished the number of segments allowed by the window, it cannot send any further segments until an acknowledgment is received from the destination.

The figure below illustrates how the window increases during the session. Notice the Destination host increasing the Window from 800 to 1000 simultaneously when it sends an ACK back to the source. This process is called windowing.

Windowing
Transmission Control Protocol (TCP) 6

Reliable Delivery with Error Recovery

When the destination receives the last segment in the agreed window, it must send an acknowledgment to the source. It sets the ACK flag in the header, and the acknowledgment number is set to the sequence number of the next byte expected. If the destination does not receive a segment, it does not return an acknowledgment. This tells the source that some segments have been lost, and it will re-transmit the segments.

The above figure illustrates how windowing and acknowledgment are used in the Transmission Control Protocol process. Notice that when the source does not receive acknowledgment for the segment with sequence number 2000, it retransmits the data. Once it receives the acknowledgment, it sends the following sequence according to the window size.

Ordered Delivery

Transmission Control Protocol transmits data in the order received from the application layer and uses the sequence number to mark the order. The data may be obtained at the destination in the wrong order due to network conditions. Thus, TCP at the destination orders the data according to the sequence number before sending it to the application layer at its end. This order delivery is part of TCP’s benefit and one of the purposes of the Sequence Number.

Connection Termination

When all data has been successfully transferred, the source initiates a four-way handshake to close the session. To close the session, the FIN and ACK flags are used.  FIN and ACK will be discussed in the coming articles.

Key Features of Transmission Control Protocol

Transmission Control Protocol’s reliability stems from its robust features:

  • Connection-Oriented: Ensures a stable link before data exchange.
  • Full-Duplex Communication: Allows simultaneous two-way data flow.
  • Congestion Control: Prevents network overload with algorithms like Transmission Control Protocol Reno or Cubic.
  • Multiplexing: Supports multiple connections using port numbers.
  • TCP is a connection-oriented protocol. It provides full-duplex communication. Transmission Control Protocol includes flow control and error control mechanisms. TCP uses port numbers to identify different applications.

TCP vs. UDP: A 2025 Perspective

While Transmission Control Protocol ensures reliability, UDP prioritizes speed, making it suitable for streaming or gaming. In 2025, the choice between TCP and UDP depends on application needs:

  • TCP: Preferred for email (SMTP), web (HTTP/HTTPS), and file transfers (FTP).
  • UDP: Used for video calls (e.g., Zoom) and online gaming.
  • 2025 Trend: Hybrid protocols blending TCP reliability with UDP speed are emerging for 5G networks.

Common TCP Problems and Solutions in 2025

Even with its strengths, Transmission Control Protocol faces challenges like latency, packet loss, and security vulnerabilities. Here’s how to address them:

Security: Implement TLS/SSL over TCP for encrypted communication.

Latency: Optimize with TCP BBR (Bottleneck Bandwidth and Round-trip propagation time).

Packet Loss: Use forward error correction (FEC) techniques.

FAQs

  • TCP vs. UDP: A 2025 Perspective While TCP ensures reliability, UDP prioritizes speed, making it suitable for streaming or gaming. In 2025, the choice between TCP and UDP depends on application needs: TCP: Preferred for email (SMTP), web (HTTP/HTTPS), and file transfers (FTP). UDP: Used for video calls (e.g., Zoom) and online gaming. 2025 Trend: Hybrid protocols blending TCP reliability with UDP speed are emerging for 5G networks. Common TCP Problems and Solutions in 2025 Even with its strengths, TCP faces challenges like latency, packet loss, and security vulnerabilities. Here’s how to address them: Latency: Optimize with TCP BBR (Bottleneck Bandwidth and Round-trip propagation time). Packet Loss: Use forward error correction (FEC) techniques. Security: Implement TLS/SSL over TCP for encrypted communication.

    TCP ensures reliable, ordered data delivery with error checking, while UDP offers faster but less reliable transmission. In 2025, TCP is favored for secure transactions, whereas UDP suits real-time applications.

  • How does TCP handle packet loss?

    TCP detects packet loss via timeouts or missing acknowledgments and retransmits the data. Modern enhancements like Selective Acknowledgments (SACK) improve efficiency in 2025 networks.

  • Is TCP still relevant in 2025?

    Yes, TCP remains critical, supporting 80% of Internet traffic, including 5G and IoT. Its adaptability with new congestion control algorithms ensures its relevance.

  • What are TCP ports?

    TCP ports are virtual endpoints (0-65535) that identify specific applications (e.g., port 80 for HTTP). They enable multiplexing on a single device in 2025 networks.

Test Your Knowledge with our self-assessment test for exam preparation – Quiz Test Transmission Control Protocol (TCP)

Avatar of Asad Ijaz

Asad Ijaz

NetworkUstad's lead networking architect with CCIE certification. Specializes in CCNA exam preparation and enterprise network design. Authored 2,800+ technical guides on Cisco systems, BGP routing, and network security protocols since 2018. Picture this: I'm not just someone who writes about tech; I'm a certified expert in the field. I proudly hold the titles of Cisco Certified Network Professional (CCNP) and Cisco Certified Network Associate (CCNA). So, when I talk about networking, I'm not just whistling in the dark; I know my stuff! My website is like a treasure trove of knowledge. You'll find a plethora of articles and tutorials covering a wide range of topics related to networking and cybersecurity. It's not just a website; it's a learning hub for anyone who's eager to dive into the world of bits, bytes, and secure connections. And here's a fun fact: I'm not a lone wolf in this journey. I'm a proud member and Editor of Team NetworkUstad. Together, we're on a mission to empower people with the knowledge they need to navigate the digital landscape safely and effectively. So, if you're ready to embark on a tech-savvy adventure, stick around with me, Asad Ijaz Khattak. We're going to unravel the mysteries of technology, one article at a time!"