Computer Network --- Note 3: Data Link Layer

First, the content of today

  1. Basic probability and basic data link layer problems
    1. basic concepts
    2. Three basic questions
  2. The data link layer in both cases
    1. Using the data link layer point channel
    2. Using the data link layer broadcast channel
  3. Ethernet LAN (Ethernet)
  4. Extended LAN
  5. Fast Ethernet

Second, the basic probability data link layer, and fundamental problems

A schematic view of a communication between two computers as follows:
Here Insert Picture Description
The study, mainly for the above figure refinement learn the data link layer, the data link layer to learn how to identify the header, the end of the frame, as well as some important problems is how to solve.

1. Basic Concepts
1. 链路(link):指一条点到点的物理线路段,中间没有其他的点。
	* 注意:一条链路只是一条通路的一个组成部分
2. 数据链路(data link):除了物理线以外,还必须有通信协议来控制这些数据的传输。而实现这些协议的硬件额软件加到链路上,就构成了数据链路。
	* 实现这些协议硬件和软件:现在最常见的方法是使用适配器(即网卡)
	* 一般的适配器都包括了数据链路层和物理层
3. 数据链路层传输的是帧。
2. The three basic questions

(1) encapsulated in a frame

1. 封装成帧:就是在一段数据的前后分别添加帧头、帧尾就构成了一个帧。
	* 注意:一段数据是指一定长度内的数据,并不是无限长的。一般最大是1500Byte
2. 帧头、帧尾
	* 实现:采用一些ASCII码为不可打印字符做帧头帧尾,比如控制字符
	* 作用:对帧进行定界。
3. 接受方:接受方在接受帧时,只有接受到帧头帧尾的帧才会获取,其他的都会舍弃。

Here Insert Picture Description
(2) transparent transmission

The above encapsulated in a frame there is a problem: the data portion of the frame of non-printing characters that may occur, and may even be the same as the frame header (the SOH) frame end (EOT). This will cause only the top half of the data is accepted, the latter half data is discarded, as seen in FIG. How to avoid?
Here Insert Picture Description
Solution: When the data portion of the frame, and non-printing characters appear, preceded by an escape character, which is to identify the data portion of the frame, the frame is not a header or footer. As shown below:
Here Insert Picture Description
data link layer of the transmitting side adds header, tail, and frame data packets escape character.
The data link layer of the receiving end will automatically remove header, tail, and frame escape character.
This user does not know the whole process, the user knows the data is transmitted in the past, so called transparent transmission .

(3) error control

  • Problem: In fact, in addition to the above problem, there is a problem: the data transmission process, the signal is affected by noise or fading, there will be some bits of data from 0 to 1 or from 1 to 0 , which appears error. How to solve?

  • Solution: General data packets will, after each group of data plus a frame check sequence (FCS) , the data link layer of the receiving end will be determined in accordance with ** ** frame check sequence (FCS) data for errors.

  • 帧检查序列(FCS)如何得到?方法有很多,下面介绍其中一种方法:循环冗余检验(CRC)
    Here Insert Picture Description

  • 接受端如何判断数据是否出错?同样的在接收端的数据链路层对数据帧进行循环冗余检验(CRC)计算。如果余数是0,则认为没有出错;反之则出错,但是无法纠错,会舍弃该数据。

无差错接受:凡是接受的帧,我们以非常接近于1的概率认为这些帧在传输过程中没有产生差错。
可靠传输:发送什么就收到什么。(通过确认和帧的重传机制)
小结:CRC差错技术是一种无比特差错,而不是可靠传输。因为通过CRC计算出的FCS可能为0,且除数越大,概率越接近1

三、两种情况下的数据链路层

1. 使用点对点信道的数据链路层

现在全世界使用最多的数据链路层协议是点对点协议的(Point-to-Point,简称PPP协议)。拨号上网一般都是采用的PPP协议,可见PPP协议有身份验证的功能。

  1. PPP协议要求:
    Here Insert Picture Description
  2. PPP协议组成:
    Here Insert Picture Description
  3. PPP协议帧格式:
    Here Insert Picture Description
  4. PPP协议的透明传输:
    (1)以字节流的形式传输数据。
    (2)以比特流的形式传输数据。

Here Insert Picture Description
Here Insert Picture Description
5. PPP协议工作状态:
Here Insert Picture Description

Published 138 original articles · won praise 224 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_43546676/article/details/104460616