0

Good evening,

I use SFTP (File Transfer over SSH) from a computer (Windows 10) to a Synology NAS. Both devices are behind NAT on different locations. Around 3 weeks ago, whenever I initiated a transfer (always one file at a time), the speed was easily around 30 MB/s. This is close to my maximum available speed, which is the limiting factor on one of the locations.

Today, I noticed that a transfer starts fast but within a second drops to not more than 2 MB/s. First I thought of bandwidth issues (ISP, switch, router, ...), but that doesn't seem to be the case because I can launch 10 of these transfers at the same time. They each stay around 2 MB/s, totalling up to 20MB/s for 10 transfers. So the bandwidth is available, it's just not used.

Someone I know advised me to make a tcpdump, suggesting I would find a lot of "TCP Retransmission" packets in there. He was right. He advised me to lower my MTU size (currently 1500 on both machines) to around 1462, however this did not seem to solve the bandwidth issue.

I have to admit that, while I am somewhat experienced with networking, the MTU is really something that I haven't had to tamper with much. It has always simply worked by default. In any case, it does not seem to be the resolution for the problem after having tried several (lower) values of the MTU on the sender side.

On the side of the NAS, unfortunately there are 2 NAT devices because at this time it cannot be avoided. Locally, when I am with the NAS in the same network or just behind the first NAT router (so before the second NAT router), I am able to reach close to 1Gbps speeds (over 100MB/s).

Could anyone point me into the right direction, something I am forgetting or simply am not aware of? All ideas welcome. :-)

Any ways to somehow force SSH to send smaller packets, since I assume that is the actual issue, could also work and is welcome.

Thanks beforehand.

Kenneth

6
  • You don't have to mess with MTU if Path MTU Discovery (PMTUD) isn't being blocked. Make sure none of your firewalls or NATs, or router ACLs at either site are blocking ICMP messages (PMTUD relies on ICMP "Destination Unreachable" messages). If limiting the MTU didn't solve the performance problem, then it's probably a red herring. By the way, can you edit your Question post to make it more clear what, if anything, was helped by lowering the MTU? From the way it's worded right now, I'm not even sure if it helped with the retransmissions you were seeing.
    – Spiff
    Commented Jan 28, 2021 at 23:48
  • I wouldn't be so sure that MTU is the cause, since TCP retransmissions are originated in layer 4, while MTU belongs to layer 2. Commented Jan 29, 2021 at 8:51
  • What if you moved to the second site, where the NAS is? Is there any other equipment you could test SFTP against? In your local network and the remote network. Commented Jan 29, 2021 at 8:55
  • @Spiff I did change the MTU and it did not resolve the performance problem, so it might just be a red herring indeed. I changed my answer to clearly indicate that it had no performance impact. Still having that particular issue...
    – Kenneth
    Commented Jan 29, 2021 at 10:47
  • @eventHandler I did try SFTP locally (same LAN as well as one NAT-device up and I reach close to 1Gbps of speeds... Also from the remote side (Windows 10) to another location I have access to, no restrictions on the bandwidth as I am seeing them. So definitely no issue on that side I guess?
    – Kenneth
    Commented Jan 29, 2021 at 10:47

1 Answer 1

0

Both devices are behind NAT on different locations.

transfer starts fast but within a second drops to not more than 2 MB/s.

I can launch 10 of these transfers at the same time. They each stay around 2 MB/s, totalling up to 20MB/s for 10 transfers.

Guess: Bufferbloat in something on the path between both locations.

Transfers starts fast as the buffer fills, then the buffer starts to randomly drop packets, without giving proper feedback to the TCP algorithm, so you get retransmissions.

Buffer seems to be connection based, so you have this effect for each of the transfers.

I don't know any good solution, as you cannot influence what happens on "the internet" between your locations.

You could try to connect up both locations via a VPN, hoping that it will avoid whatever causes the bufferbloat, by going to the VPN server instead of connecting locations directly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .