bbluffOPBtoHome Networking@selfhosted.forum•Low bandwidth to remote NAS, even though individual links are fastEnglish
11·
1 year agoThey are duplex.
Sry for the giant wall of text. There is a single-sentence tldr and a picture though, I edited the post to make the tldr more visible.
Found it. The TCP window size was too small.
Raising the maximum TCP window size on the NAS and changing the TCP window size on iperf fixed the problem. The bandwidth changed from 23 Mbit/s to 190 Mbit/s over VPN.
I believe the root cause is a combination of high latency between the endpoints and low maximum TCP window size. The latency between the two routers was 179ms, and the maximum TCP window size on the NAS was set to 128KB. Because of the high latency, the TCP ACK takes a long time to arrive, and because of the small window size the sender is waiting for the ACK instead of sending more data.
I changed the max TCP window size on the NAS to match the routers’ 16MB:
And changed iperf command to use the
-w 8M
flag to send data with a 8MB TCP window size. I found the 8M value with trial-and-error, I’m sure it could be optimized further but 190Mbit/s is good enough for this connection.