Network Three [Bridge: Data Link Layer]

table of Contents

 

1. What does the data link layer do?

2. Function summary

1. In general: provide services for the network layer.

2. Make up the frame

3. Perform error control

4. Make reliable transmission

5. Perform flow control

6. For the data link layer itself, there is access control to the medium

Three, framing

Four, error control

Error detection

Error correction

Five, reliable transmission

Six, flow control

Single frame sliding window and stop waiting protocol

Multi-frame sliding window and back N frame protocol

Multi-frame sliding window and selective retransmission protocol

7. Channel division of media access

8. Random access of media access

9. Polling of media access: token passing protocol

10. Local area network

11. WAN

PPP protocol

HDLC protocol 

Compared:

12. Data link layer equipment

Physical layer expansion Ethernet:

Link layer expansion Ethernet:

switch:

 Conflict domain and broadcast domain:


1. What does the data link layer do?

Different from the physical layer in the previous lecture-

The physical layer is the bottom layer. He only needs to get the data from the upper layer-the data link layer, and then send it to the physical layer of the other party through a series of processes.

The data link layer is the second layer , with the network layer above and the physical layer below.

So he needs to link the above and below.

First know a concept:

Every two adjacent layers has an interface called SAP (Service Access Point) ,

The nth layer can use the services provided by the n-1th layer through the service access point SAP of the n-1th layer.

And each layer can only provide services for the upper layer.

We look from the top down:

Network layer to data link layer:

First of all, the PDU (Protocol Data Unit) at the network layer is called a packet .

After the network layer passes the packet to the data link layer,

The data link layer is responsible for adding a header and a tail to this packet ,

The header and tail contain a lot of control information , and one of their important functions is to determine the boundary of the frame.

It constitutes the PDU: frame of the data link layer .

Data link layer to physical layer:

The data link layer passes the frame to the physical layer,

From the perspective of the physical layer, a frame is a long sequence of bit streams, consisting of 0 and 1.

So just from the perspective of data transmission, from the network layer to the physical layer, it has gone through such a process:

Network layer packet → transfer to the data link layer → data link layer to add header and tail to the packet → become a frame → pass to the physical layer → recognize as a bit stream, and then encode or modulate it into a signal → transmit to the other physical layer .

However, the data link layer is not just as simple as encapsulating packets into frames, it also solves many problems. ——See the function summary

 

2. Function summary

1. In general: provide services for the network layer.

The function of the data link layer is actually to transfer the data from the source network layer to the target network layer.

The specific form of expression is to encapsulate into a frame, pass it to the destination link layer, and then pass it to the network layer in the form of packets.

2. Make up the frame

The upper-layer packets are added to the header and the tail to form a frame, and then the transmission is carried out.

There is a very important concept: transparent transmission.

Transparent transmission , as the name implies, is that no matter what kind of transmission you perform at the link layer,

From the perspective of the network layer, my data is transmitted from my network layer to the destination network layer, and there is no data loss, nothing more.

To achieve transparent transmission, we need to solve the following problems:

If in the packet from the network layer, that is, the data segment of the frame, there is a segment that is the same as the head and end of the frame, that is, the frame delimiter, how to deal with it? This will cause frame confusion and serious data errors.

Transparent transmission is to solve such a problem.

The methods are:

Character counting

The beginning and end delimiter method of character filling

Head-to-End Marking Method of Zero Bit Stuffing

Code violation

3. Perform error control

Error control is divided into error detection and error correction.

Because the physical layer is only responsible for transmitting the bit stream, it cannot control whether errors occur.

Therefore, the data link layer is responsible for error detection and correction of the data transmitted by the physical layer.

The methods are:

Error detection:

Parity check code

Cyclic redundancy code

Error correction:

Hamming code 

4. Make reliable transmission

The above-mentioned error control is called bit error, which refers to the problem of the frame itself, which is based on bits.

And if there is no problem in every frame, but there is a problem with the order in which they reach the opposite shore, this is still unreliable.

Reliable transmission is to solve this problem.

The methods are:

Single frame sliding window and stop-wait protocol

Multi-frame sliding window and back N frame protocol

Multi-frame sliding window and selective retransmission protocol

5. Perform flow control

If the receiving party receives a frame at a low rate, it is too fast to accept it.

We need to control the sending rate of the frame by the sender,

So that the receiver has enough buffer space to receive each frame.

This is flow control.

The method is the same as reliable transmission:

Single frame sliding window and stop-wait protocol

Multi-frame sliding window and back N frame protocol

Multi-frame sliding window and selective retransmission protocol

6. For the data link layer itself, there is access control to the medium

