Skip to content

High-Level Data Link Control (HDLC)

Published On:
Jul 18, 2017
Last Updated:
Jul 18, 2017

High-Level Data Link Control (HDLC) is a synchronous data-link layer protocol. It was developed by the International Organization for Standardization (ISO).

The icon for HDLC.

It only describes the data-link layer (layer 2 in the OSI model), and therefore is not really considered an communication protocol in it’s own right. It may be used by other communication protocols such as LVDS.

Acronyms/Glossary

TermDefinition
TermDefinition
Cisco HDLCAn extension to HDLC created by Cisco. Also known as cHDLC. Cisco HDLC uses an alternative framing structure to ISO HDLC.
FrameA unit that data is organised into and sent across the HDLC bus in.
HDLCHigh-level Data link Control.
PPP Point-to-Point Protocol.
SLARPSerial Line Address Resolution Protocol. A control protocol used by Cisco HDLC to maintain serial link keep-alives.
X.25A protocol for packet switched WAN communication. Very popular in the 1980’s.

History

HDLC is a superset of IBM’s SDLC protocol (SDLC can be essentially imitated with HDLC in Normal Response Mode (NRM).

Framing

Framing for a HDLC packet is done with the special bit sequence 0x7E (0b01111110). This is used to mark the beginning and end of each frame. Because 0x7E can only be used to as a framing sequence, any occurrence of 0x7E in the packet must be removed. This is done differently depending of the framing type (synchronous or asynchronous, see below).

Synchronous Framing

To prevent 0x7E from ever occurring in the packet data, bit stuffing is used. Every time 5 consecutive 0’s are transmitted, a 1 is inserted. The receiver must also look for 5 consecutive 0’s and then remove the following 1.

Asynchronous Framing

Bit-stuffing is inconvenient when the communication protocol requires bits to be sent in groups such as bytes (e.g. RS-232). In this case, control-octet transparency is used instead (also called byte stuffing or octet stuffing).

With control-octet transparency, if either 0x7E (the frame boundary octet) or 0x7D (the control escape octet) appears in the packet data, the escape octet is first sent, followed by the original data, but with bit 5 inverted. This ensures that 0x7E is never found within the packet data, and is only used for packet framing.

Obviously, the receiver has to look for escape octets, remove them from the data stream, and invert bit 5 of the next byte.

  1. Normal Response Mode (NRM): A unbalanced configuration where only the primary terminal may initiate a data transfer.
  2. Asynchronous Response Mode (ARM): An unbalanced configuration where secondary terminals may transmit without permission from the primary.
  3. Asynchronous Balanced Mode (ABM): A balanced configuration in where all terminals are treated equally, and any may send frames at any time.

Standards

The HDLC protocol is specified in ISO 13239.