Error Detection and Correction

Data Link Protocols
Kyung Hee
University
1
11장 Data Link Control and Protocols
11.1 Flow and Error Control
11.2 Stop-and-Wait ARQ
11.3 Go-Back-N-ARQ
11.4 Selective Repeat ARQ
11.5 HDLC
Kyung Hee
University
2
Flow Control
• Flow control refers to a set of procedures used
to restrict the amount of data that the sender
can send before waiting for acknowledgment.
• Flow control is the regulation of the sender’s
data rate so that the receiver buffer does not
become overwhelmed.
Kyung Hee
University
3
Error Control
Error control in the data link layer is based on
automatic repeat request, which is the
retransmission of data.
Error control is both error detection and error
correction.
Kyung Hee
University
4
Stop and Wait ARQ
In Stop-and-Wait ARQ, the sender sends a frame and
waits for acknowledgment from the receiver before
sending the next frame.
Kyung Hee
University
5
Stop-and-Wait ARQ
 Normal Operation
Kyung Hee
University
6
Stop-and-Wait ARQ
 Stop-and-Wait ARQ Lost Frame
Kyung Hee
University
7
Stop-and-Wait ARQ
 Stop-and- Wait ARQ Lost ACK Frame
Kyung Hee
University
8
Stop-and-ARQ
In Stop-and-Wait ARQ, numbering frames
prevents the retaining of duplicate frames.
Kyung Hee
University
9
Stop-and-Wait ARQ, delayed ACK
Kyung Hee
University
10
Stop-and-Wait ARQ, delayed ACK
 Numbered acknowledgments are needed if an
acknowledgment is delayed and the next frame is lost.
Kyung Hee
University
11
Piggybacking
 meaning combining data to be sent and acknowledgment
of the frame received in one single frame
Kyung Hee
University
12
11.3 Go-Back-N ARQ
 Sender sliding window
Kyung Hee
University
13
Go-Back-N ARQ
 Receiver sliding window
Kyung Hee
University
14
Go-Back-N ARQ
 Control variables
Kyung Hee
University
15
Go-Back-N ARQ
 Go-Back-N ARQ, normal operation
Kyung Hee
University
16
Go-Back-N ARQ
 Go-Back-N ARQ, lost frame
Kyung Hee
University
17
Go-Back-N ARQ
 Go-Back-N ARQ: sender window size
Kyung Hee
University
18
Go-Back-N ARQ
 In Go-Back-N ARQ, the size of the sender
window must be less than 2m; the size of the
receiver window is always 1.
Kyung Hee
University
19
11.4 Selective-Repeat ARQ
 Selective Repeat ARQ, sender and receiver windows
Kyung Hee
University
20
Selective-Repeat ARQ
 Selective Repeat ARQ,
lost frame
Kyung Hee
University
21
Selective-Repeat ARQ
 In Selective Repeat ARQ, the size of the sender and
receiver window must be at most one-half of 2m.
Kyung Hee
University
22
Selective-Repeat ARQ
Selective Repeat ARQ, sender window size
Kyung Hee
University
23
Example
Example 1
In a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1
bit takes 20 ms to make a round trip. What is the bandwidth-delay product?
If the system data frames are 1000 bits in length, what is the utilization
percentage of the link?
Solution
The bandwidth-delay product is a measure of the number of bits
a system can have in transit.
The bandwidth-delay product is
1  106  20  10-3 = 20,000 bits
The system can send 20,000 bits during the time it takes for the data to go
from the sender to the receiver and then back again. However, the system
sends only 1000 bits. We can say that the link utilization is only 1000/20,000,
or 5%. For this reason, for a link with high bandwidth or long delay, use of
Kyung Hee
Stop-and-Wait
ARQ wastes the capacity of the link.
University
24
Example
Example 2
What is the utilization percentage of the link in Example 1 if the link uses GoBack-N ARQ with a 15-frame sequence?
Solution
The bandwidth-delay product is still 20,000. The system can send up to 15
frames or 15,000 bits during a round trip. This means the utilization is
15,000/20,000, or 75 percent. Of course, if there are damaged frames, the
utilization percentage is much less because frames have to be resent.
Kyung Hee
University
25
HDLC
 A mode in HDLC is the relationship between two
devices involved in an exchange; The mode of
communication describes who controls the link
 HDLC supports three modes of communication
between stations
NRM(Normal Response Mode)
ABM(Asynchronous Balanced Mode)
HDLC is a protocol that implements ARQ mechanisms.
It supports communication over point-to-point or multipoint links.
Kyung Hee
University
26
HDLC (cont’d)
NRM(Normal Response Mode)
 refers to the standard primary-secondary relationship
 secondary device must have permission from the
primary device before transmitting
Kyung Hee
University
27
HDLC (cont’d)
ABM(Asynchronous Balanced Mode)
all stations are equal and therefore only combined
stations connected in point-to-point are used
Either combined station may initiate transmission with
the other combined station without permission
Kyung Hee
University
28
HDLC (cont’d)
 HDLC Frame
