HDLC Lec5
HDLC Lec5
If the items are produced faster than they can be consumed, the
consumer can be overwhelmed and may need to discard some
items.
If the items are produced more slowly than they can be consumed,
the consumer must wait, and the system becomes less efficient.
Flow control is one of the most important duties of the data link
layer.
Flow control coordinates the amount of data that can be sent before
receiving an acknowledgment.
Producer Consumer
Error Control
Error control allows the receiver to inform the sender of any frames
lost or damaged in transmission and coordinates the retransmission
of those frames by the sender.
In the data link layer, the term error control refers primarily to
methods of error detection and retransmission.
NRM
In Normal Response Mode (NRM), the station configuration is unbalanced.
HDLC
Frames
HDLC defines three types of frames: information frames (I-
frames), Supervisory frames (S-frames), and Unnumbered frames
(U-frames).
I-frames are used to transport user data and control information
relating to user data (piggybacking).
Frame Format
Control Field
Control Field for I-Frames
I-frames are designed to carry user data, in addition, they can
include flow and error control information (piggybacking).
Control Field
Control Field for I-Frames
The next 3 bits, called N(S), define the sequence number of the
frame in travel.
With 3 bits, we can define a sequence number between 0 and 7;
but in the extension format, in which the control field is 2 bytes,
this field is larger.
Control Field
Control Field for I-Frames
The next bit is called the P/F bit. The P/F field is a single bit with
a dual purpose. It has meaning only when it is set (bit = 1) and can
mean poll or final. It means poll when the frame is sent by a
primary station to a secondary. It means final when the frame is
sent by a secondary to a primary.
Control Field
Control Field for S-Frames
S-frames are used only to transport control information.
Supervisory frames are used for flow and error control whenever
piggybacking is either impossible or inappropriate (e.g., when the
station either has no data of its own to send or needs to send a
command or response other than an acknowledgment).
Control Field
Control Field for S-Frames
The first 2 bits of the control field is 10, this means the frame is an
S-frame.
The second 2 bits is a code that defines the four types of S-frames:
Receive Ready (RR), Receive Not Ready (RNR), Reject (REJ),
and Selective Reject (SREJ).
HDLC
Control Field
Control Field for S-Frames
Receive Ready (RR):
If the value of the code subfield is 00, it is an RR S-frame.
Control Field
Control Field for S-Frames
Receive not ready (RNR)
If the value of the code subfield is 10, it is an RNR S-frame.
Control Field
Control Field for S-Frames
Reject (REJ):
If the value of the code subfield is 01, it is a REJ S-frame.
This is a NAK frame, but not like the one used for Selective
Repeat ARQ. It is a NAK that can be used in Go-Back-N ARQ to
improve the efficiency of the process by informing the sender,
before the sender time expires, that the last frame is lost or
damaged.
Control Field
Control Field for S-Frames
Selective reject (SREJ):
If the value of the code subfield is 11, it is an SREJ S-frame.
Control Field
Control Field for U-Frames
U-frames are reserved for system management (exchange session
management and control information between connected devices).
U-frame codes are divided into two sections: a 2-bit prefix before the
P/F bit and a 3-bit suffix after the P/F bit. Together, these two
segments (5 bits) can be used to create up to 32 different types of U-
frames.
HDLC
Control Field
Control Field for U-Frames
HDLC
N(R) N(S)
HDLC
The number 3 in the N(R) field tells that frames 0, 1, and 2 have all
been accepted and that A is now expecting frame number 3.
HDLC
Discard
HDLC