home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / MODEMS / MODEM / PROTOCOL.DOC < prev    next >
Text File  |  2000-06-30  |  21KB  |  455 lines

  1.                                 PRIMER
  2.                                   on
  3.                          FILE TRANSFER METHODS
  4.  
  5.                                   by
  6.  
  7.                              Terry Smythe
  8.                            Sysop, Z-Node 40
  9.  
  10. INTRODUCTION
  11.  
  12. From time to time, many of us have had a need to transfer data from our
  13. own micro computer to another micro computer.  The 2 computers might be
  14. close together, or they may be across town or across the nation.  It's
  15. when they are not close together that problems occur because the
  16. telephone system becomes the link between the two computers, rather
  17. than a short piece of shielded wire.
  18.  
  19. This "voice" telephone network is not "clean", and is a major source of
  20. aggravation and heartburn as it far too often adds extraneous
  21. characters commonly referred to as "line noise", to legitimate data as
  22. it moves through the wire.  The net effect is a document, file,
  23. program, etc., that is often made virtually unusable by the involuntary
  24. insertion of these additional characters.
  25.  
  26. The problem has its origin with the historical development, around the
  27. turn of the century, of our nationwide telephone network.  Basically,
  28. solid copper connected telephones across town, across the nation,
  29. across the continent, and it had many mechanically actuated switches
  30. scattered along the way.  These switches and many line connections
  31. eventually wear out, provoking a progressive deterioration of network
  32. efficiency.
  33.  
  34. Many of these switches and much of the wire passes near other
  35. electrical equipment throwing off magnetic fields which adds to
  36. unreliability because of the principle of induced current.  A magnetic
  37. field need only be brought near copper wire to "induce" a foreign
  38. current in it, in addition to legitimate data also passing through it
  39. at the same time.
  40.  
  41. Until the late '40's, early 50's, there was no real concern because the
  42. network carried only "voice" signals.  The combination of the human
  43. ear, coupled to an discerning brain, had the wonderful natural ability
  44. to filter intelligent conversation.  What remained was simply thought
  45. of as "static", and largely ignored.
  46.  
  47.  
  48. CURRENT SITUATION
  49.  
  50. These "voice" telephone circuits are still a major highway over which a
  51. huge amount of computerized data now flows.  Unfortunately, computers
  52. still lack the smarts inherent within a typical human brain, and have
  53. great difficulty sorting out the good from the bad in what is passing
  54. through the wire.  The ability to ignore the junk along the way is
  55. still an elusive goal.
  56.  
  57. True, networks have been made much more reliable in recent years, with
  58. the development and implementation of microwave networks, fibre optics,
  59. electronic switches, etc.  Each in their own way contributing in some
  60. significant way to reducing the amount of "noise" passing through the
  61. network.
  62.  
  63. Today, the network is no longer solid copper wire.  It is more likely a
  64. mix of solid copper wire, microwave transmission, and fibre optics.
  65. However, even in a contemporary system there are still elements of the
  66. old copper network with its increasingly unreliable mechanical
  67. switches, deteriorating connections, etc.
  68.  
  69. The bottom line is that network quality is really a function of the
  70. weakest link between 2 points.  If your computer is connected into a
  71. computerized electronic switch you will enjoy relatively clean data
  72. transmission if you are connected to another computer which itself is
  73. connected into a computer switch, possibly the same one in the
  74. telephone company's local switching centre.
  75.  
  76. However, if one of the computers is still hooked into an older
  77. mechanically switched centre, significant line noise is inevitable.
  78. Curiously, it can make itself known at one end, and not the other;
  79. where one user can be looking at an incredibly scrambled screen
  80. display, while the other user is looking at a spotless screen display,
  81. wondering what's going on.
  82.  
  83. The net result here is a high probability that when data is sent
  84. through the wire in an uncontrolled single trip fashion, it will pick
  85. up line noise somewhere along the way.  In the case of conventional
  86. ASCII data (plain, readable text), the presence of a few extraneous
  87. characters is of no great consequence, relatively easy to detect, and
  88. fix with your favorite word processor or full screen editor.
  89.  
  90. However, in the case of computer programs, the presence of a single
  91. extraneous character can make it totally unuseable.  Detection is
  92. almost impossible, certainly for the neophyte, and patching the fix is
  93. not a trivial task.  A considerable array of computer smarts is needed
  94. here, something that most users neither have nor want.
  95.  
  96.  
  97. ERROR DETECTION
  98.  
  99. In the eyes (brain?) of the computer, characters introduced by line
  100. noise are every bit as legitimate as live data passing through
  101. simultaneously.  It would take extraordinary programming talent to
  102. develop a communications system capable of sorting out the good from
  103. the bad as it streams by.  The task is mind boggling, such that it
  104. simply is not done.
  105.  
  106. However, error detection methods have been developed, are in place now,
  107. and are quite effective and reliable.  Fundamentally, they are all
  108. based upon the perception that if errors have been introduced enroute,
  109. then the file as received will be different from the file as
  110. transmitted.  They do not really care what the specific error is, only
  111. that an error of some kind has been detected.
  112.  
  113. Most of these error detection methods are based upon some simple
  114. arithmetic formulae applied to the same file at both ends, and the
  115. results compared.  If the file as received has the same result as the
  116. file when sent, then it's reasonable to assume that the file has been
  117. transferred correctly.  If different, then the file must be sent
  118. through again, and again, until it does come through the wire clean and
  119. correct.
  120.  
  121. Doing such a calculation on an entire file is very inefficient. You
  122. really should not have to find out after an hour's transmission that
  123. errors have crept in.  At this rate, it could take days to send a large
  124. file through the wire accurately.
  125.  
  126. The simple fix is to break up the file into small blocks, typically 128
  127. bytes long.  This way, only those blocks where an error has been
  128. detected, need be re-transmitted again.  So, a file of say 1500 blocks
  129. might take about an hour to transmit cleanly.  Even on a noisy line, a
  130. maximum number of bad blocks likely would not exceed 30-50.  In this
  131. way, that portion of the file needing to be re-transmitted is reduced
  132. to a manageable level.
  133.  
  134.  
  135. ERROR DETECTION METHODS
  136.  
  137. In August 1977, Ward Christensen, a pioneer in data communications,
  138. developed a method of file transmission with simultaneous error
  139. detection.  He simply called it MODEM2 (Release 2.0), but very quickly
  140. it became affectionately known as the "Christensen" protocol.
  141.  
  142. In its simplest form, this original, somewhat primitive error detection
  143. scheme added up the values of all characters in the 128 byte data
  144. stream, and sent this value through the wire.  The receiver meanwhile
  145. was adding up the values of the characters as they arrived, and
  146. compared the result with the "CHECKSUM" value sent through by the
  147. sender.
  148.  
  149. If these 2 numbers did not agree, the receiver sent through a code
  150. telling the sender to repeat the transmission of that bad block.  This
  151. process was repeated, if necessary, up to 10 times for a particular bad
  152. block.  Only when the 2 numbers were identical, did the receiver send
  153. through a code acknowledging correct block received.  The sender would
  154. then move on to the next block of 128 characters, repeating the process
  155. all over again.
  156.  
  157. This early method of error detection was deliberately made super-
  158. simple, so that it could apply to a whole host of different machines,
  159. under an almost infinite array of data transmission conditions.
  160. However, because of its simplicity, it did let a few technically
  161. obscure errors sneak through.  Consequently, Ward Christensen and Chuck
  162. Forsberg collaborated in the development, and release in 1982, of the
  163. CRC (Cylic Redundancy Checking) error detection scheme which has
  164. remained in widespread use to this day.
  165.  
  166. Because it guarantees a minimum level of error detection confidence of
  167. not less than 99.9969%, CRC is accepted as a reliable method of
  168. ensuring clean and accurate file transfer.  Most systems of file
  169. transfer now employ CRC, or a derivative of it, as their principal
  170. method of error detection.  Please note this is error detection, not
  171. error correction, a function still best left to human intelligence.
  172.  
  173. Uncertain how or when, but this protocol became universally known as
  174. XMODEM.  The original CheckSum method was never abandoned, and to
  175. distinguish between them, they are universally known as:
  176.  
  177.      XMODEM     - CheckSum protocol
  178.  
  179.      XMODEM CRC - CRC protocol
  180.  
  181. Where the CheckSum method simply added up the values of the characters
  182. in a 128 character block, the CRC method does sequential division on
  183. each character in the block, resulting in a significant improvement in
  184. error detection.  Looks something like this:
  185.  
  186.                     Discard Quotient
  187.           _____________________________________
  188. Constant )    Character
  189.  
  190.           Constant x Quotient
  191.           --------------------------------
  192.           Remainder + next character
  193.  
  194.              Constant x Quotient
  195.              ---------------------------------
  196.              Remainder + next character
  197.  
  198.                  etc
  199.  
  200.                  Constant x Quotient
  201.                  ----------------------------------
  202.                   Remainder       <-- CRC Value
  203.  
  204.      Note: Constant = (X+1)(X15+X+1)
  205.  
  206. When there are no more characters for sequential division, the final
  207. remainder is the CRC value sent through by the sender.  The receiver
  208. applies the same calculation to the incoming characters, and compares
  209. the results with the incoming CRC value.   If equal, the block is
  210. acknowledged and the next block is allowed to come through.  Inequality
  211. would require re-transmission of the block, to a maximum of 10 times.
  212. If still unequal after 10 tries, the transmission will be automatically
  213. terminated.
  214.  
  215.  
  216. ENHANCED FILE TRANSFER METHODS
  217.  
  218. With normal equipment upgrades, such as microwave and fibre optics,
  219. telephone companies around the world have progressively improved their
  220. abilities to transfer data more reliably over voice grade lines.  As
  221. line quality improves, line "noise" decreases, and data files may be
  222. successfully transferred with fewer "hits".   In fact, it is
  223. commonplace today to experience file transfers with no "hits" at all.
  224.  
  225. This improvement in data transmission capability provoked a realization
  226. that the 128 character block size had become inefficient because of its
  227. associated overhead.  Furthermore, new methods of data transmission,
  228. such as DATAPAC, resulted in dramatically inefficient use of the
  229. telephone network. (e.g. a DATAPAC "packet" capable of carrying 1024
  230. characters was carrying only 128 characters!)
  231.  
  232. To overcome this inefficiency, Chuck Forsberg developed the YMODEM
  233. protocol, where the block size was increased to 1024 characters.  In
  234. it, he inserted a rather nifty feature where the protocol would
  235. automatically step down to 128 character block size if line noise got
  236. so bad as to degrade elapsed file transmission time.  This auto step-
  237. down has been universally adopted at 3 consecutive "hits" (bad blocks).
  238.  
  239. The YMODEM protocol has only a modest improvement in elapsed file
  240. transmission time over the conventional voice network.  However, it
  241. provided a dramatic improvement on the DATAPAC network by simply using
  242. the packet size more efficiently.
  243.  
  244. Not satisfied with this improvement, Chuck Forsberg continued with his
  245. development activities and came up with YMODEM BATCH.  This allowed
  246. rapid transmission of a group of files sequentially, to reduce the
  247. overhead associated with keyboard entries to set up the communications
  248. programs at both ends with the transfer of each file.
  249.  
  250. While YMODEM is referred to as a protocol, it really is a "method" of
  251. file transfer.  The CRC protocol is still in use at its heart, no
  252. matter if in 128 or 1024 character block size.
  253.  
  254. Ever vigilant to technological developments, Chuck continued to
  255. perceive opportunities for further improvements and has recently
  256. developed and released to public domain a new file transfer protocol
  257. which he calls ZMODEM.  It is a new, sophisticated protocol aimed at
  258. efficient file transfer with time sharing systems, satellite relays,
  259. and wide area packet switching networks.
  260.  
  261. ZMODEM will work only if both ends support this new protocol, but it
  262. has built into it a fall-back routine whereby it will automatically
  263. fall-back to YMODEM protocol, if ZMODEM is not supported at the other
  264. end.   It uses a "streaming" technique whereby data is flowing
  265. continuously, with simultaneous error detection in a moving window of
  266. up to 256 characters, depending on line quality, using the capabilities
  267. of the full duplex network.
  268.  
  269. This is an oversimplified description of ZMODEM.  It is quite
  270. sophisticated, complex to learn and use, and not yet in widespread use.
  271. No attempt will be made here to describe this in anything other than
  272. this crude overview.  Those interested otherwise are encouraged to read
  273. Chuck Forsberg's paper on his ZMODEM protocol (ZMODEM.DOC).
  274.  
  275. There are other protocols, some somewhat obscure, some very complex,
  276. and some proprietory.  For example, KERMIT, MNP, BLAST, BISYNC, SDLC,
  277. HDLC, X.25, X.PC, etc., which, with perhaps the exception of Kermit,
  278. are not in widespread use, tend to be tightly bound to the fortunes of
  279. their suppliers, and which the average users will not likely encounter.
  280. Suffice to note their presence so those interested may do additional
  281. research.
  282.  
  283.  
  284. BAUD RATES
  285.  
  286. While not normally a function of file transfer methods, it does seem
  287. appropriate to briefly consider the speed at which data flows through
  288. the telephone wire.  BAUD is simply an international unit of
  289. measurement that has become synonymous with BPS (Bits Per Second).  The
  290. latter has come into popular useage, and tends to be a much more
  291. meaningful term.
  292.  
  293. Most users will encounter modem/computer/communications system
  294. configurations using baud rates of 300 BPS, 1200 BPS, and 2400 BPS.
  295. Lower or higher baud rates are still extremely rare.  By a huge margin,
  296. the most popular is 1200 Bits Per Second, and is the one most
  297. frequently recommended, and at modest cost.  300 baud configurations
  298. should be avoided for they deliver data through the wire at painfully
  299. slow speeds.  In fact, 300 baud becomes cost prohibitive if employed
  300. over long distances.
  301.  
  302. By way of comparison of how long it may take to transfer a file over
  303. the wire at various baud rates, consider the following example of a
  304. typical file taking 24 minutes to pass through the wire at 300 baud:
  305.  
  306.      File transferred at 300 baud  - 24 minutes
  307.  
  308.      Same file at 1200 baud        -  6 minutes
  309.  
  310.      Same file at 2400 baud        -  3 minutes
  311.  
  312. Modems capable of transferring files at baud rates higher than 2400 are
  313. available, but they are complex, expensive, and typically require the
  314. identical modem at both ends, because of the absence to date of
  315. consistent universal standards of methods of file transfer at 4800 and
  316. 9600 baud.  These standards will ultimately emerge, but for the
  317. present, most users will likely choose to stay with proven techniques
  318. at baud rates of 2400 or 1200.
  319.  
  320. COMMUNICATIONS TOOLS
  321.  
  322. There is no shortage of software out there to achieve reliable data
  323. communications, using these protocols.  It ranges from costly dedicated
  324. utilities, such as for AES equipment, to low cost generic systems
  325. placed into the world of "ShareWare" software.  A few of the more
  326. prominent of these ShareWare products are:
  327.  
  328. PROCOMM v. 2.42 - Excellent,  supports all protocols
  329.                   but ZMODEM
  330.  
  331. QMODEM v 2.4    - Very good, supports most protocols.
  332.  
  333. ZCOMM v 2.0     - Excellent,  but complex.  Supports
  334.                   all protocols discussed here.
  335.  
  336. These are good, and they are cheap.  As with most ShareWare software
  337. products, prices in the $40 - $60 (U.S.) range are commonplace.  There
  338. are others, too many to discuss here.  See them out, do your homework,
  339. choose that which suits you best.
  340.  
  341.  
  342. SUMMARY
  343.  
  344. Most users will be presented with the following optional methods of
  345. transfering files from one micro-computer to another:
  346.  
  347. 1. ASCII
  348.  
  349.    Straight one way trip of data without any form of error detection in
  350.    place.  Highly vulnerable to data corruction by normal line noise
  351.    adding extraneous characters to the file.
  352.  
  353. 2. XMODEM
  354.  
  355.    Very early method of file transfer, using primitive CheckSum
  356.    protocol, at a fixed 128 character block size.  Risk of a few
  357.    obscure errors slipping through.
  358.  
  359. 3. XMODEM CRC
  360.  
  361.    Reliable method of file transfer using the CRC protocol at a fixed
  362.    128 character block size.  Not very efficient, but highly compatible
  363.    with most communications systems.
  364.  
  365. 4. YMODEM
  366.  
  367.    Reliable method of file transfer using the CRC protocol at both 128
  368.    and 1024 character size blocks.  Reasonably efficient, and
  369.    reasonably compatible with many communications systems.
  370.  
  371. 5. YMODEM BATCH
  372.  
  373.    Reliable method of file transfer using the CRC protocol at both 128
  374.    and 1024 character size blocks, with an added option of sending a
  375.    number of files in Batch mode.  Quite efficient, and marginally
  376.    compatible with a few communications systems.
  377.  
  378. 6. ZMODEM
  379.  
  380.    Sophisticated, reliable, and efficient method of file transfer,
  381.    using a modified CRC protocol of up to 256 character block size with
  382.    auto step-down in accordance with line quality.  Marginally
  383.    compatibility with very few communications systems.  Currently
  384.    rarely found.
  385.  
  386.  
  387. TYPICAL APPLICATIONS
  388.  
  389. 1. Generic public domain software may be reliably transferred between 2
  390.    computers having incompatible disk formats.  If the 2 computers are
  391.    together in the same room, they may simply be connected together
  392.    through their serial ports, then 2 compatible communications systems
  393.    may then facilitate file transfer between the 2 at very high speeds
  394.    (baud rates).  Over distance, the same can be achieved with modems
  395.    at both ends, and "talking" over the voice telephone network at much
  396.    lower baud rates.  The CRC protocol virtually guarantees accurate
  397.    transfer.
  398.  
  399. 2. Text files, saved in ASCII form, may be transferred over the
  400.    telephone wires to most any location.  Typical application  might be
  401.    the content of a magazine article, or a book, where the author
  402.    finalizes content as to language and spelling, etc., and transmits
  403.    it to a printer.  While faithfully preserving content, the printer
  404.    sets it up as to publication format, type style, etc., and can go
  405.    directly to press.  A "proof" copy is not sent back to the author
  406.    for proofreading.  The CRC  protocol virtually guarantees error free
  407.    transfer, where ASCII would be a disaster.
  408.  
  409. 3. Business data, such as accounting, inventory, sales, etc.,  may be
  410.    reliably transferred, using the CRC protocol from a remote site, to
  411.    a central computer for consolidated processing.  Also possible to
  412.    set up this kind of file transfer as an automatic interrogation
  413.    during the middle of the night when rates are lowest.
  414.  
  415.  
  416. CONCLUSIONS
  417.  
  418. There was a time (not so long ago) where it was considered quite
  419. inapproriate to use a computer to send files through the voice
  420. telephone network.  Between an absence of standards on file transfer
  421. protocols and line noise, received files were rendered almost totally
  422. useless.
  423.  
  424. However, this is no longer true.  Reliable file transfer protocols are
  425. now in place, and files may now be transferred between micro-computers
  426. with a high degree of reliability.
  427.  
  428. While this may mean reduced revenues for some industries, in particular
  429. the publishing industry where transcriptions (and related revenues) can
  430. now be a thing of the past, business and industry can look forward to
  431. substantial improvements in staff productivity and significant
  432. reductions in publishing costs, by the application of the "type-it-
  433. once" principle.
  434.  
  435. In these tight money times, now is the time for business and industry
  436. to be creative in their use of micro-computers and data communications
  437. capability.
  438.  
  439. Were it not for the vision and foresight of Ward Christensen and Chuck
  440. Forsberg, and others like them, these wonderful tools would be denied
  441. to us, and companion benefits unattainable.   What they have done is
  442. indeed very much appreciated today.  They are to be commended for their
  443. achievements.
  444.  
  445.  
  446. Terry Smythe
  447. Sysop, Z-Node 40
  448. 55 Rowand Ave
  449. Winnipeg, Manitoba
  450. Canada   R3J 2N6
  451. (204) 832-3982 (Voice-res)
  452. (204) 832-4593 (Z-Node)
  453. (204) 945-6713
  454. 15 Apr 87
  455.