home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / bin / mskermit / msvv90sea.exe / KERMTRUT.TXT < prev    next >
Text File  |  1993-08-29  |  24KB  |  417 lines

  1.         THE TRUTH ABOUT KERMIT FILE TRANSFER PERFORMANCE
  2.  
  3.                 Frank da Cruz
  4.  
  5.  
  6.     Taken from KERMIT NEWS Number 5, July 1993, by R.N. Folsom
  7.  
  8. NOTE: This is a plain-text ASCII rendering of [a file from] the printed journal,
  9. KERMIT NEWS.  The cover [graph comparing the file transfer performance of Kermit
  10. versus Zmodem, Ymodem, and Xmodem], the typesetting effects, illustrations,
  11. special characters, internal cross references, pagination and page numbers, etc,
  12. are lost and/or incorrect.
  13.  
  14. Kermit News (ISSN 0899-9309) is published periodically free of charge by
  15. Kermit Development and Distribution, Columbia University Academic Information
  16. Systems, 612 West 115th Street, New York, NY 10025, USA.  Contributed articles
  17. are welcome.
  18.  
  19. Editor: Christine M. Gianone E-Mail: cmg@columbia.edu, KERMIT@CUVMA.BITNET
  20.  
  21. Copyright (C) 1993, Trustees of Columbia University in the City of New York. 
  22. Material in Kermit News may be quoted or reproduced in other publications
  23. without permission, but with proper attribution.  And if you do, be sure to
  24. send us a copy!
  25.  
  26. The Kermit file transfer protocol is named after Kermit the Frog, star of the
  27. television series The Muppet Show, used by permission of Henson Associates,
  28. Inc.
  29.  
  30.  
  31.  
  32.         THE TRUTH ABOUT KERMIT FILE TRANSFER PERFORMANCE
  33.  
  34.                 Frank da Cruz
  35.  
  36. In the early 1980s, the first generation of Kermit software used the basic
  37. Kermit protocol: stop-and-wait exchange of short packets.  The basic protocol
  38. is easily implemented and highly robust, and led to its rapid proliferation to
  39. hundreds of hardware and software platforms where it proved a success in
  40. transferring files under even the most difficult conditions.
  41.  
  42. The new generation of Kermit software improves on the original robust
  43. qualities and dramatically boosts performance without sacrificing
  44. compatibility with the earlier generation.  Protocol capabilities are
  45. negotiated automatically so the newest, most advanced versions can still
  46. exchange files with the earliest or most minimal versions.
  47.  
  48. Kermit's performance features include long packets, sliding windows,
  49. control-prefixing selection, locking shifts, and compression.  The first three
  50. have the potential for causing problems, and are not used unless you ask for
  51. them.  This article describes Kermit's performance features and tests them
  52. against other popular protocols.  The results might surprise you.
  53.  
  54. LONG PACKETS AND SLIDING WINDOWS
  55.  
  56. The maximum packet length in the basic Kermit protocol is 94, chosen to
  57. prevent data loss when the receiver has small input buffers or lacks an
  58. adequate method of flow control, and also to reduce vulnerability to noise.
  59. But since 1985, Kermit's long-packet extension has allowed packets up to 9024
  60. bytes in length to be used when conditions permit.
  61.  
  62. Longer packets reduce the ratio of protocol overhead to actual data,
  63. increasing the potential file transfer efficiency (the ratio of file
  64. characters transferred per second to the actual connection speed) from 86%
  65. (for 94-byte packets) to 95% (with 2500-byte packets).  When conditions
  66. deteriorate on the connection, the packet length is automatically adjusted.
  67.  
  68. Original, basic Kermit was a stop-and-wait protocol because it had to work on
  69. half-duplex as well as full-duplex connections.  But connections through
  70. satellites or packet-switched networks can have delays that seriously impede
  71. the efficiency of a stop-and-wait packet protocol.  For example, suppose
  72. packets are 90 bytes = 900 bits long, and there is a one-second transmission
  73. delay.  For one packet and its response, the round-trip delay is 2 seconds.
  74. At 300 bits per second (bps), the 3 seconds required to transmit the packet
  75. plus the 2-second delay make 5 seconds, so throughput is 180 bps, 60%
  76. efficiency.  At 9600 bps, it takes only 1/10 second to transmit the same
  77. packet, but the delay is still 2 seconds.  Throughput is only 428 bps, 4.5%
  78. efficiency.  When connections have delays, efficiency can be improved by
  79. lengthening the packets, but only if the connection is clean.  On a noisy
  80. connection, longer packets are more likely to be damaged in transmission and
  81. take longer to retransmit.
  82.  
  83. On full-duplex connections, the new generation of Kermit software (IBM
  84. mainframe Kermit excluded, which always has a half-duplex connection) can
  85. transmit packets in a steady stream, processing the acknowledgements later as
  86. they arrive, thus eliminating the effects of transmission delays, and also
  87. eliminating the overhead of the acknowledgements themselves, since they are
  88. "on the wire" at the same time as the data packets and therefore don't take up
  89. any extra transmission time.  This technique is called sliding windows,
  90. because multiple packets are kept in a buffer (window) that "slides" forward
  91. whenever the oldest packet in the window is acknowledged.
  92.  
  93. Using 94-byte packets without sliding windows on a connection that has a
  94. 1-second delay results (according to actual measurements) in an efficiency of
  95. about 8%.  Raising the packet length to 1500 on the same connection increases
  96. the efficiency to 63%.  Using sliding windows on the same connection raises
  97. the efficiency to 82-90%, depending on the packet length.
  98.  
  99.    ------------------------------------------------------------------------
  100.    Optimum performance can be achieved on any given connection by choosing
  101.    the right combination of packet length and window size.
  102.    ------------------------------------------------------------------------
  103.  
  104. To see a dramatic speed improvement using MS-DOS Kermit 3.13 and/or C-Kermit
  105. 5A, simply give these commands to each Kermit before file transfer:
  106.  
  107.   SET WINDOW 3
  108.   SET RECEIVE PACKET-LENGTH 1000
  109.  
  110. Adjust as necessary.  Longer delays require larger windows; noisier
  111. connections (or devices with small input buffers) need shorter packets.
  112. MS-DOS Kermit 3.13 and most versions of C-Kermit 5A allow the theoretical
  113. maximum sizes, 31 and 9024 respectively, sufficient to overcome any reasonable
  114. delay (for example, between the earth and the moon).
  115.  
  116. COMPRESSION
  117.  
  118. To reduce transmission overhead, the Kermit protocol uses a simple, but often
  119. surprisingly effective, compression technique: repeated byte values are
  120. represented by a count+byte combination.  This technique is easy to program
  121. and inexpensive in memory and CPU cycles, and is therefore implemented in most
  122. Kermit software, including MS-DOS Kermit, C-Kermit, and IBM mainframe Kermit,
  123. and is used automatically when available.
  124.  
  125. Analysis of large volumes of both textual and binary data shows an average
  126. compression of 15-20%.  Dramatic savings are achieved in certain types of
  127. files, including tabular text (or any other type of text with lots of repeated
  128. characters) and executable programs containing large amounts of pre-zeroed
  129. data.
  130.  
  131. PREFIXING
  132.  
  133. To achieve its ability to push data through even the most restrictive types of
  134. connections--for example, to mainframes that are sensitive to certain control
  135. characters, or on 7-bit connections, or on very noisy ones (one user said
  136. recently, "Kermit will send data over a communication channel that is only
  137. slightly better than a pair of tin cans connected with a wet string")--Kermit
  138. formats its packets as lines of printable text.  This is done by encoding each
  139. control character as a sequence of two printable characters and, on 7-bit
  140. connections only, encoding 8-bit characters as a sequence of two printable
  141. 7-bit bytes.
  142.  
  143. On some connections it is safe to transmit certain control characters "bare,"
  144. without prefixing or encoding.  "Unprefixing" of control characters can speed
  145. up the transfer of binary files, particularly precompressed files, which tend
  146. to contain a lot of bytes in the control range.  MS-DOS Kermit 3.13 and
  147. C-Kermit 5A(189) give you the ability to specify which control characters are
  148. to be prefixed and which are not.  In the benchmarks on pages 7 and -SPEEDY,
  149. only three control characters are prefixed:
  150.  
  151.   SET CONTROL UNPREFIXED ALL
  152.   SET CONTROL PREFIXED 0 1 129
  153.  
  154. This technique can be used even if the Kermit program on the other end doesn't
  155. know anything about it, since well-designed Kermit software will, indeed,
  156. accept bare control characters literally.  The three exceptions above are NUL
  157. (0), which is used internally by C-Kermit for string termination, and SOH (1)
  158. and SOH+parity (129), Kermit's normal packet-start indicator.  It takes some
  159. experimentation to find the maximum safe set.  That's why Kermit prefixes all
  160. control characters by default: first make it work, then make it fast.
  161.  
  162. On 8-bit connections, Kermit transfers 8-bit data with no additional overhead.
  163. On 7-bit connections, which are quite common--these are the connections that
  164. use even, odd, mark, or space parity, often without the user's
  165. knowledge--8-bit data is encoded using a single-shift technique, a prefix
  166. character for each byte whose 8th bit is 1, similar to holding down the
  167.  
  168.    ------------------------------------------------------------------------
  169.    The Kermit protocol implementations found in many of the popular
  170.    commercial and shareware PC communication software packages are minimal
  171.    and perfunctory, usually lacking some or all of the performance
  172.    features...
  173.    ------------------------------------------------------------------------
  174.  
  175. Shift key on your keyboard for each 8-bit character.  This allows Kermit to
  176. work where most other protocols fail. The amount of prefixing ranges from 0%
  177. up to 100%, depending on the type of file.
  178.  
  179. LOCKING SHIFTS
  180.  
  181. To avoid the high overhead of transferring 8-bit text, particulary Cyrillic,
  182. Hebrew, or Kanji, on 7-bit connections, a new "locking-shift" feature works
  183. like the Caps Lock key on your PC:  a special shift prefix applies to a entire
  184. run of 8-bit characters, no matter how long, rather than to a single
  185. character.  Locking shifts are used in combination with single shifts to
  186. achieve the most compact encoding.
  187.  
  188. Locking shifts are supported by MS-DOS Kermit 3.13, C-Kermit 5A, and IBM
  189. Mainframe Kermit 4.2.4, and are negotiated automatically when parity is in use
  190. (including when parity is detected automatically).  They reduce the 8th-bit
  191. prefixing penalty anywhere from 0% to 100%, depending on the groupings of the
  192. 8-bit characters within the file.
  193.  
  194. SO WHY THE BAD REPUTATION?
  195.  
  196. The Kermit protocol implementations found in many of the popular commercial
  197. and shareware PC communication software packages are minimal and perfunctory,
  198. usually lacking some or all of the performance features just described.  Many
  199. of these same packages also include XMODEM, YMODEM, or ZMODEM protocol, which
  200. (when they work at all) usually perform better than the basic short-packet,
  201. stop-and-wait, prefix-everything Kermit protocol.  Using a limited Kermit
  202. implementation is like filling your bathtup from a dripping faucet instead of
  203. turning the water on full blast.  It is easy to see why users of such packages
  204. might conclude that Kermit file transfers are slow.  Nothing could be further
  205. from truth; turn the page and see for yourself.
  206.  
  207. TRUE-LIFE BENCHMARKS
  208.  
  209. Table 1 illustrates the performance of the Kermit protocol implementations
  210. found in different PC software packages.  These measurements were made on a
  211. direct 19200-bps serial connection, downloading a typical ASCII text file (the
  212. VM/CMS Kermit-370 manual), 135087 bytes in length, from a Sun SPARCserver-10
  213. with C-Kermit 5A(189) to the hard disk of an IBM PS/2 Model 70.
  214.  
  215. Table 1:  Kermit Implementations Compared
  216. ------------------------------------------------------------------------------
  217.               Window Packet Time Speed
  218. PC Software    Size  Length secs  cps  Effic. Remarks
  219. ------------------------------------------------------------------------------
  220.  Telix           1     94   131   1052   55%  Long packets and s/w not avail
  221.  MTEZ            1     94   119   1158   60%  Long packets and s/w not avail
  222.  Smartcom III    1     94   113   1220   64%  Long packets and s/w not avail
  223.  PROCOMM PLUS   14   1000    77   1790   93%  Window size not selectable
  224.  Zstem 340       2   1000    74   1863   97%  Maximum window size 2
  225.  MS-DOS Kermit   3   1000    72   1915   99%  Full control-character prefixing
  226.  MS-DOS Kermit   3   1000    69   1999  104%  Only 0, 1, and 129 prefixed
  227. ------------------------------------------------------------------------------
  228.  
  229. The results speak for themselves.
  230.  
  231.     If you thought Kermit file transfer was slow, you were probably not
  232.     using real Kermit software!
  233.  
  234. The UNIX-resident copy of the file, like all UNIX text files, uses only
  235. linefeed (LF) for line termination.  During text-mode transfer, each LF
  236. becomes carriage return and linefeed (CRLF).  There are 2814 lines in the
  237. file, so the actual data size during (and after) transfer is 137901.  Since
  238. the connection runs at 1920 characters per second (10 bits per character), a
  239. 100%-efficiency transfer should take 137901 / 1920 = 71.8 seconds.  The
  240. following PC communications software was used:
  241.  
  242.   MS-DOS Kermit 3.13     Columbia University, New York, NY, USA
  243.   MTEZ 1.16              MagicSoft, Inc., Lombard, IL, USA
  244.   PROCOMM PLUS 2.0       Datastorm Technologies, Inc., Columbia, MO, USA
  245.   Smartcom III 1.0A      Hayes Microcomputer Products, Inc, Norcross, GA, US
  246.   Telix 3.21             deltaComm Development, Cary, NC, USA
  247.   Zstem 340 1.0.4        KEA Systems Ltd., Burnaby, BC, Canada
  248.  
  249. KERMIT AND X-Y-ZMODEM
  250.  
  251. XMODEM, YMODEM, and ZMODEM are the file tranfer protocols most commonly
  252. compared with Kermit, and which are found in numerous shareware and commercial
  253. communication software packages.  XMODEM and YMODEM are stop-and-wait
  254. protocols; XMODEM uses short blocks (128 data bytes), YMODEM uses longer ones
  255. (1024 data bytes).  ZMODEM is a streaming protocol.
  256.  
  257. The tables on page 8 compare XMODEM, YMODEM, ZMODEM, and Kermit transfers
  258. between the PC and UNIX.  The file transfer software on the UNIX system is sx
  259. (XMODEM) / sb (YMODEM) / sz (ZMODEM) 3.24 (June 1993) and C-Kermit 5A(189).
  260. On the PC, X-, Y- and ZMODEM transfers were done with Telix and PROCOMM PLUS
  261. (which gave exactly the same results).  For fairness, four types of files are
  262. transferred:
  263.  
  264.   ASCII Text:    IKCKER.DOC 137901 bytes  Our original ASCII text file
  265.   UNIX Binary:   uuencode    24576 bytes  A Sun SPARC binary executable program
  266.   PC Binary:     KERMIT.EXE 197928 bytes  An MS-DOS binary executable program
  267.   Precompressed: KERMIT.ZIP 238584 bytes  A compressed ZIP archive
  268.  
  269. Tests were performed on four types of connections and in each trial, Kermit
  270. transfers used a window size of 5 and a packet length of 5000, and control
  271. prefixing was disabled except for NUL (0), Ctrl-A (1), and 129.  As the tables
  272. show, Kermit outperforms the competition every time.
  273.  
  274. Table 2 shows the figures for transferring all four files with each of the
  275. four protocols on same direct connection used for Table 1.  In this and the
  276. following tables, the secs column shows the elapsed time of transfer in
  277. seconds, the cps column shows actual file characters transferred per second,
  278. and the eff column shows the percent efficiency (file characters per second
  279. divided by the connection speed).
  280.  
  281. Table 2:  X- Y- and ZMODEM vs Kermit on a 19200-bps Direct Connection
  282. ------------------------------------------------------------------------------
  283.               XMODEM          YMODEM          ZMODEM           KERMIT
  284. File Type     secs  cps  eff  secs  cps  eff  secs  cps  eff   secs  cps  eff 
  285. ------------------------------------------------------------------------------
  286. ASCII Text      89 1549  81%    76 1814  95%    73 1889  98%     69 1999 104%
  287. UNIX Binary     15 1638  85%    13 1890  98%    13 1890  98%      9 2648 138%
  288. PC Binary      127 1558  81%   109 1816  95%   107 1850  96%    100 1979 103%
  289. Precompressed  153 1559  81%   133 1794  93%   130 1835  96%    129 1849  96%
  290. -------------------------------------------------------------------------------
  291.  
  292. Table 3 shows the results for a local-call dialup connection using Telebit
  293. T3000 modems, V.32bis modulation (14400 bps), V.42 error correction, V.42bis
  294. compression, RTS/CTS hardware flow control, and an interface speed of 57600
  295. bps.  The efficiencies in this table are based on the modem's 14400-bps
  296. connection speed, and therefore also reflect the modem's compression methods.
  297.  
  298. Table 3:  X- Y- and ZMODEM vs Kermit with High-Speed Modems
  299. ------------------------------------------------------------------------------
  300.               XMODEM          YMODEM          ZMODEM           KERMIT
  301. File Type     secs  cps  eff  secs  cps  eff  secs  cps  eff   secs  cps  eff 
  302. ------------------------------------------------------------------------------
  303. ASCII Text     221  624 43%     79 1746 121%    42 3283 228%     39 3535 246%
  304. UNIX Binary     32  768 53%     13 1890 131%    15 1638 114%      3 8192 569%
  305. PC Binary      346  572 40%    129 1534 106%    83 2385 166%     80 2474 172%
  306. Precompressed  500  477 33%    208 1147  79%   149 1601 111%    148 1612 112%
  307. ------------------------------------------------------------------------------
  308.  
  309. So far we've looked only at connections with no delays.  Table 4 (also see
  310. cover, left group) shows the results for a V.32 9600-bps cross-country dialup
  311. connection from the same PC to a PC/486-50 running UNIX System V R4, with the
  312. same C-Kermit, sx, sb, and sz software as on the Sun.  The round-trip delay is
  313. a fraction of a second.  No error correction or compression is done by the
  314. modems, but the connection is clean and no errors occurred.
  315.  
  316. Table 4:  X- Y- and ZMODEM vs Kermit with Delays at 9600 bps
  317. ------------------------------------------------------------------------------
  318.               XMODEM          YMODEM          ZMODEM           KERMIT
  319. File Type     secs  cps  eff  secs  cps  eff  secs  cps  eff   secs  cps  eff 
  320. ------------------------------------------------------------------------------
  321. ASCII Text     422  327  33%   253  545  57%   217  635  66%    151  913  95%
  322. UNIX Binary     73  337  35%    41  599  62%    32  768  80%      8 3072 320%
  323. PC Binary      536  369  38%   319  620  65%   271  730  76%    207  956  99%
  324. Precompressed  710  336  37%   363  657  68%   314  759  79%    284  840  87%
  325. ------------------------------------------------------------------------------
  326.  
  327. But if we always had clean connections, why would we need error-correcting
  328. file-transfer protocols?  Table 5 (and middle group, cover) shows the results
  329. for the same cross-country connection, same settings, but with short bursts of
  330. noise injected every two seconds, which cause errors and retransmissions in
  331. all four protocols.
  332.  
  333. Table 5:  X- Y- and ZMODEM vs Kermit with Delays and Noise at 9600 bps
  334. ------------------------------------------------------------------------------
  335.               XMODEM          YMODEM          ZMODEM           KERMIT
  336. File Type     secs  cps  eff  secs  cps  eff  secs  cps  eff   secs  cps  eff 
  337. ------------------------------------------------------------------------------
  338. ASCII Text    3346   41   4%  fail    0   0%   438  315  33%    206  669  70%
  339. UNIX Binary    573   43   4%    58  424  44%   144  171  18%      9 2736 284%
  340. PC Binary     5154   42   4%  fail    0   0%   566  350  36%    281  706  74%
  341. Precompressed 5917   40   4%  fail    0   0%   694  344  36%    385  621  65%
  342. ------------------------------------------------------------------------------
  343.  
  344. WHAT ABOUT 7-BIT CONNECTIONS?  NO CONTEST!
  345.  
  346. The foregoing benchmarks were conducted in environments where XMODEM, YMODEM,
  347. and ZMODEM can work, namely 8-bit transparent connections that are not
  348. sensitive to any control characters.  Now let's look a different, but very
  349. common, situation.  Table 6 (and right group, cover) shows the results of
  350. downloading the same files from an IBM Mainframe running VM/CMS and Kermit-370
  351. 4.2.5 to the PS/2 over a 19200-bps serial connection through an IBM 7171
  352. protocol converter, which uses even parity and Xon/Xoff flow control.
  353. Kermit's window size is 1 because the mainframe can operate only in half
  354. duplex, and the packet length is 1920, the largest allowed by the 7171.  All
  355. control characters are prefixed.
  356.  
  357. Table 6:  File Transfer on a 7-Bit Connection
  358. ------------------------------------------------------------------------------
  359.               XMODEM          YMODEM          ZMODEM           KERMIT
  360. File Type     secs  cps  eff  secs  cps  eff  secs  cps  eff   secs  cps  eff 
  361. ------------------------------------------------------------------------------
  362. ASCII Text      -     0   0%    -     0   0%    -     0   0%     81 1702  88%
  363. UNIX Binary     -     0   0%    -     0   0%    -     0   0%      9 2730 142%
  364. PC Binary       -     0   0%    -     0   0%    -     0   0%    162 1221  63%
  365. Precompressed   -     0   0%    -     0   0%    -     0   0%    243  981  51%
  366. ------------------------------------------------------------------------------
  367.  
  368. The table shows Kermit file transfer to be infinitely more efficient than
  369. X-Y-Z-MODEM transfer with IBM mainframes, because X-Y-Z-MODEM implementations
  370. do not work with IBM mainframe operating systems such as VM/CMS, MVS/TSO, or
  371. CICS, whereas Kermit works with all of them.  Of course, 7-bit connections are
  372. not peculiar to IBM mainframes.  They are also used by other types of
  373. mainframes and front ends as well as many types of networks and devices,
  374. including some X.25-based public data networks and certain terminal servers.
  375. You can use Kermit to transfer files on these connections, but not X-Y-Z-MODEM
  376. protocols.
  377.  
  378. LOCKING SHIFTS
  379.  
  380. Although Kermit, unlike X-Y-Z-MODEM, can transfer 8-bit data over 7-bit
  381. connections, there is often a performance penalty.  This penalty is
  382. particularly unfair to people whose written languages are encoded primarily in
  383. 8-bit characters, as are Russian, Hebrew, and Japanese.  Russian text encoded
  384. in any of the commonly used 8-bit Cyrillic character sets typically consists
  385. of about 80%  8-bit characters and Japanese Kanji text often consists of
  386. nearly 100% 8-bit characters.
  387.  
  388. Table 7 shows the results of attempting to upload typical Russian and Japanese
  389. 8-bit text files over a 19200-bps 7-bit serial connection to an IBM mainframe
  390. using X-Y-Z-MODEM (it can't be done), Kermit with only single shifts (SS), and
  391. Kermit with locking shifts (LS).  The Kermit window size is 1 and the packet
  392. length is 1920.  In these cases, locking shifts improve the speed of transfer
  393. 30-40%.
  394.  
  395. Table 7:  Effect of Locking Shifts
  396. -------------------------------------------------------------------------------
  397.                          X-Y-Z-MODEM       KERMIT (SS)       KERMIT (LS)
  398. File Type      Size      secs  cps  eff    secs  cps  eff    secs  cps  eff
  399. -------------------------------------------------------------------------------
  400. Russian Text   52046       -     0   0%      55  946  49%      39 1334  69%
  401. Japanese Text  29706       -     0   0%      34  873  45%      20 1485  77%
  402. -------------------------------------------------------------------------------
  403.  
  404. CONCLUSION
  405.  
  406. Kermit protocol works in practically every communication and computing
  407. environment.  You don't have to be a data communications expert to transfer a
  408. file with Kermit software.  Its first priority is getting your data through
  409. safe and sound, and its second is efficiency.  Kermit's conservative protocol
  410. defaults reflect these priorities:   First make it work, then make it fast.
  411.  
  412. But as the tests show, today's Kermit software, when given several simple
  413. commands to enable its efficiency features, outperforms X-, Y-, and ZMODEM
  414. protocol transfers every time.  And real Kermit software also outperforms the
  415. Kermit protocol implementations found in commercial and shareware
  416. communications programs.  Skeptical?  Run your own tests!
  417.