+ All Categories
Home > Documents > Discussion #8 EE450, 10/13/2010

Discussion #8 EE450, 10/13/2010

Date post: 05-Feb-2016
Category:
Upload: ayala
View: 38 times
Download: 0 times
Share this document with a friend
Description:
Discussion #8 EE450, 10/13/2010. Sample Problems: -ARQ protocols (Sliding window). Draw a timeline diagram for the sliding window algorithm with SWS=RWS=4 frames for two given scenarios using the following assumptions: - PowerPoint PPT Presentation
41
Discussion #8 EE450, 10/13/2010 Sample Problems: -ARQ protocols (Sliding window)
Transcript
Page 1: Discussion #8 EE450, 10/13/2010

Discussion #8EE450, 10/13/2010

Sample Problems: -ARQ protocols (Sliding window)

Page 2: Discussion #8 EE450, 10/13/2010

2

Problem#1: Description

Draw a timeline diagram for the sliding window algorithm with SWS=RWS=4 frames for two given scenarios using the following assumptions:

1. The receiver sends a duplicate acknowledgement if it does not receive the expected frame. For example it sends dupack[2] when it expects to see frame[2] but receives frame[3] instead.

2. The receiver sends a cumulative acknowledgement after it receives all the outstanding frames. For example it sends ACK[5] when it receives the lost frame[2] after it already received frame[3], frame[4] and frame[5].

3. The timeout interval is about 2RTT.

Page 3: Discussion #8 EE450, 10/13/2010

3

Problem#1: Two Scenarios

a. Frame[2] is lost. Retransmission takes place upon timeout (as usual).

b. Frame[2] is lost. Retransmission takes place either upon receipt of the first dupack or upon timeout. Does this scheme reduce the transaction time?

Note that some end-to-end protocols (e.g. variants of TCP) use a similar scheme for fast retransmission.

Page 4: Discussion #8 EE450, 10/13/2010

4

Problem#1 Solution: Scenario (a)

Transmission time

Frame[2]

Ack[1]

time time

Sender Receiver

Frame[3]Frame[4]

Frame[5]

Frame[1]

Dupack[2]Dupack[2]Dupack[2]Timeout=2R

TTFrame[2]

Ack[5]

Frame[6]

Ack[6]

Ttrans + RTT

Ttrans + RTT

Page 5: Discussion #8 EE450, 10/13/2010

5

Frame[2]

Ack[1]

time time

Problem#1 Solution: Scenario (b)

Sender Receiver

Frame[3]Frame[4]

Frame[5]

Frame[1]

Dupack[2]Dupack[2]Dupack[2]

Frame[2]

Ack[5]

Frame[6]

Ack[6]

Ttrans + RTT

Ttrans + RTT

Transmission time

Page 6: Discussion #8 EE450, 10/13/2010

6

Comparing the two scenarios

(a) Delay1= 2Ttrans + 3RTT (b) Delay2= 4Ttrans + 2RTT

Frame[2]

Ack[1]

Frame[3]Frame[4]

Frame[5]

Frame[1]

Dupack[2]Dupack[2]Dupack[2]

Timeout=2RTT

Frame[2]

Ack[5]

Frame[6]

Ack[6]

Ttrans + RTT

Frame[2]

Ack[1]

Frame[3]Frame[4]

Frame[5]

Frame[1]

Dupack[2]Dupack[2]Dupack[2]

Frame[2]

Ack[5]

Frame[6]

Ack[6]

2Ttrans

2Ttrans + 2RTT

Transmission time

Transmission time

Ttrans

Page 7: Discussion #8 EE450, 10/13/2010

7

Comparing the transaction time (transfer delay) in the two scenarios

RTT=2Tprop

Delay1= 2Ttrans + 3RTT= 2Ttrans + 6Tprop

Delay2= 4Ttrans + 2RTT=4Ttrans + 4Tprop

?

2Ttrans + 6Tprop > 4Ttrans + 4Tprop

?

2Tprop > 2Ttrans

If Tprop > Ttrans , in Scenario (b) the transaction time is reduced!

Page 8: Discussion #8 EE450, 10/13/2010

8

Problem#2: Description

A is connected to B via an intermediate router R.

The A-R and R-B links each accept and transmit only one packet per second in each direction (so two packets take 2 seconds).

The two directions transmit independently. A sends to B using the sliding window

protocol with SWS=4.

