fb0d4962   
   From: rick.jones2@hp.com   
      
   David Schwartz wrote:   
   > When you call 'send', make sure to send *all* the data that needs to   
   > be sent at this point in the protocol (or at least 2KB, ideally   
   > 4KB).   
      
   Indeed, trying to send all logically associated data at the same time   
   is goodness.   
      
   As magic numbers go, 2KB and 4KB are fine, but Nagle keys off of the   
   MSS, so while 99 times out of 10 across a "real" network 2KB and 4KB   
   will be larger than the MSS, that 100th time out of 10 when the   
   connection is over loopback, or the network is configured for   
   JumboFrames, they will still be less than the MSS.   
      
   > Otherwise, you are forcing the protocol layer to try to guess what   
   > to do. When it sees the first send, it has no idea the second send   
   > is coming and its best guess is to send the data immediately. When   
   > it sees the second send, it has no idea there isn't a third send   
   > coming right after it, so it best guess is to wait .2 seconds in   
   > hopes of being able to combine data.   
      
   The sending side is not waiting .2 seconds - not explicitly   
   anyway. Putting it that way makes it sound like there is an explicit   
   coalescing timer, and to the best of my knowledge, there are no such   
   timers in TCP stacks. It is waiting for more data to send to get to   
   an MSS-worth, or for the outstanding data to be ACKnowledged. The   
   only timer going in the sender at that point is the retransmission   
   timer, which was started on the first send. It is though used as a   
   "catch all" and the data of the second send may be included when data   
   of the first is retransmitted (if there is room in the segment).   
      
   (I should go update my boilerplate to mention the retransmission timer)   
      
   And before the Nagle algorithm was added to TCP, TCP did what it does   
   today when TCP_NODELAY is set - it would simply send whatever data the   
   user gave it, as it was given.   
      
   --   
   The computing industry isn't as much a game of "Follow The Leader" as   
   it is one of "Ring Around the Rosy" or perhaps "Duck Duck Goose."   
    - Rick Jones   
   these opinions are mine, all mine; HP might not want them anyway... :)   
   feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|