当前位置:网站首页>[kingcraft] 3.1 link layer - functions of data link layer

[kingcraft] 3.1 link layer - functions of data link layer

2022-06-11 00:27:00 ChuHao H

3.1 Data link layer functions

The main function of the data link layer is to strengthen the ability of the physical layer to transmit the original bit stream , Transform the possible error physical connection of the physical layer into a logically error free data link .

3.1.1 Services for the network layer

The data link layer can provide the following services for the network layer :

  1. No connection service without confirmation : The source machine does not need to establish a link connection before sending data frames , The destination machine does not need to play a confirmation when it receives it . For lost frames , The data link layer is not responsible for retransmission, but is handled by the upper layer .
  2. Confirmed connectionless service : The source machine does not need to establish a link connection before sending data frames , But the destination machine must send back the data frame . When the source machine does not receive the return message within the specified time, it retransmits the data frame , So as to improve the reliability of data transmission
  3. Connection oriented service with acknowledgement : The frame transmission of this service is divided into link establishment 、 Transmit frame 、 There are three stages to releasing the data link . The destination machine needs to confirm each received frame , The source machine cannot send the next frame until it receives it

Establishment of data link layer connection 、 The process of maintenance and release is called Link management , It is mainly used for connection oriented services , That is, a connection oriented service with validation .

3.1.2 Frame delimitation 、 Frame synchronization and transparent transmission

When two hosts transmit information to each other , The network layer packets (packet) Packets are encapsulated into frames . Add a piece of data before and after the head and tail to form a frame . An important information in the head and tail is to determine the frame delimitation . Frame synchronization is that the receiver should distinguish the start and end of the frame from the received binary bit stream . For example HDLC In the agreement, it is marked as F(01111110) To identify the beginning and end of the frame , This is Frame delimiter . Each data link layer protocol specifies the maximum length of the data part of the frame —— Maximum transfer unit (MTU)

Start flag
Address
8 position
control
8 position
Information
N position ( variable )
Frame check sequence (FCS)
16 position
Termination sign

But if the same bit combination as the frame delimiter happens to appear in the data , The receiver may mistake the information in the data for the termination flag , Causes the frame to be truncated from the middle . The data link layer protocol can adopt special methods to prevent this kind of situation , That is, no matter what combination of bitstreams are transmitted , The link layer can transmit complete frames , The transmitted information will not be mistaken for the end flag , This is it. Transparent transmission .

3.1.3 flow control

Since the sending and receiving parties will have their own working rates , The sending capacity of the sender may exceed the receiving capacity of the receiver . If the sender's rate is not limited , This will result in a steady stream of incoming frames flooding the receiver , As a result, more and more frames need to be cached by the receiver, and eventually the cache will burst , Cause frame loss . Therefore, flow control is the data flow of the sender , The sending rate shall not exceed the receiving rate .

3.1.4 Error control

Due to channel noise and other reasons , Errors may occur in the transmission of frames . The method that enables the sender to confirm whether the receiver has correctly received the data sent by the sender is called Error control . Usually, errors are divided into Bit error and Frame error . Bit error is the error of some bits in the frame , use CRC Cyclic redundancy check Dislocations can be found , adopt Automatic retransmission request ARQ Method to retransmit the wrong frame . Frame error refers to the loss of frames 、 Repetition or disorder , The introduction of timer and numbering mechanism in the data link layer can ensure that each frame is finally and only once correctly delivered to the destination .

原网站

版权声明
本文为[ChuHao H]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020628372433.html