MX Foundation 4
HDLC Introduction

HDLC stands for High-level Data Link Control. HDLC is based on IBM's SDLC protocol, which is the layer 2 protocol for IBM's Systems Network Architecture (SNA). It was extended and standardized by the ITU as LAP, while ANSI named their essentially identical version ADCCP. Derivatives have since appeared in innumerable standards. It was adopted into the X.25 protocol stack as LAPB, into the V.42 protocol as LAPM, into the Frame Relay protocol stack as LAPF and into the ISDN protocol stack as LAPD. HDLC was the inspiration for the IEEE 802.2 LLC protocol, and it is the basis for the framing mechanism used with the PPP on synchronous lines, as used by many servers to connect to a WAN, most commonly the Internet. A mildly different version is also used as the control channel for E-carrier (E1) and SONET multichannel telephone lines. Some vendors, such as Cisco, implemented protocols such as Cisco HDLC that used the low-level HDLC framing techniques but added a protocol field to the standard HDLC header. More importantly, HDLC is the default encapsulation for serial interfaces on Cisco routers. It has also been used on Tellabs DXX for destination of Trunk.

HDLC procedures are designed to permit synchronous or start/stop, code-transparent data transmission. The normal cycle of the code-transparent data communication between two data stations consists of the transfer of frames containing information from the data source to the data sink acknowledged by a frame in the opposite direction. Generally, until the data station comprising the data source receives an acknowledgement, it holds the original information in memory in case the need should arise for retransmissions.

In those situations that require it, data sequence integrity between the data source and the data sink is affected by means of a numbering scheme, which is cyclic within a specified modulus and measured in terms of frames.

The acknowledgement function is accomplished by the data sink informing the data source of the next expected sequence number. This can be done in a separate frame, not containing information, or within the control field of a frame containing information.

HDLC procedures are applicable to unbalanced and balanced data links.

Unbalanced data links

An unbalanced data link involves two or more participating data stations. For control purposes, one data station on the data link assumes responsibility for the organization of data flow and for unrecoverable data link level error conditions. The data station assuming these responsibilities is known as the primary station in unbalanced connection-mode data links and as the control station in unbalanced connectionless-mode data links; and the frames it transmits are referred to as command frames. The other data stations on the data link are known as the secondary stations in unbalanced connection-mode data links and as the tributary stations in unbalanced connectionless-mode data links; and the frames they transmit are referred to as response frames.

For the transfer of data between the primary/control station and the secondary/tributary stations, two cases of data link control are considered. In the first case, the data station comprising the data source performs a primary/control station data link control function and controls the data station comprising the data sink that is associated with a secondary/tributary station data link control function, by select-type commands.

In the second case, the data station comprising the data sink performs a primary/control station data link control function and controls the data station comprising the data source that is associated with a secondary/tributary station data link control function, by poll-type commands. The information flows from the data source to the data sink and the acknowledgements are always transmitted in the opposite direction.

These two cases of data link control may be combined, so that the data link becomes capable of two-way alternate communication or two-way simultaneous communication.

Balanced data links

A balanced data link involves only two participating data stations. For control purposes, each data station assumes responsibility for the organization of its data flow and for unrecoverable data link level error conditions associated with the transmissions that it originates. Each data station is known as a combined station in balanced connection-mode data links and as a peer station in balanced connectionless-mode data links, and is capable of transmitting and receiving both command and response frames.

For the transfer of data between combined/peer stations : the data source in each combined/peer station controls the data sink in the other combined/peer station by the use of select-type commands. The information flows from the data source to the data sink and the acknowledgements are always transmitted in the opposite direction. The poll-type commands may be used by each combined/peer station to solicit acknowledgements and status responses from the other combined/peer station.

HDLC frame structure

In HDLC, all transmissions are in frames. Frames may be either in basic frame format or in non-basic frame format. Neither the basic nor the non-basic frame format structure includes bits inserted for bit-synchronization or, bits or octets inserted for transparency.

Basic and non-basic frame formats cannot be used simultaneously on the same media. However, it is possible for different format types of the non-basic frame to exist simultaneously on the same media.

