Selective Repeat Protocol | Practice Problems

Spread the love

Selective Repeat Protocol-

 

Before you go through this article, make sure that you have gone through the previous article on Selective Repeat Protocol.

 

We have discussed-

  • Sliding Window Protocols allow the sender to send multiple frames before needing acknowledgements.
  • Selective Repeat is an implementation of a sliding window protocol.

 

In this article, we will discuss practice problems based on selective repeat protocol.

 

 

PRACTICE PROBLEMS BASED ON SELECTIVE REPEAT PROTOCOL-

 

Problem-01:

 

The maximum window size for data transmission using the selective repeat protocol with n bit frame sequence numbers is-

  1. 2n
  2. 2n-1
  3. 2n-1
  4. 2n-2

 

Solution-

 

We know-

  • With n bits, total number of sequence numbers possible = 2n.
  • In SR Protocol, sender window size = receiver window size = W (say)

 

For any sliding window protocol to work without any problems,

 

Min Available Sequence Numbers

= Sender window size + Receiver window size

 

So, we have-

2n = W + W

2n = 2W

W = 2n-1

Therefore, maximum window size possible of sender and receiver = 2n-1

Thus, Option (B) is correct.

 

Problem-02:

 

In SR protocol, suppose frames through 0 to 4 have been transmitted. Now, imagine that 0 times out, 5 (a new frame) is transmitted, 1 times out, 2 times out and 6 (another new frame) is transmitted.

At this point, what will be the outstanding packets in sender’s window?

 

  1. 341526
  2. 3405126
  3. 0123456
  4. 654321

 

Solution-

 

In SR Protocol, only the required frame is retransmitted and not the entire window.

 

Step-01:

 

Frames through 0 to 4 have been transmitted-

4 , 3 , 2 , 1 , 0

 

Step-02:

 

0 times out. So, sender retransmits it-

0 , 4 , 3 , 2 , 1

 

Step-03:

 

5 (a new frame) is transmitted-

5 , 0 , 4 , 3 , 2 , 1

 

Step-04:

 

1 times out. So, sender retransmits it-

1 , 5 , 0 , 4 , 3 , 2

 

Step-05:

 

2 times out. So, sender retransmits it-

2 , 1 , 5 , 0 , 4 , 3

 

Step-06:

 

6 (another new frame) is transmitted-

6 , 2 , 1 , 5 , 0 , 4 , 3

 

Thus, Option (B) is correct.

 

Problem-03:

 

The selective repeat protocol is similar to Go back N except in the following way-

 

  1. Frame Formats are similar in both the protocols
  2. The sender has a window defining maximum number of outstanding frames in both the protocols
  3. Both uses piggybacked acknowledgements where possible and does not acknowledge every frame explicitly.
  4. Both uses piggyback approach that acknowledges the most recently received frame

 

Solution-

 

Also Read- Go back N Protocol

 

Option (A)-

 

  • Both the protocols use the same frame formats because both are sliding window protocols.
  • The variation occurs only in the coding and implementation.

 

Option (B)-

 

  • In both the protocols, sender has a window which defines the maximum number of outstanding frames.

 

Option (C)-

 

  • Both the protocols use piggybacked acknowledgements wherever possible.
  • Sending acknowledgements along with the data are called as piggybacked acknowledgements.
  • But Go back N protocol uses cumulative acknowledgements and does not acknowledge every frame explicitly.
  • On the other hand, Selective repeat protocol acknowledges each frame independently.

 

Option (D)-

 

  • Both the protocols use piggyback approach.
  • Go back N acknowledges the most recently received frame by sending a cumulative acknowledgement which includes the acknowledgement for previous packets too if any.
  • On the other hand, Selective Repeat protocol acknowledges all the frames independently and not only the recently received frame.

 

Thus, Options (C) and (D) are correct.

 

Problem-04:

 

Consider a 128 x 103 bits/sec satellited communication link  with one way propagation delay of 150 msec. Selective Retransmission (repeat) protocol is used on this link to send data with a frame size of 1 KB. Neglect the transmission time of acknowledgement. The minimum number of bits required for the sequence number field to achieve 100% utilization is ________ .

 

Solution-

 

Given-

  • Bandwidth = 128 x 103 bits/sec
  • Propagation delay (Tp) = 150 msec
  • Frame size = 1 KB

 

Now,

  • To achieve 100% utilization, efficiency must be 100%.
  • Efficiency is 100% when sender window size is optimal i.e. 1+2a

 

Calculating Transmission Delay-

 

Transmission delay (Tt)

= Frame size / Bandwidth

= 1 KB / (128 x 103 bits per sec)

= (1 x 210 x 8 bits) / (128 x 103 bits per sec)

= 64 msec

 

Calculating Value of ‘a’-

 

a = Tp / Tt

a = 150 msec / 64 msec

a = 2.34

 

Calculating Optimal Sender Window Size-

 

Optimal sender window size

= 1 + 2a

= 1 + 2 x 2.34

= ⌈5.68⌉

= 6

 

Calculating Number Of Sequence Numbers Required-

 

In SR Protocol, sender window size and receiver window size are same.

So, sender window size = receiver window size = 6

 

Now,

For any sliding window protocol, minimum number of sequence numbers required

= Sender window size + Receiver window size

= 6 + 6

= 12

 

Calculating Bits Required in Sequence Number Field-

 

To have 12 sequence numbers,

Minimum number of bits required in sequence number field

= ⌈log2(12)⌉

= 4

 

Thus,

  • Minimum number of bits required in sequence number field = 4
  • With 4 bits, number of sequence numbers possible = 16
  • We use only 12 sequence numbers and rest 4 remains unused.

 

Next Article- Comparison Table Of Sliding Window Protocols

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Summary
Selective Repeat Protocol | Practice Problems
Article Name
Selective Repeat Protocol | Practice Problems
Description
Practice Problems based on Selective Repeat ARQ. Selective Repeat Protocol in computer networks is a Sliding Window Protocol. SR Protocol or Selective Repeat ARQ is an implementation of sliding window protocol like Go back N Protocol.
Author
Publisher Name
Gate Vidyalay
Publisher Logo

Spread the love