I (Information) Frame

used to transport user data and control information relating
to user data
S (Supervisory) Frame

used to only to transport control information, primarily data
link layer flow and error controls
U (Unnumbered) Frame

is reserved for system management

Information carried by U-frame is intended for managing the
link itself
Kyung Hee
University
29
HDLC (cont’d)
 HDLC frame
Kyung Hee
University
30
HDLC (cont’d)
HDLC Frame types
Kyung Hee
University
31
HDLC (cont’d)
Frame may contain up to six fields
beginning flag
address
control
information
FCS(Frame Check Sequence)
Ending flag
Kyung Hee
University
32
HDLC (cont’d)
Flag Field serves as a synchronization pattern for the
receiver
Kyung Hee
University
33
HDLC (cont’d)
Address Field
~ contains the address of the secondary station that is
either the originator or destination of the frame
Kyung Hee
University
34
HDLC(cont’d)
Control field
Kyung Hee
University
35
HDLC(cont’d)
Control field (extended mode)
Kyung Hee
University
36
HDLC(cont’d)
Poll/Final field in HDLC
Kyung Hee
University
37
HDLC(cont’d)
Information field
Kyung Hee
University
38
HDLC(cont’d)
FCS field
Kyung Hee
University
39
HDLC(cont’d)
More about Frames
s-frame
~ is used for acknowledgment, flow control, and error control
Kyung Hee
University
40
HDLC(cont’d)
U-Frame is used to exchange session management and
control information between connected devices
Kyung Hee
University
41
HDLC(cont’d)
U-Frame control command and response
Command/
response
SNRM
SNRME
SARM
SARME
SABM
SABME
UP
UI
UA
RD
DISC
DM
RIM
SIM
RSET
XID
FRMR
Kyung Hee
University
Meaning
Set normal response mode
Set normal response mode(extended)
Set asynchronous response mode
Set asynchronous response mode(extended)
Set asynchronous balanced mode
Set asynchronous balanced mode(extended)
Unnumbered poll
Unnumbered information
Unnumbered acknowledgement
Request disconnect
Disconnect
Disconnect mode
Request information mode
Set initialization mode
Reset
Exchange ID
Frame reject
42
HDLC (cont’d)
 U-Frame
~ can be divided into five basic functional category
 Mode setting commands


are sent by the primary station, or by a combined station wishing
to control an exchange, to establish the mode of the session(see
table)
SNRM, SNRME, SARM, SARME, SABM, SABME
 Unnumbered-Exchange


are used to send or solicit specific pieces of data link information
between devices (see table)
UP, UI, UA
 Disconnection : RD, DISC, DM
 Initialization Mode : RIM, SIM
 Miscellaneous : RSET, XID, FRMR
Kyung Hee
University
43
HDLC (cont’d)
Example 3
Figure 11.22 shows an exchange using piggybacking where is no
error. Station A begins the exchange of information with an I-frame
numbered 0 followed by another I-frame numbered 1. Station B
piggybacks its acknowledgment of both frames onto an I-frame of
its own. Station B’s first I-frame is also numbered 0 [N(S) field]
and contains a 2 in its N(R) field, acknowledging the receipt of A’s
frames 1 and 0 and indicating that it expects frame 2 to arrive next.
Station B transmits its second and third I-frames (numbered 1 and 2)
before accepting further frames from station A. Its N(R)
information, therefore, has not changed: B frames 1 and 2 indicate
that station B is still expecting A frame 2 to arrive next.
Kyung Hee
University
44
HDLC (cont’d)
Kyung Hee
University
45
HDLC (cont’d)
Example 4
In Example 3, suppose frame 1 sent from station B to
station A has an error. Station A informs station B to
resend frames 1 and 2 (the system is using the Go-BackN mechanism). Station A sends a reject supervisory frame
to announce the error in frame 1. Figure 11.23 shows the
exchange.
Kyung Hee
University
46
HDLC (cont’d) – Example 4
Kyung Hee
University
47
HDLC (cont’d)
 Bit stuffing
Bit stuffing is the process of adding one extra 0
whenever there are five consecutive 1s in the
data so that the receiver does not mistake the
data for a flag.
Kyung Hee
University
48
HDLC (cont’d)
 Bit stuffing and removal
Kyung Hee
University
49
HDLC (cont’d)
 Bit stuffing in HDLC
< 15
Kyung Hee
University
≥ 15
50
HDLC (cont’d)
LAP(Link Access Procedure)
LAPB(Link Access Procedure Balanced)
~ provides those basic control function required for
communication between a DTE and a DCE
~ is used only in balanced configuration of two devices
~ is used in ISDN on B channels
LAPD(Link Access Procedure for D channel)
~ used in ISDN
~ use ABM(Asynchronous Balanced Mode)
LAPM(Link Access Procedure for Modem)
~ is designed to do asynchronous-synchronous
conversation, error detection, and retransmission
~ has become developed to apply HDLC feature to modem
Kyung Hee
University
51