You are on page 1of 18

Go-Back-N ARQ

Go-Back-N ARQ
Go-Back-N
● Improve Stop-and-Wait by not waiting, i.e., Keep channel
busy by continuing to send frames.
● Allow a window of up to Ws outstanding (i.e., unACKed)
frames
● Use m-bit sequence numbering.
● If ACK for oldest frame arrives before window is
exhausted, we can continue transmitting.
● If window is exhausted, pull back and retransmit all
outstanding frames (i.e., “Go back N”)
● The receiver will only accept the frame with its next
expected sequence number, Rnext.
● In this version, the ACK N(R) contains the next expected
sequence number, Rnext, as before.
Go-Back-N ARQ
Go-Back-4: 4 frames are outstanding; so go back 4

fr fr fr fr fr fr fr fr fr fr fr fr fr fr Time
0 1 2 3 4 5 6 3 4 5 6 7 8 9
A

B
A A A out of sequence A A A A A A
C C C frames C C C C C C
K K K K K K K K K
1 2 3 4 5 6 7 8 9

Rnext 0 1 2 3 3 3 3 3 4 5 6 7 8 9

 Frame transmissions are pipelined to keep the channel busy


 A frame with errors and subsequent out-of-sequence frames are ignored
 Transmitter is forced to go back when window of 4 is exhausted
Go-Back-N with Timeout
● Problem with Go-Back-N as presented:
– If a frame is lost and the source does not have a
frame to send, then the window will not be
exhausted and recovery will not commence.
● Improvement: Use a timeout with each frame
– When timeout expires, re-send all outstanding
frames.
Go-Back-N Transmitter and Receiver
Transmitter Receiver

Send Window
... Receive Window

Frames
transmitted
and ACKed Slast Srecent Slast+ Ws - 1
Frames
Buffers received Rnext
oldest un-ACKed
Timer Slast frame
Timer Slast+ 1 Receiver will only accept
... a frame that is error-free and
that has sequence number Rnext
Timer
Srecent most recent
transmission
When such frame arrives Rnext is
...
incremented by one, so the
Slast+ Ws-1 max Seq # receive window slides forward by
allowed one
Sliding Window Operation
Transmitter

Send Window m-bit Sequence Numbering


...

Frames
transmitted
Slast
0
and ACKed Srecent Slast+ Ws-1 2 –1
m
1

2
Transmitter waits for error-free
ACK frame with sequence
number Slast Slast
send
When such ACK frame arrives, window
Slast is incremented by one, and i
the send window slides forward i + Ws – 1 i+1
by one

For a given value of m, how large can the window size, Ws, be?
Maximum Allowable Window Size is Ws = 2m-1
M = 22 = 4, Go-Back-4 and try Ws = 4 Transmitter goes back 4

fr fr fr fr fr fr fr
0 1 2
fr
1 3
Time
A 3 0 2

B A
C
A
C
A A
C C
K K K K Receiver has Rnext= 0, but it does not know
1 2 3 0 whether its ACK for frame 0 was received,
Rnext 0 1 2 3 0 so it does not know whether this is the old
frame 0 or a new frame 0
M = 4, Go-Back-3 and try Ws = 3:
Transmitter goes back 3
fr fr fr fr fr fr
0 1
Time
A 1 2 0 2

B A
C
A
C
A
C
K K K Receiver has Rnext= 3 , so it rejects
1 2 3
the old frame 0
Rnext 0 1 2 3
How to Set Timeout and Maximum
Window Size?
Go-Back-N ARQ
Go-Back-4: 4 frames are outstanding; so go back 4

fr fr fr fr fr fr fr fr fr fr fr fr fr fr Time
0 1 2 3 4 5 6 3 4 5 6 7 8 9
A

B
A A A out of sequence A A A A A A
C C C frames C C C C C C
K K K K K K K K K
1 2 3 4 5 6 7 8 9

Rnext 0 1 2 3 3 3 3 3 4 5 6 7 8 9

 Frame transmissions are pipelined to keep the channel busy


 A frame with errors and subsequent out-of-sequence frames are ignored
 Transmitter is forced to go back when window of 4 is exhausted
Required Timeout and Window Size for
100% Efficiency
Ttimeout

Tprop Tf Tproc Ta Tprop Tproc

● Timeout value should allow for a complete round-trip cycle to occur


before timeout occurs (same for Stop-And-Wait), i.e.,

T timeout 2 T prop 2 T proc T f T a


● Ws should be large enough to keep channel busy for Ttimeout., i.e.,

W s T f 2 T prop 2 T proc T f T a
Go-Back-N Efficiency
(No channel errors)
● Provided that Ws Tf > 2 Tprop + 2 Tproc + Tf + Ta , then the efficiency of
GBN is 100% (ignoring header overhead).
● If the above condition is not true then Ws transmissions will occur and
the window will close until the first ACK returns from the receiver.
When this happens the sender can send another Ws frames. The
efficiency in this case is Ws Tf /(2 Tprop + 2 Tproc + Tf + Ta ).
● The above two cases can be combined into

W sT f
 GBN =min { , 1}
2 T pro p2T proc T f T a
Go-Back-N Throughput (Pf = 0)
Required Window Size for
Delay-Bandwidth Product

Frame = 1250 bytes = 10,000 bits, R = 1 Mbps

2(tprop + tproc) 2 x Delay x BW Window

1 ms 1000 bits 1

10 ms 10,000 bits 2

100 ms 100,000 bits 11

1 second 1,000,000 bits 101


Efficiency of Go-Back-N with
Channel Errors
● GBN is 100% efficient if Ws large enough to keep channel busy, and
if channel is error-free.
● Assume a Pf frame loss probability, then the average time to deliver a
frame is
P f⋅Timeout
T f (See next slide)
1−P f
● Setting the timeout to Ws Tf , dividing the above result into Tf , and
accounting for packet header overhead gives the following

n0
1−
nf
 GBN  P f = 1−P f .
1W s −1 P f
Go-Back-N with Channel Errors
Timeout for frame 3
Timeout
Go-Back-4:
fr fr fr fr fr fr fr fr fr fr fr fr fr fr Time
0 1 2 3 4 5 6 3 4 5 6 7 8 9
A

B
A A A out of sequence A A A A A A
C C C frames C C C C C C
K K K K K K K K K
1 2 3 4 5 6 7 8 9

Rnext 0 1 2 3 3 3 3 3 4 5 6 7 8 9
Example: Impact of Bit Error Rate on GBN
nf = 1250 bytes = 10,000 bits, na= no= 25 bytes = 200 bits
Compare S&W with GBN efficiency for random bit errors with p = 0,
10-6, 10-5, 10-4 and R = 1 Mbps & 100 ms
1 Mbps x 100 ms = 100000 bits = 10 frames → Use Ws = 11

Efficiency 0 10-6 10-5 10-4

S&W 8.9% 8.8% 8.0% 3.3%

GBN 98% 88.2% 45.4% 4.9%

 Go-Back-N significant improvement over Stop-and-Wait for large


delay-bandwidth product
 Go-Back-N becomes inefficient as error rate increases
Can we improve GBN performance?

You might also like