TCP Window Size Calculator

Calculate optimal TCP window sizes based on bandwidth-delay product. Optimize network throughput for high-latency links.

Advertisement

Tuning TCP for High-Latency Links

On long-distance (high-latency) networks, a TCP connection often runs far slower than the link can support — not because of bandwidth, but because the default window size limits how much data can be in flight at once. This calculator computes the optimal TCP window size and the underlying bandwidth-delay product, then gives you OS-specific commands to apply the tuning.

The Bandwidth-Delay Product

The core concept is the bandwidth-delay product (BDP): the amount of data that can be "on the wire" at any moment.

  • BDP = bandwidth × round-trip time (RTT)
  • For example, a 1 Gbps link with 100 ms RTT has a BDP of about 12.5 MB.

The TCP window must be at least as large as the BDP to keep the pipe full. If the window is smaller, the sender stalls waiting for acknowledgments before it can transmit more — leaving most of the bandwidth unused. This is why a fast WAN link can feel sluggish for a single large transfer.

Why Defaults Fall Short

Default OS buffer sizes were tuned for typical LAN-scale latency. Across continents or over satellite, the RTT climbs and the required window grows well beyond those defaults, so you must raise the socket buffer (receive/send) limits to realize the link's full throughput. Window scaling (RFC 1323) must also be enabled to allow windows above 64 KB.

Applying the Tuning

The calculator outputs commands for Linux (sysctl net.ipv4.tcp_rmem/wmem), Windows (netsh autotuning), and macOS so you can set buffers that match your BDP. Apply changes on both ends of the connection — a large receive buffer on one side does nothing if the other side's send buffer is small.

Privacy

All math runs locally in your browser from the bandwidth and latency values you enter; nothing is sent to a server. For the addressing side of network planning, the Subnet Calculator is a useful companion.

Optimize TCP Window Size

Calculate optimal TCP window size for your network conditions to maximize throughput.

Bandwidth-Delay Product

Window Size = Bandwidth × Round Trip Time

Factors

  • Available bandwidth
  • Network latency (RTT)
  • Packet loss rate
  • Buffer sizes
Advertisement

Frequently Asked Questions

What is the bandwidth-delay product (BDP) and why does it matter?+

The bandwidth-delay product is the amount of data that can be in transit on a network path at any given time. It is calculated by multiplying the link bandwidth by the round-trip time (RTT). Understanding your BDP is essential because your TCP window size must be at least equal to the BDP to fully utilize your available bandwidth.

What is TCP window scaling and when is it needed?+

TCP window scaling is an extension that allows window sizes larger than 64 KB. It is required when your BDP exceeds 64 KB, which is common on high-bandwidth or high-latency links. Without window scaling enabled, your throughput will be severely limited regardless of your actual bandwidth.

How does packet loss affect TCP throughput?+

Packet loss significantly reduces TCP throughput because the protocol must retransmit lost packets and reduce its sending rate. The Mathis formula shows that throughput is roughly proportional to 1 divided by the square root of the loss rate. Even a 1 percent loss rate can reduce throughput to a fraction of the available bandwidth.

What is the difference between MTU and MSS?+

MTU (Maximum Transmission Unit) is the largest packet size that can be sent on a network link, typically 1500 bytes for Ethernet. MSS (Maximum Segment Size) is the largest amount of TCP data that can fit in a packet after subtracting IP and TCP headers. For IPv4 with standard headers, MSS equals MTU minus 40 bytes.

How do I tune TCP buffer sizes on Linux, Windows, or macOS?+

Each operating system has different commands for TCP tuning. On Linux, use sysctl commands to adjust tcp_rmem and tcp_wmem values. On Windows, use netsh interface tcp commands to configure auto-tuning levels. On macOS, use sysctl to modify net.inet.tcp settings. The Buffer Tuning tab provides specific commands for each OS.

What congestion control algorithm should I use?+

BBR (Bottleneck Bandwidth and Round-trip propagation time) is recommended for high-latency or lossy networks as it adapts better to real-world conditions. CUBIC is the default on most Linux systems and works well for general use. The Congestion Control tab helps you choose the right algorithm based on your network characteristics and operating system.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.