ssh intermittently hanging after a few frames

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
After installing Debian/Sarge on a new laptop, I am experiencing a very
odd problem:

I have a network routed via cable modem.  I ssh to my workplace which is
behind a firewall.  Roughly half of the time, ssh hangs shortly after
logging.  This does not occur with other machines on the local network;
these other machines have the same distro (Debian/Sarge) installed.

I have verified that the MTU of each machine in the route is the same. The
only solution is to wait, it seems.  Once a successful connection is made,
it does not subsequently hang even under load. There are no relevant error
messages from the kernel or ssh -v. Other IP services do not have this
problem at the same time as the ssh problem is occuring which leads me to
ssh in particular. I have tried playing with different MTU and IP buffer
sizes to no avail.  Rebooting after the problem occurs is not correlated
with success AFAIK.

Can anyone offer any advice??  I've scoured the news groups without
hitting on any new things to try.  I'm not sure what to try next. Thanks!!

Re: ssh intermittently hanging after a few frames

Get a network trace of what's going on, preferably on both ends, so you're
not shooting in the dark.

  Richard Silverman

Re: ssh intermittently hanging after a few frames

Quoted text here. Click to load it

Maybe one of the firewalls drops packets with the DF bit set?  Try turning
off Path MTU Discovery ("echo 1 >/proc/sys/net/ipv4/ip_no_pmtu_disc").

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Re: ssh intermittently hanging after a few frames

On Tue, 07 Sep 2004 11:21:20 -0400, Martin Weinberg wrote:

Quoted text here. Click to load it

Thanks to all who replied!

tcpdump (as Richard suggested) was helpful.

OK, for the record, the problem is the interaction between window
scaling in Linux kernel 2.6.8 and my router.  The latency for my
remote connections is large enough that the kernel attempts to use
large windows and this *appears* to cause my router to get confused.
If I turn off window scaling, e.g.

    echo 0 > /proc/sys/net/ipv4/tcp_window_scaling

then all is well.

Site Timeline