XMODEM File Transfer Protocol

XMODEM is a standard file transfer process developed by Ward Christensen in 1977. It sends data-related data blocks and awaits receipt of block receipt. XModem is used in both hardware and software.

  • XMODEM is a half-dup communication protocol with an effective error detection device.

  • It violates the original data in a series of packets sent to the recipient and other information that allows the recipient to determine whether the packets have been received correctly.

  • Marked files are completed with the end-of-file character sent behind the last block. This character is not in the packet but is sent as a single byte.

  • Since the lengths of the files are not transferred as part of the protocol, the final packages are filled with known characters, which can be released.

  • Files are transferred one datagram at a time. The package checksum is calculated and compared with that found at the end of the package on the acquisition side. When the recipient sends a confirmation message to the sender, the subsequent set of packages is sent.

  • If there is a problem with the checksum, the recipient sends a message requesting to be resubmitted.

  • Upon receiving a negative feedback, the sender re-sends the package and attempts to transfer continuously approximately ten times before issuing the transfer.

Transmission Methods

  • The recipients conduct the transfer, i.e., the sender will not send any data until the recipient sends the first NAK. The transmitter waits until the recipient sends a NAK byte.

  • The NAK byte is a signal that the recipient is ready to start. This is the first byte that indicates that the file transfer is ready to start.

  • If the recipient takes too long or an error occurs, the sender will stop waiting or "Time Out". File transfers will restart when they expired.

  • NAK is also sent if the recipient does not receive a valid package within ten seconds while waiting for data due to a lack of EOT character.

The recipient performs the following functions and transfers one packet at a time:

Assume that the packet number sent is the same as the actual packet number, i.e., the second byte is checked in the package.

  • In the event of a discrepancy, send a CAN byte to cancel the transfer. The packet's checksum is calculated after retrieval and compares with that received from the sender at the end of the package.

  • If the condition SUM = CHECKSUM is true, then the receiver sends an ACK byte to the sender, which indicates to send the next package in sequence.

  • If the situation is not satisfactory, the NAK byte is sent, signifying that the transmitter will re-send the byte.

  • When the sender sends EOT byte instead of SOH byte, the recipient sends a NAK byte.

  • If the sender sends another EOT immediately after that, the recipient sends the ACK byte, and the transfer is complete.

  • The recipient has the power to cancel the transfer at any time by sending the CAN byte, and the sender can only cancel between blocks by sending the CAN byte.