Sub topic 9
Window, RTT, and Throughput Calculations
Assume you know the layered network model, bandwidth, latency, propagation delay, transmission delay, and round-trip time (RTT). Also assume you can convert between bits, bytes, and powers of two.
The window limits data in flight
A TCP window is the amount of data that may be sent but not yet acknowledged. It prevents the sender from waiting after every segment.
TCP has two important limits:
- The receiver window,
rwnd, protects the receiver from buffer overflow. - The congestion window,
cwnd, protects the network from overload.
The sender can keep at most this much unacknowledged data in the network:
\[ W = \min(rwnd, cwnd) \]
Here, \(W\) is the effective sender window. If rwnd is 64 KB but cwnd is 16 KB, only 16 KB can be in flight.
Throughput from window size and RTT
If a sender can transmit \(W\) bytes every RTT, the window-limited throughput is:
\[ \text{Throughput} = \frac{W}{RTT} \]
Use seconds for RTT. Convert the result to bits per second by multiplying bytes per second by 8.
For example, suppose:
- \(W = 64\text{ KB} = 65{,}536\) bytes
- \(RTT = 100\text{ ms} = 0.1\) seconds
Then:
\[ \text{Throughput} = \frac{65{,}536}{0.1} = 655{,}360\text{ bytes/s} \]
\[ = 5{,}242{,}880\text{ bits/s} \approx 5.24\text{ Mb/s} \]
This is the throughput allowed by the window. The actual throughput cannot exceed the link bandwidth:
\[ \text{Actual throughput} = \min\left(\text{link bandwidth}, \frac{W}{RTT}\right) \]
| Quantity | Meaning | Common unit |
|---|---|---|
| \(W\) | Effective amount of unacknowledged data | bytes |
| RTT | Time for data and its acknowledgement | seconds |
| \(W/RTT\) | Window-limited throughput | bytes/second |
| Bandwidth | Physical link capacity | bits/second |
Bandwidth-delay product
The bandwidth-delay product (BDP) is the amount of data a link can carry during one RTT:
\[ BDP = \text{bandwidth} \times RTT \]
If the effective window is at least the BDP, the sender can usually keep the link busy. If it is smaller, the link becomes idle while the sender waits for acknowledgements.
For a 10 Mb/s link with a 50 ms RTT:
\[ BDP = 10{,}000{,}000 \times 0.05 = 500{,}000\text{ bits} = 62{,}500\text{ bytes} \]
Therefore, a window of about 62.5 KB is needed to reach 10 Mb/s under this simplified model.
Common errors
- Do not divide by one-way delay when the formula requires RTT.
- Do not mix bits and bytes.
- Do not use
rwndalone whencwndis smaller. - Do not report \(W/RTT\) above the link bandwidth.
- If a question gives segment size, convert a segment window to bytes before calculating throughput.
Exercise
A TCP connection has rwnd = 32 KB, cwnd = 8 KB, and RTT = 40 ms. What is the maximum window-limited throughput in bits per second?
Show answer
The effective window is 8 KB = 8,192 bytes. Throughput = 8,192 / 0.04 = 204,800 bytes/s = 1,638,400 bits/s, or about 1.64 Mb/s.