0% found this document useful (0 votes)
116 views19 pages

Datacom Jto Chap6

This document provides an overview of the High-Level Data Link Control (HDLC) protocol. It describes HDLC's general features, including its support for point-to-point and point-to-multipoint network configurations. It also outlines the three main modes of operation for HDLC - Normal Response Mode, Asynchronous Response Mode, and Asynchronous Balanced Mode. Finally, it discusses HDLC frames, flow control, error control, and other technical aspects of the protocol.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
116 views19 pages

Datacom Jto Chap6

This document provides an overview of the High-Level Data Link Control (HDLC) protocol. It describes HDLC's general features, including its support for point-to-point and point-to-multipoint network configurations. It also outlines the three main modes of operation for HDLC - Normal Response Mode, Asynchronous Response Mode, and Asynchronous Balanced Mode. Finally, it discusses HDLC frames, flow control, error control, and other technical aspects of the protocol.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 19

DATA LINK PROTOCOL

JTO Phase – I Data Communication

DATA LINK PROTOCOL

CONTENTS

6.1 OBJECTIVES

6.2 INTRODUCTION

6.3 GENERAL FEATURES OF HDLC

6.4 MODE OF OPERATION

6.5 FLOW CONTROL

6.6 TYPES OF FRAME

6.7 PROTOCOL OPERATION

6.8 NORMAL RESPONSE MODE, POINT-TO-POINT

6.9 NORMAL RESPONSE MODE, POINT-TO-


MULTIPOINT

6.10 NORMAL RESPONSE MODE, POINT-TO-


MULTIPOINT

6.11 ASYNCHRONOUS RESPONSE MODE (ARM)

6.12 ASYNCHRONOUS BALANCED MODE (ABM)

6.13 ADDITIONAL FEATURES

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 91


JTO Phase – I Data Communication

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.

6.3 GENERAL FEATURES


HDLC is a bit oriented data link control protocol which satisfies wide variety
of data link control requirements including :
• Point-to-point and point-to-multipoint links.
• Two way simultaneous communication over full duplex circuits.
• Two way alternate operation over half duplex or full duplex circuits.
• Synchronous and asynchronous communication.
• Communication between primary stations and between primary and
secondary stations.
• Full data transparency.
6.3.1 TYPES OF STATIONS

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 92


JTO Phase – I Data Communication

To make HDLC protocol applicable in various possible network


configurations, three types of stations have been defined.
• Primary station
• Secondary station
• Combined station
Communication can be between a primary station and one or more secondary
stations (Fig. 6.1). The primary station has the responsibility of link management, i.e.
activating and disconnecting the communication link. The secondary stations operate
under the control of the primary station. The frames sent by a primary station are
called commands and the frames sent by secondary station are called responses.

Fig. 6.1

A combined station can act as a primary as well as secondary station, i.e. it is


capable of link management function, sending and receiving both commands and
responses (Fig. 6.2). Such a communication situation occurs when it is between two
logical equal stations.

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

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 93


JTO Phase – I Data Communication

stations, one primary and other secondary stations. The asynchronous balanced mode
of operation is for logical equal combined stations.

6.4.1NORMAL RESPONSE MODE - NRM


In the normal response mode the primary station controls the overall link
management function. A secondary station can send a frame only as a result of
receiving explicit permission to do so from the primary station.

The normal response mode is applicable to point-to-point and point-to-


multipoint configurations. It is suited for polled multipoint operation where ordered
interaction between a host computer and a number of outlying computer/terminals is
required.

6.4.2ASYNCHRONOUS RESPONSE MODE – ARM


In the asynchronous response mode also, the primary station controls the
overall link management function. But a secondary station can initiate transmission
without any explicit permission from the primary station. ARM operation, therefore,
is less disciplined than NRM operation.

The asynchronous response mode is applicable to both point-to-point and


point-to-multipoint configurations. In multipoint environment, however, only one
secondary station can be active at a time. Other secondary stations must be kept in
disconnected mode.

6.4.3ASYNCHRONOUS BALANCED MODE – ABM


Asynchronous balanced mode is applicable to point-to-point communication
between two logical equal (combined) stations. Each station is capable of link
management function when required and is responsible for controlling its own data
flow. Each station issues commands and responses depending on whether the frame is
being sent by a station on its own or as a result of the command received from the
other station. Polling is not required, a station may transmit at any time.

6.4.4OTHER MODES OF OPERATION


