The CompuServe B Plus Protocol May 16, 1988 2:10 PM by Russ Ranshaw TABLE OF CONTENTS A. Introduction. B. Notation. C. B Plus Packets. 1. B Plus Packet Structure. 2. Quoting of characters. 3. Check Value. 4. B Plus Packet Types. a) Packet Type `+': Transport Parameters. b) Packet Type `T': File Transfer. c) Packet Type `N': Data. d) Packet Type `F': Failure. e) Optional `T' Packets. 1) Packet `Tr' : Download Resume. 2) Packet `Tu' : Upload Resume. 3) Packet `Tf' : Failed CRC. 4) Packet `TI' : File Information. D. B Plus Control Sequences. 1. Enquire. 2. Positive Acknowledge. 3. Wait. 4. Negative Acknowledge. 5. Panic Abort. E. Negotiation of Transport Parameters. F. Terminal Program States. G. Wait for Acknowledge. H. Packet Send Ahead I. Implementation Considerations 1. Time-Out 2. Packet Size. 3. Controlling Excessive Retransmissions. J. B Plus Transport Layer. K. Initiation of a B Plus Session. L. Supporting the Various B Protocol Versions M. Check Value Calculation. 1. Standard B Protocol Checksum. 2. XMODEM-Style CRC-16. N. Interrogation. A. Introduction. The CompuServe B protocol was developed in 1981 to provide support for a special purpose Vidtex terminal manufactured by the Tandy Corporation. It was the outgrowth of a proposed Bi-Sync oriented protocol, but with a different packet structure and provision for more than even and odd packets. The file transfer capability was added in 1982 to replace the CompuServe A protocol with a more robust protocol which was in keeping with the over-all B Protocol design. Some of the underlying assumptions made in designing the B Protocol were due to the capabilities of personal computers which were available at the time. Such machines were generally limited in the amount of available memory, 64 kilobytes being a large capacity. Other factors, such as the lack of a true UART for data communications, resulted in the send/wait nature of the protocol where only a single protocol packet at a time was sent. The explosive growth of the Personal Computer industry has given us a plethora of machines, most of which have far exceeded the early limitations of memory and communication ability. This growth has been accompanied by a multitude of file transfer protocols, such as XMODEM, KERMIT, and ZMODEM. CompuServe, realizing the need for enhancement, has developed the B Plus Protocol to meet the increasing demands being made upon its communication network and host computers, and to provide added utility for its large family of users. As the name implies, B Plus is an extension of the B Protocol. In particular: o Ability to send multiple packets without waiting for individual acknowledgements. o Larger data packets (up to 1k at present). o Optional use of modified XMODEM CRC-16 check method. o Extensions to the standard control character quoting. o Provision of a mechanism to exchange transport and application parameters. 2 B. Notation. Throughout the remainder of this document the following notational conventions will be used: o Protocol elements are enclosed within angle brackets. For example: <DLE> specifies the ASCII code for Data Link Escape. o The C-language notation for hexadecimal values will be used. Thus, the <DLE> character will also be shown as 0x10. Two entities (computers) are involved in a B Plus session. The term "Initiator" is used to refer to the entity which initiates the session. "Responder" refers to the entity which receives the initiate command. CompuServe host computers will always be the Initiator in any communication established with them. For further information regarding Host support, see Section "K. Initiation of a B Plus Session." 3 C. B Plus Packets. 1. B Plus Packet Structure. B Plus Protocol packets consist of five parts as follows: o Lead-in <DLE> <B> o Sequence <0x30 thru 0x39> o Type <Single byte> o Body <zero to 1024 data bytes> o Trailer <ETX> <Check Value> The Sequence is incremented by one for each successfully transmitted packet. It wraps from 0x39 back to 0x30. (Note that 0x30 is the ASCII character 0 and 0x39 is 9.) The Sequence, Type, all Body data, and <ETX> are included in the Check Value. Note that <Body> and <Check Value> are Quoted, and that the Check Value is computed on the actual data bytes rather than their quoted replacements (the quoting <DLE> is not included). Hence, if the character 0x13 is to be sent, it is sent as <DLE> <S> but the value 0x13 is included in the Check Value. If Standard Checksum is used, <Check Value> consists of a quoted byte. If the XMODEM CRC-16 is used, <Check Value) is transmitted as two quoted bytes with the most significant byte appearing first. By performing the CRC calculation on the XMODEM CRC-16 value, the result will be 0x0000 if no errors occured. A sample B Plus packet, sent using the Standard Checksum, is as follows: <DLE> B 7 T D A S . C <ETX> 0x2A 0x10 0x42 0x37 0x54 0x44 0x41 0x53 0x2E 0x43 0x03 0x2A where Lead-in = <DLE> B Sequence = 7 Type = T Body = DAS.C Trailer = <ETX> 0x2A If the packet was sent using the XMODEM CRC-16 option, the Check Value would be 0x57 0xFF instead of 0x2A. 4 2. Quoting of characters. The B Plus Protocol quotes certain ASCII control characters. The default set of quoted characters is: o <ETX> 0x03 o <ENQ> 0x05 o <DLE> 0x10 o <DC1> 0x11 o <DC3> 0x13 o <NAK> 0x15 The quoting mechanism uses the <DLE> character to prefix the quoted character. The quoted character with 0x40 added follows the <DLE>. For example, <ETX> is quoted as: <DLE> C 0x10 0x43 B Plus also provides a means for the Initiator and Responder to establish a different set of quoted characters. This set may consist of any or all characters in the ranges 0x00 thru 0x1f and 0x80 thru 0x9f. Quoted characters in the 0x80 thru 0x9f range are sent as: <DLE> ((char and 0x1f) + 0x60) Hence, 0x93 is quoted as: <DLE> s 0x10 0x73 When receiving protocol data, the program should be capable of decoding any quoted character, regardless of the set of quoted characters in use. This must be accomplished as follows: Get a character. If the character is <DLE> then Get next character. If character is less than 0x60 then character = character and 0x1f else character = (character and 0x1f) + 0x80 5 3. Check Value. Each B Plus packet contains a Check Value to allow detection of transmission errors. The B Plus Protocol supports two Check Value methods as follows: a) Standard B Protocol Checksum. The Standard Checksum is calculated as follows: o The checksum is initialized to zero. o For each byte that is to be checksummed: - The old checksum is rotated left 1, with the old bit 7 becoming bit 0 in the rotated value. - The new byte is added to the rotated checksum. - ...
Amiga7878