9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Dan Cross <cross@math.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Nagle algorithm
Date: Mon, 26 Nov 2001 14:11:04 -0500	[thread overview]
Message-ID: <200111261911.OAA11962@augusta.math.psu.edu> (raw)
In-Reply-To: <yty9ktu7er.fsf@cesium.clock.org>

In article <yty9ktu7er.fsf@cesium.clock.org> you write:
>Moving Nagle into the application, as is suggested later
>in the thread, is awkward: it needs to know the segment
>size, which is affected by the receiver's advertised MSS,
>the local MTU and the path MTU.  The latter two of these can
>change during the lifetime of a TCP conversation.

Err, why does it need to know those things?  All it cares about is
sending as much data as possible in a single write() call, right?  It
seems it could pack something like a 64k*o* buffer as full as possible,
and then write that, and achieve the same effect.

>The usual complaint about Nagle is that it punishes
>applications which deliberately exchange short packets.
>However, it is almost always possible to turn Nagle off on
>a per-connection basis, for those (relatively rare)
>applications which are upset by the increased transmit delay.
>
>The problem with simply "eliminating" Nagle is that a
>bulk-transfer application which DELIBERATELY schedules
>lots of small writes that do not queue at the TCP send
>level, will generate lots of small packets.  This causes
>the TCP congestion window to inflate faster, and gives such
>applications an unfair advantage over applications which
>make larger writes that queue at the TCP send level, where
>they can be coalesced.   The inflated congestion window
>means that when congestion does happen (TCP deliberately
>provokes it), the small-write/small-segment application
>will get a larger share of the bottleneck's bandwidth.
>This is perverse behaviour, since the application in
>question is a less efficient bandwidth consumer, since it
>generates more header data per user datum.

Err, if you can turn off Nagle on a per-connection basis, and the
application you describe is being purposely malicious, what's
preventing that application from turning off Nagle and then attempting
the rather antisocial behavior you describe?  A far better solution for
the application writer, if s/he really cares so much about it, is to
write into a buffer, and then send the entire buffer when it's full.
This is what, eg, stdio and bio do.  If nothing else, this will cut
down on operating system overhead incurred from making lots of system
calls, and moving data between user and kernel space, etc, etc, etc.
It seems like a good thing all around, and it really does seem
misguided to have the TCP trying to guess what I'm doing at the
application level.  I (presumably) know what I want my application to
do; I'd rather the OS's network implementation not get in my way.

>The generation of large amounts of small packets should
>always been seen as antisocial.

It seems, then, that certain classes of applications are inherently
antisocial?

	- Dan C.



  reply	other threads:[~2001-11-26 19:11 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-21 23:20 Andrew Simmons
2001-11-26 10:57 ` Sean M. Doran
2001-11-26 19:11   ` Dan Cross [this message]
2001-11-21 23:38 David Gordon Hogan
2001-11-21 23:59 ` Andrew Simmons
2001-11-22  9:57   ` Thomas Bushnell, BSG
2001-11-22 13:24 forsyth
2001-11-22 13:29 ` Boyd Roberts
2001-11-23  9:34 ` Thomas Bushnell, BSG
2001-11-26 19:13   ` Dan Cross
2001-11-23  9:44 forsyth
2001-11-26  9:59 ` Thomas Bushnell, BSG
2001-11-23 11:58 forsyth
2001-11-26 11:07 ` Sean M. Doran
2001-11-26 19:22   ` Dan Cross
2001-11-27 10:16     ` Thomas Bushnell, BSG
2001-11-27 18:55       ` Dan Cross
2001-11-24  3:26 Scott Schwartz
     [not found] <rsc@plan9.bell-labs.com>
2001-11-24  5:32 ` Russ Cox
2001-11-24 20:04   ` Scott Schwartz
2001-11-24 10:48 forsyth
2001-11-26 11:09 nigel
2001-11-26 11:23 Sean M. Doran
2001-11-26 19:28 ` Dan Cross
2001-11-27  8:57   ` Steve Kilbane
2001-11-27 14:39     ` Boyd Roberts
2001-11-27 19:56       ` Steve Kilbane
2001-11-27 22:26         ` Boyd Roberts
2001-11-29 16:55           ` Matt
2001-11-27 10:16   ` Thomas Bushnell, BSG
2001-11-27 18:59     ` Dan Cross
2001-11-26 11:52 Fco.J.Ballesteros
2001-11-26 12:07 Fco.J.Ballesteros
2001-11-27  5:31 David Gordon Hogan
2001-11-27 11:00 forsyth
2001-11-27 11:28 forsyth
2001-11-29 17:33 jmk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200111261911.OAA11962@augusta.math.psu.edu \
    --to=cross@math.psu.edu \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).