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

  1.  6-Jun-94 14:09:32-GMT,3716;000000000001
  2. Received: by watsun.cc.columbia.edu id AA07316
  3.   (5.65c+CU/IDA-1.4.4/HLK); Mon, 6 Jun 1994 10:09:19 -0400
  4. Date: Mon, 6 Jun 94 10:09:19 EDT
  5. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  6. To: Joe Doupnik <JRD@cc.usu.edu>
  7. Subject: Idea
  8. Message-Id: <CMM.0.90.4.770911759.fdc@watsun.cc.columbia.edu>
  9.  
  10. A big problem with Kermit protocol & software is that it can be in so many
  11. different (combinations of) "modes" -- local, remote, client, server, etc etc,
  12. and users are understandably confused about where to give which command under
  13. what conditions -- the sender determines the file type, the receiver
  14. determines the packet length, I can't send a GET or REMOTE or FINISH command
  15. unless the other Kermit is in server mode, etc.
  16.  
  17. I wonder if there are some simple things we can do to alleviate the situation.
  18.  
  19. Suppose the negotiation string included a new field, "What I Am".  It might
  20. contain information like:
  21.  
  22. Local vs Remote mode?
  23.   No, you've got to get this right first before they can communicate at all.
  24.  
  25. Client vs Server mode?
  26.   Yes: I am in server mode; I am not in server mode - 1 bit.
  27.  
  28. Default (global) file transfer mode, text vs binary:
  29.   Yes: 1 bit.
  30.  
  31. Suppose we have two Kermit programs that can do this.
  32.  
  33.  . Client sends a REMOTE, GET, FIN, etc, command to another Kermit that is not
  34.    in server mode.  Remote Kermit is unprepared for an I packet, and so
  35.    responds with an Error packet "Unexpected packet type" (not very
  36.    informative to the untrained user), and worse, the client stays in protocol
  37.    mode because of the (old, obscure) rule that says an E-packet in response
  38.    to an I-packet should be ignored because I-packets are optional items.
  39.    Thus the remote Kermit went back to its prompt and the local Kermit is
  40.    timing out and resending packets to it for several minutes.  Recovering
  41.    from this one would be possible if we allow Kermit in RECEIVE mode to
  42.    accept an I packet, responding with an I-Ack that says "I'm not a server",
  43.    which the client interprets as "Oops, forget it.".
  44.  
  45.  . User tells client to SET FILE TYPE BINARY and then gives a GET command,
  46.    expecting a binary-mode transfer, but the file comes in text mode because
  47.    nobody told the server.  This is a big one, that bites people all the time.
  48.    This way, the server can switch to binary mode automatically before
  49.    starting to send.  Note: We could not use the same mechanism in
  50.    SEND/RECEIVE transfers because in case of disagreement we'd have no
  51.    criterion for deciding which one to believe, other than the current one
  52.    ("the sender's mode takes precedence").
  53.  
  54.  . (think of more...)   
  55.  
  56. Once having exchanged I or S packets, each Kermit knows which mode the other
  57. is in.  If the client knows it's talking to a server and (a) the connection is
  58. still open, and (b) a BYE or FINISH command has not been given, and maybe (c)
  59. a CONNECT command has not been given, the client can act more like a client --
  60. SET commands affecting certain parameters (block check, ...) can take effect
  61. at both ends simultaneously, just like with an FTP client and server.  A
  62. RECEIVE command can give an error message right away.  We could even have a
  63. way to set or change the default destination for commands like DIR, DEL, TYPE,
  64. CD, etc -- to have them take effect locally (as now) or at the server (as in
  65. FTP).
  66.  
  67. This is still a very rough sketch of an idea, but I think it should be pretty
  68. simple to design and implement, and would score big in the "user friendliness"
  69. department.
  70.  
  71. Just background noise while doing real work...  Maybe I'll fool with it in
  72. C-Kermit to see how it feels.  Hopefully (at least at first) no changes in
  73. commands -- just better behavior based on additional behind-the-scenes smarts.
  74.  
  75. - Frank
  76.  
  77.  6-Jun-94 14:29:07-GMT,1047;000000000015
  78. Received: from grumpy.usu.edu by watsun.cc.columbia.edu with SMTP id AA08924
  79.   (5.65c+CU/IDA-1.4.4/HLK for <fdc@watsun.cc.columbia.edu>); Mon, 6 Jun 1994 10:29:01 -0400
  80. Received: from cc.usu.edu by cc.usu.edu (PMDF V4.2-13 #4757) id
  81.  <01HD7RGKJKS0BWFK3U@cc.usu.edu>; Mon, 6 Jun 1994 08:28:48 MDT
  82. Date: Mon, 06 Jun 1994 08:28:48 -0600 (MDT)
  83. From: Joe Doupnik <JRD@cc.usu.edu>
  84. Subject: Re: Idea
  85. To: fdc@watsun.cc.columbia.edu
  86. Message-Id: <01HD7RGKJRDEBWFK3U@cc.usu.edu>
  87. X-Vms-To: IN%"fdc@watsun.cc.columbia.edu"
  88. X-Vms-Cc: JRD
  89. Mime-Version: 1.0
  90. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  91. Content-Transfer-Encoding: 7BIT
  92.  
  93. Frank,
  94.     Yeah! Whatami info swap: long overdue.
  95.     Maybe the I packet, as you suggest, includes mode settings (binary
  96. etc).
  97.  
  98.     Goto: fixed. The old code distinguished line terminators as CR or
  99. LF depending on whether macro or disk file. I've canonized (canonicalized
  100. in American) this stuff to be just CR internally. Maybe that's canoned.
  101.     New msk314.exe to watsun in a couple of minutes so we have something
  102. to test today.
  103.     Joe D.
  104.  
  105.  6-Jun-94 14:35:51-GMT,779;000000000001
  106. Received: by watsun.cc.columbia.edu id AA09525
  107.   (5.65c+CU/IDA-1.4.4/HLK); Mon, 6 Jun 1994 10:35:39 -0400
  108. Date: Mon, 6 Jun 94 10:35:39 EDT
  109. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  110. To: Joe Doupnik <JRD@cc.usu.edu>
  111. Subject: Re: Idea
  112. In-Reply-To: Your message of Mon, 06 Jun 1994 08:28:48 -0600 (MDT)
  113. Message-Id: <CMM.0.90.4.770913339.fdc@watsun.cc.columbia.edu>
  114.  
  115. > Yeah! Whatami info swap: long overdue.
  116. > Maybe the I packet, as you suggest, includes mode settings (binary etc).
  117. Good, then I'll start thinking about it a little more organizedly (?).
  118.  
  119. > Goto: fixed.
  120. >
  121. Great!
  122.  
  123. > The old code distinguished line terminators as CR or
  124. > LF depending on whether macro or disk file. I've canonized (canonicalized
  125. > in American)...
  126. >
  127. Only the Pope can canonize...:-)
  128.  
  129. - Frank
  130.  
  131.  7-Jun-94  0:29:02-GMT,1667;000000000001
  132. Received: by watsun.cc.columbia.edu id AA20684
  133.   (5.65c+CU/IDA-1.4.4/HLK for Frank da Cruz <fdc@watsun.cc.columbia.edu>); Mon, 6 Jun 1994 20:28:53 -0400
  134. Date: Mon, 6 Jun 94 20:28:53 EDT
  135. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  136. To: Joe Doupnik <JRD@cc.usu.edu>
  137. Subject: WHATAMI
  138. Message-Id: <CMM.0.90.4.770948933.fdc@watsun.cc.columbia.edu>
  139.  
  140. (which sounds like a kind of Japanese mustard...)  I've been ruminating
  141. about this on and off today, and so far I can only think of one use for it:
  142. to make Kermit act like FTP.  In this regard, there are only two commands
  143. I can think of that you would give to a Kermit client, which you also wanted
  144. to affect the Kermit server:
  145.  
  146.   SET FILE TYPE { TEXT, BINARY }
  147.  
  148. and:
  149.  
  150.   SET FILE NAMES { CONVERTED, LITERAL }
  151.  
  152. Everything else is either handled already (like block check type, window size,
  153. character set, etc), or is not common to both (like packet length).
  154.  
  155. So, assuming I'm not terminally stupid, I can cobble together a spec for this
  156. in about 5 minutes, and code it in another 20 (after you get backwards GOTO
  157. fixed :-)
  158.  
  159. As a sanity check, I looked at FTP, and as far as I can tell, the only true
  160. "bimodal" command is TYPE.  All the others (like name conversion, etc) are
  161. hacks executed unilaterally by the client.
  162.  
  163. Can you see something big that I missed?
  164.  
  165. - Frank
  166.  
  167. P.S. Btw, a guy named James Huggins at the U of Michigan has written,
  168. for publication, a 40-page mathematical correctness proof of the Kermit
  169. protocol.  (Phew!)  I don't have his permission to distribute it yet, so
  170. don't show it to your students.  It's in ~jrd/kermit.ps on watsun.  (Next,
  171. maybe he'd like to have a crack at the command parser...)
  172.  
  173.  
  174.  7-Jun-94  0:42:37-GMT,1376;000000000015
  175. Received: from grumpy.usu.edu by watsun.cc.columbia.edu with SMTP id AA21279
  176.   (5.65c+CU/IDA-1.4.4/HLK for <fdc@watsun.cc.columbia.edu>); Mon, 6 Jun 1994 20:42:35 -0400
  177. Received: from cc.usu.edu by cc.usu.edu (PMDF V4.2-13 #4757) id
  178.  <01HD8CVGFI80C1BN8J@cc.usu.edu>; Mon, 6 Jun 1994 18:42:18 MDT
  179. Date: Mon, 06 Jun 1994 18:42:18 -0600 (MDT)
  180. From: Joe Doupnik <JRD@cc.usu.edu>
  181. Subject: Re: WHATAMI
  182. To: fdc@watsun.cc.columbia.edu
  183. Message-Id: <01HD8CVGFJ6AC1BN8J@cc.usu.edu>
  184. X-Vms-To: IN%"fdc@watsun.cc.columbia.edu"
  185. X-Vms-Cc: JRD
  186. Mime-Version: 1.0
  187. Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  188. Content-Transfer-Encoding: 7BIT
  189.  
  190. Frank,
  191.     SET FILE TYPE, and maybe the common GET/RECEIVE mixup. I know the
  192. long Server Ready message boggles the minds of mere users, so they tend
  193. to say Send on one side and many times try GET on the other. Certainly
  194. TYPE ranks well above everything else.
  195.     Protocol verification. I wonder if he used the Petri net program
  196. which appeared on News a year or so ago. Clearly, the MSK command parser
  197. would cause it to exhaust memory from excessive numbers of states.
  198.         I added handling of literal  OUT  AT\B  by using triple \, as
  199. in OUT AT\\\B. Bob Babcock needed it and reminded me this afternoon.
  200. I understand that means CK and MSK use the same notation for this.
  201.     Backward jumps in scripts. It's in the works now as a matter
  202. of fact.
  203.         Joe D.
  204.  
  205.  7-Jun-94  1:37:00-GMT,1135;000000000001
  206. Received: by watsun.cc.columbia.edu id AA23378
  207.   (5.65c+CU/IDA-1.4.4/HLK for fdc); Mon, 6 Jun 1994 21:36:44 -0400
  208. Date: Mon, 6 Jun 94 21:36:43 EDT
  209. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  210. To: Joe Doupnik <JRD@cc.usu.edu>
  211. Subject: Re: WHATAMI
  212. In-Reply-To: Your message of Mon, 06 Jun 1994 18:42:18 -0600 (MDT)
  213. Message-Id: <CMM.0.90.4.770953003.fdc@watsun.cc.columbia.edu>
  214.  
  215. > Protocol verification. I wonder if he used the Petri net program
  216. > which appeared on News a year or so ago. Clearly, the MSK command parser
  217. > would cause it to exhaust memory from excessive numbers of states.
  218. >
  219. No, it's something new they've developed at Michigan called Evolving Algebra;
  220. this paper is one of many on the subject to be published in a book
  221. "Specification and Validation Methods".
  222.  
  223. Anyway, I gave it a quick scan (40 pages!) and learned a few things.  For
  224. example, his discussion of sliding windows seemed to contain an error (he said
  225. the maximum window size was 32 rather than 31) -- luckily, before I pointed
  226. out the error to him, I thought about it first, and he's right.  So, hurray,
  227. we get another window slot.  Stupid me.
  228.  
  229. - Frank
  230.  
  231.  7-Jun-94 14:12:26-GMT,1796;000000000005
  232. Received: by watsun.cc.columbia.edu id AA20551
  233.   (5.65c+CU/IDA-1.4.4/HLK for Frank da Cruz <fdc@watsun.cc.columbia.edu>); Tue, 7 Jun 1994 10:12:09 -0400
  234. Date: Tue, 7 Jun 94 10:12:08 EDT
  235. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  236. To: Joe Doupnik <JRD@cc.usu.edu>
  237. Subject: Re: WHATAMI
  238. In-Reply-To: Your message of Mon, 06 Jun 1994 18:42:18 -0600 (MDT)
  239. Message-Id: <CMM.0.90.4.770998328.fdc@watsun.cc.columbia.edu>
  240.  
  241. > ... and maybe the common GET/RECEIVE mixup.  I know the long Server Ready
  242. > message boggles the minds of mere users, so they tend to say Send on one
  243. > side and many times try GET on the other.
  244. >
  245. This is the only one I haven't been able to apply the new scheme to, because
  246. we never reach the point where the two Kermits exchange initialization data.
  247. There are actually two scenarios:
  248.  
  249.  1. User escapes back and says GET, local Kermit sends I.
  250.     Remote, after its DELAY expires, sends S.
  251.     Local gets S and errors out, sends E to other Kermit.
  252.  
  253. When it works this way, it's not so bad.  Just as likely, however:
  254.  
  255.  2. Remote sends S, but user didn't escape back in time to read it.
  256.     Local (having been told to GET) sends I.
  257.     Remote sends E and quits - as it should.
  258.     Local ignores E because of "the rule" and sends the R (GET) packet.
  259.  
  260. But the remote Kermit has already left protocol mode, so the local Kermit
  261. keeps timing out and retransmitting the R packet.
  262.  
  263. It doesn't make sense for Kermit to accept I packets when in SEND mode (as
  264. we did yesterday for RECEIVE mode), because the directionality is wrong --
  265. the sender would have to send an ACK.
  266.  
  267. One possible way out of this would be if the sender retransmitted the S
  268. packet instead of sending an E packet.  This would turn scenario 2 into 1.
  269.  
  270. Maybe I'll play with this later (after long meetings...)
  271.  
  272. - Frank
  273.  
  274.  9-Jun-94  1:50:12-GMT,7652;000000000401
  275. Received: by watsun.cc.columbia.edu id AA12186
  276.   (5.65c+CU/IDA-1.4.4/HLK for fdc); Wed, 8 Jun 1994 21:50:04 -0400
  277. Date: Wed, 8 Jun 94 21:50:00 EDT
  278. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  279. To: Joe Doupnik <JRD@cc.usu.edu>
  280. Subject: WHATAMI
  281. Message-Id: <CMM.0.90.4.771126600.fdc@watsun.cc.columbia.edu>
  282.  
  283. Well, Joe, I've spent most of today thinking about this one, and it's hard to
  284. imagine how to stretch it beyond my original idea.  So here is a scaled-down
  285. and deflated draft spec.  If you have any inspirational thoughts, let me know.
  286. You'll find an implementation in my kermit subdirectory on netlab1; the
  287. changes are small, confined to ckcker.h, ckcfns.c, and ckcpro.w -- just a few
  288. lines of code.  Look for the strings "WHATAMI" and "WM_".
  289.  
  290. - Frank
  291.  
  292. WHATAMI  -  FIRST DRAFT
  293.  
  294. Those who are accustomed to using client/server applications such as FTP
  295. expect that certain kinds of commands, when given to the client, will affect
  296. the server correspingly.  Most notable among these commands (in FTP's case)
  297. are those that set the transfer mode: BINARY, ASCII, TENEX, etc.
  298.  
  299. In Kermit, however, the transfer mode is determined by the file sender, a
  300. concept totally unrelated to the client/server distinction, and
  301. counterintuitive to most people.  Furthermore, Kermit programs do not always
  302. have a client/server relationship -- there is also the send/receive
  303. arrangement.
  304.  
  305. It might be desirable, when two Kermits are indeed client-and-server, for the
  306. CLIENT's file-transfer mode to be used rather than the FILE SENDER's.
  307.  
  308. On the positive side, this would make Kermit more like FTP and, for that
  309. matter, "less astonishing" to most users -- in English, one expects a "server"
  310. to honor the wishes of a "client".  We have had many complaints from users who
  311. put the remote Kermit in server mode, escaped back, told the local Kermit to
  312. "set file type binary", then "get foo.zip", and were rudely surprised to find
  313. the file was transferred in text mode.
  314.  
  315. On the other hand, this would be a change in behavior.  There might be users
  316. who actually depend on the current behavior, e.g. so that files will be sent
  317. to the server in binary mode, but retrieved *from* the server in text mode or
  318. vice versa.
  319.  
  320. On balance, it seems better to make the change -- another case of doing what
  321. the majority of users would expect, rather than catering to a small (perhaps
  322. nonexistent) minority.  Should the minority exist at all, they can still
  323. determine the transfer mode by giving SET FILE TYPE commands to the client.
  324.  
  325. Would it be desirable to extend this notion to the send/receive relationship?
  326. No, it would not.  In that case, there would be no criterion at all for
  327. settling a disagreement.  So in this case, traditional rules should prevail.
  328.  
  329. FEATURES
  330.  
  331. Two settings could be handled by WHATAMI: the file transfer mode (text or
  332. binary) and the filename conversion method (converted [analogous to text] and
  333. literal [analogous to binary]).
  334.  
  335. All other settings are either negotiated or conveyed already, or else they
  336. are not appropriate for this type of treatment (because, for example, there is
  337. no reason that they should always be the same in both Kermits).
  338.  
  339. The WHATAMI information will allow two Kermit programs to tell whether they
  340. have a client/server relationship, and if so, to allow the file transfer mode
  341. and name conversion to be determined by the client rather than the file sender.
  342.  
  343. IMPLEMENTATION
  344.  
  345. The following following fields remain reserved in the initialization string
  346. for Checkpoint/Restart:
  347.  
  348.   CAPAS+4, CHKPNT, 1 byte: WILL (1), WONT (0), DO (2)
  349.   CAPAS+5, CHKINT, 3 bytes: Checkpoint interval
  350.  
  351. In the absence of Checkpoint/Restart capability, these fields should be
  352. filled in as follows:
  353.  
  354.   CHKPNT: "0"      (Character 0 = WONT)
  355.   CHKINT: "___"    (Three underscores)
  356.  
  357. CAPAS+8 will be the WHATAMI field, with room for 6 bits of information.  This
  358. is a binary 6-bit quantity which will be encoded for transmission via tochar()
  359. and decoded after reception via unchar() (functions which add and subtract 32,
  360. respectively).  The items are simple on/off items corresponding to commands
  361. that, in a client-server environment, one would expect to take effect for
  362. subsequent file transfers:
  363.  
  364.   SET FILE TYPE { TEXT, BINARY }
  365.   SET FILE NAMES { CONVERTED, LITERAL }
  366.  
  367. The layout of the (unencoded) WHATAMI field is:
  368.  
  369.     Bit 5    Bit 4      Bit 3      Bit 2    Bit 1    Bit 0
  370.   +--------+----------+----------+--------+--------+--------+
  371.   |     1  | FLAG3    | reserved | FNAMES | FMODE  | SERVER |
  372.   +--------+----------+----------+--------+--------+--------+
  373.  
  374. where:
  375.  
  376.   FLAG3  = 0, meaning that Bit 3 is undefined and should be ignored,
  377.  
  378.   BINARY:
  379.     My global file transfer mode (SET FILE TYPE):
  380.       0 = TEXT
  381.       1 = BINARY
  382.  
  383.   NAMES:
  384.     My SET FILE NAMES setting
  385.       0 = LITERAL (unconverted)
  386.       1 = CONVERTED (normal)
  387.  
  388.   SERVER:
  389.       0 = I am not in server mode
  390.       1 = I am in server mode
  391.  
  392. When we think of a use for Bit3, then we'll set Bit4 to 1 to indicate that
  393. Bit3 contains a value to be used.  (Alternatively, if anybody can think of a
  394. good use for these two bits before we go public with this, we can define them
  395. now.)  Bit 5 is always set to 1; you'll see why in a second.
  396.  
  397. Thus, the valid values for the WHATAMI field are currently @ABCDEFG.
  398.  
  399. ACTIONS
  400.  
  401. Every Kermit program that implements the WHATAMI feature shall set its WHATAMI
  402. field (as well as the intervening, but as-yet-unused, checkpoint-related
  403. fields) in the initialization string.  This is purely a matter of reporting:
  404. Here's What I Am.
  405.  
  406. Kermit programs that implement this feature shall keep a "What Are You"
  407. variable that contains the WHATAMI information most recently received from
  408. the other Kermit.  This variable is initialized to zero at the beginning of
  409. each protocol transaction.
  410.  
  411. When a Kermit program receives an initialization string containing a WHATAMI
  412. field, it saves the value of this string in its "What Are You" variable.
  413. Since Bit 5 of a valid WHATAMI field is always set, this distinguishes the
  414. initial value of zero from any legitimate WHATAMI value.
  415.  
  416. Now, when a Kermit server receives a GET (R) packet, it checks its What Are
  417. You variable, and if Bit 5 is set, then it sets its global file transfer mode
  418. and name conversion according to bits 1 and 2, respectively.  Note that these
  419. global modes can still be overridden on a per-file basis in the normal way;
  420. the server will always respond to REMOTE commands in text mode, no matter what
  421. its global transfer mode; a VMS C-Kermit server will always determine a file's
  422. transfer mode based on its RMS characteristics, etc.
  423.  
  424. That's about it.  When the client gives SEND or MSEND commands, everything
  425. behaves well already, and WHATAMI won't change that.  Ditto for REMOTE
  426. commands.  Other uses can be imagined for WHATAMI (besides as a condiment for
  427. sushi) but they are only frills -- detecting mode mismatches and issuing more
  428. intelligent error messages, etc.  Nothing earthshaking.
  429.  
  430. Finally, here is a sample dialog between two Kermits who have the WHATAMI
  431. feature.  The remote Kermit starts out in server mode and in text mode, the
  432. local Kermit client is in binary mode, seen from the client's point of view:
  433.  
  434.   s-^A5 I~* @-#Y3~^$5$0___FO    F = Names converted, binary mode, client
  435.   r-^A5 Y~* @-#Y3~^$5$0___E^    E = Names converted, text mode, server
  436.   s-^A& Rx.xX                   Client says "get x.x"
  437.   r-^A5 S~* @-#Y3~^$5$0___GZ    G = Names converted, binary mode, server
  438.   s-^A5 Y~* @-#Y3~^$5$0___F_    F = Names converted, binary mode, client
  439.   r-^A(!FX.X+ /
  440.   s-^A(!Yx.x.-N
  441.   r-^AG"A."U1""B8#119940608 21:02:22!!11"98,1/   <--  Note "B8".
  442.   s-^A%"Y.5!
  443.  
  444. etc etc.
  445.  
  446. (End of WHATAMI DRAFT 1)
  447.  
  448.