Está en la página 1de 38

1

Automatic Repeat Request


2

The Problem
-
data in data out
→ →
Tx - Rx
-

Transmission of data requires series of PDUs to be sent


PDU may be lost

PDU may be corrupted


3

Automatic Repeat Request


I
-
N
 ACK
N
data in data out
→ I
- →
N+1
Tx Rx
 NAK
N+1

I
-
N+1
 ACK
N+1

automatic repeat request (ARQ)


Data link layer (transport layer, application layer, . . . )
Number PDUs, and add error checking
Data in I-frames, Acknowledgement in ACK-frames
4

Two Approaches to ARQ

idle RQ
Tx waits after each I(N) until it receives ACK(N) or NAK(N) or times out
also called stop-and-wait or synchronous

continuous RQ
Tx sends continuous stream of I-frames
can send I(N+1) before receiving ACK(N)
also called asynchronous
5

Idle RQ: Tx and Rx Actions


T=N =N+1

I
Tx N

⇒ time

Rx

R=N
6

Idle RQ: Tx and Rx Actions


T=N =N+1

I
Tx N

⇒ time

N
I
Rx N

R=N =N+1
7

Idle RQ: Tx and Rx Actions


T=N =N+1

I
Tx N

⇒ time

N
I ACK
Rx N N

R=N =N+1
8

Idle RQ: Tx and Rx Actions


T=N =N+1

I ACK
Tx N N

⇒ time

N
I ACK
Rx N N

R=N =N+1
9

Idle RQ: Tx and Rx Actions


T=N =N+1 =N+2

I ACK I
Tx N N N+1

⇒ time

N
I ACK
Rx N N

R=N =N+1
10

Idle RQ: Tx and Rx Actions


T=N =N+1 =N+2 =N+3

I ACK I ACK I
Tx N N N+1 N+1 N+2
 
⇒ time

N N N
I ACK I ACK I ACK
Rx N N N+1 N+1 N+2 N+2

R=N =N+1 =N+2 =N+3


11

Worksheet: Automatic Repeat Request


t
?
Tx

Rx
12

Idle RQ: Stop-and-wait efficiency

 TR -
I ACK I ACK I
Tx N N N+1 N+1 N+2
 
⇒ time

N N N
I ACK I ACK I ACK
Rx N N N+1 N+1 N+2 N+2
- --
--
TP TI TD TA TP

TR = TI + 2TP + TD + TA

TI
ρs =
TI + 2TP + TD + TA
13

Idle RQ: Improving performance

TI
ρs =
TI + 2TP + TD + TA
Increase ρs ?

reduce TP by decreasing the distance between Tx and Rx


usually not possible

increase TI by decreasing the bit rate


would not want to do this
tells us Idle RQ more efficient on slower channels

increase TI by increasing the number of bits per I-frame


larger I-frames more likely to suffer errors
14

Idle RQ: Example Protocol Efficiency Calculation

Compute the maximum data throughput of Idle RQ


10Mbs−1 communications system
I-frame size is 92 bits and the ACK-frame size is 8 bits
via a satellite in orbit at 37,500km above the Earth’s surface
propagation speed 300 × 106 ms−1
92
TI = 10×106 = 9.2 × 10−6 s
8
TA = 10×106 = 0.8 × 10−6 s
assume TD = 0
2×37.5×106
TP = 300×106 = 0.25s
9.2×10−6
ρs = 9.2×10−5 +2×0.25+0.8×10−6 = 18.4 × 10−6
throughput = ρs B = 18.4 × 10−6 × 10M bs−1 = 184bs−1
15

Overall Efficiency of Idle RQ

Three factors cause the raw bit-rate of a channel to be wasted (i=no I-frame bits,
c=control bits in I-frame, a=no ACK-frame bits)

Wastage due to stop-and-wait protocol


TI
ρs =
TI + 2TP + TA + TD

Wastage due to errors forcing retransmission


1
ρe = (1 − BER)i+a ρe ≈
1+p

Wastage due to control information

i−c
ρc =
i+a
Overall efficiency ρi = ρs ρe ρc
16

Worksheet: Overall Efficiency of Idle RQ

I-frames of 10000 bits; hosts separated by 500km over a 1Mbs−1 link. The
I-frames consist of 1000 bits of header and 9000 bits of data. The signal
propagation speed is 200 × 106 ms−1 , and the BER is 10−5

1. Calculate the probability that an I-frame is lost due to an error.


2. What is the error efficiency of the system ρe ?

3. What is the stop-and-wait efficiency of the system ρs ?