The task of medium access control is to let each node that uses the medium isolate the signal transmitted by other nodes that use the same channel to ensure that its signal is not interfered.

The methods are:

Static: channel division method

Time division multiplexing

Frequency division multiplexing

Code division multiplexing

Wavelength division multiplexing

 Dynamic: Random Access Method

ALOHA agreement

CSMA agreement

CSMA/CD protocol

CSMA/CA agreement

Dynamic: Polling access method 

Token pass protocol

Three, framing

The reason why the data link layer combines bits into a frame is to retransmit the wrong frame only when an error occurs, instead of retransmitting all the data.

 Methods to achieve transparent transmission:

1. Character counting method:

 

 But if the count field is wrong, the basis for dividing the frame boundary is lost.

2. Character filling method

Ingenious use of escape characters.

3. Zero bit stuffing method 

The delimiter contains 6 ones,

And every time the data segment encounters 5 consecutive 1s, a 0 is added.

The receiving end then removes the added 0.

4. Violation of the coding law 

Four, error control

Where did the error come from?

In a nutshell, errors in transmission are caused by noise.

This article discusses dislocations.

Error detection

1. Parity check code

It is composed of n-1 bits of information element and 1 bit of parity element.

Check the number of 1 to judge whether there is an error.

2. CRC Cyclic Redundancy Code

First generate a polynomial, and then divide the data to be transmitted by this polynomial to get the redundant code.

The final data sent = the data to be sent + redundant code

After sending it, the receiver divides the received data by the generated polynomial,

If the remainder is 0, it is determined that there is no error.

Error correction

1. Hamming code

The location of the error can be judged, and the purpose of error correction can be achieved by directly negating it.

 

Five, reliable transmission

Whatever the sender sends, the receiver receives what.

See six for the method.

 

Six, flow control

Control the sending rate so that the receiver has enough buffer space to receive each frame.

Single frame sliding window and stop waiting protocol

Error-free situation:

There are errors:

A timeout timer is started every time a frame is sent. If it times out, retransmit.

If the confirmation message ACK is late, it will be retransmitted, and the subsequent ACK will be discarded.

Simple to use, but the channel utilization is too low. 

Multi-frame sliding window and back N frame protocol

1. Cumulative confirmation.

2. The receiver only receives the frames in order, and if they are out of order, they will retransmit all of them.

3. Confirm that the frame with the largest sequence number arrives in sequence.

Multi-frame sliding window and selective retransmission protocol

Set a single acknowledgment, enlarge the receiving window, set the receiving buffer, and buffer the frames that arrive out of order.

1. Confirm the data frame one by one, receive one confirmation one by one

2. Only retransmit error frames

3. The receiver has a cache 

7. Channel division of media access

Two kinds of links are used to propagate data:

 

 Frequency division multiplexing means that all users occupy different frequency bandwidths at the same time.

It is parallel.

Time-division multiplexing refers to dividing time into a segment of time-division multiplexed frames of equal length.

Similar to the time slice rotation method.

Is concurrency.

 

Wavelength division multiplexing is the transmission of multiple optical signals of different wavelengths in one optical fiber. Because the wavelengths are different, the optical signals of each channel do not interfere with each other. Finally, one by one is broken down.

Code division multiplexing uses different codes to distinguish the original signal.

 

8. Random access of media access

See: https://blog.csdn.net/Kukeoo/article/details/114552957

9. Polling of media access: token passing protocol

See: https://blog.csdn.net/Kukeoo/article/details/114552957

10. Local area network

See: https://blog.csdn.net/Kukeoo/article/details/114554146

11. WAN

WAN usually refers to a long-distance network with a wide coverage (far beyond the range of a city).

It is the core part of the Internet.

The task is to transport the data sent by the host over a long distance.

He is different from LAN,

The local area network is multi-point access, emphasizing data transmission;

The WAN is point-to-point and emphasizes resource sharing.

Mainly use packet switching technology.

PPP protocol

The point-to-point protocol is currently the most widely used data link layer protocol.

Only full-duplex links are supported .

Byte-oriented .

Need to meet:

No need to meet:

 

Components: three

Frame format:

HDLC protocol 

Advanced data link control protocol,

Full duplex,

Bit-oriented.

High reliability, using CRC inspection, and numbering.

Compared:

12. Data link layer equipment

Physical layer expansion Ethernet:

Very troublesome and easy to conflict.

Link layer expansion Ethernet:

Through the network bridge.

Divided into transparent bridge and source route bridge.

Source route bridges are widely used.

switch:

A multi-interface bridge.

 Conflict domain and broadcast domain:

4 conflict domains and one broadcast domain.

Guess you like

Origin blog.csdn.net/Kukeoo/article/details/114542304