Skip to content

DataLink

1. 帧 (Frame)

  • 定义 (Definition): 数据链路层的数据单元称为帧(Frame)。帧是数据链路层将数据封装并准备通过物理介质传输的格式。每个帧包括一个帧头(Header)、数据部分(Payload)和帧尾(Trailer)。
  • The data unit at the Data Link Layer is called a frame. A frame is the format used by the Data Link Layer to encapsulate data and prepare it for transmission over the physical medium. Each frame includes a header, a data portion (payload), and a trailer.

2. MAC 地址 (MAC Address)

  • 定义 (Definition): 媒体访问控制地址(MAC 地址)是每个网络接口卡(NIC)上唯一的硬件地址,用于识别同一网络中的设备。MAC 地址在数据链路层用于标识数据帧的源和目的地址。
  • The Media Access Control (MAC) address is a unique hardware address assigned to each Network Interface Card (NIC) and is used to identify devices within the same network. MAC addresses are used at the Data Link Layer to identify the source and destination of data frames.
  • 定义 (Definition): LLC 是数据链路层的上层子层,负责帧的多路访问、帧同步、流量控制和错误检测。它为网络层提供接口,并管理多种网络协议的操作。
  • LLC is the upper sublayer of the Data Link Layer, responsible for multiplexing, frame synchronization, flow control, and error detection. It provides an interface to the Network Layer and manages the operation of multiple network protocols.

4. 媒体访问控制子层 (MAC, Media Access Control)

  • 定义 (Definition): MAC 是数据链路层的下层子层,负责控制设备如何访问物理传输介质。它处理帧的发送和接收,以及与物理层的接口管理。
  • MAC is the lower sublayer of the Data Link Layer, responsible for controlling how devices access the physical transmission medium. It handles the sending and receiving of frames, as well as managing the interface with the Physical Layer.

5. 错误检测与纠正 (Error Detection and Correction)

  • 错误检测 (Error Detection): 数据链路层使用帧校验序列(FCS)来检测数据在传输过程中是否发生了错误。FCS 通常基于循环冗余校验(CRC)算法计算得到。
  • The Data Link Layer uses the Frame Check Sequence (FCS) to detect errors that may occur during data transmission. The FCS is typically calculated using the Cyclic Redundancy Check (CRC) algorithm.

  • 错误纠正 (Error Correction): 在某些协议(如 HDLC)中,数据链路层可以执行简单的错误纠正,通常是通过请求重新发送损坏的数据帧来实现的。

  • In some protocols (such as HDLC), the Data Link Layer can perform simple error correction, usually by requesting the retransmission of corrupted data frames.

6. 交换与桥接 (Switching and Bridging)

  • 交换 (Switching): 交换机是工作在数据链路层的设备,通过读取每个帧的目标 MAC 地址,将帧转发到正确的端口。交换机分隔碰撞域,每个端口都是一个独立的碰撞域,从而减少网络中的数据冲突。
  • A switch is a device that operates at the Data Link Layer by reading the destination MAC address of each frame and forwarding it to the correct port. Switches segment collision domains, with each port being an independent collision domain, reducing data collisions in the network.

  • 桥接 (Bridging): 桥接器用于连接两个或多个网络段,并根据 MAC 地址表来转发或过滤帧,减少不必要的流量。

  • A bridge is used to connect two or more network segments and forwards or filters frames based on the MAC address table, reducing unnecessary traffic.

7. 流量控制 (Flow Control)

  • 定义 (Definition): 流量控制是防止发送方在接收方处理能力不足时发送过多数据的一种机制。它确保网络设备之间的数据传输不会导致丢包和网络拥塞。
  • Flow control is a mechanism that prevents the sender from overwhelming the receiver with too much data, ensuring that data transmission between network devices does not result in packet loss and network congestion.

8. 媒体访问控制方法 (Media Access Control Methods)

  • CSMA/CD (载波监听多路访问/碰撞检测): 用于有线以太网中,设备在发送数据前监听信道是否空闲,如果发生碰撞,设备会等待随机时间后重新发送。
  • Used in wired Ethernet, devices listen to the channel before sending data. If a collision occurs, the device waits for a random time before retransmitting.

  • CSMA/CA (载波监听多路访问/碰撞避免): 用于无线网络中,设备在发送数据前发出一个准备发送信号,以避免碰撞。

  • Used in wireless networks, devices send a ready-to-send signal before transmitting data to avoid collisions.

9. 碰撞域与广播域 (Collision Domain and Broadcast Domain)

  • 碰撞域 (Collision Domain): 在一个碰撞域中,多个设备共享同一传输介质,可能导致数据帧碰撞。通过交换机或路由器分隔碰撞域可以减少碰撞的发生。
  • In a collision domain, multiple devices share the same transmission medium, which may lead to data frame collisions. Segmenting collision domains using switches or routers can reduce collisions.

  • 广播域 (Broadcast Domain): 一个广播域是一个网络段,所有设备都能接收到来自任意设备发送的广播消息。路由器通常用于分隔广播域,防止广播消息在整个网络中泛滥。

  • A broadcast domain is a network segment where all devices can receive broadcast messages sent by any device. Routers are typically used to segment broadcast domains, preventing broadcast messages from flooding the entire network.
  • 链路建立与维护 (Link Establishment and Maintenance): 数据链路层负责建立、维护和终止物理链路上的连接,确保数据帧在发送方和接收方之间可靠传输。
  • The Data Link Layer is responsible for establishing, maintaining, and terminating connections on the physical link, ensuring reliable data frame transmission between the sender and receiver.

11. 协议 (Protocols)

  • 以太网 (Ethernet): 最常用的数据链路层协议,定义了帧格式、MAC 地址规则以及介质访问控制方法。
  • The most commonly used Data Link Layer protocol, defining frame formats, MAC address rules, and media access control methods.

  • HDLC (高级数据链路控制): 一种面向比特的同步数据链路层协议,常用于点对点和多点通信。

  • A bit-oriented synchronous Data Link Layer protocol commonly used in point-to-point and multipoint communications.

  • PPP (点对点协议, Point-to-Point Protocol): 一种用于直接连接两个节点的链路层协议,支持多种网络层协议(如 IP)。

  • A Data Link Layer protocol used for direct connection between two nodes, supporting multiple Network Layer protocols (such as IP).

总结 (Summary)

数据链路层在 OSI 模型中负责提供可靠的物理网络连接,通过帧的封装、地址管理、错误检测与纠正、交换和流量控制等功能,确保数据能够在网络设备之间高效且无误地传输。理解数据链路层的核心知识对于设计、管理和优化网络至关重要。 - The Data Link Layer in the OSI model is responsible for providing a reliable physical network connection. Through functions such as frame encapsulation, address management, error detection and correction, switching, and flow control, it ensures that data is efficiently and accurately transmitted between network devices. Understanding the core concepts of the Data Link Layer is crucial for designing, managing, and optimizing networks.

---