(37) Flow Control - Final
-
Upload
saideepak2010 -
Category
Documents
-
view
224 -
download
0
Transcript of (37) Flow Control - Final
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 1/30
1
Data Link Control
and
Protocols
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 2/30
11.2
1111--2 FLOW AND ERROR CONTROL2 FLOW AND ERROR CONTROL
TheThe most most important important responsibilitiesresponsibilities of of thethe datadata link link
layer layer areare flow flow control control and and error error control control .. Collectively,Collectively,
thesethese functions functions areare knownknown asas datadata link link control control ..
Flow Control
Error Control
Topics discussed in this section:Topics discussed in this section:
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 4/30
11.4
Error control in the data link layer isbased on automatic repeat request,
which is the retransmission of data.
N ote
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 5/30
how much data sender can transmit before
receiving the ack
Why flow control?
Limitation with receiver
1.Processing speed
2. Limited memory to store incoming data
5
FlowFlow ControlControl
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 6/30
Error Control
Error Detection + Error Correction
Otherwise
Error Detection + Retransmission ARQ
- any time, an error is discovered in an
exchange,specified frames are retransmitted
6
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 7/30
Flow and Error Control
Mechanisms
Stop and Wait ARQ
Go-Back ARQ
Selective Repeat ARQ
7
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 8/30
Stop-and-Wait Automatic Repeat reQuest
simplest flow and error control mechanism
the sending device keeps a copy of the last frame
transmitted until it receives an acknowledgement
Frames - alternately numbered as 0 and 1
Ack for frame0 = ACK 1 and for frame1= ACK0
Out of order frames and erroneous frames are
discarded and no ack is sent
Timers
8
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 9/30
Stop and Wait ARQ -scenario
Normal Operation
Frame lost
Acknowledgement lost
Acknowledgement delayed
9
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 10/30
10
Normal operation
The sender will notsend the next piece of
data until it is sure that
the current one is
correctly received
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 11/30
11
Stop-and-Wait ARQ, lost frame
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 12/30
12
Stop-and-Wait ARQ, lost ACK frame
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 13/30
13
Stop-and-Wait ARQ, delayed ACK
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 14/30
14
I n Stop I n Stop--and and--Wait ARQ,Wait ARQ,
1.1. numbering frames prevents thenumbering frames prevents the
retaining of duplicate frames.retaining of duplicate frames.
2.2. Numbered acknowledgements are Numbered acknowledgements areneeded in case of delayed ack and needed in case of delayed ack and
next frame lost.next frame lost.
Why numbering frames?Why numbering frames?
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 15/30
15
Bidirectional Transmission
Piggybacking(hooking ack
with next
outgoing data
frame) can be
used to save
bandwidth.
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 16/30
Drawbacks of stop and wait
Only one frame can be in transit at a time after each frame sent the host must wait for an ACK
± inefficient use of bandwidth
to improve efficiency, multiple frames can be sentbefore receiving acknowledgement
Alternatives: Sliding Window protocols
- one task begins before the other one ends(concept of pipelining)
-increases efficiency in transmission
16
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 17/30
Sliding Window Protocols
Sliding window
± Holds the unacknowledged outstanding frames in sender
± Holds the expected frames in receiver
Sequence numbers
± sent frames are numbered sequentially
Protocols
1. Go back N2. Selective Repeat
17
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 18/30
Go Back - N
Why the name go back- N?
± when the frame is damaged the sender goes back andsends a set of frames starting from the last one ACKnd
± the number of retransmitted frames is N
Example:
The window size is 4.
A sender has sent frame 6 and the timer expires for frame 3(frame 3 not ACKnd). The sender goes back and re-sends theframes 3, 4, 5 and 6.
18
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 19/30
19
Sender sliding window
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 20/30
20
Receiver sliding window
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 21/30
21
Go-Back-N ARQ, normal operation
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 22/30
22
Go-Back-N ARQ, lost frame
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 23/30
Try for (go back N)
Damaged or lost ACK
case 1 : next ack arrives before timer
expires
case 2 : Next ack arrives after timer expires
Delayed Ack
23
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 24/30
24
Go-Back-N ARQ: sender window size
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 25/30
Drawbacks of Go-back-N
Inefficient ± all out of order received packets are discarded (
recieiver side is simplified) This is a problem in a noisy link
± many frames must be retransmitted -> bandwidthconsuming
Solution ± re-send only the damaged frames
Selective Repeat ARQ ± avoid unnecessary retransmissions
25
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 26/30
Selective repeat ARQ
26
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 27/30
27
Selective Repeat ARQ, lost frame
8/8/2019 (37) Flow Control - Final
http://slidepdf.com/reader/full/37-flow-control-final 28/30
Try for selective repeat
Lost and delayed ACKs
Bidirectional transmission (both side requires both
sending and receiving windows)
28