home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / protocol / nagle-streaming.txt < prev    next >
Text File  |  2020-01-01  |  6KB  |  123 lines

  1. 12-Nov-97 20:54:18-GMT,5578;000000000001
  2. Return-Path: <jaltman>
  3. Received: (from jaltman@localhost)
  4.     by watsun.cc.columbia.edu (8.8.5/8.8.5) id PAA11570;
  5.     Wed, 12 Nov 1997 15:54:17 -0500 (EST)
  6. Date: Wed, 12 Nov 97 15:54:17 EST
  7. From: Jeffrey Altman <jaltman@watsun.cc.columbia.edu>
  8. Reply-To: jaltman@columbia.edu
  9. To: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  10. Subject: Re: I couldn't help it
  11. In-Reply-To: Your message of Wed, 12 Nov 1997 15:28:48 -0500 (EST)
  12. Cc: jaltman@watsun.cc.columbia.edu
  13. Message-ID: <CMM.0.90.4.879368057.jaltman@watsun.cc.columbia.edu>
  14.  
  15. > Here's a rough draft to start things off.  Don't worry about the negotation,
  16. > just try the stuff at the end....
  17. > STREAMING KERMIT PROTOCOL FOR RELIABLE CONNECTIONS
  18. > Why is FTP faster than Kermit on a TCP/IP connection?  Even when Kermit is
  19. > tuned for top speed, FTP can still be significantly faster.  Much of this is
  20. > caused by the added overhead from going through a Telnet server on the far
  21. > end.  But even when the remote Kermit is set up to listen on its own TCP
  22. > socket to bypass the Telnet server, FTP is still faster.  Why?  Because when
  23. > transferring data, it does not use, and therefore does not wait for,
  24. > acknowledgements.  It relies on TCP and IP to provide a reliable data stream,
  25. > and it uses a second channel for control signaling.
  26. But why, in a sliding window protocol like Kermit, should ACKs slow things
  27. down at all?  
  28. Because of conflicts between the Nagle and Delayed Acknowledgement
  29. Algorithms designed to reduce inefficient network traffic.  The Nagle
  30. algorithm restricts the number of unfilled TCP data segments to one
  31. per connection by refusing to send additional data until an
  32. acknowledgement is received.  The Delayed Acknowledgement algorithm
  33. delays the sending of an ACK hoping that there will be some real data
  34. to piggy back it on.  
  35.  
  36. Kermit ACKs are so short that they always trigger the Nagle algorithm.
  37. That in itself is not a problem.  However, the sending of a Kermit ACK
  38. resets the Delay Ack timer.  Many implementations of TCP/IP, such as
  39. Microsoft Winsock 1.x and 2.0 and SunOS, use a hardwired 200msec timer
  40. regardless of the Round Trip Time of the connection.  While this would
  41. not create a significant issue for connections whose RTT was greater
  42. than 200 msecs it proves to be a major waste of bandwidth when the RTT
  43. is on the order of 1ms or smaller.
  44.  
  45. (I still need to clean this up; show network timings, ...)
  46.  
  47. > One way around this problem is to not send or expect ACKs during the data
  48. > portion of a file transfer when we know the underlying transport is reliable.
  49. > HOW DO WE KNOW WHEN WE HAVE A RELIABLE TRANSPORT?
  50. > The Kermit program that makes the connection knows what the underlying
  51. > transport is, and therefore whether it is reliable.  When it is a TCP
  52. > connection, in most cases it can be considered reliable, since error detection
  53. > and correction are done by TCP, IP, and the layers below.  Similarly for X.25
  54. > and other reliable end-to-end protocols.  A serial connection, on the other
  55. > hand, should never be considered reliable, even when error-correcting modems
  56. > are involved, for all the well-known reasons (lack of effective flow control,
  57. > interrupt conflicts, loose wires, etc).
  58. > The remote Kermit can not usually tell what kind of connection it has, and
  59. > so some means is required to tell it that it has a reliable one.
  60. > This can be done by command, or the information can be conveyed from the 
  61. > local Kermit via protocol.
  62. > In some cases, a reliable transport is not truly reliable; for example, a TCP
  63. > connection to VMS can still lose characters if the remote session has certain
  64. > parameters set, such as TERMINAL /NOTTSYNC /NOHOSTSYNC.  So commands are
  65. > necessary in all cases to let the user have the final say about whether a
  66. > connection is reliable.
  67.  
  68. Another example is Telnet to a terminal server for access to a
  69. outgoing modem.
  70.  
  71. > SUGGESTED PROTOCOL
  72. > When a Kermit program believes it has a reliable connection, it can inform
  73. > the other Kermit program via the WHATAMI mechanism, Bit 3, which is presently
  74. > reserved.  If either Kermit sets this bit, they both can assume they have
  75. > a reliable connection.
  76. > At this point they also need to let each other know they are capable of
  77. > ACKless transfers, and this will require another capability bit, to be chosen
  78. > later.
  79. > Once they have agreed to use ACKless protocol:
  80. >  . The sender does not wait for ACKs to D packets, but keeps sending the
  81. >    file without pause until the end, at which point it sends a Z packet in
  82. >    the normal manner.
  83. >  . The receiver does not send ACKs for D packets, but simply writes incoming
  84. >    data to disk.  The underlying transport handles pacing and flow control
  85. >    automatically.  When the Z packet arrives, the file is closed and the
  86. >    Z packet is acknowledged.
  87. > Implementation in C-Kermit:
  88. >  . Sender: the input() routine in ckcfn2.c examines the sndtyp variable
  89. >    and if it is "D", it marks the packet as ACK'd (see the section at the
  90. >    beginning of the "if (nakstate) { } else part) and then returns immediately
  91. >    a "Y".
  92. >  . Receiver: in <rdata>D state, it simply skips sending the ACK.
  93. >    Well, it calls a special version of ack() that does everything that
  94. >    the real one does EXCEPT send it.
  95. > - Frank
  96.  
  97. - Jeff
  98.  
  99.     Jeffrey Altman * Sr.Software Designer * Kermit-95 for Win32 and OS/2
  100.                  The Kermit Project * Columbia University
  101.        612 West 115th St #716 * New York, NY * 10025 * (212) 854-1344
  102.     http://www.columbia.edu/kermit/k95.html * kermit-support@columbia.edu   
  103.  
  104.  
  105.