Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| ref:ymodem [2011/07/13 21:31] – digitalman | ref:ymodem [2011/07/13 22:02] (current) – digitalman | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| This document was formatted for Wiki syntax by [[person: | This document was formatted for Wiki syntax by [[person: | ||
| - | |||
| - | |||
| - | Please distribute as widely as possible. | ||
| - | Questions to [[http:// | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | Omen Technology Inc | ||
| - | The High Reliability Software | ||
| - | 17505-V Sauvie Island Road | ||
| - | Portland Oregon 97231 | ||
| - | VOICE: 503-621-3406 :VOICE | ||
| - | Modem (TeleGodzilla): | ||
| - | 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." | + | can go ahead." |
| 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 |
| - | | + | |
| - | "s -k foo.bar" | + | "s -k foo.bar" |
| - | " | + | " |
| - | C | + | C |
| - | 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 |
| - | | + | |
| - | "s -k foo.bar" | + | "s -k foo.bar" |
| - | " | + | " |
| - | C | + | C |
| - | 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, | To maintain upwards compatibility, | ||
| - | ==== Pathname | + | === Pathname === |
| The pathname (conventionally, | The pathname (conventionally, | ||
| terminated ASCII string. | terminated ASCII string. | ||
| 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: | ||
| - | | + | |
| No spaces are included in the pathname. | No spaces are included in the pathname. | ||
| 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. | * File names are forced to lower case unless the sending system supports upper/lower case file names. | ||
| Line 456: | Line 437: | ||
| * If directories are included, they are delimited by /; i.e., " | * If directories are included, they are delimited by /; i.e., " | ||
| - | ==== 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 |
| - | | + | |
| - | "sb foo.*< | + | "sb foo.*< |
| - | " | + | " |
| - | C (command: | + | C (command: |
| - | SOH 00 FF foo.c NUL[123] CRC CRC | + | SOH 00 FF foo.c NUL[123] CRC CRC |
| - | ACK | + | ACK |
| - | C | + | C |
| - | 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 |
| - | C | + | C |
| - | SOH 00 FF NUL[128] CRC CRC | + | SOH 00 FF NUL[128] CRC CRC |
| - | ACK | + | ACK |
| - | | + | === Figure 4: YMODEM Batch Transmission Session-1k Blocks |
| - | | + | |
| - | "sb -k foo.*< | + | "sb -k foo.*< |
| - | " | + | " |
| - | C (command: | + | C (command: |
| - | SOH 00 FF foo.c NUL[123] CRC CRC | + | SOH 00 FF foo.c NUL[123] CRC CRC |
| - | ACK | + | ACK |
| - | C | + | C |
| - | 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 |
| - | C | + | C |
| - | SOH 00 FF NUL[128] CRC CRC | + | SOH 00 FF NUL[128] CRC CRC |
| - | ACK | + | ACK |
| - | Figure 5. | + | === Figure 5: YMODEM Filename block transmitted by sz === |
| + | < | ||
| + | -rw-r--r-- | ||
| - | | + | |
| - | + | 10 36333437 20333331 34373432 35313320 | |
| - | 00 0100FF62 62637363 6865642E 74787400 | + | 20 31303036 34340000 00000000 00000000 |
| - | | + | 30 00000000 00000000 00000000 00000000 |
| - | | + | 40 00000000 00000000 00000000 00000000 |
| - | | + | 50 00000000 00000000 00000000 00000000 |
| - | | + | 60 00000000 00000000 00000000 00000000 |
| - | | + | 70 00000000 00000000 00000000 00000000 |
| - | | + | 80 000000CA 56 |
| - | | + | </ |
| - | | + | === Figure 6: YMODEM Header Information and Features |
| - | + | ||
| - | Figure 6. | + | |
| _____________________________________________________________ | _____________________________________________________________ | ||
| Line 658: | Line 639: | ||
| recovery. | recovery. | ||
| - | | + | === Figure 7: YMODEM-g Transmission Session |
| - | | + | |
| - | "sb foo.*< | + | "sb foo.*< |
| - | " | + | " |
| - | 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 |
| - | G | + | G |
| - | 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 |
| - | G | + | G |
| - | 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 | ||
| - | | + | < |
| - | ---- | + | |
| - | < | + | |
| 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 |
| Each block of the transfer looks like: | Each block of the transfer looks like: | ||
| Line 790: | Line 769: | ||
| getting garbaged. | getting garbaged. | ||
| - | | + | === Figure 9: Data flow including Error Recovery |
| SENDER | SENDER | ||
| 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 === |
| 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. | + | ===Figure 11: Example of CRC Calculation written in C === |
| + | |||
| + | The following XMODEM crc routine is taken from " | ||
| + | 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 " | ||
| - | the source code for these programs (contained in RZSZ.ZOO) for usage. | ||
| - | fast table driven version is also included in this file. | ||
| < | < | ||
| /* 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' |
| SENDER | SENDER | ||
| Line 1006: | Line 986: | ||
| 2 CRC bytes. | 2 CRC bytes. | ||
| - | Figure 13. | + | === Figure 13: Receiver and Sender Both have CRC Option |
| SENDER | SENDER | ||
| 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 |
| - | | + | Optional fields added for number of files remaining to be sent and total number of bytes remaining to be sent. |
| - | | + | === 10-18-87 |
| - | | + | Flow control discussion added to 1024 byte block descritpion, |
| - | | + | === 8-03-87 |
| - | * The April 15 1986 edition | + | Revised for clarity. |
| - | | + | === 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 10. Message Block Level Protocol, CRC mode.................... | ||
| - | |||
| - | Figure 11. Example of CRC Calculation written in C................... | ||
| - | |||
| - | Figure 12. Data Flow: Receiver has CRC Option, Sender Doesn' | ||
| - | |||
| - | Figure 13. Receiver and Sender Both have CRC Option.................. | ||
| - | |||
| ===== See Also ===== | ===== See Also ===== | ||