1,192 views
5 votes
5 votes
Suppose you want to transfer a file from Hyderabad to Bangalore.
The size of file is 90,000 bytes. The file will be transferred in 1,500-byte data packets, for which 40 bytes are taken up with headers. The size of acknowledgement packets is 40 bytes including header. Every packet is acknowledged. The communication is bidirectional and the bandwidth is 100 Mbps (megabits/sec) in each direction. Hosts can send and receive at the same time. The latency from Hyderabad to Bangalore is 5 ms, as is the latency in the opposite direction. Assume that time to process a packet is very small, so the receiver can send an acknowledgement as soon as it receives a data packet, but not before it receives the entire data packet.Assume no packet loss.  With Stop-and-Wait, how long will it take to transfer the file successfully?

1 Answer

Best answer
4 votes
4 votes

In the stop and wait protocol sender sends a data packet and waits for its acknowledgment and then transfers the next packet so here also the same transfer method will only be followed but the only thing which we need to take care of here in this question is that :

  1. the communication is bidirectional here
  2. in every data packet, the actual amount of data that will be transferred is 1500B – 40B = 1460B

So now we will find the number of packets required to carry 90000B is 90000B / 1460B = 61.64 packets which means 61 packets will carry 1460B of data and 62nd packet will carry 940B of data (excluding header).

The time to transmit one packet of 1500B is

(1500*8 )/ (100* 10^6) = 120 microseconds

Propagation time 5000 microseconds (given)

The transmission time of acknowledgment = 3.2 microseconds

Now 62nd packet acknowledgment time will be  

(980*8) / (100* 10^6) = 7.84 microseconds

Now,

Total transmission time is [61( 120 + 2*5000+ 3.2) + (7.84 + 2*5000 + 3.2) ]  = 627526.24 microsecond = 627.526 milliseconds = 628 ms approx.

Hope This Helps !!! 

selected by

Related questions