- 1 - XMODEM/YMODEM PROTOCOL REFERENCE A compendium of documents describing the XMODEM and YMODEM File Transfer Protocols This document was formatted 9-11-86. Edited by Chuck Forsberg Please distribute as widely as possible. Questions to Chuck Forsberg Omen Technology Inc 17505-V Sauvie Island Road Portland Oregon 97231 Voice: 503-621-3406 Modem (Telegodzilla): 503-621-3746 Speed 1200,300 Compuserve: 70007,2304 UUCP: ...!tektronix!reed!omen!caf - 2 - 1. ROSETTA STONE Here are some definitions which reflect the current vernacular in the computer media. The attempt here is identify the file transfer protocol rather than specific programs. XMODEM refers to the original 1979 file transfer etiquette introduced by Ward Christensen's 1979 MODEM2 program. It's also called the MODEM or MODEM2 protocol. Some who are unaware of MODEM7's unusual batch file mode call it MODEM7. Other aliases include "CP/M Users's Group" and "TERM II FTP 3". This protocol is supported by every serious communications program because of its universality, simplicity, and reasonable performance. XMODEM/CRC replaces XMODEM's 1 byte checksum with a two byte Cyclical Redundancy Check (CRC-16), giving modern error detection protection. XMODEM-1k Refers to the XMODEM/CRC protocol with 1024 byte data blocks. YMODEM refers to the XMODEM/CRC (optional 1k blocks) protocol with the batch transmission described below. ZMODEM uses familiar XMODEM/CRC and YMODEM technology in a new protocol that provides reliability, throughput, file management, and user amenities appropriate to contemporary data communications. 2. YET ANOTHER PROTOCOL? Since its development half a decade ago, the Ward Christensen modem protocol has enabled a wide variety of computer systems to interchange data. There is hardly a communications program that doesn't at least claim to support this protocol. Recent advances in computing, modems and networking have revealed a number of weaknesses in the original protocol: + The short block length caused throughput to suffer when used with timesharing systems, packet switched networks, satellite circuits, and bufffirst to the sending program and then again to the receiving program. + The transmitted file could accumulate as many as 127 extraneous bytes. Chapter 2 X/YMODEM Protocol Reference 09-11-86 3 + The modification date of the file was lost. A number of other protocols have been developed over the years, but none have displaced XMODEM to date: + Lack of public domain documentation and example programs have kept proprietary protocols such as MNP, Blast, and others tightly bound to the fortunes of their suppliers. + Complexity discourages the widespread application of BISYNC, SDLC, HDLC, X.25, and X.PC protocols. + Performance compromises and moderate complexity have limited the popularity of the Kermit protocol, which was developed to allow file transfers in environments hostile to XMODEM. The XMODEM protocol extensions and YMODEM Batch address these weaknesses while maintaining XMODEM's simplicity. YMODEM is supported by the public domain programs YAM (CP/M), YAM(CP/M-86), YAM(CCPM-86), IMP (CP/M), KMD (CP/M), rz/sz (Unix, Xenix, VMS, Berkeley Unix, Venix, Xenix, Coherent, IDRIS, Regulus). Commerical implementations include MIRROR, and Professional-YAM.[1] Communications programs supporting these extensions have been in use since 1981. The 1k packet length (XMODEM-1k) described below may be used in conjunction with YMODEM Batch Protocol, or with single file transfers identical to the XMODEM/CRC protocol except for minimal changes to support 1k packets. Another extension is simply called the g option. It provides maximum throughput when used with end to end error correcting media, such as X.PC and error correcting modems, including the emerging 9600 bps units by Electronic Vaults and others. To complete this tome, Ward Christensen's original protocol document and John Byrns's CRC-16 document are included for reference. References to the MODEM or MODEM7 protocol have been changed to XMODEM to accommodate the vernacular. In Australia, it is properly called the Christensen Protocol. __________ 1. Available for IBM PC,XT,AT, Unix and Xenix Chapter 2 X/YMODEM Protocol Reference 09-11-86 4 2.1 Some Messages from the Pioneer #: 130940 S0/Communications 25-Apr-85 18:38:47 Sb: my protocol Fm: Ward Christensen 76703,302 (EDITED) To: all Be aware the article[2] DID quote me correctly in terms of the phrases like "not robust", etc. It was a quick hack I threw together, very unplanned (like everything I do), to satisfy a personal need to communicate with "some other" people. ONLY the fact that it was done in 8/77, and that I put it in the public domain immediately, made it become the standard that it is. I think its time for me to (1) document it; (people call me and say "my product is going to include it - what can I 'reference'", or "I'm writing a paper on it, what do I put in the bibliography") and (2) propose an "incremental extension" to it, which might take "exactly" the form of Chuck Forsberg's YAM protocol. He wrote YAM in C for CP/M and put it in the public domain, and wrote a batch protocol for Unix[3] called rb and sb (receive batch, send batch), which was basically XMODEM with (a) a record 0 containing filename date time and size (b) a 1K block size option (c) CRC-16. He did some clever programming to detect false ACK or EOT, but basically left them the same. People who suggest I make SIGNIFICANT changes to the protocol, such as "full duplex", "multiple outstanding blocks", "multiple destinations", etc etc don't understand that the incredible simplicity of the protocol is one of the reasons it survived to this day in as many machines and programs as it may be found in! Consider the PC-NET group back in '77 or so - documenting to beat the band - THEY had a protocol, but it was "extremely complex", because it tried to be "all things to all people" - i.e. send binary files on a 7-bit system, etc. I was not that "benevolent". I (emphasize > I < ) had an 8-bit UART, __________ 2. Infoworld April 29 p. 16 3. VAX/VMS versions of these programs are also available. Chapter 2 X/YMODEM Protocol Reference 09-11-86 5 so "my protocol was an 8-bit protocol", and I would just say "sorry" to people who were held back by 7-bit limitations. ... Block size: Chuck Forsberg created an extension of my protocol, called YAM, which is also supported via his public domain programs for UNIX called rb and sb - receive batch and send batch. They cleverly send a "block 0" which contains the filename, date, time, and size. Unfortunately, its UNIX style, and is a bit weird[4] - octal numbers, etc. BUT, it is a nice way to overcome the kludgy "echo the chars of the name" introduced with MODEM7. Further, chuck uses CRC-16 and optional 1K blocks. Thus the record 0, 1K, and CRC, make it a "pretty slick new protocol" which is not significantly different from my own. Also, there is a catchy name - YMODEM. That means to some that it is the "next thing after XMODEM", and to others that it is the Y(am)MODEM protocol. I don't want to emphasize that too much - out of fear that other mfgrs might think it is a "competitive" protocol, rather than an "unaffiliated" protocol. Chuck is currently selling a much-enhanced version of his CP/M-80 C program YAM, calling it Professional Yam, and its for the PC - I'm using it right now. VERY slick! 32K capture buffer, script, scrolling, previously captured text search, plus built-in commands for just about everything - directory (sorted every which way), XMODEM, YMODEM, KERMIT, and ASCII file upload/download, etc. You can program it to "behave" with most any system - for example when trying a number for CIS it detects the "busy" string back from the modem and substitutes a diff phone # into the dialing string and branches back to try it. 3. XMODEM PROTOCOL ENHANCEMENTS This chapter discusses the protocol extensions to Ward Christensen's 1982 XMODEM protocol description document. The original document recommends the user be asked whether to continue trying or abort after 10 retries. Most programs no longer ask the operator whether he wishes to keep retrying. Virtually all correctable errors are corrected within the first few retransmissions. If the line is so bad that ten attempts are insufficient, there is a significant danger of undetected errors. If the connection is that bad, it's better to redial for a better connection, or mail a floppy disk. __________ 4. The file length, time, and file mode are optional. The pathname and file length may be sent alone if desired. Chapter 3 XMODEM Protocol Enhancements X/YMODEM Protocol Reference 09-11-86 6 3.1 Graceful Abort The YAM and Professional-YAM X/YMODEM routines recognize a sequence of two consecutive CAN (Hex 18) characters without modem errors (overrun, framing, etc.) as a transfer abort command. T...
Amiga7878