This is the mail archive of the
mailing list for the Cygwin project.
Re: SSH tunneling buffers...
- From: Brian Genisio <briangenisio at yahoo dot com>
- To: cygwin at cygwin dot com
- Cc: pechtcha at cs dot nyu dot edu
- Date: Wed, 7 May 2003 04:57:55 -0700 (PDT)
- Subject: Re: SSH tunneling buffers...
- Reply-to: brian at genisio dot org
On Thu, 1 May 2003, Brian Genisio wrote:
> Hi all...
> I am using SSH to tunnel (Using LocalForwarding ports) from one application
> another. The system exists of a controller software in Linux (where the SSH
> server resides), and the actual software in Cygwin.
> Cygwin connects to the Linux SSH server and sets up a port forward. The
> app sends a small amount of data (about 12 bytes) 30 times per second.
> The problem is that the Cygwin/SSH side of the tunnel is buffering the data
> before it sends it to the Cygwin app. The result is the data is received in
> bursts, and the control is not fluid.
> I have tried this system in a Linux to Linux situation, and the buffering did
> not happen. Also, I have tried sending data from Cygwin to Linux, and the
> buffering does not happen. It only happens when data is being sent from
> to Cygwin.
> I have also tried switching between LocalForward and RemoteForward, and it is
> the dirction that matters, not the type of port forwarding.
> Both sides sets the TCP_NODELAY flag before it starts sending, and I know the
> SSH code does the same...
> Any ideas?
#Does "ssh -vvv" show anything that could be related to this?
It turns out we found the problem for this. It is a bug in SSH (sshd). When
the SSH daemon receives the initial connection (accept), it is not setting
TCP_NODELAY on the main socket (it does it for all forwarding sockets, but
neglects to do it on the main connection). Because of this, traffic coming
from the daemon side gets buffered, and we get a bursting effect. The
solution, of course, is to call set_nodelay(newsock) just after the accept, and
the problem is fixed.
I sent a mail off to the SSH development list yesterday, and I am waiting for a
response... none yet.
Thought you might want to know,
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html