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

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%.

• Would appreciate if you could elaborate further as I am not really good in mathematics. Do I need to do something like 0.6 * 1 of the value inside? Feb 22, 2014 at 13:42
• Thanks for the edited elaborated answer. For this 160, is it based on 4000bps X 0.04s (u converted from 40ms) $$L = T_P \cdot 4000 bps = \frac{160}{\frac{1}{Eff} - 1}$$ , Feb 22, 2014 at 16:43
• Yes, the 160 (bits) is the result of multiplying the bit rate by two times the propagation delay: $4000 bps \cdot 2 \cdot 0.02 s = 160 bits$. If you find this answer helpful, you should upvote it and/or accept it. Feb 22, 2014 at 17:10
• thanks for that. I have accepted the answer. Not enough reputation to up votes answers in electronics stack exchange. Feb 22, 2014 at 17:27
• Seems like I just unlocked some privileges and have sufficient points to up vote your post :) Feb 22, 2014 at 17:31