The transport layer is Layer 4 of the five-layer TCP/IP model. It delivers data from a destination host to the correct application process, using port numbers to distinguish among services running simultaneously. section 4.3.1 section 4.4
Understand the transport layer by separating its role from the lower layers:
- Layer 2 uses MAC addresses for hop-to-hop delivery; Layer 3 uses IP addresses for end-to-end delivery between hosts. section 4.3.1
- Layer 4 uses port numbers to direct received data to the appropriate application process, such as a web service. section 4.3.1
- Transport-layer ports are logical addressing values and are unrelated to the physical ports used for cables and connectors. section 4.3.1
- TCP and UDP are the two major Layer 4 protocols; TCP provides features such as reliable communication and flow control, while their preferred situations are compared separately. section 22.0
HTTPS request to a web server
A browser on PC1 requests a web page from SRV1 using HTTPS. Layers 2 and 3 deliver the message across the network, while Layer 4 addresses it to port 443 so SRV1 can pass it to the HTTPS service. Other open ports, such as 53 and 80, identify different services. section 4.3.1
Figure 4.4 Layers 2 and 3 work together to deliver PC1’s message to SRV1. At Layer 4, PC1 addresses the message to port 443, which is used by the HTTPS protocol. Three ports are open on SRV1 (53, 80, 443), meaning it will accept messages addressed to any of those ports.
Trace how MAC addresses change at each hop, the destination IP remains constant, and port 443 identifies the HTTPS application on the destination host. section 4.3.1
During encapsulation, a Layer 4 protocol adds a header containing the destination port before Layer 3 and Layer 2 add their own headers. At the destination, headers are inspected and removed in reverse order before the application processes the data. section 4.3.2

