中文

Introduction to HDLC Protocol

HDLC Frame Delimitation  

 

    The identifier of SDLC/HDLC protocol is an 8-bit combination with a format of 01111110 (hexadecimal 7E), that is, two 0 sandwiched between six consecutive 1. a frame of information begins and ends with the identifier, so the identifier is also known as the frame delimiter.

 

    The goal of the HDLC protocol is to transmit data of any bit combination (so-called data transparent transmission), and the identifier is unique, that is, the sequence of 01111110 can no longer appear in the data sequence.

 

    In order to achieve the purpose of transparent transmission, the sender uses the '0 bit insertion technology'. When sending the information frame, for all information except the identifier, as long as five consecutive 1 are encountered, one 0 is automatically inserted after them. In order to recover the original format of the information, the receiver adopts the '0 bit deletion technology' when receiving, that is, except for the identifier, when five 1 are continuously received, one 0 is automatically deleted.

 

Frame Format

 

    The complete frame of HDLC consists of a Flag field (F), Address field (A), Control field (C), Information field (I), Frame Check Sequence field (FCS), and so on:

    ●  Flag field (F): flag 01111110, which marks the opening and closing of the frame.

    ●  Address field (A): identifies the address of the communication site, where a full 1 indicates the broadcast address.

    ●  Control field (C): identifies the frame type.

    ●  Information field (I): variable-length byte of information content, must be an integer multiple of 8 bits, can also be 0 length.

    ●  Frame Check Sequence (FCS): uses a 16-bit CRC to check the contents of the entire frame between the two flag fields.

 

  Opening Flag  

  Address Field  

  Control Field  

        Information Field

  Frame Check Sequence Field  

  Closing Flag  

    01111110

      1 byte

      1 byte

  variable-length,N bytes  

                   2 bytes

    01111110

 

Frame Type and Operation Mode

 

    According to the control field, the HDLC protocol divides the frames into three categories: information frame I (Information), monitoring frame S (Supervisory) and unnumbered frame U (Unnumbered). It also defines three link operation modes, NRM, ARM and ABM, and agrees on how to master-slave and handshake between communication endpoints.

 

    Since HDLC works on low-speed lines in many cases, in order to avoid long packet delay, data fields are required to be as short as possible, generally not exceeding 256 bytes.