GATE CS 2024 Set 1 — Question 36

MCQ+2 / -0.67MediumStop-and-WaitData Link LayerComputer Networks

Computer Networks → Data Link Layer → Stop-and-Wait

Last updated

Question

Consider a network path P—Q—R between nodes P and R via router Q. Node P sends a file of size 10610^6 bytes to R via this path by splitting the file into chunks of 10310^3 bytes each. Node P sends these chunks one after the other without any wait time between the successive chunk transmissions. Assume that the size of extra headers added to these chunks is negligible, and that the chunk size is less than the MTU.
Each of the links P—Q and Q—R has a bandwidth of 10610^6 bits/sec, and negligible propagation latency. Router Q immediately transmits every packet it receives from P to R, with negligible processing and queueing delays. Router Q can simultaneously receive on link P—Q and transmit on link Q—R.
Assume P starts transmitting the chunks at time t=0t = 0.
Which one of the following options gives the time (in seconds, rounded off to 3 decimal places) at which R receives all the chunks of the file?
A.
8.000
B.
8.008
C.
15.992
D.
16.000

Correct answer

(B) 8.008

Solution

Given:
  • File size F=106F = 10^6 bytes
  • Chunk size L=103L = 10^3 bytes
  • Bandwidth B=106B = 10^6 bits/sec
  • Path: P \to Q \to R (2 hops)
First, calculate the number of packets (NN):N=106 bytes103 bytes=1000 packetsN = \frac{10^6 \text{ bytes}}{10^3 \text{ bytes}} = 1000 \text{ packets}Next, calculate the transmission time for one packet (TtransT_{trans}):
Packet size in bits = 103×8=800010^3 \times 8 = 8000 bitsTtrans=8000 bits106 bits/sec=8×103 sec=8 msT_{trans} = \frac{8000 \text{ bits}}{10^6 \text{ bits/sec}} = 8 \times 10^{-3} \text{ sec} = 8 \text{ ms}In a packet-switched network with pipelining (store-and-forward at router Q), the total time to transfer NN packets over kk hops is given by:Ttotal=(N+k1)×TtransT_{total} = (N + k - 1) \times T_{trans}Here, the number of hops k=2k = 2 (P-Q and Q-R).Ttotal=(1000+21)×8 msT_{total} = (1000 + 2 - 1) \times 8 \text{ ms}Ttotal=1001×8 ms=8008 msT_{total} = 1001 \times 8 \text{ ms} = 8008 \text{ ms}Converting to seconds:Ttotal=8.008 secondsT_{total} = 8.008 \text{ seconds}Alternatively, we can trace the packets:
  • The first packet arrives at Q at t=8t = 8 ms. Q immediately starts forwarding it to R. It arrives at R at t=8+8=16t = 8 + 8 = 16 ms.
  • Due to pipelining, subsequent packets arrive at R every Ttrans=8T_{trans} = 8 ms after the first packet.
  • There are N1=999N-1 = 999 remaining packets.
  • Total time = Time for 1st packet + Time for remaining 999 packets
  • Total time = 16 ms+999×8 ms=16+7992=8008 ms=8.008 s16 \text{ ms} + 999 \times 8 \text{ ms} = 16 + 7992 = 8008 \text{ ms} = 8.008 \text{ s}.

More questions on Data Link Layer

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free