HDLC frame format

Source: Internet
Author: User

 

 

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 operation method used. 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. However, when it is required to provide unreliable connectionless services, it can also carry data. These control functions are defined by 5 m-bit (M1, M2, M3, M4, and M5. You can define 32 additional command functions or 32 response functions with 5 m bits, but many of them are currently blank. Source: http://hi.baidu.com/rjsjsks/blog/item/2d16574eb3b19fccd1c86ab5.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.