Sie sind auf Seite 1von 22

Data Link Control Protocol

The most important responsibility :


Flow Control and Error Control

Flow Control and Error Control


Flow Control is a set of procedure to restrict the
amount of data that the sender can send before
waiting for acknowledgment.
Error Correction is both error detection and error
correction. (Simply : Anytime an error is detected
in an exchange, specified frames are
retransmitted. This process called Automatic
Repeat Request (ARQ)
(ARQ).

Flow and Error Control Mechanisms

Stop-and-Wait ARQ
Go-Back-N-ARQ
Selective-Repeat ARQ

Stop-and-Wait ARQ
This is the simplest flow and error control mechanism. It has
the following mechanism :
The sending device keep the copy of the last frame transmitted
until
til it receives
i
an acknowledgment
k
l d
t ffor th
thatt fframe.
For identification purpose, both Data Frame and
Acknowledgment (ACK) frame are numbered alternately 0 and
1 This numbering allow for identification of data frame in case of
1.
duplicate transmission.

A data 0 frame
A data 1 frame

ACK 1
ACK 0

- A damaged and lost frame is treated in the same manner by the


receiver. (Its simply discards).
- The sender has control variable S,
S The receiver has control
variable R.
- The sender start a timer when it send a frame.
- The receiver send only positive acknowledgment for frame
received safe and sound.
4

There are four situation in a frame transmission : Normal situation,


the frame is lost,
lost the acknowledgment is lost,
lost or the
acknowledgment is delayed.

Normal situation

Lost or Damaged Frame

Lost ACK Frame

The receiver
discards the 2nd
copy of Frame 1
7

the acknowledgment is delayed

Numbered ACKs are needed of an acknowledgment is delayed


and the frame is lost.
8

If station A and B both have data to send. Piggybacking


ggy
g is a
method to combine a data frame and an acknowledgment.

Go-Back N ARQ
Go-Back-N ARQ improves the efficiency of Stop and
Wait ARQ in term of using transmission medium.
It lets more than one frame be outstanding; It can send
up to W frames before worrying about acknowledgment.
Frame from a sending station are numbered sequentially
with a range from 0 to 2m-1.
The window slides to includes new unsent frames when
the correct acknowledgments are received (Sliding
Window).

10

Example : Sender Sliding Window

Receiver Sliding
Window
The receiver is always
looking for the specific
frame to arrive
arri e in a specific
order.
11

Control Variables

S = Variable holds the sequence number of the recently


sent frame.
SF= Holds the sequence number of the first frame.
SL= Holds the sequence number of the last frame.
The size of the window :
W = SL SF+1

The receiver only has one


variable R that only hold
the sequence of the frame it
expect to receive
12

Acknowledgment
The receiver send positive ACK if a frame has arrived and
sound and in order.
If frame is damaged
g or is received out of order,, the
receiver is silent and will discard all subsequent frames
until receives the one it is expecting.
The silent of the receiver causes the timer of
unacknowledged frame to expire.
It causes the sender to go back and resend all frame,
b i i with
beginning
ith th
the one with
ith expired
i d titimer.
For Example, suppose the sender has already sent
frame 6, but the timer for frame 3 expires. This means
that frame 3 has not been acknowledged, so the
sender goes back and send frame 3, 4, 5, 6 again. (GoBack-N ARQ).
)
13

Go-Back-N ARQ Normal Operation

14

Go-Back-N ARQ; Damaged or Lost Frame

15

Damaged or Lost Acknowledgment ..?


D l
Delayed
d Acknowledgment
A k
l d
t

?
?

16

Sender Window Size

In Go-Back-N ARQ
ARQ, the size of the sender must be lest
than 2m; the size of the receiver window is always 1

17

Selective Repeat ARQ


The Go-Back-N protocol is very inefficient
for a noisy link
link.!!!?
!!!?
The Selective Repeat ARQ only resend
one frame
f
is
i d
damaged.
d (M
(More efficient
ffi i t for
f
noisy link but more complex process at
th receiver).
the
i )
The window size at the sender and the
receiver is the same size:
W = one half of the value 2m
18

Selective Repeat ARQ, Sender and Receiver windows

RF = Receive First
RL = Receive
R
i L
Lastt

19

Selective Repeat ARQ; Lost Frame

Selective
S
l ti R
Repeatt
ARQ also defines
a negative
acknowledgment
(NAK) that reports
the sequence
number of a
damaged frame
before the timer
expires

20

Selective Repeat ARQ; Lost and


Delayed
e ayed ACKs
C sa
and
d
NAKs.???

21

Selective Repeat
p
ARQ, Sender and Window Size

22

Das könnte Ihnen auch gefallen