Page 9: Discussion #8 EE450, 10/13/2010

9

Problem#2: Questions?

a) For Time=0, 1, 2, 3, 4, 5 state what packets arrive at and leave each node, or label them on a timeline.

A R B1 pkt/sec 1 pkt/sec

b)What happens if the links have a propagation delay of 1 seconds, but accept immediately as many packets as are offered (i.e. latency= 1 second but bandwidth is infinite).

A R B

Tprop=1 sec

BW=∞ BW=∞

Tprop=1 sec

Page 10: Discussion #8 EE450, 10/13/2010

10

Part (a) SolutionSWS=4 packets, RTT=4 sec

T=0 sec

A R B

Data[2]Data[1]

Data[0]

Data[3]

A R B

Data[3]Data[2]

Data[0]

0<T<1 sec

A R B

Data[3]Data[2]

Data[1]Data[0]

1<T<2 sec Data[1]

Page 11: Discussion #8 EE450, 10/13/2010

2<T<3 secA R B

Data[3]

A R BData[3]

3<T<4 sec A R BData[3]

4<T<5 sec

Data[1]Data[2]

Ack[0]

Data[2]

Data[0]

Ack[0]

Ack[0]

Data[2]

Data[1]

Ack[1]

Ack[1] Ack[2]

Part (a) Solution Ctd.Ignoring Ack Transmission Time

At T=2 sec Data[0] arrives at B

At T=3 sec Data[1] arrives at B

At T=4 sec Data[2] arrives at B

At T=5 sec Data[3] arrives at B, and Data[4] arrives at R

Data[4]

Page 12: Discussion #8 EE450, 10/13/2010

12

Part (b) SolutionSWS=4 packets, infinite BW, RTT=4 sec

T=0

A R B

Data[2]Data[1]

Data[0]

Data[3]

T=0+sec

A R B

T=1 sec

Data[1]Data[0]Data[2]Data[3]

A R B

Data[1]Data[0]Data[2]Data[3]

Page 13: Discussion #8 EE450, 10/13/2010

13

Part (b) Solution Ctd.Virtually No Transmission Time!

T=2 sec

T=2+ sec

T=1+ secA R B

Data[1]Data[0]Data[2]Data[3]

A R B

A R B

Ack[2]Ack[3]Ack[1]Ack[0]

Data[1]Data[2]

Data[3]

Data[0]

Page 14: Discussion #8 EE450, 10/13/2010

14

T=3 sec

T=3+ sec

A R B

Ack[2]Ack[3]Ack[1]Ack[0]

A R B

Ack[2]Ack[3]Ack[1]Ack[0]

T=4 sec A R B

Ack[2]Ack[3]Ack[1]Ack[0]

Part (b) Solution Ctd.

Data[6]Data[5]

Data[4]

Data[7]

Page 15: Discussion #8 EE450, 10/13/2010

15

Part (b) Solution Ctd.

T=4+sec

A R B

Data[5]Data[4]Data[6]Data[7]

T=5 sec

A R B

Data[5]Data[4]Data[6]Data[7]

A R B

Data[5]Data[4]Data[6]Data[7]

T=5+sec

Page 16: Discussion #8 EE450, 10/13/2010

16

Problem#3: Description

A is connected to B via an intermediate router R.

The A-R link is instantaneous but the R-B link transmit only one packet per second (so two packets take 2 seconds).

The two directions transmit independently.

A sends to B using the sliding window protocol with SWS=4.

Page 17: Discussion #8 EE450, 10/13/2010

17

Problem#3 : Questions?

a) For Time=0, 1, 2, 3, 4, 5 state what packets arrive at and are sent from each node.

b) How large does the queue at R grow?

A R B

Tprop=0 sec

BW=Infinity 1 pkt/sec

Buffer

Page 18: Discussion #8 EE450, 10/13/2010

18

Part (a) SolutionSWS=4 packets, RTT=2 sec

T=0 sec

A R B

Data[2]Data[1]

Data[0]

Data[3]

A R BData[0]

A R B

0<T<1 sec

Data[1]Data[0]T=0+sec

Data[3]Data[2]

Data[2]Data[1]

Data[3]

Page 19: Discussion #8 EE450, 10/13/2010

1<T<2 secA R B

A R B

Data[1]

Ack[0]

Data[0]

Ack[0]

Data[1]

Part (a) Solution Ctd.Ignoring Ack Transmission Time

