Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Nov 1998 09:59:37 -0800 (PST)
From:      Marc Slemko <marcs@znep.com>
To:        Michael Robinson <robinson@public.bta.net.cn>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: writev() to tcp
Message-ID:  <Pine.BSF.4.05.9811160950230.12077-100000@alive.znep.com>
In-Reply-To: <199811161720.BAA26218@public.bta.net.cn>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 17 Nov 1998, Michael Robinson wrote:

> I'm working with ORBit under FreeBSD 2.2.7.  The ORBit IIOP driver makes
> extensive use of writev.
> 
> I've noticed this very wierd thing:  with a total writev buffer of 160
> bytes, the tcp socket is sending the first 100 bytes (on a segment boundary),
> waiting for a tcp ack on the socket, and then sending the remaining 60 bytes.
> Here's a tcpdump:
> 
> 01:11:33.789875 localhost.2358 > localhost.2359: P 1441:1541(100) ack 891 win 57344 <nop,nop,timestamp 51147 51147,nop,nop,cc 2011> (DF)
> 01:11:33.970016 localhost.2359 > localhost.2358: . ack 1541 win 57344 <nop,nop,timestamp 51147 51147,nop,nop,cc 2010> (DF)
> 01:11:33.970223 localhost.2358 > localhost.2359: P 1541:1601(60) ack 891 win 57344 <nop,nop,timestamp 51147 51147,nop,nop,cc 2011> (DF)
> 
> Obviously, a gratuitous 200ms delay in the middle of every transaction is
> not exactly what you want in your CORBA library.  But the bigger question
> in my mind is, why is the tcp socket flushing its buffer in the middle of
> the writev, instead of at the end (or when the buffer gets full, whichever
> comes first)?

This doesn't really have anything to do with writev() in particular. There
is a bug in the TCP code where a packet bigger than a single mbuf (MLEN ==
108 bytes) but not big enough for a mbuf cluster (MINCLSIZE == 204 bytes)  
ends up being put into two mbufs that end up being put on the wire in two
parts.  There should be some messages about it in the archives.  There are
various fixes, but none has been made yet.

Disabling nagle can work around some of the bad interactions between nagle
and delayed ack in this case, but isn't a great solution in general.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9811160950230.12077-100000>