![]() ![]() ![]() |
School of Computing and Mathematical Sciences, De Montfort University, Leicester 8 March 1997 |
The HDLC family is typical of bit-oriented protocols which utilise the sliding window mechanism. High Level Data Link Control (HDLC) is the ISO name for its protocol standard. It is based on lBMs Synchronous DataLink Control (SDLC) and many manufacturers have analogous products (eg Burroughs DataLink Control - BDLC). CCITT call it Link Access Protocol B CLAPB) and ANSI call it Advanced Data Communications Control Procedure (ADCCP).
The protocol is based around a common frame format:

where:
| flag | is a unique bit pattern 01111110 used to delimit the start and end of each frame. Bit stuffing is used to ensure data transparency (see Appendix). Flags may be transmitted continuously when the link is idle. |
| address | indicates the destination station address |
| control | a field indicating the type of frame |
| data | is a field of arbitrary length. |
| checksum | is a cyclic redundancy check using polynomial CRC-16 and applied to all fields in the frame except the flags. The receiver can always locate this check field by counting back from the end flag. |
There are 3 distinct types of frame which are distinguished by different formats of the control field.
I-frame: Information frame
Data is transferred in Information frames (I) with the control field format:
where:
| S | is the frame sequence number of the frame modulo 8 |
| R | is a piggy backed acknowledgement, modulo 8, of the next frame expected. |
| P/F |
stands for Poll/Final and is used to support compatibility with
some older mainframe multidrop networks and multiframe block data transfer. |
HDLC uses a sliding window with a send window of size 7. There is also a variant (extended HDLC) which has a 2-byte control field, providing a maximum window size of 127 for use on satellite links.
If an acknowledgement for any frame is not received within the timeout interval, the sender starts retransmitting from that frame number.
S-frame: Supervisory Frame
Supervisory Frames provide a separate acknowledgement facility and have the control field format:
where
| R | is the sequence number, modulo 8, of the next frame expected from the other side. |
| type |
a two bit field indicating the nature of the acknowledgement:
|
Notice that the supervisory frames do not have a sequence number; why is one not needed?
U-frame: UnNumbered Frame
The final class of frames is used for network management; the particular usage varies in different implementations. They are called UnNumbered Frames because they have the control field format:
The type and modifier fields together identify
the function of the frame. Typical functions include:
| RIM | Request Initialisation Mode |
| SABM | Set Asynchronous Balanced Mode |
| DiSC | Disconnect the Link |
| RSET | Reset the Link |
| FRMR | FRame Reject. ie you sent me a frame which arrived with a totally impossible format. |
There is also a type of frame called an UnNumbered Acknowledgement used, not surprisingly, by one side to acknowledge that it has received an UnNumbered Frame from the other side.
Discussion
The Information and Supervisory frames control the exchange
during the data transfer phase of the protocol. The set-up and
termination phases involve the exchange of UnNumbered Frames.
For example, negotiation is required about how the link is configured,
eg will 3-bit or 7-bit sequence numbers be used, etc.
HDLC was developed in the days of master-slave networks and was
initially designed to support this type of configuration. It is
called unbalanced operation since both ends do not have the same
control of the link. The computer master is called the primary
and the slave is called the secondary; the addres& field
in the frame is the address of the secondary. There are two unbalanced
modes of operation:
| Normal Response Mode (NRM) | where the secondary may only respond to commands from the primary |
| Asynchronous Response Mode (ASM) | where the primary can set the secondary link so that a secondary can transmit without waiting for the primary to select it each time. |
There is also a balanced mode of operation called Asynchronous Balanced Mode (ABM). This reflects environments where both ends of the link are intelligent and both may initiate transmissions without waiting for permission from the other.
The following pages illustrate a generic HDLC type protocol (for the precise action taken under difference see details of the relevant protocol).
Generic HDLC data link protocol
Assuming message transmission from host A to host B only!


Generic HDLC data link protocol
Assuming message transmission from host A to host B only!

Generic HDLC data link protocol
Assuming message transmission from host A to host B only!

Generic HDLC data link protocol
Message transmission both ways!

Generic HDLC data link protocol
Example of selective-reject protocol

Sample answer to problem
Transmitter pseudo code
|
(* initial sequence number *) (* get message from host *) ( * transmit frame *) (* STOP and WAIT for ack frame *) (* get frame *) (* yes *) (* if acknowledge OK exit *) (* yes, set next sequence number *) |
Receiver pseudo code
|
(* initial sequence number *) (* until frame OK (* wait for Frame Arrival *) (* frame OK? *) (* yes, pass message to host *) (* build ack frame *) |
In practice the sequence numbers for this protocol can be held in a single bit with a sequence of frame having the numbers 0 1 0 1 0 1 0 1 etc.
