Читать книгу CCNP Enterprise Certification Study Guide: Implementing and Operating Cisco Enterprise Network Core Technologies - Ben Piper, David Higby Clinton - Страница 41
Layer 4: The Transport Layer
ОглавлениеSo far, we've seen how protocols at the first three layers enable communication between two host interfaces. The primary purpose of the Transport layer is to facilitate application-to-application (end-to-end) data transfer. Whereas Network layer protocols (e.g., IPv4, IPv6) provide a way to move data from one host's interface to another host's interface, the Transport layer protocols—TCP and UDP—provide a means for applications to distinguish different communication streams. They both do this using 16-bit port numbers, as shown in Table 1.3.
Table 1.3 Common applications and their TCP and UDP port numbers
Application protocol | Transport protocol | Source IP | Source port | Destination IP | Destination port |
HTTP | TCP | 192.168.88.10 | 5230 | 18.213.128.4 | 80 |
HTTP | TCP | 192.168.88.10 | 5231 | 18.213.128.4 | 81 |
DNS | UDP | 192.168.88.10 | 56801 | 192.168.88.1 | 53 |
For example, when a web browser retrieves a web page it may open multiple TCP connections to the same web server. Each TCP connection originates from a different ephemeral (short-lived) source port chosen by the operating system, allowing the web browser and web server to keep track of which requests go with which connection.
The protocol data unit for TCP is called a segment, and for UDP it's called a datagram.
When a host receives an IP packet, the host's networking stack looks at the Protocol field to determine to which upper-layer protocol to send the data. If the Protocol field in the IP header is 6, the data contains a TCP segment. If it's 17, then it contains a UDP datagram. Consequently, a single host can use the same UDP and TCP port numbers simultaneously.
Transport layer protocols aren't always necessary. The interior gateway protocols EIGRP and OSPF ride directly over IP, using the IP protocol numbers 88 and 89, respectively.