Basic frame format

Each frame using the basic frame format consists of the following fields (transmission sequence left to the right).

Flag Address Control Info. FCS Flag
01111110 8 bits 8 bits * 16 bits 01111110

Where * is an unspecified number of bits which in some cases may be a multiple of a particular character size (e.g. an octet).

Flag = flag sequence

Address = data station address field

Control = control field

Information = information field

FCS = frame checking sequence field

Frames containing only control sequences form a special case where there is no information field. All frames shall start and end with the flag sequence. All data stations which are attached to the data link shall continuously search for this sequence. Thus, the flag is used for frame synchronization. A single flag may be used as both the closing flag for one frame and the opening flag for the next frame.

HDLC operations, and frame types

There are three fundamental types of HDLC frames :

  • Information frames, or I-frames, transport user data from the network layer. In addition they can also include flow and error control information piggybacked on data.
  • Supervisory frames, or S-frames, are used for flow and error control whenever piggybacking is impossible or inappropriate, such as when a station does not have data to send. S-frames do not have information fields.
  • Unnumbered frames, or U-frames, are used for various miscellaneous purposes, including link management. Some U-frames contain an information field, depending on the type.

HDLC classes of procedures

Six basic classes of procedures are defined in HDLC : two unbalanced classes of procedures, a balanced class of procedures and three connectionless classes of procedures.

Unbalanced classes of procedures

Two types of data stations are defined for the unbalanced classes of procedures :

  • The primary station sends commands, receives responses and is ultimately responsible for data link layer error recovery.
  • The secondary stations receives commands, sends responses and may initiate data link layer error.

Balanced class of procedures

One type of data station is defined for the balanced class of procedures:

  • The combined stations sends and receives commands and responses, and are responsible for data link layer error recovery.

Connectionless classes of procedures

Three types of data stations are defined for the connectionless classes of procedures :

  • The control station in unbalanced connectionless class of procedure sends commands, receives responses, but does not support any form of data link layer connection establishment/termination, flow control, acknowledgement, or error recovery.
  • The tributary stations in unbalanced connectionless class of procedures receives commands, sends responses, but does not support any form of data link layer connection establishment/termination, flow control, acknowledgement, or error recovery.
  • The peer stations in balanced connectionless class of procedures sends and receives commands and responses, but are not responsible for any form of data link layer connection establishment/termination, flow control, acknowledgement, or error recovery.

Configurations

For the two unbalanced classes of procedures, a single primary station plus one or more secondary station(s) shall be connected together over various types of transmission facilities to build point-to-point or multipoint, half-duplex or duplex, switched or non-switched configurations.

For the balanced class of procedures, two combined stations shall be connected together over various types of transmission facilities to build point-to-point, half-duplex or duplex, switched or non-switched configurations.

For the unbalanced connectionless class of procedures, a single control station plus one or more tributary station(s) shall be connected together over various types of transmission facilities to build point-to-point, half-duplex or duplex, switched or non-switched configurations.

For the balanced connectionless class of procedures, two peer stations shall be connected together over various types of transmission facilities to build point-to-point, half-duplex or duplex, switched or non-switched configurations.

Addressing scheme

In all classes (unbalanced, balanced and connectionless), commands shall always be sent containing a destination data station address, and responses shall always be sent containing the assigned transmitting data station address.

The "all-station" address or a "group" address may be used to transmit a command frame simultaneously to all the secondary stations on a multipoint configuration or to the defined group of secondary stations.The mechanism to avoid overlapping responses to multiple station addressing is system dependent and is not specified in the International Standard.

Send and receive state variables

For each primary-to-secondary or combined-to-combined pairing, a separate pair of send and receive state variables shall be used for each direction of transmission of information frames. Upon receipt and acceptance of a mode setting command, both the send and receive state variables of the receiving station shall be set to zero. Upon receipt and acceptance of an acknowledgement response to a mode setting command, both the send and receive state variables of the originating station shall be set to zero. For each control-to-tributary or peer-to-peer pairing, there are no send and receive state variables used for each direction of transmission of data.

Updated 10/23/2023