text
stringlengths
0
99.6k
Chapter 6 Rev 10-27-87 Typeset 10-27-87 11
Chapter 6 ZMODEM Protocol 12
7. ZZZZMMMMOOOODDDDEEEEMMMM BBBBAAAASSSSIIIICCCCSSSS
7.1 PPPPaaaacccckkkkeeeettttiiiizzzzaaaattttiiiioooonnnn
ZMODEM frames differ somewhat from XMODEM blocks. XMODEM blocks are not
used for the following reasons:
o+ Block numbers are limited to 256
o+ No provision for variable length blocks
o+ Line hits corrupt protocol signals, causing failed file transfers. In
particular, modem errors sometimes generate false block numbers, false
EOTs and false ACKs. False ACKs are the most troublesome as they cause
the sender to lose synchronization with the receiver.
State of the art programs such as Professional-YAM and ZCOMM overcome
some of these weaknesses with clever proprietary code, but a stronger
protocol is desired.
o+ It is difficult to determine the beginning and ends of XMODEM blocks
when line hits cause a loss of synchronization. This precludes rapid
error recovery.
7.2 LLLLiiiinnnnkkkk EEEEssssccccaaaappppeeee EEEEnnnnccccooooddddiiiinnnngggg
ZMODEM achieves data transparency by extending the 8 bit character set
(256 codes) with escape sequences based on the ZMODEM data link escape
character ZDLE.[1]
Link Escape coding permits variable length data subpackets without the
overhead of a separate byte count. It allows the beginning of frames to
be detected without special timing techniques, facilitating rapid error
recovery.
Link Escape coding does add some overhead. The worst case, a file
consisting entirely of escaped characters, would incur a 50% overhead.
The ZDLE character is special. ZDLE represents a control sequence of some
sort. If a ZDLE character appears in binary data, it is prefixed with
ZDLE, then sent as ZDLEE.
The value for ZDLE is octal 030 (ASCII CAN). This particular value was
chosen to allow a string of 5 consecutive CAN characters to abort a ZMODEM
__________
1. This and other constants are defined in the _z_m_o_d_e_m._h include file.
Please note that constants with a leading 0 are octal constants in C.
Chapter 7 Rev 10-27-87 Typeset 10-27-87 12
Chapter 7 ZMODEM Protocol 13
session, compatible with YMODEM session abort.
Since CAN is not used in normal terminal operations, interactive
applications and communications programs can monitor the data flow for
ZDLE. The following characters can be scanned to detect the ZRQINIT
header, the invitation to automatically download commands or files.
Receipt of five successive CAN characters will abort a ZMODEM session.
Eight CAN characters are sent.
The receiving program decodes any sequence of ZDLE followed by a byte with
bit 6 set and bit 5 reset (upper case letter, either parity) to the
equivalent control character by inverting bit 6. This allows the
transmitter to escape any control character that cannot be sent by the
communications medium. In addition, the receiver recognizes escapes for
0177 and 0377 should these characters need to be escaped.
ZMODEM software escapes ZDLE, 020, 0220, 021, 0221, 023, and 0223. If
preceded by 0100 or 0300 (@), 015 and 0215 are also escaped to protect the
Telenet command escape CR-@-CR. The receiver ignores 021, 0221, 023, and
0223 characters in the data stream.