text
stringlengths
0
99.6k
experiencing with XMODEM and Kermit file transfers.
In the beginning, we thought a few modifications to XMODEM would allow
high performance over packet switched networks while preserving XMODEM's
simplicity.
The initial concept would add a block number to the ACK and NAK characters
used by XMODEM. The resultant protocol would allow the sender to send
more than one block before waiting for a response.
But how to add the block number to XMODEM's ACK and NAK? WXMODEM,
SEAlink, MEGAlink and some other protocols add binary byte(s) to indicate
the block number.
Pure binary was unsuitable for ZMODEM because binary code combinations
won't pass bidirectionally through some modems, networks and operating
systems. Other operating systems may not be able to recognize something
coming back[1] unless a break signal or a system dependent code or
sequence is present. By the time all this and other problems with the
simple ACK/NAK sequences mentioned above were corrected, XMODEM's simple
ACK and NACK characters had evolved into a real packet. The Frog was
riveting.
Managing the window[2] was another problem. Experience gained in
debugging The Source's SuperKermit protocol indicated a window size of
about 1000 characters was needed at 1200 bps. High speed modems require a
__________
1. Without stopping for a response
2. The WINDOW is the data in transit between sender and receiver.
Chapter 4 Rev 10-27-87 Typeset 10-27-87 7
Chapter 4 ZMODEM Protocol 8
window of 20000 or more characters for full throughput. Much of the
SuperKermit's inefficiency, complexity and debugging time centered around
its ring buffering and window management. There had to be a better way to
get the job done.
A sore point with XMODEM and its progeny is error recovery. More to the
point, how can the receiver determine whether the sender has responded, or
is ready to respond, to a retransmission request? XMODEM attacks the
problem by throwing away characters until a certain period of silence.
Too short a time allows a spurious pause in output (network or timesharing
congestion) to masquerade as error recovery. Too long a timeout
devastates throughput, and allows a noisy line to lock up the protocol.
SuperKermit solves the problem with a distinct start of packet character
(SOH). WXMODEM and ZMODEM use unique character sequences to delineate the
start of frames. SEAlink and MEGAlink do not address this problem.
A further error recovery problem arises in streaming protocols. How does
the receiver know when (or if) the sender has recognized its error signal?
Is the next packet the correct response to the error signal? Is it
something left over "in the queue"? Or is this new subpacket one of many
that will have to be discarded because the sender did not receive the
error signal? How long should this continue before sending another error
signal? How can the protocol prevent this from degenerating into an
argument about mixed signals?
SuperKermit uses selective retransmission, so it can accept any good
packet it receives. Each time the SuperKermit receiver gets a data
packet, it must decide which outstanding packet (if any) it "wants most"
to receive, and asks for that one. In practice, complex software "hacks"
are needed to attain acceptable robustness.[3]
For ZMODEM, we decided to forgo the complexity of SuperKermit's packet
assembly scheme and its associated buffer management logic and memory
requirements.
Another sore point with XMODEM and WXMODEM is the garbage added to files.
This was acceptable with old CP/M files which had no exact length, but not
with modern systems such as DOS and Unix. YMODEM uses file length
information transmitted in the header block to trim the output file, but
this causes data loss when transferring files that grow during a transfer.
In some cases, the file length may be unknown, as when data is obtained
from a process. Variable length data subpackets solve both of these
__________
3. For example, when SuperKermit encounters certain errors, the _w_n_d_e_s_r
function is called to determine the next block to request. A burst of
errors generates several wasteful requests to retransmit the same
block.