"Science, Faculty of"@en . "Computer Science, Department of"@en . "DSpace"@en . "UBCV"@en . "Lee, Kenneth"@en . "2010-11-18T20:28:36Z"@en . "1990"@en . "Master of Science - MSc"@en . "University of British Columbia"@en . "In this thesis, we first surveyed and analyzed the Kermit, XMODEM, YMODEM, and ZMODEM file transfer protocols. A number of theoretical channel utilization equations were then developed that would predict the effective utilization, and hence effective throughput, of stop and wait protocols and streaming protocols. A series of experiments were performed that measured the effective throughput of the protocols at various baud rates and error rates and showed the utilization equations to be within \u00B15% of the measured values. Based upon these results, a full-streaming communications protocol, MAX2, was designed. A subset of the MAX2 protocol was then implemented and tested at different baud rates and error rates. These results were within \u00B11.5% of the theoretical values and showed that the MAX2 protocol to be more efficient than the Kermit, XMODEM, YMODEM, and ZMODEM protocols at all baud rates and error rates when using comparable maximum packet sizes . These results also indicated that in order to achieve maximum effective throughput, the packet size must change as the communication channel's error rate changes."@en . "https://circle.library.ubc.ca/rest/handle/2429/30015?expand=metadata"@en . "COMMUNICATION PROTOCOL CHANNEL UTILIZATION AND T H E DESIGN OF T H E MAX2 DATA LINK PROTOCOL by KENNETH LEE B.Sc, The University of British Columbia, 1985 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE in THE FACULTY OF GRADUATE STUDIES (Department of Computer Science) We accept this thesis as conforming to the required standard. THE UNIVERSITY OF BRITISH COLUMBIA September 1991 \u00C2\u00A9 Kenneth Lee, 1991 In presenting this thesis in partial fulfilment of the requirements for an advanced degree at the University of British Columbia/ I agree that the Library shall make it freely available for reference arid study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives, it is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Department of 6U)Mpu.Tr>(l (t-\Ui^ The University of British Columbia Vancouver, Canada Date $Ej)T\u00C2\u00A3-M6F-ft. 1 9 0 1 DE-6 (2/88) ABSTRACT In this thesis, we first surveyed and analyzed the Kermit, XMODEM, YMODEM, and ZMODEM file transfer protocols. A number of theoretical channel utilization equations were then developed that would predict the effective utilization, and hence effective throughput, of stop and wait protocols and streaming protocols. A series of experiments were performed that measured the effective throughput of the protocols at various baud rates and error rates and showed the utilization equations to be within \u00C2\u00B15% of the measured values. Based upon these results, a full-streaming communications protocol, MAX2, was designed. A subset of the MAX2 protocol was then implemented and tested at different baud rates and error rates. These results were within \u00C2\u00B11.5% of the theoretical values and showed that the MAX2 protocol to be more efficient than the Kermit, XMODEM, YMODEM, and ZMODEM protocols at all baud rates and error rates when using comparable maximum packet sizes . These results also indicated that in order to achieve maximum effective throughput, the packet size must change as the communication channel's error rate changes. ii TABLE OF CONTENTS Abstract \u00E2\u0080\u00A2 1 1 List Of Tables v i List Of Figures v i i List Of Graphs vm Acknowledgement x 1. Introduction 1 1.1 Motivation and Objectives 1 1.2 Outline 2 2. Protocol Survey 4 2.1 Introduction 4 2.2 Kermit 4 2.2.1 Introduction - 4 2.2.2 Classic Kermit 5 2.2.3 Extended Length Packet Extension 8 2.2.4 Sliding Window Extension .9 2.3 XMODEM 10 2.3.1 Introduction 10 2.3.2 XMODEM (Original) 10 2.3.3 XMODEM-CRC H 2.3.4 XMODEM-1K 12 2.4 YMODEM 12 2.5 ZMODEM 13 2.6 Summary 15 2.7 Conclusion 18 3. Protocol Channel Utilization 19 3.1 Introduction 19 3.2 Analysis 19 3.2.1 Uniform Deterministic Error Distribution 20 3.2.2 Poisson Error Distribution 21 3.3 Channel Utilization Equation For Stop and Wait Protocols .22 3.4 Channel Utilization Equation For Streaming Protocols 25 3.4.1 Selective Retransmission 26 3.4.2 Go Back N 28 3.5 Equation Verification 31 3.5.1 Experiment Description 32 3.5.2 Uniform Byte Error Distribution Experiments 34 3.5.3 Random Bit Error Distribution (BLACK30) Experiments 36 3.6 Summary 37 3.7 Conclusion 39 iii 4. MAX2 Protocol 40 4.1 Introduction 40 4.2 Specification 41 4.2.1 Encoding Algorithms 41 4.2.1.1 Hex Encoding 41 4.2.1.2 Network Control Character Encoding 42 4.2.1.3 Full Control Character Encoding .42 4.2.1.4 Eighth Bit Character Encoding .42 4.2.2 Checksum Types 42 4.2.3 Packet Format .43 4.2.3.1 SOH Field 44 4.2.3.2 SEQ Field 44 4.2.3.3 TYPE Field 44 4.2.3.4 LEN Field 44 4.2.3.5 DATA Field 45 4.2.3.6 CHECK Field .45 4.2.4 Packet Types 45 4.2.4.1 ABORT Packet 46 4.2.4.2 ABORT-A Packet 47 4.2.4.3 ACK Packet 47 4.2.4.4 ACK-C Packet 47 4.2.4.5 CHANNEL Packet 47 4.2.4.6 CONNECT Packet .48 4.2.4.6.1 PSIZE Field 49 4.2.4.6.2 BSIZE Field 49 4.2.4.6.3 SSIZE Field 50 4.2.4.6.4 CHECK Field 50 4.2.4.6.5 ENCODE Field 50 4.2.4.6.6 CTL Field 51 4.2.4.6.7 8TH Field 51 4.2.4.6.8 DUPLEX Field 52 4.2.4.7 DATA-BLOCK Packet 52 4.2.4.8 DATA-REPLY Packet 53 4.2.4.9 DATA-STREAM Packet 53 4.2.4.10 DISCONNECTED Packet 53 4.2.4.11 DISCONNECTING Packet 53 4.2.4.12 FEEDBACK Packet 54 4.2.4.13 NAK Packet 54 4.2.4.14 NAK-A Packet 54 4.2.4.15 NAK-C Packet 55 4.2.4.16 PAUSE Packet 55 4.2.4.17 PROBE Packet 55 4.2.4.18 RESUME Packet 55 4.2.4.19 TIMEOUT Packet 56 4.2.5 Protocol Description 56 4.2.5.1 CONNECT Phase 57 4.2.5.2 DATA Transfer Phase 58 4.2.5.3 DISCONNECT Phase 60 iv 4.3 Implementation .61 4.4 Throughput Experiments 62 4.4.1 Random Bit Error Distribution (BLACK30) Experiments 62 4.5 Summary 64 4.6 Conclusion 67 5. Conclusion 68 6. Bibliography 71 APPENDIX 1. Theoretical Utilization Graphs, Uniform Error Distribution 73 APPENDIX 2. Theoretical Throughput Graphs, Uniform Error Distribution 78 APPENDED 3. Measured Throughput Graphs, Uniform Error Distribution 83 APPENDIX 4. Percentage Difference Graphs, Uniform Error Distribution 91 APPENDED 5. Theoretical Utilization Graphs, Random Error Distribution 99 APPENDIX 6. Theoretical Throughput Graphs, Random Error Distribution 108 APPENDK 7. Measured Throughput Graphs, Random Error Distribution 117 APPENDED 8. Percentage Difference Graphs, Random Error Distribution 120 v LIST OF TABLES Table 1. Protocol Survey Feature Summary 17 Table 2. Percentage Difference of Measured Utilization Relative to Theoretical Utilization For Uniform Byte Error Distributions Produced By BLACK10 34 Table 3. Percentage Difference of Measured Utilization Relative to Theoretical Utilization For Random Bit Error Distributions Produced by BLACK30 37 Table 4. MAX2 Checksum Types and Field Values 43 Table 5. MAX2 Packet Types .46 Table 6. MAX2 CONNECT Packet Data Field Types 49 Table 7. MAX2 ENCODE Field Values 51 Table 8. MAX2 Packet Types Recognized By MAX2SEND and MAX2RECV . 61 Table 9. MAX2 Percentage Difference of Measured Utilization Relative to Theoretical Utilization For Random Bit Error Distributions Produced by BLACK30 63 Table 10. MAX2 Average Measured Throughput Comparison At Random Bit Error Rates Produced by BLACK30 .64 Table 11. MAX2 Protocol Feature Summary 66 Table 12. Protocol Overhead Summary 68 vi LIST OF FIGURES Figure 1. Kermit Repeat Encoding Algorithm 6 Figure 2. Kermit Eighth Bit Encoding Algorithm 6 Figure 3. Kermit Control Prefix Encoding Algorithm 7 Figure 4. Classic Kermit Packet Format 7 Figure 5. Extended Length Kermit Packet Format 9 Figure 6. XMODEM DATA Packet Format 11 Figure 7. XMODEM-CRC DATA-CRC Packet Format 11 Figure 8. XMODEM-1K DATA-IK Packet Format 12 Figure 9. ZMODEM Data Packet Format .14 Figure 10. ZMODEM Control Packet Data Field 15 Figure 11. ZMODEM Control Packet Formats 15 Figure 12. Utilization Equation For Stop and Wait Protocols 24 Figure 13. Utilization Equation For Half-Duplex Streaming Protocols (Selective Retransmission) 27 Figure 14. Utilization Equation For Full-Duplex Streaming Protocols (Selective Retransmission) , 27 Figure 15. Utilization Equation For Half-Duplex Streaming Protocols (Go Back N) 30 Figure 16. Channel Utilization For Full-Duplex Streaming Protocols (Go Back N) 30 Figure 17. Throughput Test Computer Configuration 31 Figure 18. BLACK30 Random Number Generator .36 Figure 19. Example of MAX2 Hex Encoding 41 Figure 20. MAX2 Packet Format 44 Figure 21. MAX2 CONNECT Packet Data Field Format 48 Figure 22. MAX2 RESUME Packet Data Field Format 56 vii LIST OF GRAPHS Graph 1. Theoretical Utilization At 2400 Baud And Uniform Error Distribution 74 Graph 2. Theoretical Utilization At 4800 Baud And Uniform Error Distribution 75 Graph 3. Theoretical Utilization At 9600 Baud And Uniform Error Distribution 76 Graph 4. Theoretical Utilization At 19200 Baud And Uniform Error Distribution 77 Graph 5. Theoretical Throughput At 2400 Baud And Uniform Error Distribution 79 Graph 6. Theoretical Throughput At 4800 Baud And Uniform Error Distribution 80 Graph 7. Theoretical Throughput At 9600 Baud And Uniform Error Distribution 81 Graph 8. Theoretical Throughput At 19200 Baud And Uniform Error Distribution 82 Graph 9. Measured Throughput At 2400 Baud And Uniform Error Distribution 84 Graph 10. Measured Throughput At 4800 Baud (#1) Uniform Error Distribution 85 Graph 11. Measured Throughput At 4800 Baud (#2) Uniform Error Distribution 86 Graph 12. Measured Throughput At 9600 Baud (#1) Uniform Error Distribution 87 Graph 13. Measured Throughput At 9600 Baud (#2) Uniform Error Distribution 88 Graph 14. Measured Throughput At 19200 Baud (#1) Uniform Error Distribution 89 Graph 15. Measured Throughput At 19200 Baud (#2) Uniform Error Distribution 90 Graph 16. Percentage Difference At 2400 Baud Uniform Error Distribution 92 Graph 17. Percentage Difference At 4800 Baud (#1) Uniform Error Distribution 93 Graph 18. Percentage Difference At 4800 Baud (#2) Uniform Error Distribution 94 Graph 19. Percentage Difference At 9600 Baud (#1) Uniform Error Distribution 95 Graph 20. Percentage Difference At 9600 Baud (#2) Uniform Error Distribution 96 Graph 21. Percentage Difference At 19200 Baud (#1) Uniform Error Distribution .97 Graph 22. Percentage Difference At 19200 Baud (#2) Uniform Error Distribution .98 Graph 23. Theoretical Utilization At 2400 Baud And Random Error Distribution 100 viii Graph 24. Theoretical Utilization At 4800 Baud And Random Error Distribution 101 Graph 25. Theoretical Utilization At 9600 Baud And Random Error Distribution 102 Graph 26. Theoretical Utilization At 19200 Baud And Random Error Distribution . . . . 103 Graph 27. Theoretical Utilization (Streaming Protocols) At 2400 Baud And Random Error Distribution 104 Graph 28. Theoretical Utilization (Streaming Protocols) At 4800 Baud And Random Error Distribution 105 Graph 29. Theoretical Utilization (Streaming Protocols) At 9600 Baud And Random Error Distribution 106 Graph 30. Theoretical Utilization (Streaming Protocols) At 19200 Baud And Random Error Distribution 107 Graph 31. Theoretical Throughput At 2400 Baud And Random Error Distribution . . . . 109 Graph 32. Theoretical Throughput At 4800 Baud And Random Error Distribution . . . . 110 Graph 33. Theoretical Throughput At 9600 Baud And Random Error Distribution . . . . I l l Graph 34. Theoretical Throughput At 19200 Baud And Random Error Distribution . . . .112 Graph 35. Theoretical Throughput (Streaming Protocols) At 2400 Baud And Random Error Distribution 113 Graph 36. Theoretical Throughput (Streaming Protocols) At 4800 Baud And Random Error Distribution 114 Graph 37. Theoretical Throughput (Streaming Protocols) At 9600 Baud And Random Error Distribution 115 Graph 38. Theoretical Throughput (Streaming Protocols) At 19200 Baud And Random Error Distribution 116 Graph 39. Measured Throughput At 4800 Baud And Random Error Distribution 118 Graph 40. Measured Throughput At 9600 Baud And Random Error Distribution 119 Graph 41. Percentage Difference At 4800 Baud And Random Error Distribution 121 Graph 42. Percentage Difference At 9600 Baud And Random Error Distribution 122 ix 1 ACKNOWLEDGEMENT The work in this thesis was funded in part by the National Research Council of Canada under IRAP Grant #9-8275-H-19. The equipment used in the experiments was provided by IPC Systems (3D Micro) and Telimax Software Corporation. Thanks must also be given to Dr. Sam Chanson who provided valuable guidance during the derivation of the throughput equations and the design of the throughput experiments. x 1. INTRODUCTION 1.1 MOTIVATION AND OBJECTIVES There are a large variety of protocols that can be used to transfer a file between two computer systems. Although many of these protocols are proprietary, there are several that are in the public domain and suitable for use on microcomputers. Protocols such as the Kermit, XMODEM, YMODEM, and ZMODEM protocols are in the public domain and are designed to perform end-to-end file transfers. The Kermit, XMODEM, and YMODEM are stop and wait protocols while the ZMODEM protocol is a streaming protocol with go back N retransmission. Each of these protocols have different capabilities and characteristics that determine its channel utilization under various communication channel conditions. After examining these protocols, it was felt that none of the protocols make optimal use of the communications channel under all conditions and that a better protocol could be designed. This can be confirmed experimentally or by using mathematical equations that analyze the channel utilization of these and other similar protocols under different communication channel error rates, error distributions, and transmission speeds. Work performed by Zacharov [16] and Field [3] showed that a protocol's packet size affects the channel utilization. As a packet's size increases, the chance that it is corrupted by transmission errors increases and the cost of recovering from a corrupted packet also increases. However, for a given communication channel error rate and distribution, there is a packet size that will allow for maximum channel utilization. Unfortunately, neither Field nor Zacharov considered the effect of a protocol's timeout period on the channel utilization of stop and wait protocols. 1 Miller [11], however, analyzed the throughput of several link level protocols as a function of the communication channel's bit error rate. The protocols examined used either a selective or nonselective retransmission scheme. As a result of his research, Miller, concluded that there is little performance difference between different retransmission strategies with a reliable communications channel. However, Miller's analysis did not take into account the possibility that a reply packet could be corrupted. A set of simple channel utilization equations for stop and wait protocols and sliding window protocols have been derived by Stallings [13]. However, the equations assume that reply packets are always transmitted correctly. In addition, the channel utilization equations do not consider the effect that timeouts and reply packet sizes may have on a protocol's channel utilization. A more accurate set of channel utilization equations have been derived by Tanenbaum [16]. Although these equations take more factors into consideration, they do not differentiate between the possibilities that a packet can be lost or corrupted. 1.2 OUTLINE A summary of the public domain file transfer protocols, Kermit, XMODEM, YMODEM, and ZMODEM is presented in Chapter 2. The packet sizes, packet formats, and encoding algorithm of each of the protocols and their variants are described. In addition, the capabilities and strengths of these protocols were compared. In Chapter 3, a number of mathematical models are derived that analyzes the channel utilization of stop and wait protocols, streaming protocols with selective retransmission, and streaming protocols with go back N retransmission. These models show the effect that a protocol's data packet size, reply packet size, timeout period, and data encoding algorithm and the communication channel's error rate, error distribution, and 2 transmission speed have on a protocol's effective channel utilization. Once a protocol's effective channel utilization has been determined, the protocol's effective data throughput can be calculated by taking the product of the communication channel's transmission speed and the protocol's channel utilization. The validity of these mathematical models were verified by measuring the throughput of the Kermit, XMODEM, YMODEM, and ZMODEM protocols under different communication channel transmission speeds, error rates, and error distributions. A new data link protocol, MAX2, is presented in Chapter 4. Using the information obtained from the work performed in Chapter 3, the MAX2 protocol is designed to be a powerful, versatile protocol that provides better channel utilization than the protocols described in Chapter 2. A prototype of the MAX2 protocol was implemented and its effective data throughput measured under different communication channel transmission speeds and error rates. These results were used to validate the channel utilization model for streaming protocols with selective retransmission and to show that it offers better channel utilization than the public domain file transfer protocols described in Chapter 2. 3 2. PROTOCOL SURVEY 2.1 INTRODUCTION There are many protocols that can be used to transfer information over serial telecommunication lines. Several of these protocols have been placed in the public domain and are used by many users to transfer files between machines of possibly different architectures and operating systems. This section summarizes the capabilities, strengths, and weaknesses of the following public domain file transfer protocols: Kermit, XMODEM, YMODEM, and ZMODEM. Although these protocols do not contain all seven layers of the OSI Model*, they contain aspects of the application and data link layers. However, since each of these protocols are fully described in their respective protocol documents, only those aspects of the protocols that have a direct bearing on the channel utilization are described here. 2.2 KERMIT 2.2.1 Introduction In 1981, a new file transfer protocol, Kermit, was developed at Columbia University by Bill Catchings and Frank da Cruz [3] to allow the exchange of data between a diverse mixture of computer systems. Unlike existing protocols, Kermit could be implemented on any computer system capable of transparently transmitting ASCII characters over seven bit serial lines. In addition to placing the Kermit protocol and its implementations in the public 1. Data and Computer Communications [13], page 389 4 domain, Columbia University also took on the task of coordinating the maintenance and distribution of the Kermit protocol and its implementations. 2.2.2 Classic Kermit The original Kermit protocol, Classic Kermit, was a simple stop and wait protocol with selective retransmission. To ensure that communications between extremely dissimilar systems and possibly over seven bit serial lines will be successful, the Kermit protocol packets contain only seven bit printable ASCII characters, values 32 to 126. In order to do so, the Kermit protocol applied two encoding algorithms to its packets. The first algorithm, \"tochar\", converted one byte unsigned integer field values into one byte encoded ASCII values by adding the value 32 to them. Consequently, Kermit integer field values were restricted to the values 0 to 94. The second encoding algorithm, prefix encoding, is applied to the user data. It was a three pass algorithm that performs, in order, repeat encoding (optional), eighth bit encoding, and control encoding. These algorithms are shown in Figures 1, 2, and 3, respectively. 5 BEGIN Repeat Encoding Algorithm count = 1; WHILE (more data) AND (value = next value) AND (count < 94) DO count = count + 1 value = next value END WHILE IF (count > REPEAT_THRESHOLD) THEN IF (tochar (count) = REPEAT_PREFIX_CHAR) THEN encoded count = REPEAT_PREFIX_CHAR, REPEAT_PREFIX_CHAR ELSE encoded count = tochar (count)) END IF IF (value = REP EAT_P REFIX_CHAR) THEN RETURN (encoded count, value, value) ELSE RETURN (encoded count, value) END IF ELSE WHILE (count > 0) DO encoded value = encoded value, value IF (value = REPEAT_PREFIX_CHAR) THEN encoded value = encoded value, value END IF count = count - 1 END WHILE END IF END Repeat Encoding Algorithm , Figure 1. Kermit Repeat Encoding Algorithm BEGIN Eighth B i t P r e f i x Encoding IF (value = EIGHTH_BIT_PREFIX_CHAR) THEN RETURN (EIGHTH_BIT_PREFIX_CHAR, EIGHTH_BIT_PREFIX_CHAR) ELSE IF (value > 7Fh) AND (7 b i t communications) THEN RETURN (EIGHTH_BIT_PREFIX_CHAR, value & 80h) ELSE RETURN (value) END IF END Eighth B i t P r e f i x Encoding Figure 2. Kermit Eighth Bit Encoding Algorithm 6 BEGIN Control P r e f i x Encoding IF (value == CONTROL_PREFIX_CHAR) THEN RETURN (CONTROL_PREFIX_CHAR, CONTROL_PREFIX_CHAR) ELSE IF (32 <= (value AND 7Fh) <= 12 6) THEN RETURN (value) ELSE RETURN (CONTROL_PREFIX_CH AR, value XOR 40h) END IF END Control P r e f i x Encoding Figure 3. Kermit Control Prefix Encoding Algorithm Once the data has been encoded, it is partitioned and inserted into the DATA field of packets, whose format is shown in Figure 4, such that the value of each packet's LEN field does not exceed 94 and no encoded sequence is split across two packets. If Kermit's CRC-CCITT checksum is used, each data packet could contain a maximum of 89 bytes of encoded data. 1 LEN bytes j MARK LEN SEQ TYPE DATA CHECK EOL 1 CHECKsummed 1 i n d i c a t e s s t a r t of packet, u s u a l l y CTL-A length of remainder of packet - 1 <= 94 sequence number MOD 64 packet type 0 to 91 bytes of encoded user data 1 to 3 byte checksum end of l i n e character, usually carriage return Figure 4. Classic Kermit Packet Format The Kermit protocol's error mechanism is very simple. After sending a data packet, the sender waits for the receiver to send an acknowledgement. Since all needed information MARK LEN SEQ TYPE DATA CHECK -EOL 7 is contained within the reply packet's header, the DATA field is empty. If the reply is a positive acknowledgement, the next data packet is sent; otherwise, the current data packet is retransmitted. However, if the sender does not receive a reply within a preset timeout period, it resends the current data packet. Conversely, if the receiver does not receive a data packet within its preset timeout period, it either resends its last reply or sends a negative acknowledgement for the expected data packet. 2.2.3 Extended Length Packet Extension In 1986, extended length packets were added to the Kermit protocol. This extension was fully backwards compatible with the original protocol and provided a greater effective data throughput by allowing larger data packets to be used. The format of this extended length Kermit packet is shown in Figure 5. 8 (95 * LEN1 + LEN2) bytes MARK LEN SEQ TYPE LEN1 LEN2 HCHECK DATA CHECK EOL HCHECKsummed ; CHECKsummed MARK - i n d i c a t e s s t a r t of packet, u s u a l l y CTL-A LEN - set to 0 SEQ - sequence number MOD 64 TYPE - packet type LEN1 - 0 to 94 LEN2 - 0 to 94 HCHECK - one byte arithmetic checksum of SEQ, TYPE, LEN1, and LEN2 f i e l d s DATA - 0 to 9023 bytes of p r e f i x encoded user data CHECK - 1 to 3 byte checksum EOL - end of l i n e character, u s u a l l y carriage return Figure 5. Extended Length Kermit Packet Format Although the use of extended length packets must be agreed upon by both the sender and receiver during the connection phase, both standard and extended length packets may be intermixed within the negotiated session. If the LEN field of a packet is greater than three, the packet is a standard length packet; otherwise, if the LEN field is zero, the packet is an extended length packet. Consequently, both extended length data packets and standard length reply packets can and are used during the data transfer phase. 2.2.4 Sliding Window Extension In 1985, an extension was added to the original Kermit protocol that would allow sliding windows to be used with the existing Kermit packets. When the sliding windows extension is being used, the sender is allowed to send successive data packets without 9 waiting for their replies as long as the window is not full. The receiver simply sends acknowledgements for each data packet received. In addition, negative acknowledgements are sent to the sender for any missing packets that are detected by the receiver. 2.3 XMODEM 2.3.1 Introduction The original version of the XMODEM protocol was developed by Ward Christensen in 1977 [4]. It is also referred to as \"MODEM\", \"MODEM7\", and the \"Christensen Protocol\". Since then, a number of modifications have been made that have produced XMODEM-CRC and XMODEM-1K. However, each of these modified XMODEM protocols, like the original, require an asynchronous transmission medium that is capable of providing 8 data bits, no parity bit, and one stop bit. 2.3.2 XMODEM (Original) The XMODEM protocol is a simple stop and wait protocol. It is comprised of only two types of packets: control and data packets. The control packets, ACK, NAK, CAN, and EOT, are simple one byte packets. Meanwhile, data packets, shown in Figure 6, are 132 bytes long. Furthermore, the XMODEM protocol does not perform any encoding. 10 SOH BLOCK # 255 - BLOCK # DATA CHECKSUM SOH BLOCK 255 -DATA # BLOCK # -01H, i n d i c a t e s s t a r t of packet sequence number MOD 256 ones complement of sequence number 128 bytes of user data CHECKSUM - bytewise checksum Figure 6. XMODEM DATA Packet Format After the sender has sent a DATA packet, it waits for a reply from the receiver. If the reply is an ACK, the next DATA packet is sent; otherwise, if the reply is an NAK, the DATA packet is resent. However, if the reply is a CAN, the transfer is aborted. If the sender does not receive a reply before its timeout period expires, it resends the current DATA packet. Conversely, if the receiver times out, it sends an NAK 2.3.3 XMODEM-CRC The XMODEM-CRC protocol is a simple extension of the XMODEM protocol to provide CRC-16 checksums. During the connection phase, if the receiver sends the C packet, a new control packet, instead of the NAK packet, the sender uses the DATA-CRC packets shown in Figure 7 instead of the normal DATA packets. SOH BLOCK # 255 - BLOCK # DATA CRC-16 SOH - 01H, i n d i c a t e s s t a r t of packet BLOCK # - sequence number MOD 25 6 255 - BLOCK # - ones complement of sequence number DATA - 128 bytes of user data CRC-16 - 16 b i t CRC Figure 7. XMODEM-CRC DATA-CRC Packet Format 11 2.3.4 XMODEM-1K In 1982, Chuck Forsberg improved the throughput of XMODEM and XMODEM-CRC by extending the size of the DATA packets and created the XMODEM-1K protocol [4]. This protocol required a simple modification to the XMODEM-CRC protocol and the addition of a DATA-IK packet shown in Figure 8. STX BLOCK # 255 - BLOCK # DATA CHECKSUM STX BLOCK 255 -# BLOCK # -02H, i n d i c a t e s s t a r t of packet sequence number MOD 256 ones complement of sequence number DATA - 1024 bytes of user data CHECKSUM - CRC16 (st r o n g l y recommended) or bytewise a r i t h m e t i c checksum Figure 8. XMODEM-1K DATA-IK Packet Format The checksum used in the DATA-IK packets is determined by the receiver. Like the XMODEM-CRC protocol, if the receiver sends the C packet at start up, the sender uses a CRC-16 checksum in its data packets; otherwise, a bytewise arithmetic checksum is used. Like the other XMODEM packets, DATA-IK packets are fixed length and its contents are not encoded. 2.4 YMODEM The YMODEM protocol is a modified XMODEM-1K protocol developed by Chuck Forsberg that allows multiple files to be transferred after a connection has been established [4]. When the sender receives a C packet, it sends a DATA packet containing the name (and possibly size) of the file about to be transferred. Upon receiving this DATA 12 packet, the receiver acknowledges it appropriately. When the file information has been received correctly, if it is possible to receive and store the specified file, another C packet is sent; otherwise, a CAN packet is sent to abort the transfer of the specified file. Once the sender receives the second C packet, the file transfer begins and is identical to the XMODEM-1K protocol. When the file transfer is complete, the receiver sends a C packet to request information on the next file to be transferred. If there is no file to be transferred, the sender responds with a DATA packet containing a blank file name. Once this packet is successfully ACKed the connection is terminated. A variant of the YMODEM protocol, YMODEM-g, is a streaming version of YMODEM with error detection but no error recovery. It is initiated by the receiver sending a G packet instead of the C or NAK packet at start up. In this mode, the sender simply sends data packets as fast as the transfer medium will accept them. If the receiver detects a transmission error in any data packet, it aborts the transfer. 2.5 ZMODEM In 1986, Telenet, a Public Data Network, funded a project to develop a public domain file transfer protocol. The purpose of this new protocol was to provide Telenet customers with a protocol capable of greater throughput than what was possible with existing protocols such as XMODEM, YMODEM, and Kermit. This new protocol, ZMODEM, was designed by Chuck Forsberg [5]. The ZMODEM protocol is a streaming protocol with a \"go back N\" error recovery mechanism. During the data phase, the sender sends a ZDATA control packet followed by data packets. If the receiver detects a transmission error, it sends a ZRPOS control packet to request retransmission of file data beginning at the position specified. If the ZRPOS packet 13 was received by the sender correctly, it responds with a ZDATA packet and then data packets containing the requested information. Although a ZMODEM data packet, shown in Figure 9, is always \"binary\" encoded, a control packet, shown in Figures 10 and 11 can be \"binary\" or \"hex\" encoded. DATA ZDLE TYPE CRC 0 - 1024 bytes o f user data i n d i c a t e s end of user data i n d i c a t e s data packet type e i t h e r a 16 or 32 b i t CRC, same as p r e c e d i n g packet Figure 9. ZMODEM Data Packet Format Although the binary encoding algorithm is similar to Kermit's control encoding algorithm, ZMODEM's algorithm only prefix encodes the following control values: 16,17,19, 24, 127,144,145,147, and 255. In addition, each character in the Telnet command string, \"CR-@-CR\", is prefix encoded. The operator may also request that all control values be prefix encoded. If the control packet is \"hex\" encoded, each byte is represented by a two character ASCII (lower case) string which corresponds its hexadecimal value. In either case, the checksum of the packets shown in Figure 11 is also similarly encoded. DATA -ZDLE -TYPE -CRC -14 TYPE DO DI D2 D3 TYPE - packet type DO - p o s i t i o n byte 0 (PO) or f l a g byte 3 (F3) DI - p o s i t i o n byte 1 (PI) or f l a g byte 2 (F2) D2 - p o s i t i o n byte 2 9 6 0 0 B A U D (#1) Uniform Error Distribution (BLACK10) 100O CI 900-800-700-*, 600-500- -\u00E2\u0080\u00A2 400-300-200-100-Extended Kermit XMODEM (Procomm) -E3--\"^ik YMODEM (Procomm) O.OOE+00 ' 2.00E-O4 ' 4.00E-O4 ' 6.00E-O4 1 8.00E-04 ^ 100^-03 1.00E-04 3.00E-04 5.00E-04 7.00E-04 9.00E-04 Classic Kermit Error Rate (Errors / Byte) MEASURED THROUGHPUT @ 9600 BAUD (#2) Uniform Error Distribution (BLACK10) 100C-XMODEM(DSZ) -E>-YMODEM (DSZ) -X-ZMODEM (DSZ) O.OOE+00 2.0tfE-04 4.0OE-O4 6.00E-04 8.00E-04 1.0dE-O3 1.00E-04 3.00E-04 5.0OE-O4 7.00E-04 9.00E-04 Error Rate (Errors / Byte) MEASURED THROUGHPUT @ 19200 BAUD (#1) Uniform Error Distribution (BLACK10) 20CO 1800r3> 1600-\u00E2\u0080\u00A2 1400-600- \u00E2\u0080\u00A2 400-200-O.OOE+00 2.00^ 04 ' 4.(X)'E-04 6.00E-04 8.00E-O4 1.00E-03 1.00E-04 3.00E-04 5.00E-04 7.00E-04 9.00E-04 e ook-( B.\u00C2\u00BB E+O0 2.00E-04 4.00^04 6.00E-04 8.00E-04 1.00E-03 1.00E-04 3.00E-04 5.00E-04 7.00E-04 9.00E-04 -< Classic Kermit \u00E2\u0080\u00A2\u00E2\u0080\u00A2+-. Extended Kermit XMODEM (DSZ) -ED-YMODEM (DSZ) -X-ZMODEM(DSZ) Error Rate (Errors / Byte) PERCENTAGE DIFFERENCE @ 4800 BAUD (#1) Uniform Error Distribution (BLACK10) 10 ro c & -10-0.00 i 4-E+00 2.00E-O4 4.00E-04 6.00E-04 8.0OE-O4 1.00E-03 1.00E-04 3.00E-04 5.0OE-O4 7.00E-04 9.00E-04 Classic Kermit \u00E2\u0080\u00A2\u00E2\u0080\u00A2+-Extended Kermit -x-XMODEM (Procomm) -E3--YMODEM (Procomm) Error Rate (Errors / Byte) PERCENTAGE DIFFERENCE @ 4800 BAUD (#2) Uniform Error Distribution (BLACK10) 10 -10--7? -20-8 c i Q (D S> co CD CL -30--40--50--60--70--80-0.00 \ \ \ \ \ \ \ \ i fi i I C ^ r \u00E2\u0080\u0094<. ;+00 ' 2.00E-04 - 4.00E 0^4 6.00E-04 8.00E-04 1.00E-03 1.00E-04 3.00E-04 5.00E-04 7.00E-04 9.00E-O4 B. 0E-( XMODEM (DSZ) -E3--YMODEM (DSZ) -H-ZMODEM (DSZ) Error Rate (Errors / Byte) PERCENTAGE DIFFERENCE @ 9600 BAUD (#1) Uniform Error Distribution (BLACK10) 0.00 :+00 2.00E-04 1.00E-04 3.00E-04 i-04 6.00E-O4 8.0tiE-04 1.00E-03 5.00E-04 7.00E-04 9.00E-04 B 0 < si Classic Kermit Extended Kermit XMODEM (Procomm) -E3--YMODEM (Procomm) Error Rate (Errors / Byte) CD 65 >d tr to \u00C2\u00A9 \u00C2\u00BB CD 9 ts o CD CO cn o o td \u00C2\u00BB CL to U t-<\u00C2\u00BB cn rf-cr rt-o ts PERCENTAGE DIFFERENCE @ 9600 BAUD (#2) Uniform Error Distribution (BLACK10) it> -10--20-8 \u00C2\u00A3 -30-a> c 8 -40--50--60--70--80-\ \ _ % % > \\ \> rt \ \u00C2\u00BB V * . W W t i . . . j j l x N \ \ \ \ \ \u00C2\u00A3 i x.X t O.OOE-tOO 2.0OE-O4 4.00lE-04 ' 6.00E-04 ' 8.00E-04 \" 1.0OE-O3 1.00E-04 3.00E-04 5.00E-04 7.00E-O4 9.00E-04 ok - j -\u00E2\u0080\u0094_ XMODEM (DSZ) -E3--YMODEM (DSZ) -X-ZMODEM (DSZ) Error Rate (Errors / Byte) PERCENTAGE DIFFERENCE @ 19200 BAUD (#1) Uniform Error Distribution (BLACK10) \u00E2\u0080\u0094 ^ 0.00 -t- -t- -r-I+OO 2.00E-O4 ' 4.00E-04 ' 6.00E-04 ' 8.00E-04 1.00E-03 1.00E-04 3.00E-O4 5.00E-04 7.00E-04 9.00E-04 Classic Kermit -\u00E2\u0080\u00A2+-\u00E2\u0080\u00A2 Extended Kermit XMODEM (Procomm) -E3--YMODEM (Procomm) Error Rate (Errors / Byte) PERCENTAGE DIFFERENCE @ 19200 BAUD (#2) Uniform Error Distribution (BLACK10) XMODEM (DSZ) 1.00E-04 3.00E-O4 5.00E-O4 7.00E-04 9.0OE-O4 Error Rate (Errors / Byte) APPENDIX 5. Theoretical Utilization Graphs, Random Error Distribution When examining the graphs in this appendix, please keep the following in mind: DATA REPLY PACKET PACKET PROTOCOL SIZE SIZE C l a s s i c K e r m i t 97 8 E x t e n d e d K e r m i t 1 0 3 3 8 X M O D E M - C R C 133 1 YMODEM 1 0 2 9 1 ZMODEM 1 0 2 7 21 MAX2 (1024 ) 1 0 2 4 8 MAX2 (512) 512 8 MAX2 (256 ) 2 5 6 7 MAX2 (128) 128 7 99 THEORETICAL UTILIZATION @ 2400 BAUD Random Error Distribution 5.00E-05 1.50E-O4 2.50E-04 Error Rate (Errors / Bit) THEORETICAL UTILIZATION @ 4800 BAUD Random Error Distribution THEORETICAL UTILIZATION @ 9600 BAUD Random Error Distribution THEORETICAL UTILIZATION @ 19200 BAUD Random Error Distribution THEORETICAL UTILIZATION @ 4800 BAUD Random Error Distribution THEORETICAL UTILIZATION @ 9600 BAUD Random Error Distribution THEORETICAL UTILIZATION @ 19200 BAUD Random Error Distribution Error Rate (Errors/Bit) APPENDIX 6. Theoretical Throughput Graphs, Random Error Distribution When examining the graphs in this appendix, please keep the following in mind: DATA REPLY PACKET PACKET PROTOCOL SIZE SIZE C l a s s i c Kermit 97 8 Extended Kermit 1033 8 XMODEM-CRC 133 1 YMODEM 1029 1 ZMODEM 1027 21 MAX2 (1024) 1024 8 MAX2 (512) 512 8 MAX2 (256) 256 7 MAX2 (128) 128 7 108 THEORETICAL THROUGHPUT @ 2400 BAUD Random Error Distribution THEORETICAL THROUGHPUT @ 4800 BAUD Random Error Distribution THEORETICAL THROUGHPUT @ 9600 BAUD Random Error Distribution 1000-5.00E-05 1.50E-04 2.50E-04 Error Rate (Errors / Bit) THEORETICAL THROUGHPUT @ 19200 BAUD Random Error Distribution 2000-5.00E-05 1.50E-04 2.50E-04 Error Rate (Errors / Bit) APPENDIX 7. Measured Throughput Graphs, Random Error Distribution When examining the graphs in this appendix, please keep the following in mind: DATA REPLY PACKET PACKET PROTOCOL SIZE SIZE C l a s s i c Kermit 97 8 Extended Kermit 1033 8 XMODEM-CRC 133 1 YMODEM 1029 1 MAX2 (128) 128 7 MAX2 (1024) 1024 8 117 MEASURED THROUGHPUT @ 4800 BAUD Random Error Distribution (BLACK30) Classic Kermit \u00E2\u0080\u00A2 -+--Extended Kermit MAX2 (128 bytes) -E>-MAX2 (1024 bytes) -X-XMODEM (Procomm) YMODEM (Procomm) 3.00E-04 5.O0E-05 1.50E-O4 Error Rate (Errors / Bit) 2.50E-04 MEASURED THROUGHPUT @ 9600 BAUD Random Error Distribution (BLACK30) 100O m Q_ JZ O) 3 O Classic Kermit \u00E2\u0080\u00A2\u00E2\u0080\u00A2+\u00E2\u0080\u00A2\u00E2\u0080\u00A2 Extended Kermit -yg--MAX2 (128 bytes) -E3--MAX2 (1024 bytes) XMODEM (Procomm) YMODEM (Procomm) 3.00E-04 5.00E-05 1.50E-04 Error Rate (Errors / Bit) 2.50E-04 APPENDIX 8. Percentage Difference Graphs, Random Error Distribution When examining the graphs in this appendix, please keep the following in mind: DATA REPLY PACKET PACKET PROTOCOL SIZE SIZE C l a s s i c Kermit 97 8 Extended Kermit 1033 8 XMODEM-CRC 133 1 YMODEM 1029 1 MAX2 (128) 128 7 MAX2 (1024) 1024 8 120 PERCENTAGE DIFFERENCE @ 4800 BAUD Random Error Distribution (BLACK30) Classic Kermit \u00E2\u0080\u00A2\u00E2\u0080\u00A2+--Extended Kermit MAX2 (128 bytes) -E3--MAX2 (1024 bytes) -X-XMODEM (Procomm) YMDDEM (Procomm) 3.00E-04 5.00E-05 1.50E-04 Error Rate (Errors / Bit) 2.50E-O4 PERCENTAGE DIFFERENCE @ 9600 BAUD Random Error Distribution (BLACK30) Classic Kermit Extended Kermit ->e MAX2 (128 bytes) -E3--MAX2 (1024 bytes) - * -XMODEM (Procomm) YMODEM (Procomm) 2.00E-04 3.00E-04 5.00E-05 1.50E-04 Error Rate (Errors / Bit) 2.50E-04 "@en . "Thesis/Dissertation"@en . "10.14288/1.0051993"@en . "eng"@en . "Computer Science"@en . "Vancouver : University of British Columbia Library"@en . "University of British Columbia"@en . "For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use."@en . "Graduate"@en . "Communication protocol channel utilization and the design of the MAX2 data link protocol"@en . "Text"@en . "http://hdl.handle.net/2429/30015"@en .