Nepedia
Back to Discover
Advanced Reader
💻

Transmission Control Protocol

technology Maturity 11-13 Next article →

The Transmission Control Protocol, commonly known as TCP, is a fundamental pillar of the Internet protocol suite. It functions as a core communication service within the transport layer of the TCP/IP model. TCP is designed to provide reliable, ordered, and error-checked delivery of a stream of octets, which are also called bytes, between applications on different hosts. Because it ensures that data arrives exactly as it was sent, it is essential for major internet applications like the World Wide Web, email, file transfers, and remote administration.

TCP connection establishment
TCP connection establishment

To ensure reliability, TCP operates as a connection-oriented protocol. This means that a sender and a receiver must first establish a formal connection using agreed-upon parameters before any actual data is exchanged. This process begins with a three-way handshake, which is an active open procedure used to synchronize the two devices. Before this can happen, a server must perform a passive open, meaning it sits in a "listening" state to wait for incoming connection requests from clients. This careful setup phase ensures that both parties are ready to communicate effectively.

Once a connection is established, TCP manages the complex task of data transmission through a series of organized steps. When an application wants to send a large file, the TCP layer divides that data into smaller, manageable chunks called segments. These segments are then passed down to the internet layer, where the Internet Protocol (IP) encapsulates each TCP segment into an IP datagram. The IP datagram includes a header containing the destination IP address to guide the data through the network. This layering allows the application to ignore the messy details of how the network actually moves the bits.

Tcp
Tcp

Reliability is maintained through a technique called positive acknowledgment with re-transmission. As the receiver gets each segment, it must respond with an acknowledgment message to confirm receipt. The sender keeps a detailed record of every packet sent and maintains a timer for each one. If the timer expires before the sender receives an acknowledgment, it assumes the packet was lost or corrupted and sends the data again. This process allows TCP to detect and fix problems like lost, duplicated, or out-of-order packets. However, this constant checking and re-sending can increase latency, sometimes causing delays of several seconds.

Tcp state diagram fixed new
Tcp state diagram fixed new

A TCP segment is composed of two main parts: a segment header and a data section. The header contains ten mandatory fields and may include an optional extension field known as "Options." These options can serve various purposes, such as the Maximum Segment Size (SS) or Selective Acknowledgment (SACK), which helps the receiver tell the sender exactly which blocks of data arrived. The data section, or the payload, contains the actual information being sent by the application. The length of this data section is not explicitly stated in the segment header; instead, it is calculated by comparing the total IP datagram length to the combined size of the headers.

The history of TCP is rooted in the early development of internetworking. In May 1974, Vint Cerf and Bob Kahn described a protocol for sharing resources using packet switching. They incorporated concepts from the French CYCLADES project, working alongside Gérard Le Lann. In December 1974, Vint Cerf, Yogen Dalal, and Carl Sunshine published the "Specification of Internet Transmission Control Program." This historic document contained the first known use of the term "internet" as a shorthand for internetwork. Over time, the original monolithic program was divided into the modular TCP/IP architecture we use today. For their foundational work, Vint Cerf and Bob Kahn were awarded the Turing Award in 2004.

TCP close() - sequence diagram
TCP close() - sequence diagram

Because TCP prioritizes accuracy over speed, it is not always the best choice for every task. For real-time applications like voice over IP, where speed is more important than catching every single error, developers often use the User Datagram Protocol (UDP) instead. UDP provides a connectionless service that prioritizes timely delivery over the strict reliability found in TCP. While TCP is excellent for web browsing and files, it can struggle with network congestion. To manage this, TCP employs congestion avoidance mechanisms to help stabilize the flow of data across the diverse and unpredictable networks of the modern internet.

TCP CLOSE
TCP CLOSE
699 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (5)
File:Tcp state diagram fixed new.svg
Tcp state diagram fixed new.svg
File:TCP connection establishment.svg
TCP connection establishment.svg
File:TCP CLOSE.svg
TCP CLOSE.svg
File:TCP close() - sequence diagram.svg
TCP close() - sequence diagram.svg
File:Tcp.svg
Tcp.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.