Top Banner
1  Data Link Control and  Protocols
30

(37) Flow Control - Final

Apr 10, 2018

Download

Documents

saideepak2010
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: (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

Page 2: (37) Flow Control - Final

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:

Page 3: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 3/30

Page 4: (37) Flow Control - Final

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

Page 5: (37) Flow Control - Final

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

Page 6: (37) Flow Control - Final

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

Page 7: (37) Flow Control - Final

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

Page 8: (37) Flow Control - Final

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

Page 9: (37) Flow Control - Final

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

Page 10: (37) Flow Control - Final

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

Page 11: (37) Flow Control - Final

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

Page 12: (37) Flow Control - Final

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

Page 13: (37) Flow Control - Final

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 

Page 14: (37) Flow Control - Final

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?

Page 15: (37) Flow Control - Final

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.

Page 16: (37) Flow Control - Final

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

Page 17: (37) Flow Control - Final

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

Page 18: (37) Flow Control - Final

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

Page 19: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 19/30

19

Sender sliding window

Page 20: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 20/30

20

Receiver sliding window

Page 21: (37) Flow Control - Final

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

Page 22: (37) Flow Control - Final

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

Page 23: (37) Flow Control - Final

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

Page 24: (37) Flow Control - Final

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

Page 25: (37) Flow Control - Final

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

Page 26: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 26/30

Selective repeat ARQ 

26

Page 27: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 27/30

27

Selective Repeat ARQ, lost frame

Page 28: (37) Flow Control - Final

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

Page 29: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 29/30

Page 30: (37) Flow Control - Final

8/8/2019 (37) Flow Control - Final

http://slidepdf.com/reader/full/37-flow-control-final 30/30

30

Selective Repeat ARQ, sender window size