Datacom Jto Chap6
Datacom Jto Chap6
CONTENTS
6.1 OBJECTIVES
6.2 INTRODUCTION
Chapter 6
DATA LINK PROTOCOL
6.1OBJECTIVES
The objective of this chapter is to familiarize with : -
i) General features of HDLC
ii) Types of stations in network
iii) Mode of operation
iv) Types of frame
v) Protocol operation
6.2INTRODUCTION
High Level Data Link Control (HDLC) was developed by ISO and has
become the most widely accepted data link protocol. It offers a high level of
flexibility, adaptability, reliability and efficiency of operation for today as well as
tomorrow's synchronous data communication needs. ADCCP developed by ANSI is
almost similar to HDLC, IBM'S SDLC is a proper subset of HDLC and level 2 of X-
25 is a permissible option of HDLC.
In this chapter, we shall study the basic features and operation of HDLC
protocol. Certain liberties have been taken in the level of completeness of description
so as not to cloud the overall picture with the details.
Fig. 6.1
Fig. 6.2
6.4 MODES OF OPERATION
Communication can be between logical unequal stations, i.e. one primary and
one or more secondary stations or between two logical equal stations, i.e. combined
stations. For these situations, three modes of operation for data transfer are possible :
• Normal Response Mode (NRM)
• Asynchronous Response Mode (ARM)
• Asynchronous Balanced Mode (ABM)
The normal and asynchronous response modes of operation (NRM and ARM)
provide an unbalanced type of data transfer capability between logical unequal
stations, one primary and other secondary stations. The asynchronous balanced mode
of operation is for logical equal combined stations.
mode the operational parameters are exchanged or the data link control programs may
be regenerated.
6.5.2 FRAMING
HDLC utilises two types of frame formats (Fig. 6.3), one for transporting user
data and control sequence and the other for transporting only the control sequence.
The frame format is fixed and the size of data field is variable. Other fields have fixed
sizes. Two frame identifier/delimiters are required, one at the start of the frame and
the other at the end.
(a)
(b)
Fig. 6.3
The various fields of the frame are as under :
Flag
The flag is a unique 8-bit word pattern (01111110) which identifies the start
and end of each frame. It is also used to fill the time between the consecutive frame
(Fig. 6.4). The receiving end uses the flag for synchronisation and to locate start and
end of the frame.
Fig. 6.4
Address Field
The address field in a frame identifies always the secondary station (not
necessarily a receiving station) whether the frame is transmitted by a primary station
or a secondary station. In Fig. 6.5, when primary station sends a frame it indicates
address of the secondary station so that the secondary may receive the frame. But
when the primary station receives a frame, it would not be able to identify the frame
unless the sending secondary station inserts its own address in the frame.
Fig. 6.5
Control Field
The control field consists of 8 bits (it can be extended to 16 bits as explained
later) and is used to carry sequence number of the frame, acknowledgements, request
for retransmission and other control commands and responses.
Information Field
The information field has variable size and can consist of 0 or more bits. The
maximum number of the bits in the information field is not specified.
Fig. 6.6
The last three bits are the sequence number N(R) of the acknowledgement
(RR) which is piggy backed on the I-Frame.
Fig. 6.7
6.6.2SUPERVISORY FRAME (S-FRAME)
S-Frame does not have data field (Fig.3b) and is used to carry only
acknowledgements, requests for retransmission, etc. It is identified by the first two
bits of the control field (Fig. 6.8). These two bits are 10 in an S-Frame. The next two
bits (SS) are used to indicate four supervisory states. Receive Ready (RR), Receive
Not Ready (RNR), Reject (REJ) and Selective Reject (SREJ).
The fifth bit is Poll/Final bit. The last three bits are the sequence number
associated with the supervisory states RR, RNR, REJ and SREJ indicated in the SS-
Bits of the control field. Note that an acknowledgement (RR) can be sent either on a
supervisory frame or piggybacked on an I-Frame as mentioned earlier. On the other
hand RNR, REJ and SREJ are sent only through a supervisory frame.
Fig. 6.8
The first two bits of the control field are 11 which identify an unnumbered
frame. The fifth bit is Poll/Final bit. The rest five bits are called modifier bits. They
specify the control function.
Fig. 6.9
Table-1 gives the bit coding of the control field of a U-Frame for the various
commands and responses.
U-Frame commands are sent by the primary station and the responses by the
secondary station. Important U-Frame commands and responses are described below.
Disconnect Command
The disconnect command (DISC) is used to terminate a previously established
link and to cause the stations involved to assume the disconnected mode.
station sends frames and finally returns the permission by explicitly marking its last
frame. The secondary station utilises the 'F' bit of the control field in the last frame. It
sets this bit to '1'.
6.6.5 TRANSPARENCY
In HDLC, transparency is achieved by ensuring that the unique flag sequence
(01111110) does not occur in the address, control, information and FCS fields. A
technique called 'Zero Stuffing' is used. At the sending end an extra 0 bit is inserted
after every five contiguous 1s occurring anywhere after the opening flag and before
the closing flag. At the receiving end, the 0 bit following five contiguous is deleted.
After zero stuffing flag sequence cannot occur anywhere from address to FCS fields.
Note that zero stuffing is performed before the flags are appended to rest of
the frame. Therefore, any sequence of bits (including flag sequence) can be
transmitted in the address, control information and FCS fields without affecting the
data link control operation.
In Fig. 6.10 to 6.17, the frames have been represented as a code of five
symbols A, B, C, D and E, where
Fig. 6.10
• The primary station sends mode setting command SNRM with P bit set to '1'.
• A mode setting command is always acknowledgement with UA response and
with F bit set to '1'.
• Being TWA operation, only one station transmits at a time.
• Secondary station can initiate transmission only after it receives explicit
permission from the primary station in form of P bit set to '1'.
• Link is disconnected by sending DISC command which is acknowledged with
UA response.
• Before the link is disconnected, it is ensured that :
• All frames have been acknowledged.
• All acknowledgements have been received.
• Secondary station does not send any frame.
Fig. 6.11
• A mode setting command is re-transmitted after time out if it is not
acknowledged.
• Loss of a frame is detected when next frame in sequence is received. A frame
received with error is also considered as lost because the error may even be in
its sequence number.
• Loss of a frame is communicated when its acknowledgement is not received in
the frames sent subsequently, e.g. B100 and B could have been sent only after
receipt of B110P. As B100 of B does not acknowledge B100 of A, the frame
must have been lost.
• Loss of a frame with P bit set to '1' is detected when no acknowledgement is
received. After time out, an enquiry is sent with another P bit, e.g. BSRR-2P is
sent when there is no response to B112P.
• Loss of a frame with F bit set to '1' is detected when there is no activity on the
link. After timeout an enquiry is sent with P bit set to '1'.
Fig. 6.12
• Both the stations can transmit and receive simultaneously but the secondary
station can send a frame only after it receives permission to transmit from the
primary station.
• When loss of a frame is detected, a supervisory frame with REJ is sent.
• When REJ is received, all the frames from the lost frame onward are re-
transmitted.
Fig. 6.13
6.10ASYNCHRONOUS RESPONSE MODE (ARM)
Two Way Alternate – No Errors (Fig. 6.14)
• The secondary station need not wait for the poll from the primary station to
transmit, e.g. after receiving the mode setting command from the primary
station A, the secondary station B sends the B100 and B110 frames to A.
• Since the stations are operating on TWA link, a station sends a frame after it
senses no activity on the link.
Fig. 14
• P bit is set to '1' only when the primary station wants to force an
acknowledgement from the secondary station, e.g. A sends an I-Frame with P
bit set to '1' to force acknowledgement from B. B immediately sends B131F
with F bit set to '1' acknowledging A's frame at the same time.
Fig. 6.15
• If a frame sent by the secondary station is lost, the secondary station
retransmits the frame after time out, e.g. frame B100 from B is lost and after
time out B retransmits the frame.
• The primary station can always force an acknowledgement from the secondary
station by sending S-Frame with P bit set to '1' after time out.
Fig. 6.16
Fig. 6.17
6.12ADDITIONAL FEATURES
6.12.1EXTENDED ADDRESSING
Two address field options are defined in HDLC protocol.
• Single octet addressing.
• Multiple octet addressing.
The single octet addressing provides for maximum of 256 different addresses.
In case of multiple octet addressing, the address field is recursively extendable using
the first bit of each octet to indicate the extended format of the address field
(Fig.6.18). The first bit of each octet is set to '0' indicating that the next octet is also to
be considered as part of the address field. In the final octet, the first bit is set to '1'.
Fig. 6.18
The addressing scheme cannot be dynamically changed. Once a scheme has
been initially agreed to, then it has to be adhered to.
6.12.2EXTENDED CONTROL FIELD
The window size in the HDLC protocol can be 7 or 127. In the first case, three
bit frame sequence number is sufficient. In the second case, however, the sequence
number has to be seven bits to count upto 128 frames. To accommodate seven bit
frame sequence numbers, the control field of I- and S-Frames is extended to two
octets as shown in the Fig. 6.19. Note that the control field of U-Frame remains
unchanged as it does not carry the frame sequence number.
Fig. 6.19