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

  1. Just got back from vacation a couple days ago, and have been looking at
  2. your messages about putting text in ACK data fields.  I think this could be
  3. added to the Kermit protocol pretty easily.
  4.  
  5. This discussion can only apply to ACKs in reply to Data packets.  ACKs to S,
  6. I, or A packets have special data, and ACKs to F or X packets may contain
  7. free-form text, normally a filename or heading.  ACKs to Data packets may
  8. contain an X or a Z to request the sender to quit sending the current file, or
  9. the entire group.  Currently, any data other than X or Z as the first
  10. character in the ACK to a Data packet is ignored.  Therefore, as you've
  11. pointed out, adding a new protocol character in this position would not affect
  12. existing Kermits.
  13.  
  14. So let's make the character M for Message, and any following text may be
  15. displayed, or stored in a message box for later perusal, or put into the
  16. transaction log, or any combination of these.  As Joe points out, the text
  17. should be encoded -- that's the rule for all packets except S, I, and A
  18. packets and the ACKs to these packets.
  19.  
  20. About the message length...  The file sender tells the receiver the maximum
  21. length packet it's prepared to receive, so that should also be the limit
  22. (allowing for control fields) on the length of the ACK message.  The same deal
  23. as for E packets, which can also go from receiver to sender.  Joe thinks
  24. messages shouldn't be longer than 40 characters, but that's due to a
  25. peculiarity in MS-DOS Kermit's file transfer screen display, and we shouldn't
  26. hold the world to that.  A good project for somebody (other than Joe, who has
  27. more important things to worry about!) would be to reorganize this display
  28. into separate windows, scrolling regions for debug display, messages,
  29. warnings, etc.  Of course the problem here is that you lose portability to
  30. non-IBM-compatible machines.
  31.  
  32. E packets are always guaranteed to contain a "complete" message, in the
  33. sense that it's the last packet you'll ever get.  Therefore, the data field
  34. contains only the text of the error message.  But now we're allowing for the
  35. possibility of longer, "continued" messages, so should these contain
  36. formatting characters, like CR and LF?  This would allow multiline messages,
  37. even paragraphs to be sent down the "reverse channel".  If so, then a short
  38. one-liner should be terminated with CRLF, which seems wasteful and is
  39. inconsistent with E-packet format.  We could also stipulate that CRLF should
  40. separate lines, but need not terminate the last one...
  41.  
  42. If we carry this idea one step further, we could even have bidirectional
  43. file transfer.  A fairly useless feature, but one which certain commercial
  44. packages love to brag about.  Actually it's useful in certain situations, like
  45. in UUCP or FIDO networks, where computers call each other up late at night and
  46. exchange a day's worth of queued up mail.  
  47.  
  48. This is a really silly idea, but it's worth thinking about for a minute...
  49. If we somehow specify that we're transferring files in both directions at
  50. once, how could this work?  Well, the Send-Init exchange is symmetrical and
  51. does all we want -- both sides tell each other their parameters and features.
  52. With the F-packet and its ACK, each side tells the other the name of the file
  53. that is coming (this is obviously different from the current meaning of a
  54. filename in the F-packet ACK).  And during the data transfer phase, the file
  55. receiver sends its file back in ACK packets with, say, a "D" as the first
  56. character.  The ACKs to the Z and B packets would act just like the Z and B
  57. packets themselves.
  58.  
  59. Pretty screwy, huh?  What about problems?  How would the "sender" be able to
  60. "NAK" bad data from the "receiver"?  No problem, the same way as now.  Just
  61. resend its previous packet.  The only real headache comes from the fact that
  62. the files will not be the same size, and therefore one side finishes sending
  63. before the other.  What if the sender has the bigger file?  Then the receiver
  64. runs out of data to send in its ACKs.  So big deal, it just sends empty ACKs,
  65. and no harm is done.  But what if the receiver has the bigger file?  Well, the
  66. sender finishes with its file and sends a Z packet, but the receiver still has
  67. lots more data to send, but can only send it in ACKs, which make the sender
  68. (who just sent a Z packet) think that the receiver is finished sending too...
  69. But if the ACK to the Z packet had data in it, then the sender, instead of
  70. sending the B packet or the next F packet, could (and this requires a "minor
  71. change" to the protocol) keep on sending Z packets (bumping the packet number
  72. each time to indicate acknowledgement, or failing to bump it if bad data
  73. arrived) until an ACK arrived with no data, and then the sender would send its
  74. B or F packet, and the whole process would terminate (or repeat).
  75.  
  76. If the sender had more files to send than the receiver, again, no problem.  If
  77. the receiver has more files than the sender...  too bad, maybe it should have
  78. been the sender after all.
  79.  
  80. I don't know how I got off on this tangent...  Joe, this sounds like a good
  81. project for one of your students!  Now back to reality.  Are we agreed on the
  82. ACK message business?  I like "M" rather than blank for the message indicator,
  83. because it looks more like a real protocol item, and allows for other
  84. extensions, like the aforementioned "D".  Also, maybe it should be stated
  85. formally somewhere (like in the next edition of the book?) that the ACK to the
  86. F packet may be used to return the name under which the file will be stored.
  87. And shall we allow for imbedded CRLFs in ACK-messages, but not require a CRLF
  88. at the end?
  89.  
  90. By the way, another reason for using "M" is that someone in the UK (Chris
  91. Kennington) once inveigled me into agreeing that there should also be
  92. allowance for messages in the same direction as the data.  After some
  93. discussion, I agreed that a separate packet type was necessary, and called it
  94. "M".  M-packets can be interleaved with data packets.  But, of course, since
  95. it's a new packet type, its use must be negotiated, and capability bit #6
  96. (which overflows into the second capability byte) was assigned for this.
  97. Another item for the second edition...
  98.  
  99. - Frank
  100.