Transport Layer ConceptsBefore moving to a more detailed discussion of TCP and UDP, it is worth pausing for a moment to focus on a few of the important concepts:
These important concepts are essential to understanding the design of the Transport layer. You'll learn about these concepts in the following sections. Connection-Oriented and Connectionless ProtocolsTo provide the appropriate level of quality assurance for any given situation, developers have come up with two alternative network protocol archetypes:
Figure 6.1 shows two people demonstrating connection-oriented communication. Of course, they are not intended to show the true complexity of digital communications but simply to illustrate the concept of a connection-oriented protocol. Figure 6.1. A connection-oriented protocol.Figure 6.2 shows how the same data would be sent using a connectionless protocol. Figure 6.2. A connectionless protocol.Ports and SocketsThe Transport layer serves as an interface between network applications and the network and provides a method for addressing network data to particular applications. In the TCP/IP system, applications can address data through either the TCP or UDP protocol module using port numbers. A port is a predefined internal address that serves as a pathway from the application to the Transport layer or from the Transport layer to the application (see Figure 6.3). For instance, a client computer typically contacts a server's FTP application through TCP port 21. Figure 6.3. A port address targets data to a particular application.A closer look at the Transport layer's application-specific addressing scheme reveals that TCP and UDP data is actually addressed to what is called a socket. A socket is an address formed by concatenating the IP address and the port number. For instance, the socket number 111.121.131.141.21 refers to port 21 on the computer with the IP address 111.121.131.141. Figure 6.4 shows how computers using TCP exchange socket information when they form a connection. Figure 6.4. Exchanging the source and destination socket numbers.The following is an example of how a computer accesses an application on a destination machine through a socket:
You'll learn more about how to initiate a TCP connection later in this hour.
Multiplexing/DemultiplexingThe socket addressing system enables TCP and UDP to perform another important Transport layer task: multiplexing and demultiplexing. As described earlier, multiplexing is the act of braiding input from several sources into a single output, and demultiplexing is the act of receiving input from a single source and delivering it to multiple outputs (see Figure 6.5). Figure 6.5. Multiplexing and demultiplexing.Multiplexing/demultiplexing enables the lower levels of the TCP/IP stack to process data without regard to which application initiated that data. All associations with the originating application are settled at the Transport layer, and data passes to and from the Internet layer in a single, application-independent pipeline. The key to multiplexing and demultiplexing is the socket address. Because the socket address combines the IP number with the port number, it provides a unique identifier for a specific application on a specific machine. See the Telnet server depicted in Figure 6.6. All client machines use the well-known port address TCP 23 to contact the Telnet server, but the destination socket for each of the connecting PCs is unique. Likewise, all network applications running on the Telnet server use the server's IP address, but only the Telnet service uses the socket address, consisting of the server's IP address plus TCP port 23. Figure 6.6. The socket address uniquely identifies an application on a particular server. |