Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ref:xmodem [2011/07/13 23:35] – digitalman | ref:xmodem [2011/07/13 23:49] (current) – digitalman | ||
---|---|---|---|
Line 130: | Line 130: | ||
this paper: | this paper: | ||
< | < | ||
- | | + | |
- | | + | |
- | EOT 04 | + | EOT 04 |
- | ACK 06 | + | ACK 06 |
- | DLE 16 | + | DLE 16 |
- | X-On (DC1) | + | X-On (DC1) |
- | X-Off(DC3) | + | X-Off(DC3) |
- | NAK 21 | + | NAK 21 |
- | SYN 22 | + | SYN 22 |
- | CAN 24 | + | CAN 24 |
</ | </ | ||
Line 150: | Line 150: | ||
to say: | to say: | ||
- | | + | |
- | everything I do), to satisfy a personal need to communicate | + | everything I do), to satisfy a personal need to communicate |
- | with some other people. | + | with some other people. |
- | 8/77, and that I put it in the public domain immediately, | + | 8/77, and that I put it in the public domain immediately, |
- | made it become the standard that it is" | + | made it become the standard that it is" |
- | suggest I make SIGNIFICANT changes to the protocol, such as | + | suggest I make SIGNIFICANT changes to the protocol, such as |
- | 'full duplex', | + | 'full duplex', |
- | destinations', | + | destinations', |
- | simplicity of the protocol is one of the reasons it survived | + | simplicity of the protocol is one of the reasons it survived |
- | to this day in as many machines and programs as it may be | + | to this day in as many machines and programs as it may be |
- | found in!" | + | found in!" |
| | ||
Line 204: | Line 204: | ||
< | < | ||
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Line 219: | Line 219: | ||
The Xmodem Packet looks like this: | The Xmodem Packet looks like this: | ||
< | < | ||
- | [SOH] [seq] [cmpl [seq] [128 data bytes] [csum] | + | [SOH] [seq] [cmpl [seq] [128 data bytes] [csum] |
- | SOH Start of header character (decimal 1). | + | SOH Start of header character (decimal 1). |
- | seq one byte sequence number which starts at 1, and | + | seq one byte sequence number which starts at 1, and |
- | | + | |
- | | + | |
- | cmpl seq one byte 1's complement of seq. This can be | + | cmpl seq one byte 1's complement of seq. This can be |
- | | + | |
- | | + | |
- | data 128, 8 bit bytes of data. Note than when sending | + | data 128, 8 bit bytes of data. Note than when sending |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | csum one byte sum of all of the data bytes where any | + | csum one byte sum of all of the data bytes where any |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Line 263: | Line 263: | ||
Let's look at a three block file transfer: | Let's look at a three block file transfer: | ||
< | < | ||
- | Transmitter | + | Transmitter |
- | <<<<< | + | <<<<< |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Seems easy, right? | Seems easy, right? | ||
Line 366: | Line 366: | ||
end of transmission after receiving two EOT's. | end of transmission after receiving two EOT's. | ||
< | < | ||
- | | + | |
- | | + | |
- | <<<<< | + | <<<<< |
- | [EOT] >>>>> | + | [EOT] >>>>> |
- | <<<<< | + | <<<<< |
- | [EOT] >>>>> | + | [EOT] >>>>> |
- | <<<<< | + | <<<<< |
</ | </ | ||
Just in case the transmitter was not prepared to resend the | Just in case the transmitter was not prepared to resend the | ||
Line 559: | Line 559: | ||
=== Rules === | === Rules === | ||
- | + | 1. The window is always 4 Xmodem packets. | |
- | 1. The window is always 4 Xmodem packets. | + | |
- | ets. Transmission will not cease and the time out | + | |
2. The receiver will transmit acknowledgements in the form: | 2. The receiver will transmit acknowledgements in the form: | ||
Line 580: | Line 579: | ||
example, after an unknown number of packets: | example, after an unknown number of packets: | ||
< | < | ||
- | Transmitter | + | Transmitter |
- | .... | + | .... |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
Since some transmitters must close the window and | Since some transmitters must close the window and | ||
Line 600: | Line 599: | ||
- | |||
- | |||
4. The receiver will reject a packet (request retransmission) by sending: | 4. The receiver will reject a packet (request retransmission) by sending: | ||
- | | + | |
Where [sequence] is then next window sequence | Where [sequence] is then next window sequence | ||
Line 633: | Line 630: | ||
7. The timeout intervals at various points in processing are: | 7. The timeout intervals at various points in processing are: | ||
- | Waiting for a character on receive, start of packet | + | * Waiting for a character on receive, start of packet |
- | | + | |
- | Waiting for a character on receive, start of packet has been recognized: | + | |
- | | + | |
- | Waiting for an Ack or Nak on transmit side after the window has closed: | + | |
- | | + | |
- | Waiting for an X-On after receipt of an X-Off by the transmitter: | + | |
- | | + | |
8. When the transmitter times out waiting for an ACK or NAK when the window is closed (e.g. four blocks | 8. When the transmitter times out waiting for an ACK or NAK when the window is closed (e.g. four blocks | ||
Line 698: | Line 691: | ||
binary value (52) ends up in the first byte of I% and the second | binary value (52) ends up in the first byte of I% and the second | ||
byte is zero. | byte is zero. | ||
- | Result | + | < |
- | + | | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | I%=0 [x' | ||
+ | I%=1 [x' | ||
+ | A$=" | ||
+ | I%=ASC(A$) | ||
+ | B$=MKI$(I%) | ||
+ | I%=CVI(CHR$(0)+A$) | ||
+ | A$=CHR$(65) | ||
+ | </ | ||
Once this is understood, many problems with these algorithms goes away. | Once this is understood, many problems with these algorithms goes away. | ||
Line 874: | Line 868: | ||
what its author has to say: | what its author has to say: | ||
- | | + | |
- | everything I do), to satisfy a personal need to communicate | + | everything I do), to satisfy a personal need to communicate |
- | with some other people. | + | with some other people. |
- | 8/77, and that I put it in the public domain immediately, | + | 8/77, and that I put it in the public domain immediately, |
- | made it become the standard that it is" | + | made it become the standard that it is" |
- | suggest I make SIGNIFICANT changes to the protocol, such as | + | suggest I make SIGNIFICANT changes to the protocol, such as |
- | 'full duplex', | + | 'full duplex', |
- | destinations', | + | destinations', |
- | simplicity of the protocol is one of the reasons it survived | + | simplicity of the protocol is one of the reasons it survived |
- | to this day in as many machines and programs as it may be | + | to this day in as many machines and programs as it may be |
- | found in!" | + | found in!" |
Ward Christensen, | Ward Christensen, |