# Electronic – Frame size range calculation for stop-and-wait protocol

communicationmathNetwork

I have a question and answer below. The answer seems to show less working on how it derived.

My question is if the efficiency of at least is changed to say 60%? Will it still be the same answer?

Question
A channel has a data rate of 4 kbps and a propagation delay of 20 ms. For what range of frame sizes does stop-and-wait give an efficiency of at least 50%?

$$a = \frac{Propagation\,Delay}{Transmission\,Time} = \frac{20 \times 10^{-3}}{\frac{L}{4 \times 10^{3}}}$$

Using the maximum possible utilization expression:

$$U = \frac{1}{1+2a} = \frac{1}{1 + \frac{160}{L}} \ge 0.5$$

$$L \ge 160$$

Therefore, an efficiency of at least 50% requires a frame size of at least 160 bits.

No, it won't be the same. The "dead time" on the link is 2× the propagation delay. Therefore, to improve the overall efficiency, the packet length must change.

The interval between packet starts on the transmit side includes three segments: the time it takes to transmit the packet, the time it takes the last byte to propagate to the receive side, and the time it takes the ACK to propagate back to the transmit side. (We're ignoring the time that it takes the receive side to generate and transmit the ACK message, but in a real system, this would matter, too.)

$$Packet Duration = T_P = \frac{L}{4000 bps}$$

$$Packet Interval = T_I = T_P + 2 \cdot 20 ms$$

The overall efficiency of the link is the packet transmit time divided by the interval between packet starts.

$$Efficiency = \frac{T_P}{T_I} = \frac{T_P}{T_P + 40 ms}$$

Solve this for TP as a function of efficiency:

$$T_P = \frac{40 ms}{\frac{1}{Eff} - 1}$$

and express this in terms of the number of bits in the packet:

$$L = T_P \cdot 4000 bps = \frac{160}{\frac{1}{Eff} - 1}$$

Now it is straightforward to calculate the packet lengths for various efficiency numbers:

$$L = \frac{160}{\frac{1}{0.5} - 1} = 160 bits$$

$$L = \frac{160}{\frac{1}{0.6} - 1} = 240 bits$$

In other words, given these link parameters, you need to send 50% more bits in order to raise the link efficiency from 50% to 60%.