6.8 小结

6.8 小结#

6.8 Summary

在本章中,我们考察了链路层——其服务、其操作原理,以及若干使用这些原理实现链路层服务的重要具体协议。

我们看到,链路层的基本服务是将一个网络层数据报从一个节点(主机、交换机、路由器、WiFi 接入点)移动到相邻节点。我们了解到,所有链路层协议在传输帧到相邻节点之前,都是通过将网络层数据报封装在链路层帧中来进行操作的。然而,除了这种共同的帧封装功能之外,不同链路层协议所提供的链路访问、传输和交付服务差异巨大。这些差异部分来源于链路层协议必须运行于各种不同类型链路之上。一个简单的点对点链路有单一的发送方和接收方,它们通过一根“线”通信。而一个多址链路则被多个发送方和接收方共享;因此,用于多址信道的链路层协议必须具备一种用于协调链路访问的协议(即多址协议)。在 MPLS 的情形中,连接两个相邻节点的“链路”(例如,在 IP 意义上相邻的两个 IP 路由器——即它们是通往某目的地的下一跳 IP 路由器)实际上可能本身就是一个网络。从某种意义上说,将一个网络视为链路并不奇怪。例如,连接家庭调制解调器/计算机与远程调制解调器/路由器的电话链路,其实就是穿过一个复杂电话网络的路径。

在构成链路层通信的诸多原理中,我们考察了差错检测与纠正技术、多址协议、链路层寻址、虚拟化(VLAN),以及扩展交换式局域网与数据中心网络的构建。如今链路层研究的重点大多集中在这些交换式网络上。在差错检测/纠正方面,我们探讨了如何通过在帧首部添加额外比特位来检测并在某些情况下纠正链路传输过程中可能出现的位翻转错误。我们介绍了简单的奇偶校验与校验和方法,以及更为健壮的循环冗余校验。随后我们进入多址协议主题,识别并研究了三种协调广播信道访问的主要方法:信道划分方法(TDM、FDM)、随机访问方法(ALOHA 协议和 CSMA 协议)以及轮流使用方法(轮询和令牌传递)。我们研究了有线接入网络,并发现其使用了多种多址方法。我们看到,多节点共享单一广播信道的结果是必须在链路层提供节点地址。我们了解到链路层地址与网络层地址差异显著,而在互联网中,一种特殊协议(ARP——地址解析协议)被用来在这两种寻址形式之间进行转换,并详细学习了极其成功的以太网协议。接着我们研究了如何使共享广播信道的节点形成 LAN,以及如何将多个 LAN 互联形成更大的 LAN——这一切都无需通过网络层路由来互联这些本地节点。我们还学习了如何在一套物理 LAN 基础设施上创建多个虚拟 LAN。

我们以 MPLS 网络在连接 IP 路由器时如何提供链路层服务为重点,结束了对链路层的学习,并概览了当今大型数据中心的网络设计。我们以识别获取一个简单网页所需的众多协议,作为本章(实际上也是前五章)的结尾。在讲完链路层之后,我们在协议栈中的旅程也告一段落了!当然,在链路层之下还有物理层,但物理层的细节可能更适合留给另一门课程(例如通信原理课程,而非计算机网络课程)。不过,我们在本章以及 第 1 章 中对物理媒介的讨论)中已经涉及了物理层的若干方面。在下一章中我们研究无线链路特性时,还会再次提到物理层。

尽管我们在协议栈中的旅程已结束,但对计算机网络的学习尚未完结。在接下来的三章中,我们将讲授无线网络、网络安全和多媒体网络。这四个主题并不方便地归属于某一特定层;实际上,每个主题都跨越多个层。理解这些主题(在某些网络教材中被归为高级主题)因此需要对整个协议栈各层有坚实的理解——而我们对链路层的学习正好完成了这一基础!

In this chapter, we’ve examined the link layer—its services, the principles underlying its operation, and a number of important specific protocols that use these principles in implementing link-layer services.

We saw that the basic service of the link layer is to move a network-layer datagram from one node (host, switch, router, WiFi access point) to an adjacent node. We saw that all link-layer protocols operate by encapsulating a network-layer datagram within a link-layer frame before transmitting the frame over the link to the adjacent node. Beyond this common framing function, however, we learned that different link-layer protocols provide very different link access, delivery, and transmission services. These differences are due in part to the wide variety of link types over which link-layer protocols must operate. A simple point-to-point link has a single sender and receiver communicating over a single “wire.” A multiple access link is shared among many senders and receivers; consequently, the link-layer protocol for a multiple access channel has a protocol (its multiple access protocol) for coordinating link access. In the case of MPLS, the “link” connecting two adjacent nodes (for example, two IP routers that are adjacent in an IP sense—that they are next-hop IP routers toward some destination) may actually be a network in and of itself. In one sense, the idea of a network being considered as a link should not seem odd. A telephone link connecting a home modem/computer to a remote modem/router, for example, is actually a path through a sophisticated and complex telephone network.

Among the principles underlying link-layer communication, we examined error-detection and -correction techniques, multiple access protocols, link-layer addressing, virtualization (VLANs), and the construction of extended switched LANs and data center networks. Much of the focus today at the link layer is on these switched networks. In the case of error detection/correction, we examined how it is possible to add additional bits to a frame’s header in order to detect, and in some cases correct, bit-flip errors that might occur when the frame is transmitted over the link. We covered simple parity and checksumming schemes, as well as the more robust cyclic redundancy check. We then moved on to the topic of multiple access protocols. We identified and studied three broad approaches for coordinating access to a broadcast channel: channel partitioning approaches (TDM, FDM), random access approaches (the ALOHA protocols and CSMA protocols), and taking-turns approaches (polling and token passing). We studied the cable access network and found that it uses many of these multiple access methods. We saw that a consequence of having multiple nodes share a single broadcast channel was the need to provide node addresses at the link layer. We learned that link-layer addresses were quite different from network-layer addresses and that, in the case of the Internet, a special protocol (ARP—the Address Resolution Protocol) is used to translate between these two forms of addressing and studied the hugely successful Ethernet protocol in detail. We then examined how nodes sharing a broadcast channel form a LAN and how multiple LANs can be connected together to form larger LANs—all without the intervention of network-layer routing to interconnect these local nodes. We also learned how ­multiple virtual LANs can be created on a single physical LAN infrastructure.

We ended our study of the link layer by focusing on how MPLS networks provide link-layer services when they interconnect IP routers and an overview of the network designs for today’s massive data centers. We wrapped up this chapter (and indeed the first five chapters) by identifying the many protocols that are needed to fetch a simple Web page. Having covered the link layer, our journey down the protocol stack is now over! Certainly, the physical layer lies below the link layer, but the details of the physical layer are probably best left for another course (for example, in communication theory, rather than computer networking). We have, however, touched upon several aspects of the physical layer in this chapter and in Chapter 1 (our discussion of physical media in Section 1.2). We’ll consider the physical layer again when we study wireless link characteristics in the next chapter.

Although our journey down the protocol stack is over, our study of computer networking is not yet at an end. In the following three chapters we cover wireless networking, network security, and multimedia networking. These four topics do not fit conveniently into any one layer; indeed, each topic crosscuts many layers. Understanding these topics (billed as advanced topics in some networking texts) thus requires a firm foundation in all layers of the protocol stack—a foundation that our study of the link layer has now completed!