In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the main functions of the data link layer". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought. Let's study and learn what are the main functions of the data link layer?
The main functions of the data link layer are: 1, combining data into data blocks and encapsulating them into frames; 2, error control; 3, flow control; 4, link control; 5, MAC addressing; 6, distinguishing data and control information; 7, transparent transmission.
The operating environment of this tutorial: windows10 system, Dell G3 computer.
Main functions of the data link layer
1. Framing (frame synchronization)-combine data into blocks and encapsulate them into frames
In order to provide services to the network layer, the data link layer must use the services provided by the physical layer. The physical layer is transmitted by bit stream, which does not guarantee that there are no errors in the process of data transmission, and the number of bits received may be less than, equal to, or more than the number of bits sent. And they may have different values, so the data link layer uses a "frame" data block for transmission in order to achieve effective error control of the data. In order to adopt frame format transmission, there must be corresponding frame synchronization technology, which is the "framing" (also known as "frame synchronization") function of the data link layer.
The advantage of using frame transmission method is that when data transmission errors are found, only the frames with errors need to be transmitted again, and there is no need to retransmit the bit stream of all data, which will greatly improve the transmission efficiency.
The advantage of using frame transmission is that it brings two problems:
(1) how to identify the beginning and end of a frame
(2) when receiving the retransmitted data frame, does the receiver recognize it as a new data frame or as a retransmission frame? This depends on various "frame synchronization" technologies at the data link layer. "frame synchronization" technology not only enables the receiver to accurately distinguish the beginning and end of each frame from a bit stream that is not completely ordered, but also to identify retransmitted frames.
two。 Error control
In the process of data communication, some transmission errors may inevitably occur due to factors such as physical link performance and network communication environment, but in order to ensure the accuracy of data communication, the probability of these errors must be as low as possible. This function is also realized in the data link layer, which is its "error control" function.
In digital or data communication systems, anti-jamming coding is usually used for error control. It is generally divided into four categories: forward error correction (FEC), feedback detection (ARQ), hybrid error correction (HEC) and information feedback (IRQ).
The FEC method is to add enough redundant bits in a specific structure to the information code sequence-called "supervised element" (or "parity element"). The receiver decoder can automatically identify a small number of errors and correct them according to the specific supervision rules agreed by both parties. FEC is most suitable for real-time high-speed data transmission.
In non-real-time data transmission, ARQ error control is commonly used. The decoder detects the error of the received code group according to the coding rules one by one. If it is correct, feedback the "confirmation" of the ACK message to the sender; if there is an error, the ANK message is returned to indicate that the request sender repeats the information that has just been sent. The advantage of ARQ is that it has less redundant bits, strong error detection ability and simple coding and decoding. Because error detection has little to do with channel characteristics, it has universal application value in non-real-time communication.
HEC mode is an organic combination of the above two methods, that is, automatic error correction is implemented within the error correction capability; when the number of error bits that exceed the error correction capability, the error code can be found through detection, no matter how many error codes can be corrected by ARQ.
IRQ mode is the simplest error control mode with full feedback. In the error detection mode, the receiver forwards the received code back to the sender as is, and compares it with the original sending code. If an error is found, the sender retransmits it. It is a primitive method that it is only suitable for low-speed non-real-time data communication.
3. Flow control
In the data communication between the two sides, how to control the flow of data communication is also very important. It can not only ensure that the data communication is carried out in an orderly manner, but also avoid the data loss caused by the late reception of the receiver in the communication process. This is the flow control function of the data link layer.
The sending and receiving of data must follow certain transmission rate rules, which can enable the receiver to receive the data sent by the sender in time. And when the receiver does not have time to receive, it must timely control the sending rate of the sender's data, so that the rates of the two aspects basically match.
4. Link control
The link management function of the data link layer includes three main aspects: the establishment, maintenance and release of the data link.
When two nodes in the network want to communicate, the sender of the data must know whether the receiver is ready to receive. For this reason, both sides of the communication must first exchange some necessary information in order to establish a basic data link. The data link is maintained when data is transmitted, and the data link is released when the communication is complete.
5. MAC addressing
This is the main function of the MAC sublayer in the data link layer. The "addressing" mentioned here is completely different from the "IP address addressing" that will be introduced in the next chapter, because the address you are looking for here is the MAC address of the computer network card, also known as "physical address" and "hardware address", not the IP address.
In Ethernet, the media access control (Media Access Control, MAC) address is used for addressing, and the MAC address is burned into each Ethernet network card. This is very necessary in the case of multipoint connection, because in this kind of multipoint network communication, every frame must be accurately sent to the correct address, and the receiver should know which station the sender is.
6. Distinguish between data and control information
Because the data and control information are transmitted in the same channel, in many cases, the data and control information are in the same frame, so there must be corresponding measures to enable the receiver to distinguish them. In order to transmit only the data information that is really needed.
7. Transparent transmission
The so-called "transparent transmission" means that no matter what kind of bit combination data can be effectively transmitted on the data link. This requires that when the bit combination in the transmitted data happens to be exactly the same as a certain control information, corresponding technical measures can be taken so that the receiver will not mistake such data for some kind of control information. Only in this way can the transmission of the data link layer be guaranteed to be transparent.
Note: among the above seven link layer functions, the first five are the main ones, and the latter two functions are incidentally implemented in the first five functions without additional technology, so only the first five functions are introduced here.
Services provided by the link layer to the network layer
The design goal of the data link layer is to provide a variety of required services for the network layer. The actual services vary from system to system, but in general, the data link layer provides the following three types of services to the network layer:
1. Connectionless service without confirmation
"Connectionless service without acknowledgment" means that the source computer sends independent frames to the destination computer, and the target computer does not acknowledge these frames. For this service, there is no need to establish a logical connection in advance or to explain the logical connection afterwards. Because of this, if the data of a frame is lost due to reasons on the line, the data link layer will not detect such missing frames and will not recover them. The consequences of this situation can be imagined. Of course, such a service is very useful when the error rate is very low or the data integrity is not high (such as voice data), because such a simple error can be handed over to the layers above the OSI to recover. For example, the services used by most Lans in the data link layer are also connectionless services without acknowledgement.
two。 Connectionless service with confirmation
In order to solve the deficiency of the above "connectionless service without confirmation" and improve the reliability of data transmission, "connectionless service with confirmation" is introduced. In this connection service, the source host data link layer must number each transmitted data frame, and the destination host data link layer must acknowledge each received data frame. If the source host data link layer does not receive an acknowledgement of the transmitted data frame within a specified period of time, it needs to retransmit the frame. In this way, the sender knows whether each frame reaches the other party correctly. Such services are mainly used in unreliable channels, such as wireless communication systems. It differs from the "confirmed connection-oriented service" described below in that it does not need to establish a data link before the frame transmission, nor does it release the data link after the frame transmission is over.
3. Confirmed connection-oriented service
Most data link layers provide connection-oriented confirmation services to the network layer. With this service, the source computer and the target computer need to establish a connection before transmitting data, and every frame sent on the connection is numbered, and the data link layer ensures that every frame will be received. And it also ensures that each frame is received only once in the normal order. This is precisely the difference between the connection-oriented service and the previously introduced "confirmed connectionless service". In a connectionless and confirming service, when no confirmation is detected, the system will think that the other party has not received it, so the data will be retransmitted. Because it is connectionless, such data may recur many times, and the other party may receive it many times, resulting in data errors. There are three stages of this type of service, namely, data link establishment, data transmission and data link release. Each transmitted frame is numbered to ensure the correctness of the content and order of the frame transmission. The data link layer of most WAN communication subnets uses a connection-oriented confirmation service.
Ethernet works in a connectionless way, and the data frames sent by the read are not numbered and do not require the other party to send back confirmation. When the destination station receives the frame with an error, it discards it and does not take other actions.
Other knowledge points
The advantages of local area network: it has broadcast function, it can easily access the whole network from one site; it is convenient for the expansion and gradual evolution of the system; it improves the reliability, availability and survivability of the system.
The protocol used in Ethernet is carrier sense multipoint access CMSA/CD with collision detection. The main point of the protocol is: monitor before sending, then monitor while sending, and stop sending as soon as you find a collision on the bus. Then wait for a random period of time according to the Backoff algorithm and then send it again. Therefore, each station has the possibility of collision within a short period of time after sending its own data. All stations on Ethernet compete equally for Ethernet channels.
Thank you for your reading. the above is the content of "what are the main functions of the data link layer". After the study of this article, I believe you have a deeper understanding of the main functions of the data link layer. the specific use also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.