Bandwidth-Delay Product & Stop-and-Wait Efficiency
Interview Question: "A link has a bandwidth of 5 Mbps and a propagation delay of 20 ms. Calculate the bandwidth-delay product, the Stop-and-Wait link utilization for a 1000-bit frame, explain why Stop-and-Wait fails on Long Fat Networks (LFNs), and walk through how TCP window scaling overcomes the 64 KB limit."
A protocol window that's too small for the link it's running on is the single most common way to quietly throttle a gigabit fiber link down to dial-up speeds. The Bandwidth-Delay Product (BDP) is the number that tells you how big that window needs to be.
Bandwidth-Delay Product (BDP) Deep Dive
Picture the link as a physical pipe. Bandwidth is how wide the pipe is (bits/second it can carry). Delay is how long the pipe is (seconds for something to travel end to end). BDP is just the pipe's volume — how many bits can be in flight, inside the wire, at any one instant:
100,000 bits in flight at onceOne-Way BDP vs Round-Trip BDP:
In network literature, candidates must distinguish between two definitions:
- One-Way BDP (): The capacity of the wire in a single direction.
- Round-Trip BDP (): The total unacknowledged in-flight data needed to keep the sender's transmitter continuously busy while waiting for an acknowledgment (ACK):
Stop-and-Wait ARQ Efficiency Analysis
Stop-and-Wait requires the sender to transmit one frame of size and freeze until the receiver's ACK traverses the channel back to the sender.
Transmission Time ():
Total Cycle Time ():
Assuming processing delay and ACK transmission time are negligible:
Link Utilization / Efficiency ():
Link efficiency is the fraction of total cycle time during which useful bits are actively pushed onto the wire:
Actual Achieved Throughput:
Despite paying for a 5 Mbps link, Stop-and-Wait utilizes less than half of one percent of the link capacity! The sender spends 0.2 ms transmitting and 40 ms sitting idle.
Long Fat Networks (LFNs) & The Utilization Crisis
A Long Fat Network (LFN) is any network link with a large bandwidth-delay product (high bandwidth, high latency). Typical examples include:
- Trans-oceanic submarine fiber cables (e.g., 100 Gbps, 80 ms RTT).
- Geostationary satellite broadband (e.g., 50 Mbps, 500 ms RTT).
- Inter-data-center backbone interconnects.
In our problem, the link pipe has a volume of 100,000 bits. Under Stop-and-Wait, the sender pushes a tiny 1,000-bit frame into the pipe (filling only 1% of the volume) and immediately stops. The pipe remains 99% empty at all times.
To achieve high utilization on an LFN, protocols must use pipelining (Sliding Window protocols like Go-Back-N, Selective Repeat, and TCP), keeping the entire BDP saturated with in-flight data.
The 64 KB TCP Window Size Trap & RFC 7323 Scaling
In the original TCP specification (RFC 793), the Window Size field in the TCP header is strictly 16 bits wide:
This 64 KB ceiling creates an artificial throughput barrier on modern high-speed links. The maximum theoretical throughput of a TCP connection is bounded by:
The High-BDP Throughput Collapse:
Consider a modern cross-continental link:
- Bandwidth:
- RTT:
- Required BDP:
If this connection is restricted to the default 16-bit window ():
A 10 Gbps link is throttled down to 5.24 Mbps, a staggering 99.95% waste of available capacity!
The Fix: TCP Window Scale Option (RFC 1323 / RFC 7323)
To overcome this limitation, TCP includes a Window Scale option negotiated during the initial 3-way handshake (SYN packets):
- Defines a 1-byte scale factor (from 0 to 14).
- The true receive window is calculated as:
- With the maximum scale factor :
This allows TCP to fully saturate high-speed 100 Gbps and multi-gigabit satellite connections over global distances.
Bufferbloat: The Danger of Oversizing Buffers
While sizing TCP socket buffers to match BDP is critical for throughput, oversizing intermediate router queue buffers creates bufferbloat:
- When network buffers are excessively large, TCP congestion control continues pushing packets into the queue instead of dropping them to signal congestion.
- The router queue fills to capacity, adding hundreds of milliseconds or seconds of queuing delay () to every packet without increasing link throughput by a single bit.
- Modern congestion control algorithms like BBR (Bottleneck Bandwidth and RTT) and Active Queue Management schemes like CoDel (Controlled Delay) and FQ-CoDel explicitly measure link BDP to keep queue occupancy minimal.
Python: Runnable Implementation
This script computes one-way and RTT BDP, analyzes Stop-and-Wait efficiency, and evaluates TCP throughput limits under default 64 KB vs RFC 7323 window-scaled configurations.
"""
Bandwidth-Delay Product (BDP) & Protocol Efficiency Simulator
Demonstrates channel capacity, Stop-and-Wait degradation,
and TCP Window Scaling (RFC 7323).
"""
def compute_bdp(bandwidth_bps: int, prop_delay_sec: float) -> tuple[int, int]:
"""Calculates one-way and round-trip BDP in bits and bytes."""
bdp_oneway_bits = int(bandwidth_bps * prop_delay_sec)
bdp_rtt_bits = int(bandwidth_bps * (2 * prop_delay_sec))
return bdp_oneway_bits, bdp_rtt_bits
def stop_and_wait_efficiency(frame_bits: int, bandwidth_bps: int, prop_delay_sec: float) -> tuple[float, float]:
"""
Computes Stop-and-Wait link efficiency and achieved throughput.
Returns: (efficiency_fraction, achieved_throughput_bps)
"""
t_trans = frame_bits / bandwidth_bps
t_cycle = t_trans + (2 * prop_delay_sec)
efficiency = t_trans / t_cycle
achieved_throughput = efficiency * bandwidth_bps
return efficiency, achieved_throughput
def max_tcp_throughput(window_bytes: int, rtt_sec: float) -> float:
"""Calculates maximum theoretical TCP throughput bounded by window size."""
return (window_bytes * 8) / rtt_sec
if __name__ == "__main__":
bandwidth = 5 * 10**6 # 5 Mbps
prop_delay = 20 * 10**-3 # 20 ms
frame_size = 1000 # 1000 bits
# 1. BDP Calculation
bdp_1way, bdp_rtt = compute_bdp(bandwidth, prop_delay)
print(f"One-Way BDP: {bdp_1way:,} bits ({bdp_1way // 8:,} bytes)")
print(f"Round-Trip BDP: {bdp_rtt:,} bits ({bdp_rtt // 8:,} bytes)")
assert bdp_1way == 100_000
assert bdp_rtt == 200_000
# 2. Stop-and-Wait Efficiency
eff, actual_bw = stop_and_wait_efficiency(frame_size, bandwidth, prop_delay)
print(f"\nStop-and-Wait Efficiency: {eff * 100:.3f}%")
print(f"Achieved Throughput: {actual_bw / 1000:.2f} kbps (of 5000 kbps)")
assert round(eff * 100, 2) == 0.50
# 3. Long Fat Network & TCP 64 KB Limit Analysis
print("\n--- 10 Gbps Cross-Continental LFN (RTT = 100 ms) ---")
lfn_bandwidth = 10 * 10**9 # 10 Gbps
lfn_rtt = 0.100 # 100 ms
lfn_bdp_bytes = int((lfn_bandwidth * lfn_rtt) / 8)
print(f"Required Window to fill link: {lfn_bdp_bytes / 10**6:.2f} MB")
# Default 16-bit TCP Window (65,535 bytes)
default_wnd = 65535
tput_unscaled = max_tcp_throughput(default_wnd, lfn_rtt)
print(f"Throughput (Default 64 KB Window): {tput_unscaled / 10**6:.2f} Mbps (Efficiency: {(tput_unscaled / lfn_bandwidth) * 100:.3f}%)")
# Scaled TCP Window with RFC 7323 (scale factor = 11 -> ~134 MB window)
scale_factor = 11
scaled_wnd = default_wnd * (2**scale_factor)
tput_scaled = max_tcp_throughput(scaled_wnd, lfn_rtt)
effective_tput = min(tput_scaled, lfn_bandwidth)
print(f"Throughput (RFC 7323 Scaled Window): {effective_tput / 10**9:.2f} Gbps (Efficiency: {(effective_tput / lfn_bandwidth) * 100:.1f}%)")
Say this in the interview
"The Bandwidth-Delay Product (BDP) represents the volume of data that can exist in transit on the link at any given moment. For a 5 Mbps link with a 20 ms propagation delay, the one-way BDP is (12.5 KB), while the round-trip BDP required to saturate the connection is 200,000 bits (25 KB).
In Stop-and-Wait ARQ with a 1,000-bit frame, transmission takes only 0.2 ms, but the sender must wait 40 ms of round-trip propagation for the ACK. The link efficiency is , delivering an effective throughput of just 24.88 kbps. Because the channel holds 100,000 bits and the sender only transmits 1,000 bits before freezing, the link pipe is 99% empty.
On Long Fat Networks (high-bandwidth, high-latency links), Stop-and-Wait is unusable. Furthermore, standard TCP historically suffered from the same issue due to its 16-bit
Window Sizefield, which capped unacknowledged in-flight data at 64 KB. On a 10 Gbps link with 100 ms RTT, a 64 KB window limits throughput to just 5.24 Mbps. Modern systems resolve this using the TCP Window Scale Option (RFC 7323), which applies a left-shift factor up to 14 bits, unlocking receive windows up to 1 GB to fully saturate high-BDP links."