HDLC and SDLC Protocol
HDLC (High-Level Data Link Control) is the ISO/IEC 13239 bit-oriented framing protocol behind X.25, ISDN, many telecom links and a lot of industrial and metering equipment. IBM's SDLC is its forerunner. Frames are marked by 0x7E flags, kept transparent by bit stuffing and protected by a CRC. A synchronous serial analyser such as the Lineeye LE-200PF decodes HDLC and SDLC on RS-232, RS-422 and RS-485 lines, and logic analysers with an HDLC decoder do the same on board-level signals.
How an HDLC Frame Is Built
- Flags: 01111110 marks the start and end of a frame. Idle links send continuous flags, or hold the line at 1 (mark idle).
- Bit stuffing: the transmitter inserts a 0 after any five consecutive 1s in the frame content, and the receiver removes it. Six 1s can only be a flag; seven or more are an abort.
- Address: identifies the secondary station. In normal response mode one primary polls many secondaries on a multi-drop line.
- Control: says what the frame is. Information (I) frames carry data with send and receive sequence numbers; supervisory (S) frames acknowledge or reject (RR, RNR, REJ, SREJ); unnumbered (U) frames set up and clear the link (SNRM, SABM, UA, DISC, DM, FRMR, UI).
- FCS: a CRC over address, control and information, usually the 16-bit CRC-CCITT (x16 + x12 + x5 + 1), sometimes 32-bit.
Variants You Will Meet
| Variant | Where It Is Used | Difference From Basic HDLC |
|---|---|---|
| SDLC | IBM SNA networks, older POS and banking equipment | Predecessor of HDLC, normal response mode, often NRZI line coding |
| LAPB | X.25 packet networks | Balanced mode between two equal stations |
| LAPD | ISDN D channel (ITU-T Q.921) | Two-byte address with service and terminal identifiers |
| PPP in HDLC-like framing | Dial-up, serial links, some cellular modems (RFC 1662) | Often asynchronous, with byte stuffing (0x7D escape) instead of bit stuffing |
| HDLC in DLMS/COSEM | Electricity, gas and water meters (IEC 62056-46) | Frame format type 3 with a length field, sent as asynchronous 8N1 characters over the optical port or RS-485 |
Where HDLC and SDLC Are Used
- Telecoms: E1 and T1 signalling, ISDN, X.25 and legacy WAN links over V.35, X.21 and RS-530 interfaces.
- Utility metering: DLMS/COSEM meters use HDLC framing on their optical and RS-485 ports.
- Industrial and rail: multi-drop RS-485 links between controllers, drives and on-train equipment.
- Embedded: microcontroller and SoC serial controllers with built-in HDLC framing for board-to-board links.
Common HDLC Faults and How to Find Them
| Symptom | Likely Cause | What to Check |
|---|---|---|
| Every frame fails the FCS | Wrong CRC type or bit order, or the decoder uses NRZ on an NRZI line | Confirm 16 or 32-bit FCS and line coding in both ends' configuration |
| Frames decode as garbage after a few bytes | Bit stuffing not applied or not removed | Look for runs of six 1s inside frames |
| Link never comes up | Mode set-up frames (SNRM or SABM) not answered with UA | Decode the U frames and check station addresses |
| Data repeated or lost | Sequence numbers out of step, REJ or timeouts | Follow N(S) and N(R) in the I and S frames over time |
| Errors at higher speed only | Clock edge or skew problem on the synchronous clock | Capture data and clock together and check which edge samples the data |
Tools for Analysing HDLC and SDLC
Watch tools capture the line and decode flags, fields and FCS. Drive tools can also act as one end of the link to simulate a station.
Serial Line Analyser
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Lineeye LE-200PF Protocol Analyser | Watch Drive | PC-connected or stand-alone logging analyser for RS-232C, RS-422 and RS-485, capturing bit-synchronous HDLC, SDLC and X.25 at up to 1.544 Mbit/s; the PC software also shows LAPD and PPP frames in its protocol translation view | €1.276,95 |
Logic Analysers With HDLC Decoding
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Acute TravelLogic 34-Channel | Watch | Logic analyser running Acute's decoder library, which includes HDLC | €1.577,95 |
| ZeroPlus LAP-C Pro Series | Watch | Logic analyser with an HDLC decoder in ZeroPlus's decoder library; ask us to confirm it comes with your LAP-C Pro model | €1.158,95 |
Working on V.35, X.21 or RS-530? Tell us the interface and clock rate and we will recommend an analyser and interface board.
Frequently Asked Questions
What Is the Difference Between HDLC and SDLC?
SDLC is IBM's earlier protocol; ISO built HDLC from it and added modes and options. The frame layout of flags, address, control and FCS is the same, so most analysers decode both.
Why Does HDLC Use Bit Stuffing?
So the flag pattern 01111110 can never appear inside a frame. After five 1s the transmitter inserts a 0, and the receiver removes it, so any data can be sent.
Is PPP the Same as HDLC?
PPP borrows HDLC-like framing: the 0x7E flag, an address of 0xFF, a control byte of 0x03 and an FCS. On asynchronous links it uses byte stuffing with a 0x7D escape instead of bit stuffing. RFC 1662 defines it.
Can a UART Decoder Read HDLC?
Only the asynchronous variants: PPP in HDLC-like framing (RFC 1662) and the HDLC used by DLMS/COSEM meters (IEC 62056-46), which sends each byte as an 8N1 character. Synchronous HDLC has no start and stop bits, so it needs a synchronous analyser or an HDLC decoder working on data and clock.
Which CRC Does HDLC Use?
Usually the 16-bit CRC-CCITT, polynomial x^16 + x^12 + x^5 + 1. ISO/IEC 13239 also allows a 32-bit FCS, so check both ends are configured the same way.
More Protocols
By John Legg CEng, Director, Debug Store. Updated 24 November 2026.