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

  1. 4.2. Control-Character Unprefixing
  2.  
  3. This feature allows you to improve C-Kermit's file transfer performance on
  4. connections that you know are transparent to certain control characters.  It
  5. lets you tell C-Kermit exactly which control characters need to be prefixed
  6. and encoded, and which ones can be transmitted "bare" when sending files.
  7.  
  8. SET { SEND, RECEIVE } CONTROL-PREFIX <code>
  9.   Sets the control-character prefix which C-Kermit uses to the ASCII character
  10.   represented by the numeric <code>.  The <code> must be in the range 33-63 or
  11.   96-126.  Normally it is 35 (#, number sign).  SEND is the one that C-Kermit
  12.   should use in packets it is sending.  RECEIVE should normally never be used,
  13.   except to override some kind of protocol negotiation foulup with a buggy
  14.   commercial or shareware Kermit implementation.
  15.   Synonym: SET { SEND, RECEIVE } QUOTE.
  16.  
  17. SET CONTROL-CHARACTER UNPREFIXED { <code>..., ALL }
  18.   Says you think it's safe to include the control character represented by
  19.   <code> without prefixing in packets which C-Kermit sends.  The <code> is the
  20.   numeric ASCII code for a control character, 1-31, 127-159, or 255.  For
  21.   example, linefeed (code 10) is normally sent as two printable characters,
  22.   #J.  SET CONTROL UNPREFIXED 10 lets linefeed be sent literally.  Include the
  23.   word ALL to unprefix all control characters (except 0).  Or you can specify
  24.   a list of one or more numeric values, separated by spaces, e.g.:
  25.  
  26.      SET CONTROL UNPREFIXED 2 4 5 18 20
  27.  
  28.   If you can safely declare a lot of control characters to be UNPREFIXED, you
  29.   can send binary files (esp. precompressed ones) up to about 20-25% faster.
  30.   If you include a control character in this category that causes trouble,
  31.   however, the transfer will fail, so experimentation is necessary.  This
  32.   command will not let you "unprefix" the NUL character (0), nor the following
  33.   characters if C-Kermit's current FLOW-CONTROL setting is XON/XOFF: 17, 19,
  34.   145, 147.  Nor can you unprefix character 255 on a TELNET connection (if
  35.   C-Kermit *knows* it's a TELNET connection).
  36.  
  37. SET CONTROL-CHARACTER PREFIXED { <code>..., ALL }
  38.   Says that the given control character(s) must be prefixed in Kermit packets.
  39.   By default, all control characters, 0-31, 127-159, and 255, are prefixed.
  40.  
  41. SHOW CONTROL-PREFIXING
  42.   Displays the current control prefix and a table of all control-character
  43.   values, showing 1 for each one that will be prefixed and 0 for each one that
  44.   will not be prefixed.
  45.  
  46. SET REPEAT PREFIX <code>
  47.   Sets the repeat-count prefix to the ASCII character represented by the
  48.   numeric <code>.  Normally it is 126 (tilde).  The <code> must be in the
  49.   range 33-63 or 96-126.
  50.  
  51. SET REPEAT COUNTS { OFF, ON }
  52.   Turns the repeat-count compression mechanism off and on.  REPEAT COUNTS are
  53.   ON by default.  Turn them OFF in case they cause trouble when used against a
  54.   faulty Kermit implementation in a shareware or commercial communications
  55.   program.  Or when transferring precompressed files (like .ZIP or .Z files),
  56.   since it is very rare to find runs of repeated characters, and disabling the
  57.   repeat-count mechanism frees another character from prefixing, thus
  58.   resulting in slightly more efficient transfers.
  59.  
  60. The purpose of the SET CONTROL UNPREFIX command is to UNILATERALLY configure
  61. C-Kermit to skip prefixing and printable encoding of selected control
  62. characters to achieve higher performance when sending files.  This feature
  63. takes advantage of the fact that most Kermit programs will accept control
  64. characters within packet data-fields literally, provided they get through at
  65. all, and provided they do not have a special meaning to the receiving Kermit
  66. program (such as, in many cases, the packet-start and packet-end characters).
  67.  
  68. There is no protocol negotiation between the two Kermit programs to determine
  69. a "safe set" of control characters, and in fact any such negotiation would be
  70. largely meaningless, because in most cases the two Kermit programs don't have
  71. all the needed information.  For example, there might be a terminal server or
  72. PAD between them that is sensitive to a particular control character, even
  73. though the two Kermit programs are not.
  74.  
  75. If you include in your SET CONTROL UNPREFIXED list one or more control
  76. characters that are unsafe, any of several things might happen:
  77.  
  78.  1. Transfer of any file containing these characters will fail.
  79.  
  80.  2. The receiving Kermit program might be interrupted or halted.
  81.  
  82.  3. Your connection might become hung, stuck, or broken.  For example because
  83.     a control character causes a PAD, terminal server, modem, or similar
  84.     device to go from online mode to command mode.
  85.  
  86. The set of safe control characters depends on the two Kermit programs, their
  87. settings, the host operating systems and their settings, the communication and
  88. flow control methods, and all the devices, drivers, and protocols that lie
  89. between the two Kermit programs.  Therefore, this feature is recommended only
  90. for use on well-known and often-used connections, so the time invested in
  91. finding an optimal unprefixed control-character set will pay off over many
  92. file transfers.
  93.  
  94. <give them a test file to transfer...>
  95.  
  96. You must be willing to experiment in order to achieve the optimal safe set.
  97.  
  98. To send the file to MS-DOS Kermit from either C-Kermit or MS-DOS Kermit,
  99. try the following settings:
  100.  
  101.   SET CONTROL UNPREFIXED ALL ; Turn prefixing off for all but 0
  102.   SET CONTROL PREFIXED 1     ; Turn it back on for packet-start character
  103.   SET CONTROL PREFIXED 129   ; and 8-bit version thereof
  104.  
  105. (HINT: Abbreviate SET CON U and SET CON P)
  106.  
  107. Or to send the file from MS-DOS Kermit to C-Kermit, tell MS-DOS Kermit to:
  108.  
  109.   SET CON U ALL   ; Turn prefixing off for all
  110.   SET CON P 0     ; Turn it back on for NUL
  111.   SET CON P 3     ; and for Ctrl-C
  112.   SET CON P 131   ; as well as Ctrl-C + parity bit
  113.  
  114. NOTE 1: 3 and 131 normally need not be prefixed when sending to C-Kermit
  115. 5A(190) or later, nor to 5A(189) if you have SET TRANSFER CANCELLATION OFF.
  116.  
  117. NOTE 2: 1 and 129 need not be prefixed when sending files *to* C-Kermit, but
  118. must be prefixed when sending files to MS-DOS Kermit.
  119.  
  120. NOTE 3: 13 (carriage return, the customary packet terminator) normally need
  121. not be prefixed when sending files to either C-Kermit or MS-DOS Kermit,
  122. except on a TELNET connection (because TELNET servers are likely to change
  123. CRLF into CR).
  124.  
  125. Try to send the test file in binary mode.  If it works, fine.  If not, try
  126. prefixing some of the other likely control characters (see below).  Once you
  127. find the minimum set of prefixed control characters for the test file, it is
  128. likely they will also work for any other file on the same connection.  Try
  129. sending a large precompressed (e.g. ZIP or .Z or GZIP) file.  And, of course,
  130. for maximum performance, also use a window size greater than 1 (say, 3) and a
  131. packet length of 1000 or more.
  132.  
  133. Under ideal conditions (totally transparent and clean serial connection, no
  134. Xon/Xoff, and C-Kermit has been told to SET TRANSFER CANCELLATION OFF, see
  135. below), the minimum set of control characters that need to be prefixed is:
  136.  
  137.   SENDER          RECEIVER         PREFIXED CONTROLS
  138.    MS-DOS Kermit   MS-DOS Kermit    1 129
  139.    MS-DOS Kermit   C-Kermit         0
  140.    C-Kermit        MS-DOS Kermit    0 1 129
  141.    C-Kermit        C-Kermit         0
  142.  
  143. For example, to set up C-Kermit to unprefix the minimum set of prefixed
  144. control characters for sending files to MS-DOS Kermit, tell C-Kermit to:
  145.  
  146.   SET FLOW NONE            ; Or SET FLOW RTS/CTS
  147.   SET CONTROL UNPREFIX ALL
  148.   SET CONTROL PREFIX 1 129 ; C-Kermit always prefixes character 0
  149.  
  150. When the mininum set doesn't work, consult this list of control characters
  151. that are apt to cause trouble and are therefore likely candidates for
  152. prefixing.  In particular, note that unprefixing of the packet-start character
  153. (normally 1 and 129), can cause problems when sending to C-Kermit if the
  154. communication link (including device input buffers) is noisy or apt to lose
  155. characters.
  156.  
  157. set con p 0   ; Ctrl-@ = NUL, internal string terminator in C-Kermit.
  158.               ;          Also, often discarded as padding.
  159. set con p 1   ; Ctrl-A = Packet-start character.
  160. set con p 3   ; Ctrl-C = Packet breakout for remote-mode C-Kermit,
  161.               ;          packet breakout for server-mode MS-DOS Kermit,
  162.               ;          likely to cause interruptions on other systems.
  163. set con p 13  ; Ctrl-M = Carriage return, packet-end character.
  164.               ;          Always prefix on TELNET connections.
  165. set con p 14  ; Ctrl-N = Shift Out
  166. set con p 15  ; Ctrl-O = Shift In
  167. set con p 16  ; Ctrl-P = Commonly-used X.25/X.3 PAD escape character
  168. set con p 17  ; Ctrl-Q = XON, must be prefixed with Xon/Xoff flow control
  169. set con p 19  ; Ctrl-S = XOFF, must be prefixed with Xon/Xoff flow control
  170. set con p 27  ; Ctrl-[ = ESC, prefix if going through some kind of ANSI device
  171. set con p 28  ; Ctrl-\ = CONNECT-mode escape for C-Kermit
  172. set con p 29  ; Ctrl-] = CONNECT-mode escape for TELNET
  173. set con p 30  ; Ctrl-^ = Cisco terminal server escape.
  174. set con p 127 ; Ctrl-? = DEL, often discarded as padding.
  175.               ;          Also becomes TELNET IAC if parity bit is added.
  176. set con p 128 ; = NUL    + 128 (i.e. NUL + parity bit)
  177. set con p 129 ; = Ctrl-A + 128
  178. set con p 131 ; = Ctrl-C + 128
  179. set con p 141 ; = CR     + 128
  180. set con p 145 ; = XON    + 128
  181. set con p 147 ; = XOFF   + 128
  182. set con p 255 ; 255 = TELNET IAC, must be prefixed on TCP/IP TELNET connections
  183.                 INCLUDING TELNET connections through terminal servers!
  184.  
  185. Note, by the way, that nothing special need be done for SLIP connections,
  186. since the four special SLIP characters are in the G1 printable range:
  187.  
  188.   192 SLIP END character
  189.   219 SLIP ESC character
  190.   220 SLIP END quote
  191.   221 SLIP ESC quote
  192.  
  193. Here is a suggested (conservative) starting point for experimenting with
  194. control-character unprefixing.  Tell the file sender to:
  195.  
  196.   SET CONTROL UNPREFIX ALL
  197.   SET CONTROL PREFIX 0 1 3 13 17 19 127 129 131 141 145 147 255
  198.  
  199. Perhaps some of these can be removed, depending on the connection, and maybe
  200. others need to be added.  If you are going through a terminal server or an
  201. intermediate Kermit or TELNET program, also add the appropriate escape
  202. character values (bare, and plus 128).
  203.  
  204. Kermit will not let you unprefix XON (17), XOFF (19), XON+128 (145), or
  205. XOFF+128 (147) if its FLOW-CONTROL setting is XON/XOFF.  If you want to
  206. unprefix these, make sure *both* Kermits have first been told to SET FLOW
  207. NONE (or RTS/CTS), and that XON/XOFF flow control is not in effect anywhere
  208. along the communication path between the two Kermits.
  209.