The current standard for HDLC is ISO 13239. HDLC was developed from the Synchronous Data Link Control (SDLC) standard proposed in the 1970s. HDLC provides both connection-oriented and connectionless service.
- HDLC uses synchronous serial transmission to provide error-free communication between two points. HDLC defines a Layer 2 framing structure that allows for flow control and error control through the use of acknowledgments. Each frame has the same format, whether it is a data frame or a control frame.
- HDLC uses a frame delimiter, or flag, to mark the beginning and the end of each frame.
- Although Cisco HLDC (also referred to as cHDLC) is proprietary, Cisco has allowed many other network equipment vendors to implement it. Cisco HDLC frames contain a field for identifying the network protocol being encapsulated. The figure compares standard HLDC to Cisco HLDC.
HDLC defines three types of frames, each with a different control field format.
The flag field initiates and terminates error checking. The frame always starts and ends with an 8-bit flag field. The bit pattern is 01111110. Because there is a likelihood that this pattern occurs in the actual data, the sending HDLC system always inserts a 0 bit after every five consecutive 1s in the data field, so in practice the flag sequence can only occur at the frame ends. The receiving system strips out the inserted bits.
When frames are transmitted consecutively, the end flag of the first frame is used as the start flag of the next frame.
The address field contains the HDLC address of the secondary station. This address can contain a specific address, a group address, or a broadcast address. A primary address is either a communication source or a destination, which eliminates the need to include the address of the primary.
The control field uses three different formats, depending on the type of HDLC frame used:
- Information (I) Frame – I-frames carry upper layer information and some control information. This frame sends and receives sequence numbers, and the poll final (P/F) bit performs flow and error control. The send sequence number refers to the number of the frame to be sent next. The receive sequence number provides the number of the frame to be received next. Both sender and receiver maintain send and receive sequence numbers. A primary station uses the P/F bit to tell the secondary whether it requires an immediate response. A secondary station uses the P/F bit to tell the primary whether the current frame is the last in its current response.
- Supervisory (S) Frame – S-frames provide control information. An S-frame can request and suspend transmission, report on status, and acknowledge receipt of I-frames. S-frames do not have an information field.
- Unnumbered (U) Frame – U-frames support control purposes and are not sequenced. Depending on the function of the U-frame, its control field is 1 or 2 bytes. Some U-frames have an information field.
Only used in Cisco HDLC. This field specifies the protocol type encapsulated within the frame (e.g. 0x0800 for IP).
The data field contains a Path Information Unit (PIU) or Exchange Identification (XID) information.
6, Frame Check Sequence (FCS)
The FCS precedes the ending flag delimiter and is usually a Cyclic Redundancy Check (CRC) calculation remainder. The CRC calculation is redone in the receiver. If the result differs from the value in the original frame, an error is assumed.
Cisco HDLC is the default encapsulation method used by Cisco devices on synchronous serial lines.
Use Cisco HDLC as a point-to-point protocol on leased lines between two Cisco devices. If connecting non-Cisco devices, use
If the default encapsulation method has been changed, use the
encapsulation hdlc command in privileged EXEC mode to re-enable HDLC.
As shown in the figure, there are two steps to re-enable HDLC encapsulation:
Step 1. Enter the interface configuration mode of the serial interface.
Step 2. Enter the encapsulation hdlc command to specify the encapsulation protocol on the interface.
Trouble shooting HDLC
The output of the
show interfaces serial command displays information specific to serial interfaces. When HDLC is configured, encapsulation HDLC should be reflected in the output.
The show interfaces serial command returns one of six possible states:
- Serial x is up, line protocol is up
- Serial x is down, line protocol is down
- Serial x is up, line protocol is down
- Serial x is up, line protocol is up (looped)
- Serial x is up, line protocol is down (disabled)
- Serial x is administratively down, line protocol is down
Of the six possible states, there are five problem states. Table bellow lists the five problem states, the issues associated with that state, and how to troubleshoot the issue.
This table shows the interface status conditions, possible problems associated with the conditions, and solutions to those problems.
show controllers command is another important diagnostic tool when troubleshooting serial lines. The output indicates the state of the interface channels and whether a cable is attached to the interface. In the figure, interface serial 0/0/0 has a V.35 DCE cable attached. The command syntax varies, depending on the platform. Cisco 7000 series routers use a cBus controller card for connecting serial links. With these routers, use the
show controllers cbus command.
If the electrical interface output displays as UNKNOWN instead of V.35, EIA/TIA-449, or some other electrical interface type, the likely problem is an improperly connected cable. A problem with the internal wiring of the card is also possible. If the electrical interface is unknown, the corresponding display for the
show interfaces serial command shows that the interface and line protocol are down.