Transmission Control Protocol
Written by GPT-6 Luna from the web 23 of 64 sentences cited
An AI wrote this article, and it can be wrong.
Transmission Control Protocol (TCP) is an Internet transport-layer protocol that provides applications with a reliable, ordered stream of bytes between two endpoints. It is one of the Internet’s foundational protocols: TCP carries data for many widely used services, while working alongside the Internet Protocol (IP), which addresses and routes packets between networks.1
TCP matters because it provides a common way for applications to communicate despite packet loss, duplication, or reordering in the networks between them. It handles delivery and ordering, but does not define the meaning or boundaries of the application’s messages. The protocol has evolved through decades of use; its current core specification is RFC 9293, published in August 2022.12
Origins
TCP grew out of efforts to connect separate packet-switched networks that used different technologies. In 1973, Vinton Cerf and Robert Kahn began developing a protocol for communication across such networks; their paper, “A Protocol for Packet Network Intercommunication,” appeared in the IEEE Transactions on Communications in May 1974.34
The early design was called the Transmission Control Program and combined functions later assigned to TCP and IP. A December 1974 specification described this program as a means of connecting processes across interconnected networks. During the following years, designers separated reliable, host-to-host transport from the network-level work of forwarding datagrams; the two resulting protocols became known as TCP and IP.56
The separation allowed applications needing reliable delivery to use TCP, while IP remained responsible for moving datagrams across networks. In November 1981, Jon Postel published a transition plan for moving ARPANET hosts from the Network Control Program to IP and TCP, setting January 1, 1983, as the target for the changeover.7
Layering
TCP sits above IP in the Internet protocol suite and below application protocols. An application passes data to TCP; TCP divides the stream into segments and sends them in IP datagrams. IP handles addressing and routing, while TCP at the receiving endpoint reassembles the data into the ordered stream expected by the application.1
TCP identifies applications using port numbers. Combined with the addresses and ports of both endpoints, these numbers allow a host to distinguish concurrent communications and deliver data to the appropriate application. A TCP connection is therefore a logical communication path between two endpoints, rather than a dedicated physical circuit through the network.1
TCP’s service is a byte stream, not a sequence of application messages. The protocol does not preserve boundaries between individual writes made by an application; software using TCP must define its own way to identify message endings or lengths. This division lets TCP provide general-purpose delivery without needing to understand the data it carries.1
Operation
A TCP connection normally begins with a three-way handshake. The initiating endpoint sends a SYN segment to announce its initial sequence number; the other endpoint replies with a SYN that also acknowledges the first segment; the initiator then sends an acknowledgment. The exchange synchronizes sequence numbering and establishes the connection state at both endpoints.1
Each byte in the stream has a sequence number. Acknowledgments are cumulative: an acknowledgment of sequence number X indicates that the receiver has received all bytes before X and expects that byte next. Sequence numbers help TCP arrange data that arrives out of order and recognize duplicates, including those that may arise after retransmission.1
TCP segments carry control information as well as data. Their headers include source and destination ports, sequence and acknowledgment numbers, a checksum, and flags used for such purposes as opening, acknowledging, or closing a connection. The checksum can help detect corrupted segments, but it is not a cryptographic mechanism for authenticating a sender or protecting data from deliberate alteration.1
Reliability
TCP attempts to recover when data is lost or arrives damaged, duplicated, or out of order. If the sender does not receive an acknowledgment within the relevant retransmission interval, it can resend unacknowledged data. The receiver uses sequence numbers to place bytes in order and discard duplicates, so the application ordinarily receives a reliable, ordered stream rather than the network’s raw sequence of packets.1
The receiver also advertises a window indicating how much more data it can accept. This flow-control mechanism prevents a sender from overrunning the receiver’s available buffer space. It addresses the receiver’s capacity, not the overall load on the network, which is handled separately by congestion control.1
Congestion control governs how much data a sender places into the network. Standards describe mechanisms including slow start, congestion avoidance, fast retransmit, and fast recovery; these use acknowledgments and signs of loss to adjust the sender’s congestion window. The amount a sender may transmit at a given time is constrained by both this congestion window and the receiver’s advertised window.8
Extensions have been added to improve performance on particular paths. Selective acknowledgment, or SACK, lets a receiver report blocks of data it has received beyond a gap, enabling the sender to retransmit missing data without resending every later segment. Window scaling and timestamps are among the extensions specified for high-performance connections.910
Uses and limits
TCP is used by a wide range of application protocols. HTTP/1.1 ordinarily uses TCP over IP, SMTP uses TCP connections to transfer mail between servers, and SSH commonly runs over TCP/IP. In each case, the application protocol supplies its own rules for interpreting the stream.111213
Reliability and ordering are useful when applications need all data delivered in sequence, but TCP’s service is not suited to every task. An application that needs a different balance of latency, reliability, or message structure may use another transport protocol. TCP itself does not promise that a connection is still live merely because it was previously established, and delivery can be delayed while lost data is retransmitted.1
TCP also does not supply application-level encryption. Applications that need confidentiality and cryptographic integrity must use additional mechanisms; HTTP, for example, can use HTTPS to identify a protected connection. The TCP checksum detects some transmission errors, but does not replace cryptographic protection.111
Security and alternatives
TCP’s connection-establishment behavior has security implications. In a SYN-flood attack, an adversary sends connection-opening requests that cause a server to retain state for incomplete connections, potentially consuming resources needed for legitimate requests. The IETF has documented this denial-of-service technique and discussed mitigations, including SYN caches and SYN cookies.14
Sequence numbers and endpoint information also matter to the security of existing connections. The IETF’s guidance on sequence-number attacks describes how an attacker who can guess or learn relevant connection details may attempt to inject packets; cryptographic authentication is identified as the appropriate protection against such attacks.15
TCP is not the only transport used for Internet applications. QUIC is a separate, secure transport protocol carried in UDP datagrams; it provides streams, flow control, and connection migration. HTTP/3 maps HTTP onto QUIC rather than TCP, while its specification calls for clients to try TCP-based HTTP versions when connectivity problems prevent a QUIC connection.1617
Standardization
TCP’s 1981 specification, RFC 793, brought together earlier work and became the long-standing foundation for implementations. Later additions and clarifications were published in separate documents, covering features such as congestion control, security, and performance.1819
In August 2022, RFC 9293 replaced RFC 793 as the consolidated core specification. It gathers standards-track changes and clarifications to TCP’s base behavior, while pointing to companion documents for more specialized features, including advanced congestion control and loss recovery. TCP remains an Internet Standard, maintained through the Internet Engineering Task Force’s standards process.21
References
19 sourcesRFC 9293: Transmission Control Protocol (TCP) | RFC Editorrfc-editor.orgAug 18, 2022· cited 2×
Internet History | Computer History Museumcomputerhistory.org
RFC 2018: TCP Selective Acknowledgment Options | RFC Editorrfc-editor.orgOct 1, 1996
RFC 7323: TCP Extensions for High Performance | RFC Editorrfc-editor.orgSep 19, 2014
RFC 9112: HTTP/1.1rfc-editor.org· cited 2×
RFC 4253: The Secure Shell (SSH) Transport Layer Protocol | RFC Editorrfc-editor.orgJan 6, 2006
RFC 4987: TCP SYN Flooding Attacks and Common Mitigations | RFC Editorrfc-editor.orgAug 17, 2007
RFC 6528: Defending against Sequence Number Attacks | RFC Editorrfc-editor.orgFeb 1, 2012
RFC 9114: HTTP/3rfc-editor.org
RFC 793: Transmission Control Protocol | RFC Editorrfc-editor.org
RFC 7414: A Roadmap for Transmission Control Protocol (TCP) Specification Documents | RFC Editorrfc-editor.orgFeb 2, 2015