Skip to content
Calcrivo

TCP Window Size Calculator

Size the TCP receive window for a given bandwidth and RTT, and find the window scale factor it needs.

Inputs

Mbit/s
ms
bytes

Required Window Size

2 MiB

Window Scale Factor (shift)

6

Window Available With That Scale

4 MiB

Throughput Ceiling Without Scaling

13.11Mbit/s

Segments In Flight

1,712

Step by step

  1. Values used

    Link bandwidth = 500 Mbit/s; Round-trip time = 40 ms; Maximum segment size = 1,460 bytes

  2. TCP Window Size

    window = bandwidth × RTT ÷ 8, and the scale factor is ceil(log2(window ÷ 65535)).

  3. Throughput ceiling

    throughput ceiling = window ÷ RTT

  4. Required Window Size

    = 2,500,000

  5. Window Scale Factor (shift)

    = 6

  6. Window Available With That Scale

    = 4,194,240

  7. Throughput Ceiling Without Scaling

    = 13.11 Mbit/s

  8. Segments In Flight

    = 1,712

How it works

A sender may have at most one window of unacknowledged data outstanding, so the window has to cover everything the pipe holds for one round trip. The 16-bit window field stops at 65,535 bytes, so anything larger needs the RFC 7323 window scale option, which multiplies the advertised value by 2^shift. On any long fat pipe the window, not the link, sets the ceiling: a 64 KB window over 40 ms RTT tops out near 13 Mbit/s no matter how much bandwidth you bought.

Formulas

TCP Window Size

window = bandwidth × RTT ÷ 8, and the scale factor is ceil(log2(window ÷ 65535)).

65535
Largest window the 16-bit header field can express
window
Receive window in bytes
RTT
Round-trip time in seconds

Throughput ceiling

throughput ceiling = window ÷ RTT

window
Advertised receive window in bits
RTT
Round-trip time in seconds

Frequently Asked Questions

How is TCP Window Size calculated?

window = bandwidth × RTT ÷ 8, and the scale factor is ceil(log2(window ÷ 65535)). A sender may have at most one window of unacknowledged data outstanding, so the window has to cover everything the pipe holds for one round trip. The 16-bit window field stops at 65,535 bytes, so anything larger needs the RFC 7323 window scale option, which multiplies the advertised value by 2^shift.

Why does TCP Window Size matter?

On any long fat pipe the window, not the link, sets the ceiling: a 64 KB window over 40 ms RTT tops out near 13 Mbit/s no matter how much bandwidth you bought.

What values do I need to enter?

This calculator takes 3 inputs: Link bandwidth, Round-trip time, Maximum segment size. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Why does a fast link still transfer slowly?

Because throughput is capped at window ÷ RTT. If the receive window or the socket buffer is small, a single TCP stream cannot fill the link regardless of its capacity — the fix is window scaling and larger buffers, not more bandwidth.

You might also need