Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Flow&Error Control R. Supakorn. 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send.

Similar presentations


Presentation on theme: "1 Flow&Error Control R. Supakorn. 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send."— Presentation transcript:

1 1 Flow&Error Control R. Supakorn

2 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send before waiting for an acknowledgement

3 3

4 4 Stop and Wait

5 5 Sliding Window

6 6 Sender Sliding Window

7 7 Receiver Sliding Window

8 8 Sliding Window Example

9 9 Sender

10 10 Receiver

11 11

12 12 Stop-and-wait ARQ The simplest flow and error control mechanism Features –Sending device keeps the copy of the last frame transmitted –For identification purpose : Both data frames and acknowledgement frames are numbered alternately 0 and 1 –A data 0 frame is acknowledged by and ACK 1 frame

13 13 Stop-and-wait ARQ Features : lost/damaged frames –When receives a damaged frame, a receiver : Discards the frame Does not send an acknowledgement –When receives out of order frames Means lost frames Discards this frame

14 14 Stop-and-wait ARQ Features : control variables –A sender has a control variable called S Hold the number of recently sent frame (0 or 1) –A receiver has a variable called R Holds the number of next frame expected (0 or 1)

15 15 Stop-and-wait ARQ Features : a timer –The sender starts a timer when it sends a frame –If an acknowledgement is not received within the allotted time period, the sender : Assumes that the frame was lost Resends the frame

16 16 Stop-and-wait ARQ Features : an acknowledgement mechanism –The receiver Sends only positive acknowledgement for good frames Stays silent for damaged/lost frames –The acknowledgement number always defines the number of next expected frame

17 17 Stop-and-wait ARQ Operations –Normal operation –Lost or damaged frame –Lost acknowledgement –Delayed acknowledgement

18 18 Stop-and-wait ARQ Operations: normal operation time s= 0 s= 1 s= 0 R=0R=0 R=1R=1 Frame 0 Frame 1 ACK 1 ACK 0...... ReceiverSender

19 19 Stop-and-wait ARQ Operations: lost frame time s= 0 s= 1 s= 0 R=0R=0 R=1R=1 Frame 0 ReceiverSender ACK 0 Frame 1 lost R=1R=1 Frame 1 s= 1 ACK 1 Time-out R=0R=0

20 20 Stop-and-wait ARQ Operation : lost acknowledgement time s= 0 s= 1 s= 0 R=0R=0 R=1R=1 ReceiverSender ACK 1 Frame 0 R=0R=0 s= 1 Time-out Expecting frame 0, frame 1 is discarded Frame 1 ACK 0 Frame 1 ACK 1 ACK 0

21 21 Stop-and-wait ARQ Operation : delayed acknowledgement time s= 0 s= 1 R=0R=0 R=1R=1 ReceiverSender Frame 0 R=0R=0 s= 1 Frame 0 Frame 1 ACK 1 Time-out Expecting frame 1, frame 0 is discarded discarded ACK 0

22 22 Go-Back-N ARQ Overcomes inefficiency of Stop-and-Wait ARQ- sender continues sending enough frames to keep channel busy while waiting for ACKs A window of W s outstanding frames is allowed m-bit sequence numbers are used for both-frmaes and ACKs, and W s =2 m -1

23 23 Go-Back-N ARQ (cont.)

24 24 Sender Sliding Window All frames are stored in a buffer, outstanding frames are enclosed in window –Frames to the left of the window are already acknowledged and can be purged –Frames to the right of the window cannot be sent until the window slides over them –Whenever a new ACK arrives, the window slides to include new unsent frames –Once the window gets full (max# of outstanding frames is reached), entire window gets resent

25 25 Sender Sliding Window (cont.)

26 26 Receiver Sliding Window (cont.) The size of receiver window is always 1 –Receiver is always looking for a specific frame to arrive in a specific order –Any frame arriving out of order is discarded and needs to be resent

27 27 Go-Back-N with timeout Go-Back-N works correctly as long as the sender has unlimited supply of packets that need to be transmitted –But, in case when ACK packets arrive sporadically, there may not be Ws-1 subsequent transmissions => window will not be exhausted, retransmissions will not be triggered –This problem can be resolved by modifying Go-Back-N such that: Set a timer for each sent frame Resend all outstanding frames either when the window gets full or when the timer of first frame expires

28 28 Go-Back-N with timeout (cont.)

29 29 Lost frame in Go-Back-N with timeout

30 30 Sequence numbers and window size m bit allotted within a header for sequence numbers => 2 m possible sequence numbers –How long should the sender window be? –W > 2 m connot be accepted => ambiguous ACKs –W = 2 m can still cause some ambiguity –W = 2 m – 1 acceptable

31 31 Sequence numbers and window size

32 32 Selective Repeat ARQ Go-Back-N is NOT suitable for ‘noisy links’ –incase of a lost/damaged frame a whole window of frames need to be resent excessive retransmissions use up the bandwidth and slow down transmission Selective Repeat ARQ overcomes the limitationsof Go-Back- N by adding 2 new features (1)receiver window > 1 frame, so that out-of-order but error-free frames can be accepted (2)retransmission mechanism is modified –only individual frames are retransmitted Selective Repeat ARQ is used in TCP!!!

33 33 Selective Repeat ARQ (cont.)

34 34 Selective Repeat ARQ (cont.) Receiver: window advances whenever next in-order frame arrives out-of-order frames are accepted only if their sequence numbers satisfy R next < R frame < R next + W s -1 a negative ACK (NAK) with sequence number R next is sent whenever an out-of-sequence frame is observed

35 35 Selective Repeat ARQ (cont.) Sender: window advances whenever an ACK arrives if a timer expires, the corresponding frame is resent, and the timer is reset whenever a NAK arrives, R next frame is resent

36 36 Selective Repeat ARQ (cont.)

37 37 Window size – W S and W R m bits allotted within a header for sequence numbers => 2 m possible sequence numbers –how big should the windows be!? –W S and W R = 2 m -1 cannot be accepted due to possible ambiguity –W = 2 m /2 = 2 m-1 acceptable !!!

38 38 Window size – W S and W R (cont.)

39 39 HDLC General HDLC Frame Two types of control frames I (information) frames N(R) ack#,N(S)seq# S (supervisory) frames p/f = poll/final

40 40 HDLC control field SS=00 RR - Receiver Ready to accept more I-frames SS=01 REJ - Go-Back-N retransmission request for an I-frame SS=10 RNR - Receiver Not Ready to accept more I-frames SS=11 SREJ - Selective retransmission request for an I-frame

41 41 HDLC operation

42 42 HDLC operation (cont.)

43 43 HDLC operation (cont.)

44 44 HDLC operation (cont.)

45 45 HDLC operation (cont.)


Download ppt "1 Flow&Error Control R. Supakorn. 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send."

Similar presentations


Ads by Google