4. What is the control information efficiency of the system ρc ?

5. What is the overall efficiency of the Idle RQ protocol?


17

Idle RQ Error Handling: Loss of I-frame


T=N =N+1 =N+2
 TO -
I ACK I I
Tx N N N+1 N+1

⇒ time

N N
I ACK I ACK
Rx N N N+1 N+1

R=N =N+1 =N+2

Timeout TO must be set at Tx


TO > TR
18

Idle RQ Error Handling: Corrupt I-frame

T=N =N+1 =N+2

I ACK I NAK I
Tx N N N+1 N+1 N+1
 
⇒ time

N NI N
I ACK NAK I ACK
Rx N N N+1 (error) N+1 N+1 N+1

R=N =N+1 =N+2

NAK-frame speeds up retransmission of I-frame


Do not have to use NAK-frames
19

Idle RQ Error Handling: Loss of ACK-frame


T=N =N+1 =N+2
 TO -
I ACK I I
Tx N N N+1 N+1

⇒ time

N N N
I ACK I ACK I ACK
Rx N N N+1 N+1 N+1 N+1

R=N =N+1 =N+2

Rx receives I(N+1) twice


Really do have to number I-frames!
20

Continuous RQ

I I I I I
Retransmission N+1 N+2 N+3 N+4 N+5
I I I I I I
List
N N N+1 N+2 N+3 N+4
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+5 N+6
    
ACK ACK ACK ACK ACK
⇒ time N N+1 N+2 N+3 N+4

^I ^I ^I ^I ^I ^I
Rx N N+1 N+2 N+3 N+4 N+5
R=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6
21

Go-Back-N: Loss of I-frame

I I
N+4 N+4
I I I I I
Retransmission N+1 N+2 N+3 N+3 N+3
I I I I I I
List
N N N+1 N+2 N+2 N+2
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+2 N+3
  
ACK ACK NAK
⇒ time N N+1 N+2

^I ^I ^I ^I ^I
Rx N N+1 N+3 (ignore) N+4 (ignore) N+2
R=N =N+1 =N+2 =N+2 =N+2 =N+2 =N+3
22

Go-Back-N: Loss of NAK-frame


I
N+5
I I
N+4 N+4
I I I I I
Retransmission N+1 N+2 N+3 N+3 N+3
I I I I I I
List
N N N+1 N+2 N+2 N+2
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+5 N+2
  
ACK ACK NAK
⇒ time N N+1 N+2

^I ^I ^I ^I ^I
Rx N N+1 N+3 (ignore) N+4 (ignore) N+5 (ignore)

R=N =N+1 =N+2 =N+2 =N+2 =N+2 =N+2


23

Idle RQ: Rough Formula for Efficiency

r = ⌈ TTRI ⌉= number for frames sent in TR


p= probability frame suffers error
error efficiency:

1
ρe ≈
1+p
protocol efficiency:

1
ρs =
r
combined efficiency:

1
ρ=
r + rp
24

Go-back-N: Efficiency

ρs = 1
send r = ⌈ TTRI ⌉ I-frames for each erroneous I-frame

1
ρe ≈
1 + pr

ρc same as idle RQ
25

Example: Continuous RQ Go-Back-N protocols

If Continuous RQ Go-Back-N is being used, calculate the efficiency and through-


put of a 10Mbs−1 satellite communication system with BER of 10−6 , a satellite
height of 37,500km, propogation speed 300 × 106 ms−1 , I-frames 100 bits.
p = 1 − 0.9999 = 10−4
100
TI = 10×106 = 10−5 s
2×37.5×106
TP = 300×106 = 0.25s
assume TD = 0, TA = 0
TR = 10−5 + 2 × 0.25 = 0.5s
0.5
r= 10−5 = 50 × 103
1 1
ρg = 1+10−4 ×50×103 = 6 = 0.17
throughput = 1.7 Mbs−1
26

Worksheet: Efficiency of Continuous RQ Go-Back-N

Go-Back-N system uses I-frames of 10000 bits; hosts separated by 500km over a
10Mbs−1 link. Signal propagation speed is 200 × 106 ms−1 .

1. If no errors occur, what is the throughput we can expect on the link?


2. If the BER is 10−5 , what is the probability of any one frame being lost?

3. What is the throughput with this BER?

4. What would have been the throughput if Idle RQ had been used?
27

Go-Back-N: Efficiency

1
r=1
r = 10
0.8 r = 100
r = 1000

0.6
ρe
0.4

0.2

0
0 0.02 0.04 0.06 0.08 0.1
p
28

Selective Repeat: Explicit Request


