HDLC (High Level Data Link Control)
Table of Contents:
HDLC (High Level
Data Link Control) is one of the most common data link layer (layer 2)
protocols. Many other common layer 2 protocols are heavily based on HDLC,
particularly its framing structure. The HDLC protocol is defined by ISO for use
on both point-to-point and multipoint (multidrop) data links. It supports full
duplex transparent-mode operation and is now extensively used in both
multipoint and computer networks.
The rule of
HDLC is to ensure that the data has been received without any loss or errors
and in the correct order. HDLC has a flow control function which ensures that
the data is transmitted as fast as the receiver can receive it.
HDLC has
three operational modes:
1.
Normal Response Mode (NRM)
Normal Response Mode is used in unbalanced configurations, a
configuration is which there is only one primary, controlling station. In this
mode, slave stations (or secondary) can only transmit when specially instructed
by the master (primary station). The link may be point-to-point or multipoint.
In the latter case only one primary station is allowed.
2.
Asynchronous Response Mode (ARM)
Asynchronous Response Mode is used in unbalanced configurations. It
allows a secondary station to initiate a transmission without receiving permission
from the primary station. This mode is normally used with point-to-point
configurations and full duplex links and allows the secondary station to send
frames asynchronously with respect to the primary station.
3.
Asynchronous Balanced Mode (ABM)
The Asynchronous Balanced Mode (ABM) is used mainly on full duplex
point-to-point links for computer to computer communications and for
connections between a computer and a packed switched data network, in this case
each station has an equal status and performs the role of both primary and
secondary functions. This mode is used in the protocol set known as X.25.
The
standards frame of the HDLC protocol handles both data and control messages.
It has the
following format:
|
Flag |
Address |
Control |
Information |
FCS |
Flag |
|
1 Byte |
1-2 Bytes |
1 Byte |
variable |
2 Bytes |
1 Byte |
Flag - The
value of the flag is always (0x7E).
Address
field - The address of the secondary station which is sending the frame
or the destination of the frame sent by the primary station. The address
field contains Service Access Point
(6bits), a Command/Response bit to indicate whether the frame relates to
information frames (I-frames) being sent from the node or received by the node,
and an address extension bit which is usually set to true to indicate that the
address is of length one byte. When set to false it indicates an additional
byte follows. The address field may be extended to more than one byte by
agreement between the involved parties.
Control
field – Identifies the type of the frame. In addition, it includes
sequence numbers, control features and error tracking according to the frame
type.
Information
field - Data is transmitted in the information field, which can
vary in length depending upon the protocol using the frame. Layer 3 frames are
carried in the information field.
FCS - The
Frame Check Sequence (FCS) is in most cases - 16 bit wide and serves for errors
detection, the generator polynomial used is normally CRC-CCITT: x^16+x^12+x^5+1
.
HDLC uses
zero insertion/deletion process (commonly known as bit stuffing) to ensure that
the bit pattern of the delimiter flag does not occur in the fields between
flags. The HDLC frame is synchronous and therefore relies on the physical layer
to provide method of clocking and synchronizing the transmission and reception
of frames.
In the HDLC
protocol three classes of frames are used:
1.
Unnumbered frames
Unnumbered frames are used for link
management. . SNRM and SABM frames, for example, are used both to set up
logical link between the primary and the secondary station and to inform the
secondary station of the mode of operation to be used. A logical link is
subsequently cleared by the primary station sending a DISC frame. The UA frame
is used as an acknowledgment to the other frames in this class.
2.
Information frames
Information frames are those who carry the actual data. The Information
frames can be used to piggyback acknowledgment information relating to the flow
of Information frames in the reverse direction when the link is being operated
in ABM or ARM.
3.
Supervisory frames
Supervisory frames are use for error and flow control. They contain, send
and receive sequence numbers. There are four types of supervisory frames but
only RR and RNR are used in both NRM and ABM. These frames are used both to
indicate the willingness of a secondary station to receive an information frame
from the primary station, and for acknowledgment purposes. REJ and SREJ frames
are used only in ABM which permits simultaneous two-way communication across a
point to point link. The two frames are used to indicate to the other station
that a sequence error has occurred, that is an information frame containing an
out of sequence N(s) has been received. The SREJ frame is used with a selective
repeat transmission procedure, whereas the REJ frame is used with a go back N
procedure.
The two
basic functions in the protocol are link management and data transfer (which
includes error and flow control).
Prior to
any kind of transmission (either between two stations connected by a point to
point link or between a primary and secondary station connected with a
multidrop link) a logical connection between the two communication parties must
be established.
A logical
connection between the two communication parties is accomplished by the
exchange of two unnumbered frames. The procedure for setting a logical
connection (In a multidrop link) is given below:
The SNRM is
first sent by the primary station with the poll bit set to 1 and the address of
the appropriate secondary in the address field. The secondary responds with a
UA frame with the final bit set and its own address in the address field. After
all the data has been transferred, the link is cleared by the primary sending a
DISC frame and the secondary responding with a UA.

In NRM all
data (information frames) is transferred under the control of the primary
station. The unnumbered poll frame with the P bit set to 1 is normally used by
the primary to poll a secondary. If the secondary has no data to transmit, it
returns an RNR frame with the F bit set. If data is waiting, it transmits the
data, typically as a sequence of information frames.
The two most important aspects associated with the data transfer phase are
error control and flow control. Essentially, error control uses a continuous RQ
procedure with either a selective repeat or a go back N transmission strategy,
while flow controls based on a window mechanism.
References
Data Communications , Computer Networks and Open Systems, by Fred Halsall
Data
Communication ICs, High-Level Serial Communications, by Siemens