High-Level Data Link Control (HDLC) is a bit-oriented data link layer protocol for data transmission over the synchronization network. It is an International Organization for Standardization (ISO) developed based on the ibm sdlc (synchronous Data Link Control) protocol.
The Link Control Protocol focuses on the logical transmission of segments into physical blocks or packets. A block or packet is guided by the Starting Sign and ended by the ending sign, also known as a frame. Frames are media tools for each control, each response, and all information transmitted using protocols. All bits-oriented Link Control Protocols adopt a unified frame format. Both data and independent control information are transmitted in frames. Each frame has a flag code 01111110 before and after each frame, which is used as the start and end indication of the frame and the frame synchronization. The flag code cannot appear inside the frame to avoid ambiguity. To ensure the uniqueness of the Flag Code while taking into account the transparency of the data within the frame, the "0-Bit Insertion Method" can be used to solve the problem. This method monitors all fields except the flag code on the sending end.
5When "1" appears, add a "0" after it, and then continue sending the subsequent bit stream. At the receiving end, all fields except the start flag code are also monitored. When continuous discovery
5When "1" appears, if the last bit is "0", it is automatically deleted to restore the original bit stream; if continuous
6"1", it may be that the inserted "0" error is changed to "1", or it may be that the frame termination flag is received. In the latter two cases, the frame verification sequence in the frame can be further distinguished. The "0-Bit Insertion Method" is simple in principle and is suitable for hardware implementation. In the frame format of the bit-oriented protocol, there is an 8-bit control field that can be used to define rich control commands and responses in encoding mode, it is equivalent to the function of transmitting many control characters and escape sequences in the BSC protocol. As a typical Data Link Control Protocol for bits, HDLC has the following features. 1. The Protocol does not depend on any character set. 2. Data packets can be transparently transmitted. The "0-Bit Insertion Method" for transparent transmission is easy to implement by hardware. 3. full-duplex communication, data can be sent continuously without waiting for confirmation, with high data link transmission efficiency. 4. CRC verification is used for all frames and information frames are numbered to prevent missed or duplicated frames and ensure high transmission reliability. 5. Separated transmission control and processing functions, providing greater flexibility and improved control functions. 6. In view of the above features, HDLC is generally used as a data link control protocol in the network design. 7. The HDLC work process includes three phases: establishing connections through negotiation, transmitting packets, and timeout and disconnection. 8. Negotiation establishment process: the HDLC sends the negotiation packets for Link detection every 10 seconds. The sending and receiving sequence of the packets is determined by the serial number. If the serial number is out of order, the link is disconnected. This keepalive packet is used to check whether the point-to-point link is activated. 9. packet transmission process: IP packets are encapsulated on the HDLC layer. During the data transmission process, the packets of keepalive are still valid and valid. 10. timeout and disconnection phase: When the encapsulated HDLC interface cannot receive confirmation of its own incremental serial number for 10 consecutive times, the line protocol of HDLC changes from up to down. At this time, the link is in the paralyzed state and cannot communicate.
HDLC Protocol Introduction High-Level Data Link Control (HDLC) is a data link layer protocol that transmits data on the synchronization network and is bit-oriented, it was developed by the International Organization for Standardization (ISO) based on the ibm sdlc (synchronous Data Link Control) protocol.
In early 1970s, IBM took the lead in proposing the synchronization Data Link Control Procedure SDLC (synchronous Data Link Control) for bits ). Subsequently, both ANSI and ISO adopted and developed SDLC, and proposed their own standards: advanced data control procedure in the ANSI advanced communication control process ), high-level data link contl ).
The Link Control Protocol focuses on the logical transmission of data that is segmented into physical blocks or packets. A block or packet is guided by the Starting Sign and ended by the ending sign, also known as a frame. Frames are media tools for each control, each response, and all information transmitted using protocols. All bits-Oriented Data Link Control Protocols adopt a unified frame format. Both data and independent control information are transmitted in frames.
Each frame has a flag code 01111110 before and after each frame, which is used as the start and end indication of the frame and the frame synchronization. The flag is not allowed to appear inside the frame, so as to avoid exceptions. To ensure the uniqueness of the Flag Code while taking into account the transparency of the data within the frame, the "0-Bit Insertion Method" can be used to solve the problem. This method monitors all fields except the flag code on the sending end. When five consecutive "1" are found, a "0" is inserted after the flag code ", and then proceed to the next bit stream. At the receiving end, all fields except the start flag code are also monitored. When five "1" appear consecutively, if the last bit is "0", it is automatically deleted to restore the original bit stream. If six "1" in a row are found ", it may be that the inserted "0" error is changed to "1", or it may be that the frame termination flag is received. In the latter two cases, the frame verification sequence in the frame can be further distinguished. The "0-Bit Insertion Method" is simple in principle and is suitable for hardware implementation.
In the frame format of the bit-oriented protocol, there is an 8-bit control field that can be used to define rich control commands and responses in encoding mode, it is equivalent to the function of transmitting many control characters and escape sequences in the BSC protocol.
As a typical bit-Oriented Data Link Control Protocol, HDLC has the following features: the Protocol does not depend on any character set; data packets can be transparently transmitted, the "0-Bit Insertion Method" for transparent transmission is easy to implement by hardware. full-duplex communication allows continuous data transmission without waiting for confirmation, with high data link transmission efficiency; CRC verification is used for all frames, and information frames are numbered to prevent missed or duplicated frames. The transmission reliability is high. The transmission control function is separated from the processing function, it has great flexibility and comprehensive control functions. Thanks to the above features, HDLC is widely used in network design as a data link control protocol.
1. HDLc Operation Method
Hclc is a common data link control protocol. When a data link is established, a specific operation method is allowed. The so-called link operation method is generally used to operate a site on the master site or on the slave site, or both.
On the link, the target station is called the master station, and other sites controlled by the master station are called slave stations. The main site is responsible for organizing data streams and recovering errors on the link. The frame sent from the master station to the slave station is called a command frame, while the response frame returned from the master station is called a response frame.
The polling technology is usually used for links connected to multiple sites. The polling of other sites is called the master site, and each site in the link from the point to the ignition can be the master site. The master station requires more logical functions than the slave station. Therefore, when the terminal is connected to the host, the host is generally the master station.
When a station connects multiple links, the station may be the main station for some links, and for other links, it may be the slave station.
Some websites can have both the main station and the slave station functions. This station is called the combined station, and the protocols used for information transmission between the combined stations are symmetric, that is, the master and slave stations on the Link have the same transmission control functions, which are also called balanced operations. This is a very important concept in computer networks. In contrast, operations with different functions are classified by the master station and slave station, which are called unbalanced operations.
There are three common operations in hdcl:
(1) normal response mode NRM (normal responses mode) is a non-balanced data link operation method, sometimes called non-balanced normal response mode. This operation is applicable to Terminal-oriented point-to-point or point-to-point links. In this mode, the transmission process is started by the master station. The slave station can transmit information to the master station as a response only after receiving a command frame from the master station. The response information can be composed of one or more frames. If the information is composed of multiple frames, it should be pointed out which one is the last frame. The main station is responsible for managing the entire Link, and has the right to round-robin, select the slave station, and send commands to the slave station. It is also responsible for controlling timeout, re-transmission, and various recovery operations. The NRM operation method is shown in Figure 3.7 ().
(2) asynchronous response arm
Asynchronous response mode (asynchronous responses mode) is also a non-balanced data link operation mode. Unlike NRM, the transmission process under arm is started from the slave station. One or more frames actively sent from the slave station to the master station may contain information or only frames for control purposes. In this way, the slave station controls timeout and retransmission. This method is essential for the multi-site Lotus road using the polling method. The arm operation method is shown in Figure 3.7 (B ).
(3) asynchronous balancing method (ABM)
Asynchronous balanced mode (ABM) is an operation that allows any node to start transmission. To improve the link transmission efficiency, a high amount of information is required between nodes in both directions. In this mode, any station can start the transmission operation at any time. Each station can be used as both the master station and slave station, and each station is a combination station. Each site has the same set of protocols. Any site can send or receive commands or give responses, and each site has the same responsibility for the error recovery process.
2. HDLc frame format
In HDLc, data and control packets are transmitted in the standard frame format. Frames in HDLC are similar to BSC character blocks, but the datagram and control packets in the BSC protocol are transmitted independently. commands in HDLC should be transmitted by frame in a unified format. The complete HDLC frame consists of the flag field (F), address field (A), control field (C), Information Field (I), and frame verification sequence field (FCS.
(1) flag field (f)
The bits pattern in which the flag field is 01111110 indicates the start of the frame and the end of the previous frame. The flag field can also be used as a padding character between frames. Generally, when frame transfer is not performed, the channel is still active. In this status, the sender continuously sends the flag field to determine that a new frame transfer has started. The "0-Bit Insertion" method can be used to transparently transmit 0 data.
(2) Address field ()
The content of the address field depends on the colored operation method. In the operation mode, there are master station, slave station, and combination station. Each slave station and Combined Station is assigned a unique address. The address field in the Command frame carries the address of the peer site, and the address field in the response frame carries the address of this site. An address can also be assigned to more than one station. This address is called a group address. Frames transmitted using a group address can be received by all the stations in the group that have a group of one region. However, when a station or a combination station sends a response, it should still use its unique address. The "1" Address can also be used to indicate the addresses that contain all sites. It is called a broadcast address. Frames containing broadcast addresses are transmitted to all sites on the link. In addition, all "0" addresses are specified as "no station address". Such addresses are not assigned to any station and are only used for testing.
(3) control field (c)
The control field is used to form various commands and responses to monitor and control links. The sender's master station or composite station uses control fields to notify the addressable slave station or composite station to perform Agreed operations. On the contrary, the slave station uses this field to respond to commands, report changes in completed operations or status. This field is the key to HDLC. The first, first, and second digits in the control field represent the type of the transfer frame. HDLc includes the Information Frame (I frame), monitoring frame (S Frame), and unnumbered frame (U frame) three different types of frames. The fifth bit of the control field is the P/F bit, that is, the poll/final bit.
(4) Information Field (I)
The information field can be any binary bit string. The length of a bit string is not limited. The upper limit is determined by the FC field or the buffer capacity of the communication station. Currently, 1000 ~ 2000 bits; the lower limit can be 0, that is, no information field. However, information fields are not allowed in monitoring frames (s frames.
(5) frame verification sequence field (FCS)
The frame verification sequence field can use 16-bit CRC to verify the content of the entire frame between two Flag Fields. The generation polynomial CCITT v4.1 of the FCS is recommended to specify x16 + X12 + X5 + 1.
3. HDLc Frame Type
(1) Information Frame (I frame)
Information frames are used to transmit valid information or data, usually referred to as I frames. Frame I is marked by "0" as the first control word.
The N (s) in the control field of information frames is used to store the number of sending frames, so that the sender does not have to wait for confirmation to send multiple frames consecutively. N (R) is used to store the sequence number of the next expected frame received by the receiver. N (R) = 5 indicates that the next frame of the receiver must receive frame 5. In other words, each frame before frame 5 is received. Both N (s) and N (r) are three-bit binary codes. values can be 0 ~ 7.
(2) monitoring frame (S Frame)
Monitoring frames are used for Error Control and traffic control, generally referred to as s frames. S frame is marked with the first and second digits of the control field as "10. The S frame has an information field. There are only 6 bytes, that is, 48 bits. The third and fourth bits of the S frame control fields are of the S Frame Type encoding. There are four different encodings, respectively:
00 -- receiving ready (RR), sent by the master station or slave station. The master station can use the RR-type S frame to round-robin The slave station, that is, to transfer an I frame numbered N (r) from the slave station. If such a frame exists, it will be transmitted; the slave station can also use the RR-type S frame for response, indicating that the number of the next I frame that the slave station wants to receive from the master station is n (R ).
01 -- reject (rej), which is sent by the master station or slave station. It is used to require the sender to resend the frames starting from number N (R) and all subsequent frames, this also implies that I frames before N (r) have been correctly received.
10 -- the received frame is not ready (RnR), indicating that frame I with number less than N (r) has been received, but is currently in the busy status, not ready to receive the number N (r) this can be used to control the link traffic.
11 -- select reject (srej), which requires the sender to send a single I frame numbered N (R) and imply that all I frames numbered by the sender have been confirmed.
It can be seen that there are two main functions: Ready to receive RR frames and not ready to receive RnR frames: first, these two types of S frames are used to indicate that the slave station is ready or not ready to receive information. Second, confirm all received I frames whose number is less than N (R. Reject rej and select to reject the srej S frame, which is used to indicate an error to the peer site. The rej frame is used for the go-back-N policy to request re-sending of frames before N (r) has been confirmed when an N (s) after an I frame equal to the N (r) of the rej S frame, the rej state can be cleared. Srej frame is used to select the retransmission policy. When receiving an I frame of a srej frame, such as N (s), n (R), The srej status should be eliminated.
(3) unnumbered frame (U frame)
A frame without a serial number is named after its control field that does not contain numbers N (s) and N (R. U frame is used to establish, remove, and control links. These control functions have 5 m bits (M1, M2, M3, M4, and M5, also known as correction bits). You can define 32 additional command functions or 32 response functions with 5 m bits, but many of them are currently blank.