






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
ARQ Techniques
Typology: Study Guides, Projects, Research
1 / 11
This page cannot be seen from the preview
Don't miss anything!
S Chen
Flow control
deals with problem that
sender transmits frames faster thanreceiver can accept,
and solution is
to limit sender into sending no fasterthan receiver can handle
-^
Consider the
simplex
case:
data is
transmitted
in
one
direction
(Note
although data frames are transmittedin one direction, frames are going inboth directions, i.e. link is
duplex
Stop
and
wait
sender
sends
one
data
frame
waits
for
acknowledgement
from
receiver before proceeding to transmitnext frame^ –^
This simple flow control will breakdown if ACK gets lost or errorsoccur
sender may wait for ACK
that never arrives
S Chen
For noisy link, pure stop and wait protocol will break down, and solution is to incorporate some error control
mechanism
Stop
and
wait
with
:^ Automatic Repeat reQuest
(ARQ), an error control method,
is
incorporated with stop and wait flow control protocol^ –^
If error is detected by receiver, it discards the frame and send a
negative
ACK (NAK), causing
sender to re-send the frame
-^
In case a frame never got to receiver, sender has a
timer
: each time a frame is sent, timer is set
If no ACK or NAK is received during timeout period, it re-sends the frame
-^
Timer introduces a problem:
Suppose timeout and sender retransmits a frame but receiver
actually received the previous transmission
receiver has
duplicated
copies
To avoid receiving and accepting two copies of same frame, frames and ACKs are alternatively labeled
0 or 1: ACK0 for frame 1, ACK1 for frame 0
An important
link parameter
is defined by
a^ =
propagation time
frame time
R d V L
where
is data rate (bps),
d^
is link distance (m),
is propagation velocity (m/s) and
frame
length (bits)
S Chen
For large link parameter
a, stop and wait protocol is inefficient
A universally accepted flow control procedure is the
sliding window protocol
Frames and acknowledgements are numbered using
sequence numbers
Sender maintains a list of sequence numbers (frames) it is allowed to transmit, called
sending
window
-^
Receiver maintains a list of sequence numbers it is prepared to receive, called
receiving window
A sending window of size
means that sender can send up to
frames without the need for
an ACK
-^
A window size of
implies buffer space for
frames
For
n-bit sequence number, we have
n 2 numbers:
n^ −
1 , but the maximum window
size
n^ −
(not
n 2
ACK3 means that receiver has received frame 0 to frame 2 correctly, ready to receive frame 3(and rest of
frames within window)
In error-free case, efficiency or maximum
link utilisation
of sliding window protocol is:
2 a
N 1+2a
2 a
Thus it is able to maintain efficiency for large
link parameter
a: just use large widow size
S Chen
Note that
means that link has no idle time: there are always something in it, either data
frames or ACKs
-^
Consider the case of 3-bit sequencenumber with maximum window size N^
This illustration shows thatSending and receiving windows canshrink or grow during operationThe
receiver
do
not
need
to
acknowledge every frames
-^
If^
both
sending
and
receiving
window
sizes
are
the
sliding window protocol reduces tothe stop-and-wait
3
5
0
0 1
2
4
1
3 4
6 0
1
0 1
2 3
4 5
(^10)
6
6
2 3
4 5
6 0
1
F1 F (^10) (^65) (^43) 2 (^0 ) (^54) (^32) (^10)
0 1
2 3
4 5
6 0
1 2
3 4
5 6
0
0 1
3 2 3 4 5
6
1 2
3
5 6
0
0
4
1 1
F0 ACK
0 1
2 3
4 5
6 0
1 2
3 4
5 6
0 1
F3 F^
0 1
2 3
4 5
6 0
1 2
3 4
5 6
0 1
F5 F (^10) 6 (^4 ) (^21) (^06) (^54) (^32) (^10)
ACK
A:^
B:^0
1
2 3
4 5
6 0
1 2
3 4
5 6
0 1
0 1
2 3
4 5
6 0
1 2
3 4
5 6
0 1
2
5
In practice, error control must be incorporated with flow control, and we next discuss two commonerror control mechanisms
S Chen
ACK
ACK
NAK error 1
ACK
ACK
ACK
ACK
buffered
F2-5 released
n 2 2
S Chen
So far, we consider data transmission in one direction (simplex), although the link is duplex
-^
If two sides exchange data (duplex), each needs to maintain two windows: one for transmitting andone for receiving
-^
In^
duplex
communication, frames transmitted from either side can be data, ACKs and NAKs
the need to distinguish them
-^
Frame type
: Recall in frame header there is a control field, and part of it is typically used as frame
type field to tell what type the frame is
-^
Piggybacking
: In duplex situations, piggybacking is often used
If one has data and an ACK to
send, it sends both in one frame
-^
Discussion so far: data link layer is primarily concerned with making point-to-point link reliable^ –^
It is responsible for transmitting frames from sender to receiver (service to network layer), andcan only uses physical layer to do the job
-^
It has to take into account that transmission error may occur and sender/receiver may operate atdifferent speeds
error control/flow control (ACKs, NAKs, CRC, windows, sequence numbers)
Next lecture will see how all these fit into some data link layer protocols
S Chen
How to know a protocol really works
specify and verify protocol using, e.g. finite state machine
Each protocol machine (sender or receiver) is at a specific state at every time instant
-^
Each state has zero or more possible transitions to other states
-^
One particular state is initial state: from initial state, some or possibly all other states may bereachable by a sequence of transitions
-^
Simplex stop and wait ARQ protocol:^ –^
State
which
frame sender is sending;
which frame receiver is expecting; C^
(empty)
channel state, i.e. what is in channel
-^
There are 9 transitions
Transition^012345678
Whoruns?–RSRSRRSS
Frameaccepted^0 A^1 A^01 (timeout)(timeout)
FrameemittedA^1 A^0 AA^01
Tonetworklayer–Yes–Yes–NoNo––
0 0 –
0 1 –
0 1 0
0 0 0
0 1 A 1 1 1 1 1 –
1 0 A
1 0 – (^0) 1 0 1 0 8
0 7
7
0
8
4
2
6
0
0
5
(^13) (a)^
(frame lost) (b)
Initial state
: sender has just sent frame 0, receiver is expecting frame 0, and frame 0 is
currently in channel
-^
Transition 0 consists of channel losing its contents, transition 1 consists of channel correctlydelivering frame 0 to receiver, and so on
-^
During normal operation, transitions 1,2,3,4 are repeated in order over and over: in each cycle,two frames are delivered, bringing sender back to initial state
S Chen