In addition to the three data transfer modes explained above, there are three
other modes of operation. These modes refer to the states before and after data
transfer and include :
• Normal Disconnected Mode (NDM)
• Asynchronous Disconnected Mode (ADM)
• Initialization Mode (IM).
In the disconnected modes, the stations are logically disconnected. In the
normal disconnected mode, the secondary station cannot initiate any transmission.
The secondary station is activated by a mode setting command from the primary
station. In the asynchronous disconnected mode, the secondary station may generate a
particular response on asynchronous basis as a request for a mode setting command
from the primary station in order to establish data transfer mode. In the initialization

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 94


JTO Phase – I Data Communication

mode the operational parameters are exchanged or the data link control programs may
be regenerated.

6.5 FLOW CONTROL


HDLC utilizes sliding window flow control mechanism. The window size can
either be 7 or 127. All the frames are numbered (except unnumbered frames,
explained later) as required for sliding window flow control mechanism. The
receiving end sends acknowledgement in the form of a control symbol RR-N (receive
ready, frames upto N-1 acknowledged). When the receiver is not ready to receive
more frames, it sends RNR-N (receive not ready, frames upto N-1 acknowledged).

6.5.1 ERROR CONTROL


Error detection is carried out using a 16 bit Cyclic Redundancy Check (CRC)
code generated using CCITT V.41 polynomial x16 + x12 + x5 + 1
(10001000000100001). When an error is detected, the receiving end rejects the frame.
When an out of sequence frame is received, it sends REJ-N (Reject) frame or SREJ-N
(Selective Reject) frame.

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.

FLAG ADDRESS CONTROL DATA FCS FLAG

(a)

FLAG ADDRESS CONTROL FCS FLAG

