Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Selective Repeat ARQ

• GBN is inefficient because of retransmit the error frame and


subsequent frames.

• Efficient protocol can be obtained by adding two features


– Receive window made larger than one frame.
• Rnext+1, Rnext+2,………Rnext+ Wr- 1

– Retransmission mechanism is modified so that only individual frames


are retransmitted.------SR

1
Selective Repeat ARQ
• Go-Back-N ARQ inefficient because multiple frames are
resent when errors or losses occur.
• Selective Repeat retransmits only an individual frame
– Timeout causes individual corresponding frame to be resent.
– NAK causes retransmission of oldest un-acked frame.
• Receiver maintains a receive window of sequence numbers
that can be accepted
– Error-free, but out-of-sequence frames with sequence numbers
within the receive window are buffered
– Arrival of frame with Rnext causes window to slide forward by 1 or
more

2
Selective Repeat ARQ

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

B
A A N A A A A A A A A A
C C A C C C C C C C C C
K K K K K K K K K K K K
1 2 2 2 2 2 7 8 9 1 1 1
0 1 2

How large a window is required for continuous transmission


in the presence of errors?
3
Selective Repeat ARQ
Transmitter Receiver

Send Window Receive Window


...

Frames Frames
transmitted S received Rnext Rnext + Wr-1
last Srecent Slast+ Ws-1
and ACKed

Buffers Buffers
Timer Slast Rnext+ 1
Timer Slast+ 1 Rnext+ 2
...
Timer
Srecent ...
Rnext+ Wr- 1 max Seq #
... accepted
Slast+ Ws - 1
4
Send
Transmitter
& Receive Windows
Receiver

0 0
2m-1 1 2m-1 1

2 2
Rnext
Slast
receive j
send
window window
i i
i + Ws – 1 i+1
j + Wr – 1

Moves k forward when ACK Moves forward by 1 or more when frame


arrives with Rnext = Slast + k arrives with Seq. # = Rnext
k = 1, …, Ws-1
5
What size Ws and Wr allowed?
• Example: M=22=4, Ws=3, Wr=3
Frame 0 resent
Send
Window {0,1,2} {1,2} {2} {.}
fr0 fr1 fr2 fr0
A Time

B ACK1 ACK2 ACK3


Receive
Window {0,1,2} {1,2,3} {2,3,0} {3,0,1}

Problem occurs when sum of sizes of Old frame 0 accepted as a


receive window and send window is new frame because it falls
greater than M, causing receive window in the receive window
6
to wrap around.
Ws = Wr = 2m-1 is maximum allowed
• Example: M=22=4, Ws=2, Wr=2
Frame 0 resent
Send
Window {0,1} {1} {.}
fr0 fr1 fr0
A Time

B ACK1 ACK2
Receive
Window {0,1} {1,2} {2,3}

Old frame 0 rejected because it


falls outside the receive window

7
Why Ws + Wr <= 2m works
• Transmitter sends frames 0 to  Receiver window starts at {0, …, Wr}
Ws-1; send window empty
• Window slides forward to {Ws,…,Ws+Wr-
• All arrive at receiver 1}
• All ACKs lost
 Receiver rejects frame 0 because it is
 Transmitter resends frame 0 outside receive window
0 0
2m-1 1 2m-1 1

Ws +Wr-1
Slast 2 2

receive Rnext Ws
send window
window Ws-1

8
Applications of Selective Repeat ARQ

• TCP (Transmission Control Protocol):


transport layer protocol uses variation of
selective repeat to provide reliable stream
service
• Service Specific Connection Oriented Protocol:
error control for signaling messages in ATM
networks

9
Performance-Efficiency of Selective Repeat

• Most efficient of the ARQ protocols.


• Assume Pf frame loss probability, then the expected time
required to deliver a frame is:
• tf /(1-Pf)

n f  no
t f /(1  Pf ) no
 SR   (1  )(1  Pf )
R nf
Unlike SW and GBN, efficiency of SR does not depend
on delay-bandwidth product.

10
Problem
• Suppose frame nf=1250 bytes = 10000 bits,
na=no=25 bytes = 200 bits
• Compare S&W, GBN & SR efficiency for
random bit errors with p=10-6, 10-5, 10-4 and
R= 1 Mbps & 100 ms

11
Example: Impact Bit Error Rate on Selective
Repeat
nf=1250 bytes = 10000 bits, na=no=25 bytes = 200 bits
Compare S&W, GBN & SR efficiency for random bit errors with p=0, 10-6, 10-5, 10-4 and
R= 1 Mbps & 100 ms

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%


SR 98% 97% 89% 36%

 Selective Repeat outperforms GBN and S&W, especially at high error rates. The
efficiency decrease of SR at high error rates is inevitable for any ARQ protocol.

12
• Suppose that a Stop-and-Wait ARQ system has
a time-out value that is less than the time
required to receive an acknowledgment.
Sketch the sequence of frame exchanges that
transpire between two stations when station
A sends six frames to station B and no errors
occur during transmission.
• Sliding window protocol is used between the data link layers of machines A and B
with a window size of 7 frames at both sides. The figure below shows the a0 and
b0 states of the sliding windows of machines A and B, respectively, just before
Frame 0 is sent by A. The same figure also shows the sequence numbers of the
frames sent by A and acknowledgements sent by B.
– Indicate the frame numbers that should be contained in the sliding windows
and buffer memories at the sender and receiver for the states a1, b1, a2, b2,
a3, b3, a4, and b4.
• Draw the sender and receiver windows with
three bit sequences for a system using Selective
Repeat ARQ given the following frame exchanges.

a. Frame 0 is sent; frame 0 is acknowledged.


b. Frames 1, 2 and 3 are sent; NAK2 is received.
c. Frames 2, 4, 5, are sent; frames 2 through 5
are acknowledged.
d. Frames 6 and 7 are sent and acknowledged.
e. How many bits are alloted for N(S) and N(R).

You might also like