Data Communication Computer Network 简明教程
Data-link Layer Introduction
数据链路层是 OSI 分层模型的第二层。该层是最复杂的层之一,具有复杂的功能和责任。数据链路层隐藏底层硬件的详细信息,并且将自己表示为上层通信的介质。
Data Link Layer is second layer of OSI Layered Model. This layer is one of the most complicated layers and has complex functionalities and liabilities. Data link layer hides the details of underlying hardware and represents itself to upper layer as the medium to communicate.
数据链路层在以某种意义上直接连接的两个主机之间工作。这种直接连接可能是点对点或广播。广播网络上的系统据说在同一条链路上。当数据链路层处理单个碰撞域上的多个主机时,其工作往往变得更加复杂。
Data link layer works between two hosts which are directly connected in some sense. This direct connection could be point to point or broadcast. Systems on broadcast network are said to be on same link. The work of data link layer tends to get more complex when it is dealing with multiple hosts on single collision domain.
数据链路层负责逐位将数据流转换为信号并通过底层硬件发送。在接收端,数据链路层从硬件中获取以电信号形式存在的数据,将它们组装成可识别的帧格式,并移交给上层。
Data link layer is responsible for converting data stream to signals bit by bit and to send that over the underlying hardware. At the receiving end, Data link layer picks up data from hardware which are in the form of electrical signals, assembles them in a recognizable frame format, and hands over to upper layer.
数据链路层有两个子层:
Data link layer has two sub-layers:
-
Logical Link Control: It deals with protocols, flow-control, and error control
-
Media Access Control: It deals with actual control of media
Functionality of Data-link Layer
数据链路层代表上层执行许多任务。这些任务有:
Data link layer does many tasks on behalf of upper layer. These are:
-
Framing Data-link layer takes packets from Network Layer and encapsulates them into Frames.Then, it sends each frame bit-by-bit on the hardware. At receiver’ end, data link layer picks up signals from hardware and assembles them into frames.
-
Addressing Data-link layer provides layer-2 hardware addressing mechanism. Hardware address is assumed to be unique on the link. It is encoded into hardware at the time of manufacturing.
-
Synchronization When data frames are sent on the link, both machines must be synchronized in order to transfer to take place.
-
Error Control Sometimes signals may have encountered problem in transition and the bits are flipped.These errors are detected and attempted to recover actual data bits. It also provides error reporting mechanism to the sender.
-
Flow Control Stations on same link may have different speed or capacity. Data-link layer ensures flow control that enables both machine to exchange data on same speed.
-
Multi-Access When host on the shared link tries to transfer the data, it has a high probability of collision. Data-link layer provides mechanism such as CSMA/CD to equip capability of accessing a shared media among multiple Systems.