Subject: Re: very slow TCP connection on localhost
To: Pavel Cahyna <>
From: Steven M. Bellovin <>
List: tech-net
Date: 09/06/2006 13:36:20
On Wed, 6 Sep 2006 18:59:29 +0200, Pavel Cahyna <> wrote:

> On Wed, Sep 06, 2006 at 10:48:08AM -0400, Steven M. Bellovin wrote:
> > The retransmissions are, I suspect, the key.  If TCP has to retransmit,
> > it's because a packet or its acknowledgment got lost; TCP in turn
> > interprets that as due to congestion and backs off.  The question, then,
> > is why packets are getting lost.  Does 'netstat -i -d' show any drops on
> > lo0?
> It is apparently because the sending process sends segments after window,
> which the receiving side discards.
Right -- the sender is transmitting packet it's not allowed to send,
retransmits them because they're (quite properly) not acknowledged, which
in turn slows down the sender.  The question is why that should happen.
It would be interesting to see some of the connection state variables for
each side -- snd_wnd, rcv_wnd, rcv_adv, snd_cwnd to start with.  Here's a
WAG -- with RTT so low, something is getting confused in the calculation
of the sender's notion of the window size. 

		--Steven M. Bellovin,