20 TCP and UDP
This chapter covers
- How TCP and UDP provide layer-4 addressing and session multiplexing
- How TCP provides features like reliable communication and flow control
- Comparing TCP and UDP, and the situations in which each is preferred
In chapter 3 of this book, we covered physical cables, connectors, and ports—layer 1 of the TCP/IP model. In other chapters, we covered the Data Link layer (layer 2): MAC addresses, frame switching, VLANs, STP, and other related topics. We have also spent many pages on the Network layer (layer 3): IPv4 addressing and subnetting, packet forwarding, static and dynamic routing, first-hop redundancy protocols, etc. In this chapter, we will venture beyond those first three layers and take a look at layer 4 of the TCP/IP model: the Transport layer. Specifically, we will examine the two major layer-4 protocols: Transmission Control Protocol (TCP) and User Datagram Protocol (UDP), which are exam topic 1.5: Compare TCP to UDP.
20.1 The role of layer 4
In chapter 4 of this book, we took a high-level look at the role of each layer of the TCP/IP model. For review, figure 20.1 summarizes the role of each layer.
Figure 20.1 A web browser on PC1 uses a layer-7 protocol (HTTPS) to request a web page from the web server on SRV1. Layers 2, 3, and 4 work together to deliver the message to the appropriate application on SRV1. Layer 1 provides the medium over which the communication occurs.
