TCP Ports, Connections and Connection Identification
(Page 1 of 2)
The two TCP/IP transport layer protocols, TCP and UDP, play the same architectural role in the protocol suite, but do it in very different ways. In fact, one of the few functions that the two have in common is providing a method of transport-layer addressing and multiplexing. Through the use of ports, both protocols allow the data from many different application processes to be aggregated and sent through the IP layer, and then returned up the stack to the proper application process on the destination device. This is all explained in detail in the section describing ports and sockets.
Despite this commonality, TCP and UDP diverge somewhat even in how they deal with processes. UDP is a connectionless protocol, which of course means devices do not set up a formal connection before sending data. UDP doesn't have to use sliding windows, or keep track of how long it has been since a transmission was sent and so forth. When the UDP layer on a device receives data it just sends it to the process indicated by the destination port, and that's that. It can seamlessly handle any number of processes sending it messages because they are all handled identically.
Since TCP is connection-oriented, it has many more responsibilities. Each TCP software layer needs to be able to support connections to several other TCPs simultaneously. The operation of each connection is separate from of each other connection, and the TCP software must manage each independently. It must be sure not only that data is routed to the right process, but that data transmitted on each connection is managed without any overlap or confusion.
The first consequence of this is that each connection must be uniquely identified. This is done by using the pair of socket identifiers corresponding to the two endpoints of the connection, where a socket is simply the combination of the IP address and the port number of each process. This means a socket pair contains four pieces of information: source address, source port, destination address. Thus, TCP connections are sometimes said to be described by this addressing quadruple.
I introduced this in the general topic on TCP/IP sockets, where I gave the example of an HTTP request sent from a client at 184.108.40.206 to a Web site at 220.127.116.11. The server for that Web site will use well-known port number 80, so its socket is 18.104.22.168:80. If the client has been assigned ephemeral port number 3,022 for the Web browser, the client socket is 22.214.171.124:3022. The overall connection between these devices can be described using this socket pair:
Home - Table Of Contents - Contact Us
The TCP/IP Guide (http://www.TCPIPGuide.com)
Version 3.0 - Version Date: September 20, 2005
© Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.