Tcp – Lower throughput with fixed TCP window size

iperflinuxtcpthroughput

I used iperf3 to measure the effect that the TCP window has on throughput. I am measuring the throughput between two virtual machines which are located on different physical hosts. So I wrote a Python script that called iperf3 with different window sizes (2 KB -1024 KB) and plotted the throughput. It turned out that none of the windows sizes achieved a throughput nearly as high as I measured without defining the window size.

This command measured a throughput of ~250 Mbits/s:

iperf3 -c 10.0.0.3 -t 120

This is the command I used for the following plot:

iperf3 -c 10.0.0.3 -t 120 -w <window size>

iperf3 measurements with different window sizes

Can anyone explain, why the throughput without specified window size is so much higher? I also can't find the default window size that is used if not specified. Does iperf3 use a flexible windows size if not specified?

EDIT
I uploaded two output files of tcpdump here. It captured the iperf3 traffic with and without the -w flag. Starting before iperf3 started until after it ended. I had a look at it in WireShark but still cannot figure out what TCP window size was used for the connections.

Best Answer

Receive window sizes (rwin) will increase and decrease automatically during a TCP session depending on how lossy the connection ends up being. It is therefore possible that when you omit the -w flag from iperf the window size is being dynamically scaled higher than your static values. Remember that maximum theoretical throughput is rwin/delay.

Based on that graph however it appears that your bandwidth caps out at 70Mbit or so and raising the window size isn't having any impact. As window size doesn't appear to be restricting the bandwidth, is there anything else which could be consuming it - are you performing these tests over Wifi? Alternatively, can you double check that when you set a window size greater than 256 with the -w flag, that it does actually get sent "on the wire" by verifying with tcpdump/Wireshark?