You are on page 1of 4

CPS 422

Computer Networks
HDLC

DATA LINK LAYER High Level Data Link Control

Faisal Amjad CPS 422


Faisal Amjad CPS 422

HDLC HDLC Defines :


‰One of the most important Data Link ‰Three types of stations,
Control protocol. ‰Two link configurations and
‰Widely used, basis for many other ‰Three data transfer modes
protocols which use similar formats and
mechanisms.
‰Supports half and full duplex
communication over point-to-point and
multipoint links.
‰Implements the ARQ mechanisms studied.

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Station Types Link Configurations


‰Primary station ‰Unbalanced
o Responsible to control the operation of link o Consists of one primary and one or many secondary
o Frames issued by primary are called commands stations
‰Secondary station ‰Balanced
o Operates under control of primary o Consists of two combined stations
o Frames issued by secondary are called responses
‰Combined station
o A combination of above
o Issues commands and responses

Faisal Amjad CPS 422 Faisal Amjad CPS 422

1
Data Transfer Modes HDLC Frame Types
‰ Normal Response Mode (NRM)
o Used with unbalanced configuration Flag Address Control Information FCS Flag I - Frame

o Primary may initiate data transfer


Flag Address Control FCS Flag S - Frame
o Secondary can transmit data only as a response
o Used on point-to-point and multi-point links Flag Address Control Information FCS Flag U - Frame

‰ Asynchronous Response Mode (ARM)


o Used with unbalanced configuration ‰Information Frames (I-Frame)
o Secondary station may initiate data transfer without explicit o Used to transmit user data and control info
permission from the primary. Primary still responsible for
overall control ‰Supervisory Frames (S-Frame)
o Rarely used
o Used to transmit only control info
‰ Asynchronous Balanced Mode (ABM)
o Used with balanced configuration ‰Un-numbered Frames (U-Frame)
o Any combined station may initiate data transfer without o Reserved for system maintenance (link
permission from the other management)
o Most widely used because more efficient on full duplex point-
to-point link
Faisal Amjad CPS 422 Faisal Amjad CPS 422

HDLC Frame Format HDLC Frame Format


Flag Address Control Information FCS Flag
Only in I- and U- frames

Flag Address Control Information FCS Flag ‰Flag Field


No of bits 8 8
extendable
8 or 16 variable 16 or 32 8 o Delimits the frame at both ends with the pattern
01111110.
o Acts as a synchronization pattern for the receiver.
o A single flag may act as closing flag for one frame
and opening flag for another.
o It is possible that the pattern 01111110 appears
within the frame, thus destroying frame level sync.
o To avoid this (and to ensure data transparency) a
technique called bit-stuffing is used

Faisal Amjad CPS 422 Faisal Amjad CPS 422

Bit Stuffing (for data transparency) HDLC Frame Format


‰Between the transmission of starting and end Flag Address Control Information FCS Flag
flags, transmitter will always insert an extra 0
bit after each occurrence of five 1s in the ‰Address Field
frame. o Identifies the secondary station that has
‰After detecting a starting flag, if the transmitted or is to receive the frame.
receiver sees five 1s in the pattern, the sixth o Consists of 1-byte, can be more on prior agreement.
bit (seventh starting from 0) is examined. o Actual address is multiple of seven bits.
‰If seventh bit is a 1, and eighth bit is a 0, it is o Least significant bit is used to determine whether
accepted as a flag. it is or is not the last octet of the address field.
‰If bit number 7 – 14 are 1s, and 15th bit is 0, o All 1s in an address used to allow the primary to
the sender is indicating an abort condition broadcast.
‰If 15th bit is also a 1, idle channel is indicated.

Faisal Amjad CPS 422 Faisal Amjad CPS 422

2
HDLC Frame Format HDLC Frame Format
Flag Address Control Information FCS Flag Flag Address Control Information FCS Flag

‰Information Field ‰FCS Field


o Contains user data from the network layer or o Frame check sequence is HDLC’s error detection
system management info field.
o Length varies for networks but always pre-decided. o Can contain a 2 – byte or 4 – byte ITU-T CRC.

Faisal Amjad CPS 422 Faisal Amjad CPS 422

HDLC Frame Format (I – Frame) HDLC Frame Format (S – Frame)


Flag Address Control User Information FCS Flag Flag Address Control FCS Flag

0 P/F 1 0 P/F
N(S) N(R) Code N(R)

‰First bit “0” indicates an I-frame ‰ bits “1 and 0” indicate an S-frame


‰3-bit N(S) represents ‘Sent’ sequence number ‰ Code 00 – Receive Ready (RR): acknowledges safe
receipt of a group of frames
‰3-bit N(R) represents ‘Received’ seq numbers. ‰ Code 01 – Reject (REJ): represents NAK for Go-Back-N
Corresponds to value of ACK when piggybacking to improve efficiency.
is used. ‰ Code 10 – Receiver Not Ready (RNR) same as RR but also
‰P/F bit means poll or final. Has meanings only tells the sender that it cannot receive more frames.
when set (i.e. 1). Means Poll when used by ‰ Code 11 – Selective Reject (SREJ): represents NAK for
Selective Reject.
primary while sending frame to secondary. ‰ 3-bit N/R. Corresponds to value of ACK or NAK seq
Means Final, when used by secondary while number.
sending frame to primary. ‰ P/F bit same as in I-frame.
Faisal Amjad CPS 422 Faisal Amjad CPS 422

HDLC Operation
HDLC Frame Format (U – Frame) (piggybacking without error) B
A
Flag Address Control Management Info FCS Flag
I-frame 0
Address (To) Seq (ACK)
1 1 P/F
Code Code Flag B 0 0 0 Data FCS Flag

‰U-frames used for session mgmt, mode setting, Address (To)


Seq (sent)
Seq (ACK)

connection and disconnection of link etc.


‰bits “1 and 1” indicate an S-frame
Flag B 0 1 0 Data FCS Flag

Seq (sent)

‰5 – bit code represents 32 different types of Address (To) Seq (ACK)

U-frames (table 11.1) Flag A 0 0 2 Data FCS Flag

‰P/F bit same as in I-frame. Address (To) Seq (ACK) Seq (sent)

Flag B 1 0 0 0 1 FCS Flag

RR code 00
S-frame 10
Faisal Amjad CPS 422 Faisal Amjad CPS 422

3
Reading Assignment
‰HDLC operation examples in William
Stallings and Forouzan books.

Faisal Amjad CPS 422

You might also like