Data[3]Data[2]

Data[3]

Ack[1]

T=2 secData[2]

At T=1 sec Data[0] arrives at B

Page 20: Discussion #8 EE450, 10/13/2010

A R B

A R B

Data[2]

Ack[1]

Data[3]

Data[1]

Ack[1]

Data[2]

Ack[2]

Part (a) Solution Ctd.

Data[4]

Ack[0]

3<T<4 sec

T=2+sec Data[3]Data[4]

At T=3 sec Data[2] arrives at B, and Ack[1] arrives at R

Page 21: Discussion #8 EE450, 10/13/2010

A R B

A R B

Data[3]

Ack[2]

Data[4]

Data[2]

Ack[2]

Data[3]

Ack[3]

Part (a) Solution Ctd.

Data[5]

Ack[1]

4<T<5 sec

T=3+sec Data[4]Data[5]

At T=4 sec Data[3] arrives at B, and Ack[2] arrives at R

Page 22: Discussion #8 EE450, 10/13/2010

22

A R BData[4]

Ack[3]

Data[3]

Part (a) Solution Ctd.

Ack[2]

T=4+sec Data[5]Data[6]

The steady-state queue size at R is two Data Frames.

Part (b) Solution

At T=5 sec Data[4] arrives at B, and Ack[3] arrives at R

Page 23: Discussion #8 EE450, 10/13/2010

23

Problem#4: Description

Consider the same topology and situation as in problem #2.

Assume that the router has a buffer size of 1, i.e. it can hold one packet (or frame) in to addition to the one it is sending (in each direction).

Assume that A has a timeout interval of 4 sec and SWS=4.

Page 24: Discussion #8 EE450, 10/13/2010

24

Problem#4 : Questions?

From Time=0, show what happens at each second until

all four packets successfully arrive at B.

A R B

Tprop=0 sec

BW=∞ 1 pkt/sec

Buffer size=1

Page 25: Discussion #8 EE450, 10/13/2010

25

SolutionSWS=4 packets, RTT=2 sec

T=0 sec

A R B

Data[2]Data[1]

Data[0]

Data[3]

A R B

Data[2]Data[1]

Data[3] Dropped

A R BData[0]

0<T<1 secData[1]

Data[0]

T=0+sec

Page 26: Discussion #8 EE450, 10/13/2010

T=2 sec

Solution Ctd.Ignoring Ack Transmission Time

A R B

Data[1]

Ack[1]Ack[0]

A R B

Ack[0]T=2+sec

Data[4]

Ack[1]

1<T<2 sec A R BData[1]

Data[0]

Ack[0]

Page 27: Discussion #8 EE450, 10/13/2010

Solution Ctd.Ignoring Ack Transmission Time

A R B

Ack[1]T=3+sec

Data[5]

A R B

Ack[1]

T=4A R B

Data[4]

Data[3]Data[2]

At T=4 Timeout for Data[2] and Data[3]. A starts retransmitting them.

B receives an out of order frame, it does not send an Ack.

Buffered at B.

Data[4]

T=3 sec

At T=4 sec Data[5] also arrives at B.

Data[5]Buffered at B.

Data[4]

Page 28: Discussion #8 EE450, 10/13/2010

28

Solution Ctd.Ignoring Ack Transmission Time

A R B4<T<5 sec

A R BData[3]

Data[2]

T=4+sec

At T=4+sec, R has started transmitting Data[2] while Data[3] is enqueued.

Data[2]Data[3]Data[5]Buffered at B.

Data[4]

Data[5]Buffered at B.

Data[4]

Page 29: Discussion #8 EE450, 10/13/2010

29

A R B

Solution Ctd.

T=5+sec

5<T<6 sec

Data[3] Data[2]

A R B

Data[2]Data[3]

Ack[2]

T=6 secA R B

Data[5]Buffered at B.

Data[4]

Data[5]Buffered at B.

Data[4]

Data[5]Buffered at B.

Data[4]

B receives Data[3] and can send a Cumulative Ack for Data[3],Data[4] and Data[5]

B received Data[2] which was in-order, so it sends an Ack[2].

Data[3]

Ack[2]

Page 30: Discussion #8 EE450, 10/13/2010

Solution Ctd.

A R B

T=6+sec A R B

Ack[2] Ack[5]

Data[6]

Cumulative

6<T<7 sec A R B

Ack[5]Cumulative

Data[6]

T=7+secAck[5]

