Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ref:zmodem [2010/02/25 14:12] – created, imported Jacques Mattheij's ZMODEM.DOC digitalman | ref:zmodem [2021/06/29 15:34] (current) – [ZFILE FRAME FILE INFORMATION SUBPACKET] footnote about path/file names with spaces (they are in fact supported in most ZMODEM implemenations) digital man | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
zmodem.doc !copyrighted by MCS 1994 use it anyway you like but don't complain | zmodem.doc !copyrighted by MCS 1994 use it anyway you like but don't complain | ||
Line 35: | Line 35: | ||
a typical (simple) zmodem file transfer looks like this : | a typical (simple) zmodem file transfer looks like this : | ||
- | < | + | ^sender |
- | sender | + | |ZRQINIT(0) |
- | + | | | |
- | ZRQINIT(0) | + | |ZFILE |
- | ZRINIT | + | | |ZRPOS | |
- | ZFILE | + | |ZDATA data ... | | |
- | ZRPOS | + | |ZEOF | | |
- | ZDATA data ... | + | | |
- | ZEOF | + | |ZFIN | | |
- | ZRINIT | + | | |
- | ZFIN | + | |OO | | |
- | ZFIN | + | |
- | OO | + | |
- | </ | + | |
zmodem continuously transmits data unless the receiver interrupts | zmodem continuously transmits data unless the receiver interrupts | ||
Line 66: | Line 63: | ||
zmodem places no constraints on the content files. | zmodem places no constraints on the content files. | ||
+ | |||
+ | ===== FRAMING ===== | ||
+ | |||
+ | ==== ZMODEM Frame ==== | ||
+ | There are 2 classes of ZMODEM Frames: | ||
+ | - Hexadecimal (HEX) frames, containing only US-ASCII characters | ||
+ | - Binary (BIN16 or BIN32) frames, containing //almost// all possible octet values | ||
+ | |||
+ | === HEX Frame === | ||
+ | <frame header> [CR] LF [XON] | ||
+ | |||
+ | HEX frames are terminated with an ASCII linefeed character. Some ZMODEM implementations send the HEX frame terminating linefeed character with the high bit set (0x8A, that's ASCII-LF with an even-parity bit set). Also, for some HEX frame types, the frame terminator may be followed by an XON (0x11) character (" | ||
+ | |||
+ | === Binary Frame === | ||
+ | <frame header> [[<* data subpacket> | ||
+ | | ||
+ | Binary frames may contain zero or more data subpackets (depending on the frame type). The final subpacket of a binary data frame will be of type ZCRCW or ZCRCE. | ||
+ | |||
+ | ==== Frame Header ==== | ||
+ | <frame encoding> | ||
+ | |||
+ | **Frame Encoding** (single byte): | ||
+ | |||
+ | The //Frame Encoding// is also sometimes called the "Frame Style" | ||
+ | |||
+ | ^ Style ^ AKA ^ Value ^ Frame Contents | ||
+ | | HEX | ZHEX | ASCII ''' | ||
+ | | BIN16 | ZBIN | ASCII ''' | ||
+ | | BIN32 | ZBIN32 | ASCII ''' | ||
+ | |||
+ | Notes: | ||
+ | * All frames sent by the " | ||
+ | |||
+ | **Frame Type** (single byte): | ||
+ | |||
+ | ^ Type ^ Value ^ TX((from sender))^ RX((from receiver)) ^ Info ^ Data Subpkt | ||
+ | | ZRQINIT | ||
+ | | ZRINIT | ||
+ | | ZSINIT | ||
+ | | ZACK | 0x03 | Y | ||
+ | | ZFILE | 0x04 | Y | ||
+ | | ZSKIP | 0x05 | - | ||
+ | | ZNAK | 0x06 | Y | ||
+ | | ZABORT | ||
+ | | ZFIN | 0x08 | Y | ||
+ | | ZRPOS | 0x09 | - | ||
+ | | ZDATA | 0x0A | Y | ||
+ | | ZEOF | 0x0B | Y | ||
+ | | ZFERROR | ||
+ | | ZCRC | 0x0D | Y | ||
+ | | ZFREECNT | 0x11 | Y | ||
+ | |||
+ | **Frame Info**: Up to 15 bytes (but typically 4) of frame type-specific information.\\ | ||
+ | Note that later claims of //16// bytes of possible frame header data include the //Frame Type// byte. | ||
+ | |||
+ | **Frame Header Integrity**: | ||
+ | |||
+ | ==== Data Subpacket ==== | ||
+ | < | ||
+ | |||
+ | **ZDLE** is the ZMODEM Data-link-escape character ('' | ||
+ | |||
+ | === Data Subpacket Length === | ||
+ | |||
+ | * Data Subpackets may contain up to **1024** bytes of //data// (special octet values are transposed and escaped with //ZDLE//) | ||
+ | * The Data Subpacket Length is also sometimes referred to as the transmit "block size" | ||
+ | * The Data Subpacket Length can be dynamically adjusted by the sender during the transfer of a file, e.g. in response to errors reported by the receiver | ||
+ | * Some ZMODEM implementations (e.g. " | ||
+ | |||
+ | === Data Subpacket Types === | ||
+ | The Data Subpacket Type is encoded in a single byte. | ||
+ | |||
+ | ^ Type ^ ZACK/ZRPOS expected ^ End-of-Frame ^ Meaning | ||
+ | | ZCRCW | Yes (synchronous) | ||
+ | | ZCRCE | Only errors | ||
+ | | ZCRCQ | Yes (asynchronous) | ||
+ | | ZCRCG | Only errors | ||
+ | |||
+ | === Data Subpacket Integrity === | ||
+ | The Subpacket //data// and //type// bytes are integrity-protected by either a 16-bit or 32-bit CRC. | ||
===== LINK ESCAPE ENCODING ===== | ===== LINK ESCAPE ENCODING ===== | ||
Line 604: | Line 681: | ||
The pathname (conventionally, | The pathname (conventionally, | ||
null terminated ASCII string. | null terminated ASCII string. | ||
- | No spaces are included in the pathname. | + | No spaces are included in the pathname. |
Filename Considerations | Filename Considerations | ||
Line 777: | Line 854: | ||
==== ASCII ==== | ==== ASCII ==== | ||
- | + | <code c> | |
- | SOH 0x01 | + | SOH 0x01 |
- | STX 0x02 | + | STX 0x02 |
- | EOT 0x04 | + | EOT 0x04 |
- | ENQ 0x05 | + | ENQ 0x05 |
- | ACK 0x06 | + | ACK 0x06 |
- | LF 0x0a | + | LF 0x0a |
- | CR 0x0d | + | CR 0x0d |
- | XON 0x11 | + | XON 0x11 |
- | XOFF | + | XOFF 0x13 |
- | NAK 0x15 | + | NAK 0x15 |
- | CAN 0x18 | + | CAN 0x18 |
+ | </ | ||
==== ZMODEM ==== | ==== ZMODEM ==== | ||
- | | + | <code c> |
- | ZDLE 0x18 / | + | ZPAD 0x2a / |
- | ZDLEE 0x58 / | + | ZDLE 0x18 / |
+ | ZDLEE 0x58 / | ||
- | | + | ZBIN 0x41 / |
- | ZHEX 0x42 / | + | ZHEX 0x42 / |
- | ZBIN32 0x43 / | + | ZBIN32 |
- | ZBINR32 0x44 / | + | ZBINR32 |
- | | + | ZVBIN 0x61 / |
- | ZVHEX 0x62 / | + | ZVHEX 0x62 / |
- | ZVBIN32 0x63 / | + | ZVBIN32 0x63 / |
- | ZVBINR32 0x64 / | + | ZVBINR32 0x64 / |
- | | + | ZRESC 0x7e / |
+ | </ | ||
==== FRAME TYPES ==== | ==== FRAME TYPES ==== | ||
- | | + | <code c> |
- | ZRINIT 0x01 / | + | ZRQINIT |
- | ZSINIT 0x02 / | + | ZRINIT |
- | ZACK 0x03 / | + | ZSINIT |
- | ZFILE 0x04 / | + | ZACK 0x03 / |
- | ZSKIP 0x05 / | + | ZFILE 0x04 / |
- | ZNAK 0x06 / | + | ZSKIP 0x05 / |
- | ZABORT 0x07 / | + | ZNAK 0x06 / |
- | ZFIN 0x08 / | + | ZABORT |
- | ZRPOS 0x09 / | + | ZFIN 0x08 / |
- | ZDATA 0x0a / | + | ZRPOS 0x09 / |
- | ZEOF 0x0b / | + | ZDATA 0x0a / |
- | ZFERR 0x0c / | + | ZEOF 0x0b / |
- | ZCRC 0x0d / | + | ZFERR 0x0c / |
- | ZCHALLENGE 0x0e / | + | ZCRC 0x0d / |
- | ZCOMPL 0x0f / | + | ZCHALLENGE 0x0e / |
- | ZCAN 0x10 / | + | ZCOMPL |
- | | + | ZCAN 0x10 / |
- | ZFREECNT 0x11 / | + | ZFREECNT 0x11 / |
- | ZCOMMAND 0x12 / | + | ZCOMMAND 0x12 / |
- | ZSTDERR 0x13 / | + | ZSTDERR 0x13 / |
+ | </ | ||
==== ZDLE SEQUENCES ==== | ==== ZDLE SEQUENCES ==== | ||
- | | + | <code c> |
- | ZCRCG 0x69 / | + | ZCRCE 0x68 / |
- | ZCRCQ 0x6a / | + | ZCRCG 0x69 / |
- | ZCRCW 0x6b / | + | ZCRCQ 0x6a / |
- | ZRUB0 0x6c / | + | ZCRCW 0x6b / |
- | ZRUB1 0x6d / | + | ZRUB0 0x6c / |
+ | ZRUB1 0x6d / | ||
+ | </ | ||
==== RECEIVER CAPABILITY FLAGS ==== | ==== RECEIVER CAPABILITY FLAGS ==== | ||
- | | + | <code c> |
- | CANOVIO 0x02 / | + | CANFDX 0x01 / |
- | CANBRK 0x04 / | + | CANOVIO 0x02 / |
- | CANCRY 0x08 / | + | CANBRK 0x04 / |
- | CANLZW 0x10 / | + | CANCRY 0x08 / |
- | CANFC32 0x20 / | + | CANLZW 0x10 / |
- | ESCCTL 0x40 / | + | CANFC32 0x20 / |
- | ESC8 0x80 / | + | ESCCTL 0x40 / |
+ | ESC8 0x80 / | ||
+ | </ | ||
===== See Also ===== | ===== See Also ===== | ||
- | * [[:util: | + | * [[util: |
* [[: | * [[: | ||
{{tag> | {{tag> | ||