Site home page
Get alerts when Linktionary is updated
Book updates and addendums
Get info about the Encyclopedia of Networking and Telecommunicatons, 3rd edition (2001)
Download the electronic version of the Encyclopedia of Networking, 2nd edition (1996). It's free!
Contribute to this site
Electronic licensing info
TCP (Transmission Control Protocol)
Note: Many topics at this site are reduced versions of the text in "The Encyclopedia of Networking and Telecommunications." Search results will not be as extensive as a search of the book's CD-ROM.
TCP is a subset of the Internet protocol suite, which is often called TCP/IP, although the acronym TCP/IP refers to only two of the many protocols in the Internet protocol suite. Still, most people refer to the Internet protocols as TCP/IP and that style is retained here. For a description of the entire suite, refer to "Internet Protocol Suite."
The Internet Protocol suite consists of a set of protocols that provide a variety of networking services as shown in Figure T-1. TCP and UDP (User Datagram Protocol) are transport layer components that provide the connection point through which applications access network services. TCP and UDP use IP, which is a lower-layer best effort delivery service. IP encapsulates TCP and UDP information in datagrams and delivers the information across router-connected internetworks. See "IP (Internet Protocol)" and "UDP (User Datagram Protocol)."
TCP is a connection-oriented protocol that provides the flow controls and reliable data delivery services listed next. These services run in the host computers at either end of a connection, not in the network itself. Therefore, TCP is a protocol for managing end-to-end connections, as shown in Figure T-2. Since end-to-end connections may exist across a series of point-to-point connections, they are often called virtual circuits.
Reliable data delivery services are critical for applications such as file transfers, database services, transaction processing, and other mission-critical applications in which every packet must be delivered-guaranteed. See "Reliable Data Delivery Services" for a general overview of reliable services.
While TCP provides these reliable services, it depends on IP to delivery packets. IP is often referred to as an unreliable or best effort service. While it seems odd to build a network that is unreliable, the original Internet architects wanted to remove as many services from the network itself to support fast packet delivery rather than reliability. Routers do not keep track of packets or do anything to ensure delivery. They just forward packets.
The assumption was that end systems would be relatively smart devices with memory and processors. The end devices could handle all the reliability functions rather than the network. This was actually a radical approach at the time, but the implications have been profound. It meant that end systems would become the focus of application development for the Internet, not the network.
In contrast, the telephone network implements an architecture in which end devices (phones) are dumb and the network is supposedly "smart." The only problem with this model is that you can't run applications on your phone that take advantage of the network. In fact, you are totally dependent on the phone company to deploy new applications (call waiting and caller ID are examples). Compared to the Internet, the phone system is a dinosaur. Consider that the user interface for the Web is a full-color graphical browser, while the interface for the telephone network is a 12-key pad!
While end-systems provide TCP's reliability functions, not all applications need them. For example, there is no need to recover lost packets in a live video stream. By the time they are recovered, the viewer has will have already seen the barely visible glitch caused by the missing packet. These applications just need speed. So UDP was created to provide an application interface to the network for real-time applications that don't need TCP's extra services. UDP provides a very simple port connection between applications and IP.
The topic "Reliable Data Delivery Services" has a subsection called "Partial Reliable Services" that describes several Internet protocols that provide some but not all of TCP's reliable services but more than what UDP provides. An example is RTP (Real-time Transport Protocol), a multimedia delivery protocol that provides what is called a "partial ordered service." RTP sequentially numbers packets and adds timing information for services that might need to reconstruct the original packet sequence.
See "Internet" for more information about the structure of the Internet and a history of its development. TCP is described in RFC 793 (Transmission Control Protocol, September 1981). Related documents with revisions and updates are listed on the related entries page. Also see RFC 1180 (A TCP/IP Tutorial, January 1991).
An end-to-end connection actually extends up through the TCP layer to the application that is using the network services. Note the ports in Figure T-1. The most common applications such as HTTP (Web services) and FTP (File Transfer Protocol) use ports that are "well known," so clients can connect to them to access a particular service without having to query on what port that service is running. For example, Web browsers automatically connect with port 80, FTP uses port 21, and Gopher use port 70.
A typical session involves sending packets from a source IP address and port to a destination IP address and port. The combination port and IP address is called a socket. You can think of a socket as the end of a connection. If a connection is like a circuit or wire, then the socket is the end of that wire, much like a telephone exists at the end of a voice circuit. Packets flow across networks between sockets. These packet flows can be identified by an IP address/port number combination.
TCP Segment Properties
A TCP segment is the packet of information that TCP uses to exchange data with its peers (TCP running on other hosts). The segment is what gets encapsulated into an IP datagram and transmitted across the network. See "Network Architecture" for a description of how information is exchanged between protocol layers.
Segments have a 20-byte header and a variable-length Data field. The fields of the TCP segment are described here and pictured in Figure T-3. Keep in mind that either station may send a segment that contains just header information and no data to provide the other system with session control information, such as an acknowledgment that a segment was received.
These many different fields are used to set up and control connections, as well as to provide the reliability services that guarantee data delivery. The next section provides some insight into how these features are used.
A Typical TCP Session
Assume a client needs to connect with a server. First, the client must contact the server and request a connection. After the connection is established, various control parameters for the connection are negotiated. After data transmission begins, a sliding window flow-control scheme is used to manage data transfer.
A connection is established via a three-way handshake, as described next. This handshake helps define the start of a new TCP connection, and prevents a host from being confused by duplicate packets generated by a previous connection that arrives late.
Included these steps is a negotiation of an initial sequence number for the client and for the server (each uses its own sequence number scheme). Host A sends its starting number to host B and host B acknowledges that number by incrementing it and returning the number to host A. The same process is used to negotiate host B's starting sequence number.
After data is transmitted, the session is terminated. Host A sends a FIN=1 to host B. Host B then responds with ACK=1 and FIN=1 and host A responds to that with ACK=1.
TCP uses a keep-alive feature to keep connections open and manage connections. Keep-alive verifies that the computer at the other end of a connection is still available.
A single host can set up multiple connections over the TCP/IP network at any time. This is called multiplexing. If multiple applications or network processes are running, each may set up a connection to a different computer. For example, you can simultaneously open multiple Web browsers and connect with multiple sites.
TCP uses flow controls, sliding windows, and various other mechanisms to manage sessions. These are discussed further under the following headings:
The topic congestion control discusses techniques that TCP uses to control congestion. Specifically, TCP relies on dropped packets as a signal that the receiver or network is overloaded! Much work has gone into improving this technique.
A number of IETF Working Groups are developing extensions to TCP or working on updates. Refer to the IETF Web site (listed on the related entries page) and see the Transport Area section.
Copyright (c) 2001 Tom Sheldon and Big Sur Multimedia.