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

  1. WHATAMI  -  DRAFT #4
  2.  
  3. Wed Jun 15 15:38:11 1994
  4. Amended: Thu Nov 27 19:32:33 1997
  5.  
  6. Those who are accustomed to using client/server applications such as FTP
  7. expect that certain kinds of commands, when given to the client, will affect
  8. the server correspondingly.  Most notable among these commands (in FTP's case)
  9. are those that set the transfer mode: BINARY, ASCII, TENEX, etc.
  10.  
  11. In Kermit, however, the transfer mode is determined by the file sender, a
  12. concept totally unrelated to the client/server distinction, and
  13. counterintuitive to most people.  Furthermore, Kermit programs do not always
  14. have a client/server relationship -- there is also the send/receive
  15. arrangement.
  16.  
  17. It might be desirable, when two Kermits are indeed client-and-server, for the
  18. CLIENT's file-transfer mode to be used rather than the FILE SENDER's.
  19.  
  20. On the positive side, this would make Kermit more like FTP and, for that
  21. matter, "less astonishing" to most users -- in English, one expects a "server"
  22. to honor the wishes of a "client".  We have had many complaints from users who
  23. put the remote Kermit in server mode, escaped back, told the local Kermit to
  24. "set file type binary", then "get foo.zip", and were rudely surprised to find
  25. the file was transferred in text mode.
  26.  
  27. On the other hand, this would be a change in behavior.  There might be users
  28. who actually depend on the current behavior, e.g. so that files will be sent
  29. to the server in binary mode, but retrieved *from* the server in text mode or
  30. vice versa.
  31.  
  32. On balance, it seems better to make the change -- another case of doing what
  33. the majority of users would expect, rather than catering to a small (perhaps
  34. nonexistent) minority.  Should the minority exist at all, they can still
  35. determine the transfer mode by giving SET FILE TYPE commands to the client.
  36.  
  37. Would it be desirable to extend this notion to the send/receive relationship?
  38. No, it would not.  In that case, there would be no criterion at all for
  39. settling a disagreement.  So in this case, traditional rules should prevail.
  40.  
  41. FEATURES
  42.  
  43. Two settings could be handled by WHATAMI: the file transfer mode (text or
  44. binary) and the filename conversion method (converted [analogous to text] and
  45. literal [analogous to binary]).
  46.  
  47. All other settings are either negotiated or conveyed already, or else they
  48. are not appropriate for this type of treatment (because, for example, there is
  49. no reason that they should always be the same in both Kermits).
  50.  
  51. The WHATAMI information will allow two Kermit programs to tell whether they
  52. have a client/server relationship, and if so, to allow the file transfer mode
  53. and name conversion to be determined by the client rather than the file sender.
  54.  
  55. IMPLEMENTATION
  56.  
  57. The following following fields remain reserved in the initialization string
  58. for Checkpoint/Restart:
  59.  
  60.   CAPAS+4, CHKPNT, 1 byte: WILL (1), WONT (0), DO (2)
  61.   CAPAS+5, CHKINT, 3 bytes: Checkpoint interval
  62.  
  63. In the absence of Checkpoint/Restart capability, these fields should be
  64. filled in as follows:
  65.  
  66.   CHKPNT: "0"      (Character 0 = WONT)
  67.   CHKINT: "___"    (Three underscores)
  68.  
  69. CAPAS+8 will be the WHATAMI field, with room for 6 bits of information.  This
  70. is a binary 6-bit quantity which will be encoded for transmission via tochar()
  71. and decoded after reception via unchar() (functions which add and subtract 32,
  72. respectively).  The items are simple on/off items corresponding to commands
  73. that, in a client-server environment, one would expect to take effect for
  74. subsequent file transfers:
  75.  
  76.   SET FILE TYPE { TEXT, BINARY }
  77.   SET FILE NAMES { CONVERTED, LITERAL }
  78.  
  79. The layout of the (unencoded) WHATAMI field is:
  80.  
  81.     Bit 5    Bit 4          Bit 3       Bit 2    Bit 1    Bit 0
  82.   +--------+--------------+-----------+--------+--------+--------+
  83.   |     1  | CLEARCHANNEL | STREAMING | FNAMES | FMODE  | SERVER |
  84.   +--------+--------------+-----------+--------+--------+--------+
  85.  
  86. where:
  87.  
  88.   Bit 5
  89.     Is set to 1 to indicate that the other bits are to be believed.
  90.     This allows this field to be skipped over in the event it is not
  91.     implemented, but a subsequent field is added.
  92.  
  93.   CLEARCHANNEL:
  94.     Is set to 1 if I know I have a 100% transparent end-to-end
  95.     communications channel (except, possibly, for the 8th bit).
  96.  
  97.   STREAMING:
  98.     Is set to 1 if I know I have a reliable transport (see Streaming spec).
  99.  
  100.   NAMES:
  101.     My SET FILE NAMES setting
  102.       0 = LITERAL (unconverted)
  103.       1 = CONVERTED (normal)
  104.  
  105.   FMODE
  106.     My global file transfer mode (SET FILE TYPE):
  107.       0 = TEXT
  108.       1 = BINARY
  109.  
  110.   SERVER:
  111.       0 = I am not in server mode
  112.       1 = I am in server mode
  113.  
  114. ACTIONS
  115.  
  116. Every Kermit program that implements the WHATAMI feature shall set its WHATAMI
  117. field (as well as the intervening, but as-yet-unused, checkpoint-related
  118. fields) in the initialization string.  This is purely a matter of reporting:
  119. Here's What I Am.
  120.  
  121. Furthermore, all WHATAMI-capable Kermit programs should also send I-packets
  122. at the beginning of each protocol transaction when acting as clients, rather
  123. than only sending them when settings have changed.
  124.  
  125. Kermit programs that implement this feature shall keep a "What Are You"
  126. variable that contains the WHATAMI information most recently received from
  127. the other Kermit.  This variable is initialized to zero at the beginning of
  128. each protocol transaction.
  129.  
  130. When a Kermit program receives an initialization string containing a WHATAMI
  131. field, it saves the value of this string in its "What Are You" variable.
  132. Since Bit 5 of a valid WHATAMI field is always set, this distinguishes the
  133. initial value of zero from any legitimate WHATAMI value.
  134.  
  135. Now, when a Kermit server receives a GET (R) packet, it checks its What Are
  136. You variable, and if Bit 5 is set, then it sets its global file transfer mode
  137. and name conversion according to bits 1 and 2, respectively.  Note that these
  138. global modes can still be overridden on a per-file basis in the normal way;
  139. the server will always respond to REMOTE commands in text mode, no matter what
  140. its global transfer mode; a VMS C-Kermit server will always determine a file's
  141. transfer mode based on its RMS characteristics, etc.
  142.  
  143. That's about it.  When the client gives SEND or MSEND commands, everything
  144. behaves well already, and WHATAMI won't change that.  Ditto for REMOTE
  145. commands.  Other uses can be imagined for WHATAMI (besides as a condiment for
  146. sushi) but they are only frills -- detecting mode mismatches and issuing more
  147. intelligent error messages, etc.  Nothing earthshaking.
  148.  
  149. Finally, here is a sample dialog between two Kermits who have the WHATAMI
  150. feature.  The remote Kermit starts out in server mode and in text mode, the
  151. local Kermit client is in binary mode, seen from the client's point of view:
  152.  
  153.   s-^A5 I~* @-#Y3~^$5$0___FO    F = Names converted, binary mode, client
  154.   r-^A5 Y~* @-#Y3~^$5$0___E^    E = Names converted, text mode, server
  155.   s-^A& Rx.xX                   Client says "get x.x"
  156.   r-^A5 S~* @-#Y3~^$5$0___GZ    G = Names converted, binary mode, server
  157.   s-^A5 Y~* @-#Y3~^$5$0___F_    F = Names converted, binary mode, client
  158.   r-^A(!FX.X+ /
  159.   s-^A(!Yx.x.-N
  160.   r-^AG"A."U1""B8#119940608 21:02:22!!11"98,1/   <--  Note "B8".
  161.   s-^A%"Y.5!
  162.  
  163. etc etc.
  164.  
  165. COMPATIBILITY
  166.  
  167. Let's use the word "smart" to refer to a Kermit program that has WHATAMI
  168. capability, and examine the four possible combinations of client and server:
  169.  
  170.      CLIENT   SERVER
  171.   1. Smart    Smart
  172.   2. Smart    Not
  173.   3. Not      Smart
  174.   4. Not      Not
  175.  
  176. Case 1 behaves in the new way described above.  Cases 3 and 4 behave in the
  177. traditional (pre-smart) manner.  Case 2 is problematic, since the user might
  178. expect local file-type or -naming changes to also be effective at the server,
  179. and they won't be.
  180.  
  181. Let's consider case 2.  When the client receives a reply to its I packet and
  182. finds no WHATAMI info, it can:
  183.  
  184.  1. Issue a warning message to the effect that ... "The server does not
  185.     follow local settings for binary and text file transfers.  If it is not
  186.     in <current-local-mode> mode already, you should interrupt this transfer,
  187.     FINISH the server, put it in <current-local-mode>, and start again."  But:
  188.     (a) this is a big message -- we generally only have room for one-liners
  189.     on the file transfer display screen; (b) many times the message won't be
  190.     necessary because the user already *has* put the server into the right
  191.     mode, and so (c) they will want yet-another-SET-command to disable such
  192.     messages.  And (d) a good proportion of users won't have the slightest
  193.     idea what the message means anyway.
  194.  
  195.  2. Automatically send a REMOTE SET FILE TYPE BINARY command packet.  But this
  196.     might not work either because the server might not support REMOTE SET
  197.     either.  In which case the client can print a warning message and (a)
  198.     proceed with the transfer (which will be wrong if the server is in text
  199.     mode); (b) cancel the transfer with an E packet (which could be wrong if
  200.     the server was in binary mode); or (c) ask the user (which would be wrong
  201.     because it would break lots of scripts).
  202.  
  203. A third possibility would require a new SET command:
  204.  
  205.   SET TRANSFER MATCH-TYPE { ON, OFF }
  206.  
  207. (for want of a better name that is not ridiculously long...) which means:
  208.  
  209.   If I am a client and the other Kermit is a server, and it sends me a file
  210.   in text mode, but I'm in binary mode, or vice versa, then I should cancel
  211.   the transfer with an Error packet.
  212.  
  213. But that's no good either, because if the server is not smart, the client
  214. won't know it's a server, and furthermore, it will do no good anyway if the
  215. server is not using Attribute packets, in which case we won't have a clue
  216. about the transfer mode of the incoming file anyway.
  217.     
  218. So, after considering the possibilities, I think it might be best to let
  219. sleeping dogs lie.  If a GET command fails to transfer in the right mode, we
  220. are no worse off than we were before; if it works right, nobody will be the
  221. wiser about why.  "Keep it simple for the average user" -- our motto.  Let the
  222. experts fend for themselves, as they always have done anyway.
  223.  
  224. In fact, just to be safe, we have always told people to "set file type binary"
  225. (or whatever) on BOTH ends, since we can't rely in every case on the various
  226. forms of automatic transfer-type notification.  If they follow that advice,
  227. they'll be in good shape.  If they don't, the new stuff will tend to help them
  228. out in many cases -- notably the ones where they are running the latest
  229. versions of *our* software.
  230.  
  231. The only change I'd recommend would be to print TEXT or BINARY on the file
  232. transfer screen all caps for emphasis.  They can also see the interruption
  233. instructions down below on the same screen in case they notice that the
  234. transfer mode is not what they wanted.
  235.  
  236. (End of WHATAMI DRAFT)
  237.