I
N+4
I I I I I
Retransmission N+1 N+2 N+3 N+3 N+4
I I I I I I
List
N N N+1 N+2 N+2 N+2
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+2 N+5
    
ACK ACK NAK ACK ACK
⇒ time N N+1 N+2 N+3 N+4

^I ^I ^I ^I ^I
Rx N N+1 N+3 N+4 N+2
R=N =N+1 =N+2 =N+2 =N+2 =N+2 =N+5
I I
Receiver N+3 N+4
Buffer I
N+3
29

Selective Repeat: Implicit Retransmission


I I
N+4 N+5
I I I I I
Retransmission N+1 N+2 N+3 N+3 N+4
I I I I I I
List
N N N+1 N+2 N+2 N+2
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+5 N+2
   
ACK ACK ACK ACK
⇒ time N N+1 N+3 N+4

^I ^I ^I ^I ^I
Rx N N+1 N+3 N+4 N+5
R=N =N+1 =N+2 =N+2 =N+2 =N+2 =N+2
I I
Receiver N+3 N+4
Buffer I
N+3
30

Selective Repeat: efficiency

protocol efficieny ρs = 1
error efficiency as idle request

1
ρe ≈
1+p
ρc same as idle RQ
31

Example: Continuous RQ Selective-Repeat protocols

If Continuous RQ selective repeat is being used, calculate the efficiency and


throughput of a 10Mbs−1 satellite communication system with BER of 10−6 , a
satellite height of 37,500km, propogation speed 300 × 106 ms−1 , I-frames 100
bits.
p = 1 − (1 − 10−6 )100 = 10−4
1
ρs = 1+10−4 = 0.9999
throughput = 10.0 Mbs−1
32

Comparison of ARQ Protocols

protocol error combined


ρs ρe ρs ρe
1 1 1
Idle RQ r 1+p r+rp
1 1
Go-Back-N 1 1+rp 1+rp
Selective
1 1
Repeat 1 1+p 1+p

For all, control efficiency

i−c
ρc =
i+a
33

Overall Efficiency for Go-Back-N

1
r=1
r = 10
0.8

0.6
ρe ρc
0.4

0.2

0
0 100 200 300 400 500
number of data bits per frame
r = 1 graph corresponds to that for Selective Repeat
34

Duplex Operation
I I ACK I ACK
Tx N N+1 M N+2 M+1
I I ACK I ACK
Rx M M+1 N M+2 N+1
  
⇒ time

I
^ I ACK
^ I
^
ACK
Tx M M+1 N M+2 N+1
I I ACK I ACK
Rx N N+1 M N+2 M+1

Can send ACK-frames for I-frame by piggybacking it to I-frame in opposite


direction
35

Idle RQ: Window Size


T=N =N+1 =N+2 =N+3

I ACK I ACK I
Tx N N N+1 N+1 N+2
 
⇒ time

N N N
I ACK I ACK I ACK
Rx N N N+1 N+1 N+2 N+2

R=N =N+1 =N+2 =N+3

Tx and Rx only need buffer one I-frame


36

Continuous RQ Go-Back-N: Window Size

I I I I I
Retransmission N+1 N+2 N+3 N+4 N+5
I I I I I I
List
N N N+1 N+2 N+3 N+4
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+5 N+6
    
ACK ACK ACK ACK ACK
⇒ time N N+1 N+2 N+3 N+4

^I ^I ^I ^I ^I ^I
Rx N N+1 N+2 N+3 N+4 N+5
R=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+6

Tx must buffer r I-frames


37

Continuous RQ Selective Repeat: Window Size


I
N+4
I I I I I
Retransmission N+1 N+2 N+3 N+3 N+4
I I I I I I
List
N N N+1 N+2 N+2 N+2
T=N =N+1 =N+2 =N+3 =N+4 =N+5 =N+5
I I I I I I I
Tx N N+1 N+2 N+3 N+4 N+2 N+5
    
ACK ACK NAK ACK ACK
⇒ time N N+1 N+2 N+3 N+4

^I ^I ^I ^I ^I
Rx N N+1 N+3 N+4 N+2
R=N =N+1 =N+2 =N+2 =N+2 =N+2 =N+5
I I
Receiver N+3 N+4
Buffer I
N+3

Tx and Rx must buffer r I-frames


38

Sliding Windows

Error Send Receive S: Maximum sequence


protocol window size window size number (counting from 1)
Idle RQ 1 1 2
Go-back-N r 1 r+1
Selective repeat r r 2r
N does not need to be an infinite range
Use modulo S

También podría gustarte