Subject: bin/14804: OpenSSH will cause retransmitted packets and stalling sessions
To: None <>
From: None <>
List: netbsd-bugs
Date: 12/01/2001 14:11:54
>Number:         14804
>Category:       bin
>Synopsis:       OpenSSH will cause retransmitted packets and stalling sessions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 01 14:12:00 PST 2001
>Originator:     Tomas Svensson
>Release:        NetBSD 1.5.1
NetBSD 1.5.1 i386
It seems OpenSSH 2.5.2 (and other versions) sets TCP_NODELAY for interactive SSH sessions. This will lead to stalling sessions if there is some latency; if I for example do ls -l, OpenSSH will send a burst of sixty(!) small packets 100 or 116 byte in size, it looks like:

14:30:46.232151 server.22 > client.1525: P 30977:31077(100) ack 1144 win 24820
14:30:46.233358 server.22 > client.1525: P 31077:31177(100) ack 1144 win 24820

The packets will be bigger after these 50-60 small packets, 1076 and 1460 but it is too late, some of the small packets will be retransmitted and the session stalls.

If I try the same with SSH Inc ssh-3.0.0 the problem won't appear, because all the packets are as big as the MTU when possible, usually 1460.

The problem is not NetBSD-specific.
Try ls -l in a dir with lots of files (just displaying a file with cat won't do as its too fast and the packets get big enough). It must also be a remote site with some delay, it won't give problems locally on the LAN.
Disable TCP_NODELAY seems like the easy fix, but I haven't tried this yet.