Synchronet v3.19b-Win32 (install) has been released (Jan-2022).

You can donate to the Synchronet project using PayPal.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ref:ymodem [2011/07/13 21:31] digitalmanref:ymodem [2011/07/13 22:02] (current) digitalman
Line 6: Line 6:
  
 This document was formatted for Wiki syntax by [[person:digital man|Rob Swindell]] on July-13-2011. This document was formatted for Wiki syntax by [[person:digital man|Rob Swindell]] on July-13-2011.
- 
- 
-Please distribute as widely as possible. 
-Questions to [[http://omen.com|Chuck Forsberg]]. 
- 
- 
- 
- 
- 
-                               Omen Technology Inc 
-                          The High Reliability Software 
-                            17505-V Sauvie Island Road 
-                              Portland Oregon 97231 
-                            VOICE: 503-621-3406 :VOICE 
-    Modem (TeleGodzilla): 503-621-3746 Speed 19200(Telebit PEP),2400,1200,300 
-                              CompuServe: 70007,2304 
-                                    GEnie: CAF 
-                        UUCP: ...!tektronix!reed!omen!caf 
- 
  
 ===== Tower of Babel ===== ===== Tower of Babel =====
Line 43: Line 24:
 Jeff Garbers (Crosstalk package development director) said it all: "With Jeff Garbers (Crosstalk package development director) said it all: "With
 protocols in the public domain, anyone who wants to dink around with them protocols in the public domain, anyone who wants to dink around with them
-can go ahead." [1]+can go ahead." ((Page C/12, PC-WEEK July 12, 1987))
  
 Documents containing altered examples derived from YMODEM.DOC have added Documents containing altered examples derived from YMODEM.DOC have added
Line 376: Line 357:
 receiver commands CRC-16. receiver commands CRC-16.
  
-              Figure 1.  XMODEM-1k Blocks+=== Figure 1XMODEM-1k Blocks ===
  
-              SENDER                                  RECEIVER +      SENDER                                  RECEIVER 
-                                                      "s -k foo.bar" +                                              "s -k foo.bar" 
-              "foo.bar open x.x minutes" +      "foo.bar open x.x minutes" 
-                                                      +                                              
-              STX 01 FE Data[1024] CRC CRC +      STX 01 FE Data[1024] CRC CRC 
-                                                      ACK +                                              ACK 
-              STX 02 FD Data[1024] CRC CRC +      STX 02 FD Data[1024] CRC CRC 
-                                                      ACK +                                              ACK 
-              STX 03 FC Data[1000] CPMEOF[24] CRC CRC +      STX 03 FC Data[1000] CPMEOF[24] CRC CRC 
-                                                      ACK +                                              ACK 
-              EOT +      EOT 
-                                                      ACK+                                              ACK
  
-              Figure 2.  Mixed 1024 and 128 byte Blocks+=== Figure 3: Mixed 1024 and 128 byte Blocks ===
  
-              SENDER                                  RECEIVER +      SENDER                                  RECEIVER 
-                                                      "s -k foo.bar" +                                              "s -k foo.bar" 
-              "foo.bar open x.x minutes" +      "foo.bar open x.x minutes" 
-                                                      +                                              
-              STX 01 FE Data[1024] CRC CRC +      STX 01 FE Data[1024] CRC CRC 
-                                                      ACK +                                              ACK 
-              STX 02 FD Data[1024] CRC CRC +      STX 02 FD Data[1024] CRC CRC 
-                                                      ACK +                                              ACK 
-              SOH 03 FC Data[128] CRC CRC +      SOH 03 FC Data[128] CRC CRC 
-                                                      ACK +                                              ACK 
-              SOH 04 FB Data[100] CPMEOF[28] CRC CRC +      SOH 04 FB Data[100] CPMEOF[28] CRC CRC 
-                                                      ACK +                                              ACK 
-              EOT +      EOT 
-                                                      ACK+                                              ACK
  
 ===== YMODEM Batch File Transmission ===== ===== YMODEM Batch File Transmission =====
Line 436: Line 417:
 To maintain upwards compatibility, all unused bytes in block 0 must be set to null. To maintain upwards compatibility, all unused bytes in block 0 must be set to null.
  
-==== Pathname ====+=== Pathname ===
 The pathname (conventionally, the file name) is sent as a null The pathname (conventionally, the file name) is sent as a null
 terminated ASCII string.  This is the filename format used by the terminated ASCII string.  This is the filename format used by the
 handle oriented MSDOS(TM) functions and C library fopen functions. handle oriented MSDOS(TM) functions and C library fopen functions.
 An assembly language example follows: An assembly language example follows:
-                                  DB      'foo.bar',0+    DB      'foo.bar',0
 No spaces are included in the pathname.  Normally only the file name No spaces are included in the pathname.  Normally only the file name
 stem (no directory prefix) is transmitted unless the sender has stem (no directory prefix) is transmitted unless the sender has
Line 447: Line 428:
 (A:, B:, etc.) is not sent. (A:, B:, etc.) is not sent.
  
-=== Filename Considerations ===+== Filename Considerations ==
  
   * File names are forced to lower case unless the sending system supports upper/lower case file names.  This is a convenience for       users of systems (such as Unix) which store filenames in upper and lower case.   * File names are forced to lower case unless the sending system supports upper/lower case file names.  This is a convenience for       users of systems (such as Unix) which store filenames in upper and lower case.
Line 456: Line 437:
   *  If directories are included, they are delimited by /; i.e., "subdir/foo" is acceptable, "subdir\foo" is not.   *  If directories are included, they are delimited by /; i.e., "subdir/foo" is acceptable, "subdir\foo" is not.
  
-==== Length ====+=== Length ===
 The file length and each of the succeeding fields are optional.((Fields may not be skipped.)) The file length and each of the succeeding fields are optional.((Fields may not be skipped.))
 The length field is stored in the block as a decimal string counting The length field is stored in the block as a decimal string counting
Line 470: Line 451:
 any padding added by the sender to fill up the last block. any padding added by the sender to fill up the last block.
  
-==== Modification Date ====+=== Modification Date ===
 The mod date is optional, and the filename and length The mod date is optional, and the filename and length
 may be sent without requiring the mod date to be sent. may be sent without requiring the mod date to be sent.
Line 487: Line 468:
  
  
-==== Mode ====+=== Mode ===
 If the file mode is sent, a single space separates the file mode If the file mode is sent, a single space separates the file mode
 from the modification date.  The file mode is stored as an octal from the modification date.  The file mode is stored as an octal
Line 498: Line 479:
  
  
-==== Serial Number ====+=== Serial Number ===
 If the serial number is sent, a single space separates the If the serial number is sent, a single space separates the
 serial number from the file mode.  The serial number of the serial number from the file mode.  The serial number of the
Line 506: Line 487:
  
  
-==== Other Fields ====+=== Other Fields ===
 YMODEM was designed to allow additional header fields to be YMODEM was designed to allow additional header fields to be
 added as above without creating compatibility problems with older added as above without creating compatibility problems with older
Line 537: Line 518:
 RZSZ.ZOO should answer other questions about YMODEM batch protocol. RZSZ.ZOO should answer other questions about YMODEM batch protocol.
  
-              Figure 3.  YMODEM Batch Transmission Session+=== Figure 3YMODEM Batch Transmission Session ===
  
-              SENDER                                  RECEIVER +      SENDER                                  RECEIVER 
-                                                      "sb foo.*<CR>" +                                              "sb foo.*<CR>" 
-              "sending in batch mode etc." +      "sending in batch mode etc." 
-                                                      C (command:rb) +                                              C (command:rb) 
-              SOH 00 FF foo.c NUL[123] CRC CRC +      SOH 00 FF foo.c NUL[123] CRC CRC 
-                                                      ACK +                                              ACK 
-                                                      +                                              
-              SOH 01 FE Data[128] CRC CRC +      SOH 01 FE Data[128] CRC CRC 
-                                                      ACK +                                              ACK 
-              SOH 03 FC Data[128] CRC CRC +      SOH 03 FC Data[128] CRC CRC 
-                                                      ACK +                                              ACK 
-              SOH 04 FB Data[100] CPMEOF[28] CRC CRC +      SOH 04 FB Data[100] CPMEOF[28] CRC CRC 
-                                                      ACK +                                              ACK 
-              EOT +      EOT 
-                                                      NAK +                                              NAK 
-              EOT +      EOT 
-                                                      ACK +                                              ACK 
-                                                      +                                              
-              SOH 00 FF NUL[128] CRC CRC +      SOH 00 FF NUL[128] CRC CRC 
-                                                      ACK+                                              ACK
  
-            Figure 4.  YMODEM Batch Transmission Session-1k Blocks+=== Figure 4YMODEM Batch Transmission Session-1k Blocks ===
  
-            SENDER                                  RECEIVER +      SENDER                                  RECEIVER 
-                                                    "sb -k foo.*<CR>" +                                              "sb -k foo.*<CR>" 
-            "sending in batch mode etc." +      "sending in batch mode etc." 
-                                                    C (command:rb) +                                              C (command:rb) 
-            SOH 00 FF foo.c NUL[123] CRC CRC +      SOH 00 FF foo.c NUL[123] CRC CRC 
-                                                    ACK +                                              ACK 
-                                                    +                                              
-            STX 02 FD Data[1024] CRC CRC +      STX 02 FD Data[1024] CRC CRC 
-                                                    ACK +                                              ACK 
-            SOH 03 FC Data[128] CRC CRC +      SOH 03 FC Data[128] CRC CRC 
-                                                    ACK +                                              ACK 
-            SOH 04 FB Data[100] CPMEOF[28] CRC CRC +      SOH 04 FB Data[100] CPMEOF[28] CRC CRC 
-                                                    ACK +                                              ACK 
-            EOT +      EOT 
-                                                    NAK +                                              NAK 
-            EOT +      EOT 
-                                                    ACK +                                              ACK 
-                                                    +                                              
-            SOH 00 FF NUL[128] CRC CRC +      SOH 00 FF NUL[128] CRC CRC 
-                                                    ACK+                                              ACK
  
  
  
-           Figure 5.  YMODEM Filename block transmitted by sz+=== Figure 5YMODEM Filename block transmitted by sz === 
 +<code> 
 +      -rw-r--r--  6347 Jun 17 1984 20:34 bbcsched.txt
  
-           -rw-r--r--  6347 Jun 17 1984 20:34 bbcsched.txt +      00 0100FF62 62637363 6865642E 74787400   |...bbcsched.txt.| 
- +      10 36333437 20333331 34373432 35313320   |6347 3314742513 | 
-           00 0100FF62 62637363 6865642E 74787400   |...bbcsched.txt.| +      20 31303036 34340000 00000000 00000000   |100644..........| 
-           10 36333437 20333331 34373432 35313320   |6347 3314742513 | +      30 00000000 00000000 00000000 00000000 
-           20 31303036 34340000 00000000 00000000   |100644..........| +      40 00000000 00000000 00000000 00000000 
-           30 00000000 00000000 00000000 00000000 +      50 00000000 00000000 00000000 00000000 
-           40 00000000 00000000 00000000 00000000 +      60 00000000 00000000 00000000 00000000 
-           50 00000000 00000000 00000000 00000000 +      70 00000000 00000000 00000000 00000000 
-           60 00000000 00000000 00000000 00000000 +      80 000000CA 56 
-           70 00000000 00000000 00000000 00000000 +</code> 
-           80 000000CA 56 +=== Figure 6YMODEM Header Information and Features ====
- +
-                Figure 6.  YMODEM Header Information and Features+
  
     _____________________________________________________________     _____________________________________________________________
Line 658: Line 639:
 recovery. recovery.
  
-            Figure 7.  YMODEM-g Transmission Session+=== Figure 7YMODEM-g Transmission Session ====
  
-            SENDER                                  RECEIVER +      SENDER                                  RECEIVER 
-                                                    "sb foo.*<CR>" +                                              "sb foo.*<CR>" 
-            "sending in batch mode etc..." +      "sending in batch mode etc..." 
-                                                    G (command:rb -g) +                                              G (command:rb -g) 
-            SOH 00 FF foo.c NUL[123] CRC CRC +      SOH 00 FF foo.c NUL[123] CRC CRC 
-                                                    +                                              
-            SOH 01 FE Data[128] CRC CRC +      SOH 01 FE Data[128] CRC CRC 
-            STX 02 FD Data[1024] CRC CRC +      STX 02 FD Data[1024] CRC CRC 
-            SOH 03 FC Data[128] CRC CRC +      SOH 03 FC Data[128] CRC CRC 
-            SOH 04 FB Data[100] CPMEOF[28] CRC CRC +      SOH 04 FB Data[100] CPMEOF[28] CRC CRC 
-            EOT +      EOT 
-                                                    ACK +                                              ACK 
-                                                    +                                              
-            SOH 00 FF NUL[128] CRC CRC+      SOH 00 FF NUL[128] CRC CRC
  
  
Line 691: Line 672:
   <nak> 15H   <nak> 15H
   <can> 18H   <can> 18H
-   +  <C>   43H
----- +
-<C>   43H+
  
  
Line 720: Line 699:
   * The last block sent is no different from others, i.e.  there is no "short block".   * The last block sent is no different from others, i.e.  there is no "short block".
    
-                  Figure 8.  XMODEM Message Block Level Protocol+=== Figure 8XMODEM Message Block Level Protocol ===
  
     Each block of the transfer looks like:     Each block of the transfer looks like:
Line 790: Line 769:
 getting garbaged.  <xx> represents the checksum byte. getting garbaged.  <xx> represents the checksum byte.
  
-                  Figure 9.  Data flow including Error Recovery+=== Figure 9Data flow including Error Recovery ===
  
     SENDER                                  RECEIVER     SENDER                                  RECEIVER
Line 856: Line 835:
 protocol. A description of this handshake is presented in section 10. protocol. A description of this handshake is presented in section 10.
  
-                Figure 10.  Message Block Level Protocol, CRC mode+=== Figure 10Message Block Level Protocol, CRC mode ===
  
     Each block of the transfer in CRC mode looks like:     Each block of the transfer in CRC mode looks like:
Line 881: Line 860:
 block is the coefficient of X^0 in the message polynomial. block is the coefficient of X^0 in the message polynomial.
  
-               Figure 11.  Example of CRC Calculation written in C+===Figure 11Example of CRC Calculation written in C === 
 + 
 +The following XMODEM crc routine is taken from "rbsb.c" Please refer to 
 +the source code for these programs (contained in RZSZ.ZOO) for usage. 
 +fast table driven version is also included in this file.
  
-    The following XMODEM crc routine is taken from "rbsb.c" Please refer to 
-    the source code for these programs (contained in RZSZ.ZOO) for usage.  A 
-    fast table driven version is also included in this file. 
 <code> <code>
     /* update CRC */     /* update CRC */
Line 974: Line 954:
 represents the checksum byte. represents the checksum byte.
  
-          Figure 12.  Data Flow: Receiver has CRC Option, Sender Doesn't+=== Figure 12Data Flow: Receiver has CRC Option, Sender Doesn'===
  
     SENDER                                        RECEIVER     SENDER                                        RECEIVER
Line 1006: Line 986:
 2 CRC bytes. 2 CRC bytes.
  
-               Figure 13.  Receiver and Sender Both have CRC Option+=== Figure 13Receiver and Sender Both have CRC Option ===
  
     SENDER                                       RECEIVER     SENDER                                       RECEIVER
Line 1068: Line 1048:
  
  
-==== REVISIONS ====+===== Revisions =====
  
-  * 10-27-87 Optional fields added for number of files remaining to be sent and total number of bytes remaining to be sent. +=== 10-27-87 === 
-  10-18-87 Flow control discussion added to 1024 byte block descritpion, minor revisions for clarity per user comments. +Optional fields added for number of files remaining to be sent and total number of bytes remaining to be sent. 
-  8-03-87 Revised for clarity. +=== 10-18-87 === 
-  5-31-1987 emphasizes minimum requirements for YMODEM, and updates information on accessing files. +Flow control discussion added to 1024 byte block descritpion, minor revisions for clarity per user comments. 
-  9-11-1986 clarifies nomenclature and some minor points. +=== 8-03-87 === 
-  * The April 15 1986 edition clarifies some points concerning CRC +Revised for clarity. 
-    calculations and spaces in the header.+=== 5-31-1987 === 
 +emphasizes minimum requirements for YMODEM, and updates information on accessing files. 
 +=== 9-11-1986 === 
 +clarifies nomenclature and some minor points. 
 +=== 4-15-1986 === 
 +clarifies some points concerning CRC calculations and spaces in the header.
  
  
Line 1116: Line 1101:
 implement XMODEM, YMODEM, and ZMODEM with state of the art features and implement XMODEM, YMODEM, and ZMODEM with state of the art features and
 reliability. reliability.
- 
- 
-                                 LIST OF FIGURES 
- 
- 
-     Figure 1.  XMODEM-1k Blocks..........................................  11 
- 
-     Figure 2.  Mixed 1024 and 128 byte Blocks............................  11 
- 
-     Figure 3.  YMODEM Batch Transmission Session.........................  15 
- 
-     Figure 4.  YMODEM Batch Transmission Session-1k Blocks...............  15 
- 
-     Figure 5.  YMODEM Filename block transmitted by sz...................  16 
- 
-     Figure 6.  YMODEM Header Information and Features....................  16 
- 
-     Figure 7.  YMODEM-g Transmission Session.............................  17 
- 
-     Figure 8.  XMODEM Message Block Level Protocol.......................  19 
- 
-     Figure 9.  Data flow including Error Recovery........................  20 
- 
-    Figure 10.  Message Block Level Protocol, CRC mode....................  22 
- 
-    Figure 11.  Example of CRC Calculation written in C...................  23 
- 
-    Figure 12.  Data Flow: Receiver has CRC Option, Sender Doesn't........  25 
- 
-    Figure 13.  Receiver and Sender Both have CRC Option..................  26 
- 
  
 ===== See Also ===== ===== See Also =====