Channel type of the data link layer
One-to-one: point-to-point channel
One-to-many: broadcast channel
Three key concepts of the data link layer
Encapsulate into frame transparent transmission error detection
(Memory points: take one word for each concept: seal, poor air permeability)
Encapsulated into a frame
Framing is the process of adding a head and tail to the front and back of a piece of data to form a frame.
After receiving the bitstream submitted by the physical layer, the beginning and end of the frame can be identified from the received bitstream based on the tags at the head and tail.
Transparent transmission
The ability to transmit data over a link regardless of the combination of bits. As a result, the link layer is “blind” to anything that interferes with data transmission.
For example, when the combination of bits in the transmitted data happens to be exactly the same as a certain control message, appropriate measures must be taken so that the receiver will not mistake such data for a certain control message.
In this way, transparent transmission at the data link layer can be ensured.
Byte fill method
When a flag byte appears in the data message to be transmitted, it is mistaken for a frame boundary. One way to solve this problem is for the data link layer at the sending end to insert another escape character (usually ESC) before the presence of the marker byte, and the data link layer at the receiving end to remove the inserted escape character before sending the data to the network layer.
Error detection
The so-called error is the phenomenon of bit and frame errors in the bit
A dislocation is when a 1 becomes a 0 or a 0 becomes a 1
A frame error is a loss, repetition, or disorder in a sequence of bits
These errors are usually caused by noise.
Error detection
Example: The data to be sent is 1101 0110 11, using CRC check, the generated polynomial is 10011, so the final data to be sent should be?
Ideas:
Computing redundancy codes:
1 plus 0
(2) Modular 2 division
Assuming that the generating polynomial G(x) is of order R, add r zeros.
10011 is expressed as a polynomial
X4+X1+X0
=X4+X1+1
Order of 4
TIPS: Polynomial N bits, order n-1.
The remainder of the data added by 0 divided by the polynomial is redundant code /FCS/
A sequence of bits of a CRC check code.
The final data sent: 1101011011 1110
PPP is an important protocol at the data link layer
Point-to-point Protocol (P2P) is the most widely used data link layer Protocol. Users use dial-up phones to access data
PPP (the protocol used by a user’s computer to communicate with an ISP) is commonly used on the Internet.
PPP protocol to achieve transparent transmission method:
• asynchronous transmission | character-oriented: byte filling method
• synchronous transmission | oriented bits: zero bits filling method
Zero bit filling: If the string of bits between two flag fields happens to have the same bit combination as flag field F (01111110), it will be mistaken as a frame boundary. To avoid this, HDLC uses zero-bit padding so that there are no six consecutive ones between two F fields in a frame. After sending 5 1s in a row, fill in 1 0
(Flag field F is 01111110, so “5110”)
Important protocol of data link layer: CSMA/CD protocol
Chinese name: Carrier Sense Multipoint access collision Detection
CS: Carrier sense/monitor, each station before and while transmitting data
Check to see if there are other computers on the bus sending data.
MA: Multi-point access: many computers are connected to a bus in multi-point access mode.
CD: collision detection (collision detection), “send and listen”, adapter send number
The data side detects the change of signal voltage on the channel, so as to judge oneself when sending data
If other stations are sending data.