(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.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 95


JTO Phase – I Data Communication

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

The address field consists of 8 bits giving it a capability of 256 different


addresses. Greater than 256 address capability is also possible as explained later in the
section on special features. All ones address is specified as global address so that all
secondary stations may be simultaneously called.

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.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 96


JTO Phase – I Data Communication

Frame Check Sequence


Frame Check Sequence (FCS) is 16 Cyclic Redundancy Check (CRC) code
for detection of errors in the address, control & information fields (Fig. 6.6).

Fig. 6.6

6.6TYPES OF HDLC FRAMES


There are three types of HDLC frames :
• Information transfer frame (I-Frame)
• Supervisory frame (S-Frame)
• Unnumbered frame (U-Frame)
6.6.1INFORMATION TRANSFER FRAME (I-FRAME)
I-Frame is used for transporting user data. It also carries acknowledgement of
the received frames. The control field of the I-Frame is as shown in Fig. 6.7. The first
bit is 0 which identifies the frame as an I-Frame. The next three bits are the sequence
number N(S) of the frame.

The fifth is Poll/Final (P/F) bit. Its use is explained later.

The last three bits are the sequence number N(R) of the acknowledgement
(RR) which is piggy backed on the I-Frame.

CONTROL FIELD OF I-FRAME

Fig. 6.7
6.6.2SUPERVISORY FRAME (S-FRAME)

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 97


JTO Phase – I Data Communication

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.

CONTROL FIELD OF AN S-FRAME

Fig. 6.8

6.6.3UNNUMBERED FRAME (U-FRAME)


The U-Frames do not have data field as S-Frames. They are used for link
establishment, termination, mode setting and other control functions. Controls field of
an unnumbered frame is shown in Fig. 6.9.

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.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 98


JTO Phase – I Data Communication

CONTROL FIELD OF A U-FRAME

Fig. 6.9

Table-1 gives the bit coding of the control field of a U-Frame for the various
commands and responses.

Table 1 Control Field or U-Frames

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 99


JTO Phase – I Data Communication

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.

Set Mode Command


SNRM, SARM and SABM are the mode setting commands. A secondary or a
combined station sets itself in the mode corresponding to the received command.
SNRME, SARME and SABME are used when extended frame numbering format is
used to accommodate window size of 127.

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.

Set Initialisation Mode Command


This command is used to establish the initialization mode of operation during
which operational parameters are exchanged.

Unnumbered Poll Command


The unnumbered poll (UP) command is used to solicit response frames from a
station.

Unnumbered Information Command/Response


The unnumbered information frames are used to exchange miscellaneous
information such as hourly reports, periodic time checks, etc. These frames are not
acknowledged.

Unnumbered Acknowledgement (UA)


The UA response is used to acknowledge receipt and execution of a U-Frame
command.

Frame Reject Responses (FRMR)


The FRMR response is used to report a condition which is not correctable by
retransmission of frames, e.g. receipt of invalid N(R).

Disconnected Mode Response


It is sent to primary station in response to mode setting command to indicate
that mode setting action has not been executed. It is also used to request the primary
station for sending mode setting command.

6.6.4POLL/FINAL (P/F) BIT


Fifth bit of the control field of an HDLC frame is called Poll/Final (P/F) bit. It
is called 'P' bit when the frame is a command, i.e. the frame is being sent by a primary
station. It is called 'F' bit when the frame is a response, i.e. the frame is being sent by a
secondary station.

A primary station invites a secondary station to transmit a frame by setting the


'P' of the control field to '1'. Having received invitation to transmit, the secondary

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 100


JTO Phase – I Data Communication

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'.

In asynchronous modes of data transfer, ARM and ABM, P bit is used to


solicit forced response from the secondary/combined station. When a frame with P set
to '1' is received, the receiving station responds with F bit set to '1' at the earliest
opportunity.

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.

The steps involved is assembling an HDLC frame are given below :


• Build address and control fields and append to the information field.
• Generate CRC
• Carry out zero stuffing.
• Append flags.
• At the receiving ends, the above steps are carried out in reverse order.
• Identify flags and delete them.
• Remove the stuffing zeros.
• Compute and check FCS.
• Check address and control fields.

6.7 PROTOCOL OPERATION


Having reviewed the basic features of HDLC protocol, let us now examine its
operation. Typical data communication situations include point-to-point and point-to-
multipoint links in various data transfer operating modes, namely NRM, ARM and
ABM. Fig.10 to Fig.17 illustrate some examples of the protocol operation for two
way alternate and two way simultaneous links in these modes. These examples serve
to illustrate the protocol operation in typical situations but it must be noted that these
examples are not exhaustive enough to cover all the possibilities.

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

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 101


JTO Phase – I Data Communication

A - Address of the secondary station


B - Type of frame – I, S, U
C - Sequence number of the I-Frame or
Acknowledgement in S-Frame, or
Link management command, response of U-Frame
D - Sequence number associated with the acknowledgement (I- and
S-Frames only).
E - Poll/Final bit.
The poll/final bit has been shown only when it is '1'. In commands, it is shown
as 'P' and in response it is shown as 'F'. When it is not shown, it means that P/F bit is
'0'.

6.8NORMAL RESPONSE MODE, POINT-TO-POINT


Two Way Alternate (TWA) – No Errors (Fig.10).

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.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 102


JTO Phase – I Data Communication

In Fig. 6.10 station A sends RNR-2 to acknowledge I-Frames of station B and


to indicate its unwillingness to accept any more frame. Station A ensures this message
reaches station B by sending P bit set to '1'. On receipt of RR-2 from B, station A
sends disconnect command.
Two-Way Alternate (TWA) – With Errors (Fig. 6.11)

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'.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 103


JTO Phase – I Data Communication

Two Way Simultaneous (TWS) – With Errors (Fig. 6.12)

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.

6.9NORMAL RESPONSE MODE, POINT-TO-


MULTIPOINT
In Fig. 6.13, communication between a primary station A and two secondary
stations B and C is shown. Two way alternate mode of communication is adopted.

• The secondary stations are individually set to normal response mode.


Similarly, the secondary stations are individually set to normal disconnected
mode at the end.
• The primary station polls the secondary stations one at a time.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 104


JTO Phase – I Data Communication

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

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 105


JTO Phase – I Data Communication

• 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.

Two-Way Alternate – With Errors (Fig. 6.15)

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.

Two Way Simultaneous – With Errors (Fig. 6.16)


• When a frame is lost, S-Frame with REJ is sent. If the other station is in the
process of transmitting another frame when the REJ is received, the frame is
aborted and next frame as per REJ is sent, e.g. when frame BI11 from A is
detected missing, B sends BSREJ-1. On receipt of BSREJ-1, A aborts the
frame BI33 and starts from BI113 again.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 106


JTO Phase – I Data Communication

Fig. 6.16

6.11ASYNCHRONOUS BALANCED MODE (ABM)


Asynchronous balanced mode of data transfer is applicable to combined
stations. The link can be set up by either of the two stations. As in ARM, any station
can transmit without waiting for permission from the other. P bit is used to get
acknowledgement from the other station.

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.

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 107


JTO Phase – I Data Communication

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

BRBRAITT ISO 9001 : 2000 Certified / Nov – 2008 108

You might also like