Вы находитесь на странице: 1из 14

1

Go-Back-N
Improve Stop-and-Wait by not waiting!
Keep channel busy by continuing to send frames
Allow a window of up to W
s
outstanding 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
Alternative: Use timeout
How should window size be chosen?

2
Frame transmission are pipelined to keep the channel busy
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 ARQ
A
B
fr
0
Time fr
1
fr
2
fr
3
fr
4
fr
5
fr
6
fr
3
A
C
K
1
out of sequence
frames
Go-Back-4:
4 frames are outstanding; so go back 4
fr
5
fr
6
fr
4
fr
7
fr
8
fr
9
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
A
C
K
7
A
C
K
8
A
C
K
9
R
next
0 1 2 3 3 4 5 6 7 8 9

3
A
B
fr
0
Time
fr
1
fr
2
fr
3
fr
0
Receiver is
looking for
R
next
=0
Out-of-
sequence
frames
Four frames are outstanding; so go back 4
fr
2
fr
3
fr
1
fr
4
fr
5
fr
6
Go-Back-N ARQ
A
C
K
1
A
C
K
2
A
C
K
3
A
C
K
4
A
C
K
5
A
C
K
6
Window size long enough to cover round trip time
A
B
Time fr
0
fr
0
Time-out expires
fr
1
A
C
K
1
Stop-and-Wait ARQ
Receiver is
looking for
R
next
=0
GBN is no more efficient than SW
in handling errors, but it is much
more efficient when frames are
error-free.
4
Go-Back-N with Timeout
Problem with Go-Back-N as presented:
If frame is lost and source does not have frame to
send, then window will not be exhausted and
recovery will not commence
Use a timeout with each frame
When timeout expires, resend all outstanding
frames
5
Receiver
Receive Window
R
next
Frames
received
Receiver will only accept
a frame that is error-free and
that has sequence number R
next


When such frame arrives R
next
is
incremented by one, so the receive
window slides forward by one

Timer S
last
S
last
+1
S
recent
S
last
+W
s
-1
Timer
Timer
Transmitter
...
Buffers
S
last
S
last
+W
s
-1
...
Send Window
S
recent
Frames
transmitted
and ACKed
...
most recent
transmission
oldest un-ACKed
frame
max Seq #
allowed
Go-Back-N Transmitter & Receiver
6
Sliding Window Operation
Transmitter waits for error-free ACK
frame with sequence number S
last


When such ACK frame arrives, S
last

is incremented by one, and the
send window slides forward by one

m-bit Sequence Numbering
0
1
2
i
i + W
s
1
2
m
1
S
last

send
window
i + 1
Transmitter
S
last
S
last
+W
s
-1
...
S
recent
Frames
transmitted
and ACKed
Send Window
7
A
B
fr
0
Time
fr
1
fr
2
fr
3
fr
0
fr
1
fr
2
fr
3
A
C
K
1
M = 2
2
= 4, Go-Back - 4:
A
C
K
0
A
C
K
2
A
C
K
3
Transmitter goes back 4
Receiver has R
next
= 0, but it does not know
whether its ACK for frame 0 was received,
so it does not know whether this is the old
frame 0 or a new frame 0
Maximum Allowable Window Size is W
s
= 2
m
-1
R
next
0 1 2 3 0

A
B
fr
0
Time
fr
1
fr
2
fr
0
fr
1
fr
2
A
C
K
1
M = 2
2
= 4, Go-Back-3:
A
C
K
2
A
C
K
3
Transmitter goes back 3
Receiver has R
next
= 3 , so it rejects
the old frame 0
R
next
0 1 2 3

Bi-directional Link

Information flow is bidirectional Tx and Rx functions of the
modified Go-Back N protocol.

Many of the control frames can be eliminated by
Piggybacking-
ack in the headers of information frames.
can result in significant improvements in the use of bandwidth.

8
9
R
A

next
A Receive Window
R
B

next
B Receive Window
S
A

last S
A

last
+W
A

s
-1
...
A Send Window
S
B

last S
B

last
+W
B

s
-1
...
B Send Window
Transmitter
Receiver
Transmitter
Receiver
S
A
recent
R
A

next
S
B
recent
R
B

next
S
A

last
S
A

last
+1
S
A
recent
S
A

last
+W
A

s
-1
Timer
...
Buffers
...
S
B

last
S
B
last
+1
S
B
recent
S
B

last
+W
B

s
-1
...
Buffers
...
Timer
Timer
Timer
Timer
Timer
Timer
Timer
ACK Piggybacking in Bidirectional GBN
Note: Out-of-sequence
error-free frames
discarded after R
next

examined
10
Applications of Go-Back-N ARQ
HDLC (High-Level Data Link Control): bit-
oriented data link control
V.42 modem: error control over telephone
modem links
Microcom Network Protocol
11
T
f
T
f
T
proc
T
prop
T
prop
T
out
Required Timeout & Window Size
W
s
should be large enough to keep channel busy for T
out
.


Timeout value should allow for:
Two propagation times + 1 processing time: 2 T
prop
+ T
proc

A frame that begins transmission right before our frame arrives T
f

Next frame carries the ACK, T
f
Tout = 2 T
prop
+ 2T
f
+T
proc.


12
Performance issues-Efficiency of Go-
Back-N
GBN is completely efficient, if W
s
large enough to keep
channel busy, and if channel is error-free
Assume P
f
frame loss probability, then time to deliver a
frame is:


) 1 (
) 1 ( 1
1
and
1
f
f s
f
o
GBN
o f
GBN
f
f s
f f GBN
P
P W
n
n
R
t
n n
P
t W
P t t

Delay-bandwidth product determines W


s

P
f
/ (1-P
f
) is the expected
number of failures before the
frame is successfully transmitted
(from Geometric Distribution).
13
Frame = 1250 bytes =10,000 bits, R = 1 Mbps
Reaction time DBW Window
10 ms 10,000 bits 2
100 ms 100,000 bits 11
1 second 1,000,000 bits 101
Required Window Size for
Delay-Bandwidth Product
Window size Ws must be larger than the DBW product
14
Example: Impact of Bit Error Rate on
GBN
n
f
=1250 bytes = 10000 bits, n
a
=n
o
=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 W
s
= 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

Вам также может понравиться