This is the 19th day of my participation in the Gwen Challenge in November. Check out the details: The last Gwen Challenge in 2021

1. Problems solved at the data link layer

Partial shipments into the frame

Transparent transmission

Error control

2. Simple model of data link layer

3. Channel type of the data link layer

1) Point-to-point channel: this channel uses one-to-one point-to-point communication mode;

2) Broadcast channel: this channel uses one-to-many broadcast communication mode, so the process is relatively complicated. There are many hosts connected on the broadcast channel, so a dedicated shared channel protocol must be used to coordinate the data transmission of these hosts.

4. Links and data links

A link is a point-to-point physical line segment without any other switching nodes in between. (A link is just one component of a path)

In addition to physical routes, a data link must have communication protocols to control the transmission of these data. If the hardware and software to implement these protocols are added to the link, it constitutes a data link (now the most common method is to use adapters (namely network cards) to implement the hardware and software of these protocols; Generally, adapters include both the data link layer and the physical layer.

5. The frame

6. Encapsulate them into frames

Framing is the process of adding a header and a tail before and after a piece of data to form a frame. One of the most important functions of the header and tail is frame delimiting.

7. Transparent transmission

All is well if the data being transmitted is a printable character set in the ASSCII code.

A problem occurs when the transmitted data is composed of more than “printable characters,” as shown below

1) Use byte filling method to solve the problem of transparent transmission

The data link layer at the sending end inserts an escape character “ESC” (hex code is 1B) before the occurrence of the control character “SOH” or “EOT” in the data.

Byte padding or character padding – The data link layer at the receiving end removes the inserted escape characters before sending the data to the network layer.

If an escape character is also present in the data, an escape character should be inserted before the escape character. When the receiver receives two consecutive transfer characters I, it deletes the first one of them.

8. Error detection

Bit errors may occur during transmission: 1 May become 0 and 0 May become 1.

Over a period of time, the ratio of the number of incorrectly transmitted bits to the total number of transmitted bits is called the BER (bit error rate).

Ber and SNR are of great concern.

In order to ensure the reliability of data transmission, various error detection measures must be adopted in computer network data transmission.

1) Calculation process of CRC for cyclic redundancy test2) Frame test sequence FCS

The redundant codes added to the data are called frame check sequence (FCS).

Cyclic redundancy check CRC is not equivalent to frame check sequence FCS.

CRC is a common error-detection method, while FCS is a redundant code added to the end of data.

FCS can be obtained using CRC. CRC alone is not the only way to obtain FCS.

3) The receiver performs CRC check on each frame it receives

Inspection:

If the remainder R=0, the frame is judged to be correct and accepted.

If the remainder R is not equal to 0, the frame is judged to be faulty and discarded.

Features:

This test does not determine which or which bits are in error.

The probability of undetected errors is very, very small only if the divisor P is carefully selected and has enough digits.

9. The PPP protocol

Point to Point Protrcol (PPP) is the most widely used data link layer protocol in the world.

PPP is generally used when users use dial-up telephone lines to access the Internet.

1) COMPOSITION of PPP protocol

The PPP protocol was developed in 1992 and, after revisions in 1993 and 1994, is now the official standard for the Internet.

PPP has three components

Data link layer protocols can be used for asynchronous serial or synchronous serial media.

It uses LCP (Link Control Protocol) to establish and maintain data link connections.

Network Control Protocol (NCP) allows multiple network protocols to be used over point-to-point connections, as shown in figure.

2) PPP frame format

The flag field F=0x7E (the symbol “0x” indicates that the following character is represented in hexadecimal, and the binary representation of hexadecimal 7E is 01111110).

Address field A is only set to 0xFF. The address field doesn’t actually work.

Control field C is usually set to 0x03.

PPP is byte-oriented, and all PPP frames are integer bytes in length.

3) Byte fill

The value of the flag field appears in the information field, which may be mistaken for “flag”.

Converts each 0x7E byte present in the information field to a 2-byte sequence (0x7D,0x5E).

If a 0x7D byte is present in the information field, it is converted to a 2-byte sequence (0x7D,0x5D).

If an ASCII control character (that is, a character with a value less than 0x20) is present in the information field, a 0x7D byte is added before the character and the encoding of the character is changed.

4) Zero bit filling method

PPP, when used on SONET/SDH links, uses synchronous transmission (a series of bits sent continuously). At this time, PPP protocol adopts the collar bit filling method to achieve transparent transmission

At the sending end, whenever five consecutive ones appear, a 0 is immediately filled in. The receiver scans the bit stream in the frame. Every time five consecutive ones are found, the 0 following those five consecutive ones is deleted.

5) Do not use serial number and confirmation mechanism

PPP protocol does not use serial number and confirmation mechanism for the following reasons:

When the probability of errors at the data link layer is small, the PPP protocol is relatively simple.

In the Internet context, the PPP information field puts the data into the IP datagram. Reliable transmission at the data link layer does not guarantee reliable transmission at the network layer.

The frame check sequence FCS field ensures error-free acceptance.

When a user dials up to an ISP, the router’s modem confirms the dial-up and establishes a physical connection. The PC sends a series of LCP packets (encapsulated into multiple PPP frames) to the router.

These packets and their responses select some PPP parameters and perform network layer configuration. NCP assigns a temporary IP address to the newly connected PC, making the PC a host on the Internet.

When the communication is complete, NCP releases the network layer connection and takes back the original IP address. Then. LCP Releases the data link layer connection. Finally, the physical layer connections are released.

  1. Topology of the Internet