tcp – wondering on performance of SCP over WAN

Setting the latency to 200ms I have terrible performance downloading the files from the linux machine compared to 20ms delay.

While applications and protocols above the transport layer are really off topic here, that really sounds like a TCP issue. SCP’s underlying SSH is based on TCP which uses a ‘window’ to determine the amount of data that may be in flight, ie. sent without being acknowledged by the destination.
With basic TCP, the maximum send window is 64 KiB. With a one-way latency of 200 ms = 400 ms round trip, the maximum throughput is 64 KiB/400 ms = 163 KB/s – no matter what actual bandwidth there is.
Your end points need to use the TCP scale option to increase the maximum window to ~1 GiB.

with tftp the performance is much better.

Off topic here, but TFTP is based on UDP. Classically, it uses a ‘window’ of just a single packet, which would be extremely slow over that link.
Microsoft has introduced a Windowsize option for TFTP, formalized in RFC 7440. It allows for up to 65535 blocks in flight (~96 MB), so you could get up to around 240 MB/s, more than a gigabit link can transmit.
Note that TFTP does not encrypt, so it shouldn’t be used over WAN without encrypting encapsulation/VPN.

Stay in the Loop

Get the daily email from CryptoNews that makes reading the news actually enjoyable. Join our mailing list to stay in the loop to stay informed, for free.

Latest stories

- Advertisement - spot_img

You might also like...