The Gateway to Computer Science Excellence
0 votes

A system uses Selective-Repeat protocol with a window size of 4.If each packet carries 5000 bits of data, then the time taken to transfer 5 million bits of data, if the distance between sender and receiver is 2500 Km, the propagation speed is 2*108m/s and data rate is 1Mbps. We assume no data or ACK is lost or damaged.

(Computer Networks - 2 marks)

A.   7.25s

B.   8.25s

C.   11.25s

D.   16.25s

I think answer should be around 7.5 to 7.8.. Can any one explain what the answer is ??

in Computer Networks by (101 points) | 255 views
I am getting 12.5 :(
May I know the procedure u have followed
Tt = 5ms

Tp = 12.5 ms

and there are 1000 packets each of size 5000 bits.

then i used pipeline approach.

(5+12.5) + 999 *12.5 = 12505 ms = 12.5 second.

I am confused about how we will use window size.
I think it's not correct approach.. what I'm thinking is for each window it takes Tt+2Tp time. Therefore total time would be 250*( Tt+2Tp)... I need clarification...
finally got it,

window size =4 means we can send 4 packets and then we should wait for ACK.

first we will load 4 packets in window = 4*Tt = 4 * 5 = 20 ms

then we send them to receiver = Tp = 12.5 ms

then receiver sends ACK = Tp = 12.5 ms

so for 4 packets time is = 4Tt + Tp + Tp = 20 + 12.5 + 12.5 = 45 ms

we have to send 1000 packets so time it would take = 250 * 45 ms = 11250 ms = 11.25 seconds
If sender waits for all acknowledgements then efficiency must be Ws/(Ws +2 *a) , but it is not in SR protocol  as efficiency = Ws/(1+2 * a) .. that means senders starts sending new window after receiving 1st acknowledgement... It is my actual doubt... let me know if I'm wrong...
so it takes 12.5 seconds in case of GBN?
I think it is 250*30(5+25) = 7.5 ms ... but answer given as 11.5 which I'm suspecting as some error...

12.5 second will be in case of stop and wait protocol.

@Prasad Budithi

how it can be ( Tt + 2Tp) or (1+2a) ?

because in this we are using cumulative ACK. 2Tp indicates that we are getting ACK for each packet.

If sender waits for all acknowledgements then efficiency must be Ws/(Ws +2 *a)

this case is applying on it because we are modifying Selective repeat by applying the condition

we can send 4 packets and then we should wait for ACK.

we are applying this because it is said that there is no NACK or damaged frame.

Can anyone explain how efficiency is Ws/(1+2*a) in SR protocol so that i can check my intuition about sliding window protocol... what I'm thinking is except for last window all other windows take Tt  + 2 *Tp . Last one takes Ws * Tt + 2* Tp..  it is possible only if independent acks are used and upon recieving 1st ack new window's packet will be transmitted...

according to me Tt + Tp will be used for each packet and an extra Tp will be used after every 4th packet for sending cumulative ACK back to sender.

Then what is the use of pipeline concept..  it always try to keep sender busy... after transmitting a packet instead of sitting idle for Tp time , sender should transmit to use that time to improve efficiency... that's why we use window(Ws) size.....

1 Answer

0 votes
Best answer

d = 25x10^5
v = 2x10^8



Window size=4
packet size=5000 bits.

Tt=5000/10^6 = 5ms

Therefore, we send 20,000 bits in 25+5ms =30ms.

efficiency = 4/(1+2a)

efficiency=4/(1+25/5) = 4/6=2/3

throughput = BW*efficiency
=10^6 *2/3 = 2/3Mbps

in 1 sec = (2/3)x10^6 bits
1 bit = 3/(2x10^6)
5 million bits = (3*5*10^6)/(2*10^6)=7.5 sec

by Active (4.8k points)
selected by
I did in similar way but explanation has given as follows....
Number of packets to be transferred :
5*10^6/5000 = 1000

In the worst case, we send a full window of size 4 and then wait for the acknowledgment of the whole window. We need to send 1000/4 = 250 windows

Transmission time for one window = (4*5000 bits) / 1,000,000 bits/sec = 20ms

Data trip time = 2500 km / 200,000 km = 12.5 ms

ACK transmission time = 0 (It is usually negligible)

ACK trip time = 2500 km / 200,000 km = 12.5 ms

Time taken to transfer 1 window = 20 + 12.5 + 12.5 = 45 ms.

Time taken to transfer 250 windows = 250 × 45 ms = 11.25s

Can anyone explain how it is true or false
ignore the given explanation. we transmit a packet first not the whole window.
we can do it this way also

Lets RTT is total time elapsed between frame sent and ack recieved that wil be Tt + 2Tp here

in RTT as SR protocol mentined we send Ws * L data in RTT where L is size of frame

Now we want to send 5 milion bits ,

So RTT ====> 4 * 5000 b

(x)?  =====> 5 * 1000000 b

RTT = Tt + 2Tp = 5+ 25 = 30 milisec

hence x = 5 * 1000000 * 30 milisec / 4* 5000 = 7.5 sec

I found a similar question in


"Data Communications and Networking By Behrouz A.Forouzan 4th Edition Chapter 11 Data Link Control, Exercise Question 30, 31, 32"


And below is the solution given in the Solution Manual.


In all the cases, they have calculated the worst case time (waiting for the acknowledgment of the whole window).

So if found using the best case, then the answer will be different.

So which approach to use is a confusion.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,645 questions
56,588 answers
101,844 users