TCP Window Size Calculator
Calculate optimal TCP window size from bandwidth-delay product for maximum throughput.
Inputs
Optimal Window (Bandwidth-Delay Product)
10,000,000bytes
Optimal Window
9,765.63KB
TCP Window Scaling Required
true
Recommended Scale Factor
8
Max Window With Scale Factor
16,776,960bytes
Step by step
Values used
Link Bandwidth = 1,000 Mbps; Round-Trip Time (RTT) = 80 ms
Bandwidth-delay product
window = bandwidth × RTT
Optimal Window (Bandwidth-Delay Product)
= 10,000,000 bytes
Optimal Window
= 9,765.63 KB
TCP Window Scaling Required
= Yes
Recommended Scale Factor
= 8
Max Window With Scale Factor
= 16,776,960 bytes
How it works
To fully utilize a network link, the TCP window must be at least as large as the bandwidth-delay product (BDP) — the amount of data that can be in flight before the first acknowledgment returns. The base TCP header only supports a 16-bit window field, capping it at 65,535 bytes, so any link with a BDP above that threshold needs the TCP window scaling option (RFC 1323), which the Linux kernel enables by default via net.ipv4.tcp_window_scaling.
Formula
Bandwidth-delay product
window = bandwidth × RTT
- B
- bandwidth in bytes/sec
- T
- round-trip time in seconds
Frequently Asked Questions
What happens if the TCP window is smaller than the bandwidth-delay product?
Throughput gets capped well below the link's actual capacity, because the sender must stop and wait for acknowledgments before the pipe is full — this is the classic 'long fat network' problem on high-bandwidth, high-latency links.
Is TCP window scaling enabled by default on Linux?
Yes, modern Linux kernels enable window scaling by default (net.ipv4.tcp_window_scaling = 1), and it is negotiated automatically during the TCP handshake if both endpoints support it.
How do I tune the actual buffer sizes on Linux?
The relevant sysctls are net.core.rmem_max/wmem_max (system-wide caps) and net.ipv4.tcp_rmem/tcp_wmem (min/default/max per-socket buffer sizes) — set the max values at or above your calculated optimal window for the link.