Exact definition of SO_SNDLOWAT and SO_RCVLOWAT
David Collier-Brown
David.Collier-Brown at canada.sun.com
Mon May 15 13:00:42 GMT 2000
Richard Sharpe wrote:
>
> At 02:10 PM 5/14/00 +1000, Richard Sharpe wrote:
> >Hi,
> >
> >I am seeing conflicting definitions of SO_SNDLOWAT and SO_RCVLOWAT, and
> >would like some confirmation of these.
They're discussed in Stevens' "TCP/IP Illustrated,
Volume 3. From my quick reading, the difference between
high- and low-water-marks are the important ones, and
data is not sent if there is less than so_send.sb_lowat
bytes ready.
The Nagle algorithm seems seperate: the code that's turned on
by TCP_NODELAY (or SO_NODELAY) doesn't appear to use sb_lowat.
> What seems to be more important to me is how much data TCP will stuff into
> a segment, as this will control how many segments will be used when sending
> a block of data. For example, if doing a 4kB read or write, the minimum
> number of 1500-byte IP datagrams will be 3, but an implementation could
> send four or even five, depending on how the data is given to the TCP layer
> and whether or not TCP_NODELAY is set.
Yes, that's my interpretation: if NODELAY is set, TCP
will send full segments until it doesn't have any left,
then one partially-full segment. It will only stop
if it exceeds the recieve window that's available at
the time.
--dave
--
David Collier-Brown, | Always do right. This will gratify some people
185 Ellerslie Ave., | and astonish the rest. -- Mark Twain
Willowdale, Ontario | //www.oreilly.com/catalog/samba/author.html
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at canada.sun.com
More information about the samba-technical
mailing list