4. File Transfers
X Y Z Modem
XModem, YModem and ZModem are names of file transfer protocols, which
are a set of rules that two computers can use to send a file from one
computer to the other. A protocol will usually provide error
detection and correction, by resending the portion that was received in
error. XModem is the first public domain protocol developed for
use with personal computers and is one of the most widely
supported. It was developed by Ward Christensen back in 1977.
YModem is a variation of XModem that sends an additional block of
information before the file is sent. This block zero contains the
file name, size and modification time and date. Because the file
name is sent with the file data, files could be sent in batches, which
is why this protocol is sometimes referred to as YModem-Batch.
YModem was developed by Chuck Forsberg in his YAM (Yet Another Modem)
program.
YModem-G is a variation of YModem that is useful for direct connections
to another computer or when using error correcting modems. The
receiver does not send any ACKs, so the sender just pumps out the file
as fast as it can. If an error is detected, the transfer is
stopped. There is no error recovery.
The ZModem protocol was developed for the public domain under a Telenet
contract. Its goal was to “alleviate the throughput problems
network customers were experiencing with XMODEM and Kermit file
transfers.” It was developed by Chuck Forsberg/Omen
Technology. It overcomes many weaknesses of older protocols and
adds several useful capabilities. For additional information on
the ZModem protocol, wikipedia:
ZMODEM.
Omen Technology continued to enhance the ZModem protocol in the early
90's, adding proprietary new features. The extended protocol is
referred to as ZModem-90. ZTerm does not implement any of these
new features because they are not in the public domain, and would
require a licensing fee to use them.
ZModem
The ZModem file transfer protocol is arguably one of the best general
purpose file transfer protocols for personal computers using a direct
serial or modem link. Some of its features include:
• various options to let it operate efficiently in a
wide range of communication environments. The most common mode is
full streaming, where there is no wait between blocks—the receiver only
talks when he has an error.
• the sequence that starts a file transmission can be
detected by the receiving communication software, which can then
trigger its receive routines. This is sometimes referred to as
AutoDownload.
• Crash Recovery - A file transfer that is
interrupted by modem disconnection (or other reasons) can be restarted
and it will pick up where it left off. Note: if the Mac crashes
or loses power during a transfer, you may not be able to restart the
transfer because the partial file was not closed by ZTerm.
• All ZModem transfers are batch transfers:
multiple files can be sent per transfer, each file is sent with its
file name, file size and date of last modification.
• 32 or 16 bit CRC's will error check all blocks:
data blocks and control messages.
For receiving files using the ZModem protocol, just start the sender
and ZTerm will detect that it should start receiving files with
ZModem. On the Opus BBS for example, to download the file
“newfiles.txt” just type “dz newfiles.txt” and ZTerm will receive it.
For sending files using ZModem, ZTerm can send a command sequence to
put the receiver in a receive ZModem mode. In the Settings menu,
ZModem Options will bring up a dialog that includes the command to send
to put the other end into ZModem receive. For Opus, this should
be set to “uz” followed by a return. When you select Send ZModem,
you will first select what files to send. When you start the
transfer, ZTerm will send the sequence from the ZModem Options and then
the transfer will start.
Kermit
Kermit is a file transfer protocol that is most common on minicomputers
and mainframes. It has the ability to transfer files in
environments where many others cannot. The most common situation
where Kermit is the best choice is when the connection between the two
computers only supports 7 data bits for each character. Kermit
was designed by Bill Catchings and Frank da Cruz at Columbia University
and has many contributors.
Binary File Type Detection
ZTerm will detect certain types of binary files, and set the
appropriate creator and type for the kind of file. It detects the
type by either looking for a specific sequence of bytes at the start of
the file (a signature) or by matching the end of the file name (e.g.
the extension of an MS-DOS file). See the appendix on ZTerm
resources for additional information. File creator and type codes
aren't really used in OSX.
Text Detection and Conversion
When ZTerm is receiving a file, it inspects the first 128 bytes to
determine if it should be treated as a text file. If all of these
bytes are Macintosh printable characters or typical text control
characters (return, line feed, tab, etc), then it is considered a text
file. The file type will be set to TEXT and ZTerm will perform
End of Line conversion. If the text has CR/LF at each line end,
ZTerm will filter out the LF. ZTerm currently does not filter any
other control characters.
Resume an Interrupted Download
If a download is interrupted by disconnection, Cancel, or whatever (but
not a power failure - the file won’t be closed properly) it can restart
where it left off using ZModem. A partial file will have the
original file name with a bullet (•) at the end. If you try to
download a file and a file with the same name plus a bullet at the end
is already in the current receive folder, ZTerm will resume the
download where it left off.
MacBinary II
ZTerm supports the original MacBinary format for the complete transfer
of Macintosh files and their additional file information. The
MacBinary II standard (dated July 1987) is also supported. The
file transfer status dialog will display either ‘MacBinary’ or
‘MacBinary II’ when that format is being used.
Performance Log
Each time you transfer a file with ZTerm, it will place an entry in its
performance log file. The file is named “ZTerm Xfer Log” and it
is stored in the Logs directory. It is a standard TEXT file with
TABs between each field, so it can be imported to many spreadsheets,
databases, etc. Since this file could grow large, you may want to
periodically rename it. At the end of the year, I rename mine to
have the year at the end of the name. The transfer log can be
disabled in General Preferences.
Transfer Efficiency Calculations
I don’t know if there is an accepted procedure for transfer efficiency
calculation, so I will just explain how I am currently calculating
efficiency. All ZTerm timings use the Macintosh TickCount, which
has a resolution of 1/60th of a second.
For receiving files using ZModem or YModem, the clock starts when
“block zero” (the block with the file name and other information) is
received. This block zero is not the same as the MacBinary
header. For XModem file receives, the clock starts just before
the initial NAK (or whatever) is sent. The clock stops when all
file data is received, written and the file is closed.
For sending files using ZModem or YModem, the clock starts after block
zero is sent. For XModem, it starts when ZTerm starts waiting for
the initial NAK. The clock stops on ZModem file sends when the
ZRINIT response is received for the ZEOF message. For YModem and
XModem, it stops when the ACK response is received for the EOT message.
The CPS figure (characters per second) is the total file bytes (does
not include block zero) divided by seconds. The efficiency figure
is CPS times 10 bits per data byte divided by BPS (bits per second,
sometimes called baud rate).
Hardware Handshake
If you have a high speed modem or one with compression and error
control (like MNP, V.42 and V.42bis), you may want to use hardware
handshaking to get the most efficient file transfers. This
requires a correctly wired cable and additional modem
configuration. See the section on High Speed Modems.
Compressed Files
The files available for download on BBS’s and online services are
almost always in a compressed format. There are several “archive”
programs that will compress one or more files into an “archive
file.” In addition to reducing the time to transfer the file, it
provides a means to make a package of several related files, so that
anyone who downloads a package will get any necessary files. For
example, the ZTerm archive file that I upload contains the program,
this documentation file, and several other useful files.
Packaging them together in one archive file will make sure that a
downloader will get all the files.
Here are the file extensions for the common archive formats. A
file extension (which is more common with non-Mac operating systems)
appears at the end of the file name and provides some indication of the
type of file.
(Note: most of the formats are no longer used.)
.dmg OSX Disk Image file
.cpt Compactor format -- use Compact Pro or Extractor
.hqx BinHex format -- use BinHex 4.0, BinHex DA, any
of the StuffIt programs, Compact Pro, or mcvert (for Unix).
.sit StuffIt format -- use any of the StuffIt
programs.
.sea Self Extracting Archive. Double-clicking
on this should give you the uncompressed file.
.pit PackIt format, not used much any more -- use
PackIt or any of the StuffIt programs.
.image DiskCopy images of a floppy disk. This
is the format used for the System software on many services. Use
the DiskCopy application to translate these back onto disks.
.Z Unix 'compress' files. Uncompress with the
Unix command 'uncompress' or on the Mac with MacCompress (available
from sumex).
.tar Unix tar (tape archive) file.
.dd DiskDoubler format. Use DiskDoubler or
DDExpand.
CompuServe B-Plus and Quick-B
CompuServe has its own file transfer protocol that is very
efficient. Quick-B was an interim protocol that was established
while they finalized their current enhanced protocol which they call
B-Plus. When CompuServe asks you what protocol to use for
downloading, you should pick the B-Plus option. The QuickB option
will also work just fine. There is no menu entry to start a
B-Plus transfer; CompuServe will send a sequence that will start the
download. Note: You must enable this option in the Transfer
Options Settings.