Cumulative

Data[6]Data[9]Data[8] Data[7]

Ack[6]

Page 31: Discussion #8 EE450, 10/13/2010

31

Problem#5: Description

Suppose we run: A sliding Window Protocol (or

algorithm) With SWS=5, RWS=3 And no out of order arrivals

Page 32: Discussion #8 EE450, 10/13/2010

32

Problem#5 : Questions?

a) What is the smallest value for MaxSeqNum?

Hint: Assume that it suffices to find the smallest MaxSeqNum such that if Data[MaxSeqNum] is in the receive window, Data[0] can no longer arrive.

b) Give an example showing that MaxSeqNum-1 is not sufficient.

c) State a general rule for the minimum MaxSeqNum in terms of SWS and RWS.

Page 33: Discussion #8 EE450, 10/13/2010

33

Part (a) Solution

The smallest working value for MaxSeqNum is SWS+RWS= 5 +3 =8.

The earliest possible receive window is Data[6], Data[7], Data[8].

Data[5] was delivered and Acknowledged. Since SWS=5, all Data[0]s were sent

before Data[5] and by the “no out of order” hypothesis, Data[0] can no longer arrive.

Page 34: Discussion #8 EE450, 10/13/2010

34

Part (b) Solution MaxSeqNum-1=7 is not enough because:MaxSeqNum-1=7 is not enough because:

When the receiver is expecting Data[7], an old Data[0] can still arrive.

0 and 7 are indistinguishable in mod (MaxSeqNum-1) so receiver can not tell which one has arrived.

Consider this example:Consider this example: Sender sends Data[0] through Data[4] and they all

arrive so receiver sends Ack[4] but it’s slow. The receive window is now Data[5],Data[6] and

Data[7]. Sender times out and retransmits Data[0]. Receiver accepts it as Data[7].

Page 35: Discussion #8 EE450, 10/13/2010

35

Part (c) Solution

A general rule for minimum

MaxSeqNum in terms of SWS and

RWS:

MaxSeqNum >= SWS+ RWS

Page 36: Discussion #8 EE450, 10/13/2010

36

Problem#6: Description

Suppose we run: A sliding Window Protocol (or algorithm) With SWS=RWS=3 And no out of order arrivals And infinite-precision sequence

numbers

Page 37: Discussion #8 EE450, 10/13/2010

37

Problem#6 : Questions?

a) If Data[6] is in the receive window,

Data[0] (or in general any older data) can

no longer arrive (hence that MaxSeqNum

= 6 would have sufficed).

b) Show that if Ack[6] may be sent ( or more

literally, that DATA[5] is in the sending

window) then ACK[2] (or earlier) cannot

be received.

Page 38: Discussion #8 EE450, 10/13/2010

38

Reminder: Let ACK[N] denote the acknowledgment of all data packets less than N.

Note that data below the sending window (that is, <LAR) is never sent again.

Hence – because out-of-order arrival is disallowed – if DATA[N] arrives at the receiver then nothing at or before DATA[N-3] can arrive later.

Similarly for ACKs, if ACK[N] arrives then (because ACKs are cumulative) no ACK before ACK[N] can arrive later.

Problem #6: Hints

Page 39: Discussion #8 EE450, 10/13/2010

39

Part (a) Solution

If DATA[6] is in the receive window,

then the earliest that window can be

is DATA[4]-DATA[6].

This implies ACK[4] was sent, thus

DATA[1]-DATA[3] were received, and

thus DATA[0] can no longer arrive.

Page 40: Discussion #8 EE450, 10/13/2010

40

Part (b) Solution

If ACK[6] may be sent, then the lowest

the sending window can be is

DATA[3]...DATA[5].

This means that ACK[3] must have

been received.

Once an ACK is received, no smaller

ACK can ever be received later.

Page 41: Discussion #8 EE450, 10/13/2010

41

Problem#7

Design a sliding window ARQ protocol for:A 1Mbps point-to-point link to the moonWith a one-way latency of 1.25secAnd a frame size of 1KB

Minimum number of bits needed for the sequence number?

Solution:

RTT=2 × 1.25sec=2.5 sec BW=1Mbps=125 KBps

Window size=BW × RTT=125KB/sec × 2.5 sec=312 KB or 312 frames

Sequence number space= 2 × window size= 2 × 312=624

bits required for sequence number space= log2 624=9.285

~10 bits


Recommended