home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: DFÜ und Kommunikation / SOS-DFUE.ISO / programm / texte / bplus.doc < prev    next >
Encoding:
Text File  |  1993-11-18  |  84.1 KB  |  2,913 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                              The CompuServe B Plus Protocol
  9.  
  10.                                    November 18, 1993
  11.  
  12.                                            by
  13.  
  14.                                       Russ Ranshaw
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.       11/18/93 04:14 PM
  58.  
  59.  
  60.                                            2
  61.  
  62.                              The CompuServe B Plus Protocol
  63.                                    Table of  Contents
  64.  
  65.       A. Introduction..........................................3
  66.       B. Notation..............................................4
  67.       C. B Plus Packets........................................5
  68.            1. B Plus Packet Structure..........................5
  69.            2. Quoting of characters............................7
  70.            3. Check Value......................................9
  71.                 a) Standard B Protocol Checksum................9
  72.                 b) XMODEM-Style CRC-16.........................9
  73.                 4. B Plus Packet Types.........................10
  74.                 a) Packet Type `+':  Transport Parameters......10
  75.                 b) Packet Type `T':  File Transfer.............13
  76.                 e) Optional `T' Packets........................16
  77.       D. B Plus Control Sequences..............................20
  78.            1. Enquire..........................................20
  79.            2. Positive Acknowledge.............................21
  80.            3. Wait.............................................21
  81.            4. Negative Acknowledge.............................21
  82.            5. Panic Abort......................................21
  83.       D. Negotiation of Transport Parameters...................23
  84.       F. Terminal Program States...............................25
  85.       G. Wait for Acknowledge..................................26
  86.       H. Packet Send Ahead.....................................29
  87.       I. Implementation Considerations.........................31
  88.            1. Port Parameters..................................31
  89.            2. Time-Out.........................................31
  90.            3. Packet Size......................................33
  91.            4. Controlling Excessive Retransmissions............33
  92.            5. Flow Control.....................................34
  93.       J. B Plus Transport Layer................................35
  94.       K. Initiation of Master Mode.............................36
  95.       L. Supporting the Various B Protocol Versions............38
  96.       M. Check Value Calculation...............................40
  97.       N. Interrogation.........................................47
  98.       Index....................................................51
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.                                            2
  114.  
  115.  
  116.                                           3
  117.  
  118.  
  119.     A. Introduction
  120.  
  121.        The CompuServe B protocol was developed in 1981 to
  122.        provide support for a special purpose Vidtex terminal
  123.        manufacturers by the Tandy Corporation.  It was the
  124.        outgrowth of proposed Bi-Sync oriented protocol, but
  125.        with a differnt packet structure and provision for more
  126.        than even and odd packets.  The file transfer capability
  127.        was added in 1982 to replace the CompuServe A protocol
  128.        with a more robust protocol which was in keeping with the
  129.        over-all B Protocol design.
  130.  
  131.        Some of the underlying assumptions made in designing the B
  132.        Protocol were due to the capabilities of personal computers
  133.        which were available at the time.  Such machines were
  134.        generally limited in the amount of available memory, 64
  135.        kilobytes being a large capacity.  Other factors, such as
  136.        the lack of a true UART for data communications, resulted in
  137.        the send/wait nature of the protocol where only a single
  138.        protocol packet at a time was sent.
  139.  
  140.        The explosive growth of the Personal Computer industry has
  141.        given us a plethora of machines, most of which have far
  142.        exceeded the early limitations of memory and communication
  143.        ability.  This growth has been accompanied by a multitude of
  144.        file transfer protocols, such as XMODEM, KERMIT, and ZMODEM.
  145.        CompuServe, realizing the need for enhancement, has
  146.        developed the B Plus Protocol to meet the increasing demands
  147.        being made upon its communication network and host
  148.        computers, and to provide added utility for its large family
  149.        of users.
  150.  
  151.        As the name implies, B Plus is an extension of the B
  152.        Protocol.  In particular:
  153.  
  154.             o  Larger data packets (up to 2k].
  155.             o  Optional use of modified XMODEM CRC-16, CCITT CRC-16 and
  156.                CCITT CRC-32 cyclic redundancy check methods.
  157.  
  158.             o  Provide a unique end-of-packet marker to improve
  159.                network performance.
  160.  
  161.             o  Extensions to the standard control character quoting.
  162.  
  163.             o  Provision to allow partial transfers to be resumed at a later
  164.                time.
  165.  
  166.             o  Provision of a mechanism to exchange transport and
  167.                application parameters.
  168.  
  169.                                           3
  170.  
  171.  
  172.                                           4
  173.  
  174.  
  175.     B. Notation
  176.  
  177.        Throughout the remainder of this document the following
  178.        notation conventions will be used:
  179.  
  180.             o  Protocol elements are enclosed within angle
  181.                brackets.  For example:
  182.                       <DLE>
  183.                specifies the ASCII code for Data Link Escape.
  184.  
  185.             o  The C-language notation for hexadecimal values will
  186.                be used.  Thus, the <DLE> character will also be
  187.                shown as 0x10.
  188.  
  189.        Two entities (computers) are involved in a B Plus session.
  190.        The term "Initiator" is used to refer to the entity which
  191.        initiates the session.  "Responder" refers to the entity
  192.        which receives the initiate command.
  193.  
  194.        CompuServe host computers will always be the Initiator in
  195.        any communication established with them.
  196.  
  197.        For further information regarding Host support, see Section
  198.        "K. Initiation of Master Mode".
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.                                           4
  226.  
  227.  
  228.                                           5
  229.  
  230.  
  231.     C. B Plus Packets
  232.  
  233.  
  234.        1. B Plus Packet Structure
  235.  
  236.           B Plus Protocol packets consist of five parts as follows:
  237.  
  238.                o  Lead-in       <DLE> <B>
  239.                o  Sequence      <0x30 through 0x39>
  240.                o  Type          <Single byte>
  241.                o  Body          <zero to 2048 data bytes>
  242.                o  Trailer       <ETX> <Check Value>
  243.                                      (may be followed by <RS>)
  244.  
  245.           The Sequence is incremented by one for each successfully
  246.           transmitted packet.  It wraps from its high value (0x39)
  247.           to its low value (0x30.
  248.  
  249.           The Sequence, Type, all Body data, and <ETX> are included in
  250.           the Check Value.  Note that <Body> and <Check Value> are
  251.           Quoted (Sec. C2), and that the Check Value is computed on
  252.           the actual data bytes rather than their quoted replacements
  253.           (the quoting <DLE> is not included).  Hence, if the character
  254.           0x13 is to be sent, it is sent as <DLE> <S> but the value
  255.           0x13 is included in the Check Value.
  256.  
  257.           If Standard Checksum is used, <Check Value> consists of a
  258.           quoted byte.
  259.  
  260.           If the XMODEM CRC-16 is used, <Check Value) is transmitted
  261.           as two quoted bytes with the most significant byte appearing
  262.           first.  By performing the CRC calculation on the XMODEM
  263.           CRC-16 value, the result will be 0x0000 if no errors
  264.           occurred.
  265.  
  266.           If CCITT CRC-16 is used, <Check Value> is transmitted
  267.           as two quoted bytes, low-order first.  CCITT CRC-32 is
  268.           transmitted as four quoted bytes, from low to high order.
  269.           Note that the CCIT CRC values are transmitted as their
  270.           complemented values.
  271.  
  272.          If the remote supports either of the CCITT CRC types,
  273.          then the <RS> (0x1E) follows the Check Value.  This
  274.          character is to be used as "break character" for network
  275.          forwarding purposes.  It has no other implications for
  276.          the B Plus Protocol.  Note that any B Plus implementation
  277.          must not depend on the presence of <RS> to work.  Likewise,
  278.          all B Plus implementions must function properly if <RS> is
  279.          sent by the remote, even if the given implementation does
  280.          not use <RS> itself.
  281.                                           5
  282.  
  283.  
  284.                                           6
  285.  
  286.           A sample B Plus packet, sent using the Standard Checksum, is
  287.           as follows:
  288.  
  289.               <DLE>  B    7    T    D    A    S    .    C  <ETX> 0x2A
  290.               0x10 0x42 0x37 0x54 0x44 0x41 0x53 0x2E 0x43 0x03  0x2A
  291.  
  292.           where
  293.                    Lead-in   =    <DLE> B
  294.                    Sequence  =    7
  295.                    Type      =    T
  296.                    Body      =    DAS.C
  297.                    Trailer   =    <ETX> 0x2A
  298.  
  299.           If the packet was sent using the XMODEM CRC-16 option, the
  300.           Check Value would be 0x57 0xFF instead of 0x2A.
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.                                           6
  338.  
  339.  
  340.                                           7
  341.        2. Quoting of characters
  342.  
  343.           The B Plus Protocol quotes certain ASCII control characters.
  344.           The default set of quoted characters is:
  345.  
  346.                o  <ETX>  0x03
  347.                o  <ENQ>  0x05
  348.                o  <DLE>  0x10
  349.                o  <DC1>  0x11
  350.                o  <DC3>  0x13
  351.                o  <NAK>  0x15
  352.  
  353.         If B Plus is in effect, the following characters are added
  354.         to the default quoting set:
  355.  
  356.              o        0x1E  (<RS>)
  357.              o        0x91  (<DC1> + 0x80)
  358.              o        0x93  (<DC3> + 0x80)
  359.  
  360.           The quoting mechanism uses the <DLE> character to prefix the
  361.           quoted character.  The quoted character with 0x40 added
  362.           follows the <DLE>.  For example, <ETX> is quoted as:
  363.  
  364.                <DLE>  C
  365.                0x10 0x43
  366.  
  367.           B Plus also provides a means for the Initiator and Responder
  368.           to establish a different set of quoted characters.  This set
  369.           may consist of any or all characters in the ranges 0x00 through
  370.           0x1f and 0x80 through 0x9f.
  371.  
  372.           Quoted characters in the 0x80 through 0x9f range are sent as:
  373.  
  374.               <DLE> ((char and 0x1f) + 0x60)
  375.  
  376.           Hence, 0x93 is quoted as:
  377.  
  378.               <DLE>  s
  379.               0x10  0x73
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                           7
  394.  
  395.  
  396.                                           8
  397.  
  398.           When receiving protocol data, the program should be capable
  399.           of decoding any quoted character, regardless of the set of
  400.           quoted characters in use.  This must be accomplished as
  401.           follows:
  402.  
  403.               Get a character.
  404.               If the character is <DLE>
  405.               then
  406.                    Get next character.
  407.                    If character is less than 0x60
  408.                    then
  409.                         character = character and 0x1f
  410.                    else
  411.                         character = (character and 0x1f) + 0x80
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.                                           8
  450.  
  451.  
  452.                                           9
  453.        3. Check Value
  454.  
  455.           Each B Plus packet contains a Check Value to allow detection
  456.           of transmission errors.  The B Plus Protocol supports four
  457.           Check Value methods as follows:
  458.  
  459.         a) Standard B Protocol Checksum.
  460.  
  461.              The Standard Checksum is calculated as follows:
  462.  
  463.                   o  The checksum is initialized to zero.
  464.                   o  For each byte that is to be checksummed:
  465.                        -  The old checksum is rotated left 1, with the
  466.                           old bit 7 becoming bit 0 in the rotated value.
  467.                        -  The new byte is added to the rotated checksum.
  468.                        -  If addition of the new byte causes a carry,
  469.                           then one is added to the new value.
  470.  
  471.  
  472.         b) XMODEM-Style CRC-16.
  473.  
  474.              B Plus implementations may optionally specify that the
  475.              defacto standard XMODEM CRC-16 be used as a check value.
  476.              The only departure is that the CRC-16 value is initialized
  477.              to 0xffff instead of zero.  The XMODEM CRC-16 is transmitted
  478.              in the order of high byte through low byte.
  479.  
  480.  
  481.         c)  CCITT CRC-16 and CCITT CRC-32
  482.  
  483.             These are industry standard cyclic redundancy check values.
  484.             They are transmitted in the order of low byte throuth high
  485.             byte.
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.                                           9
  506.  
  507.  
  508.                                          10
  509.      4. B Plus Packet Types
  510.  
  511.           The following Packet Types are the minimum required to
  512.           support the B Plus Protocol:
  513.  
  514.               o  `+':  Transport Parameters
  515.               o  `T':  File Transfer
  516.               o  `N':  Data
  517.               o  `F':  Failure
  518.  
  519.         a) Packet Type `+':  Transport Parameters.
  520.  
  521.              This is the B Plus Transport Parameters Packet.  It describes an
  522.              entity's Transport capabilities.  The Transport Parameters Packet
  523.              is always sent with all characters in the ranges 0x00 through 0x1f
  524.              and 0x80 through 0x9f quoted, and using the Standard Checksum.
  525.  
  526.              The Body of the <+> packet is a series of bytes as follows:
  527.  
  528.                   WS WR BS CM DQ TL Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 DR UR FI
  529.  
  530.              where:
  531.  
  532.                   WS = Window Send.
  533.                        0x00 implies that a single packet at
  534.                        a time can be sent, 0x01 two packets.  The default
  535.                        is 0x00.
  536.                   RS = Window Receive.
  537.                        0x00 implies that the entity
  538.                        cannot receive other than a single packet at a
  539.                        time (that is, requests the other entity to use
  540.                        WS = 0x00);  0x01 implies two packets.  The
  541.                        default is 0x00.
  542.  
  543.                   BS = Block Size.
  544.                        This specifies the maximum size of
  545.                        the <Body> divided by 128.  Thus 0x04 represents
  546.                        512 bytes and 0x16 is 2048 bytes.  The value 0x00
  547.                        implies the default size of 512 bytes.
  548.  
  549.                   CM = Check Method.
  550.                      0x00   Standard checksum
  551.                        0x01 Modified XMODEM CRC-16
  552.                        0x02 CCITT CRC-16
  553.                        0x03 CCITT CRC-32
  554.  
  555.                        CompuServe urges the use of one of the CRC methods
  556.                        instead of the Standard checksum, as they are more
  557.                        robust in detecting transmission errors.  The most
  558.                        secure is CCITT CRC-32, at the expense of additional
  559.                        bytes in each packet.
  560.  
  561.                                          10
  562.  
  563.  
  564.                                          11
  565.                   DQ = Data Quoting Level.
  566.                        This parameter is part of an
  567.                        interim version of the B Plus Protocol.  It has
  568.                        been superseded by the eight byte Quoting Set in
  569.                        Parameters Q1 through Q8 (below).  For historical
  570.                        purposes, the Quoting Levels are:
  571.  
  572.                            0x00:  0x00 0x03 0x05 0x10 0x11 0x13 0x15
  573.                            0x01:  0x03 0x05 0x10 0x11 0x13 0x15
  574.                            0x02:  0x03 0x05 0x10 0x11 0x13 0x15 0x91 0x93
  575.                            0x03:  0x00 through 0x1f and 0x80 through 0x9f
  576.  
  577.                        If a Parameters packet contains Q1-Q8, the DQ must
  578.                        be ignored and the quoting set established from
  579.  
  580.                        must be used.
  581.  
  582.                   TL = Transport Layer.
  583.                        The Initiator sets   the TL
  584.                        parameter to 0x01 when it is running an
  585.                        application that must run under the Transport
  586.                        Layer.  If the Responder's half of the application
  587.                        also utilizes the Transport Layer, it must also
  588.                        set the TL parameter to 0x01.  The default value
  589.                        is 0x00.  More information is in Section "J. B
  590.                        Plus Transport Layer."
  591.  
  592.                   Q1-Q4
  593.                        A mask indicating which characters in the range
  594.                        0x00 through 0x1f the entity wants quoted.  The
  595.                        mapping of bits to characters is:
  596.  
  597.                          Bit:   7    6    5    4    3    2    1    0
  598.                          ----- ---- ---- ---- ---- ---- ---- ---- ----
  599.                            Q1: 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07
  600.                            Q2: 0x08 0x09 0x0a 0x0b 0x0c 0x0d 0x0e 0x0f
  601.                            Q3: 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17
  602.                            Q4: 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
  603.  
  604.                        CompuServe Hosts currently use:
  605.  
  606.                             Q1   Q2   Q3   Q4
  607.                            0x14 0x00 0xd4 0x02
  608.  
  609.                   Q5-Q8
  610.                          Same as Q1-Q4 for the range 0x80 through 0x9f.
  611.                          CompuServe Hosts currently use:
  612.  
  613.                             Q1   Q2   Q3   Q4
  614.                            0x00 0x00 0x50 0x00
  615.  
  616.  
  617.                                          11
  618.  
  619.  
  620.                                          12
  621.                   DR
  622.                          Download Resume.
  623.                                0x00 : Download Resume not supported
  624.                                0x01 : Supports `Tr' Packet
  625.                                0x02 : Supports `Tr' and `Tf' Packets
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.                                          12
  674.  
  675.  
  676.                                          13
  677.                   FI
  678.                          File Information.  This parameter specifies the
  679.                          level of extended file handling supported.
  680.  
  681.                                0x00 = No extended file handling
  682.                                0x01 = `TI' (File Information) Packet
  683.  
  684.              These are the currently defined Transport Layer Parameters.
  685.              CompuServe reserves the right to define additional
  686.              parameters at any time.  Programs must be capable of
  687.              accepting any number of parameters.  Received parameters
  688.              beyond the known ones must be ignored. If fewer Transport
  689.              Parameters are received than the entity understands, then
  690.              any beyond the last received parameter must be treated as if
  691.              it was provided as 0x00, which must be its default value.
  692.  
  693.              See Section "F.  Negotiation of Transport Parameters" for
  694.              details on deciding what level of capabilities each entity
  695.              is to use.
  696.  
  697.         b) Packet Type `T':  File Transfer.
  698.  
  699.              The File Transfer Packet consists of three fields as
  700.              follows:
  701.  
  702.                   <Direction> <Data type> <File name>
  703.  
  704.              1) Function.
  705.                      `D' = Download (Initiator -> Responder)
  706.                      `U' = Upload (Responder -> Initiator)
  707.                      `C' = Close.  End of Upload or Download
  708.  
  709.                 (Note:  Additional "T" packets are defined later.)
  710.              2) Data type.
  711.                      `A' = 7-bit ASCII data.  (Allows for End of Line
  712.                                                conversion.)
  713.                      `B' = 8-bit Binary data.
  714.                      `I' = Image data.  (This is hardware specific data and
  715.                            usually consists of some embedded header which
  716.                            describes the remainder of the file.  It is
  717.                            always 8-bit binary data.)
  718.  
  719.              3) File Name.
  720.  
  721.                 This field is variable length and specifies the name of the
  722.                 file to be transferred.
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.                                          13
  730.  
  731.  
  732.                                          14
  733.              A sample File Transfer packet using CRC Check Method is:
  734.  
  735.                 <DLE>  B    7   T   D     A   S    .   C  <ETX>0x57 0xff
  736.  
  737.                  0x10 0x42 0x37 0x54 0x44 0x41 0x53 0x2e 0x43 0x03 0x57 0xff
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.                                          14
  786.  
  787.  
  788.                                          15
  789.  
  790.              which specifies:
  791.                  o    `T':  File Transfer
  792.                  o    `D':  Download to the Responder
  793.                  o    `A':  This is an ASCII file
  794.                  o  `S.C':  The file name
  795.  
  796.              Note that there are no guidelines as to what the Responder
  797.              is to do with the File Transfer packet.  In particular, the
  798.              implementor is free to locally verify the request, permit
  799.              the file name to be changed, etc.
  800.  
  801.              If the Responder does not wish to comply with the request
  802.              made in the File Transfer packet, a Failure Packet must be
  803.              returned to the Initiator.
  804.  
  805.           c) Packet Type `N':  Data.
  806.  
  807.              This is a data packet.  The data being transferred is broken
  808.              up into a series of <N> packets.  There may be zero to the
  809.              negotiated data block size.  A count of zero does not imply
  810.              end of file.
  811.  
  812.           d) Packet Type `F':  Failure.
  813.  
  814.              This is the general Failure Packet.  A Failure Packet may be
  815.              sent at any time; the value of the <Sequence> field is
  816.              ignored.  The first character of the <Body> indicates the
  817.              general nature of the failure, and the remainder may be a
  818.              printable ASCII message further describing the condition.
  819.              The following standard failures must be supported:
  820.  
  821.                   `A':  Abort.  Usually sent if the user requests that the
  822.                         terminal program cease transferring data.
  823.  
  824.                   `C':  Capacity failure.  Out of memory or disk.
  825.  
  826.                   `E':  Processing error.  Any error other than described
  827.                         by another Failure Packet.
  828.  
  829.                   `I':  I/O error occurred.
  830.  
  831.                   `M':  File requested for Uploading is Missing (not
  832.                         found).
  833.  
  834.                   `N':  Unimplemented Packet Type was received.
  835.  
  836.                   `S':  Protocol Sequence Number failure.
  837.  
  838.                   `r`:  Transfer Resume failure.
  839.  
  840.  
  841.                                          15
  842.  
  843.  
  844.                                          16
  845.              When a Failure Packet is received, it must be acknowledged and
  846.              the transfer aborted.  Similarly, when a Failure Packet is sent,
  847.              the sending entity must wait for the acknowledge to arrive.  In
  848.              addition, the entity which sends the Failure Packet must ignore
  849.              all other packets while waiting for the acknowledgment to
  850.              arrive.  Once the Failure Packet is successfully transferred,
  851.              both entities are expected to leave protocol mode.
  852.  
  853.             e) Optional `T' Packets.
  854.  
  855.              Several "T" Packets may optionally be supported.  The
  856.              support for these packets is specified by the DR, UR, and FI
  857.              Transport Parameters.
  858.  
  859.              1) Packet `Tr' : Download Resume.
  860.  
  861.                 When the Responder receives the "TD" (Download Request)
  862.                 packet and the specified file already exits, it may attempt
  863.                 to resume the download which was aborted during a prior
  864.                 session.  In order to do this, both entities must specify
  865.                 Transport Parameter DR > 0x00.  If the Responder attempts
  866.                 the resumption, a `Tr' Packet is returned to the Initiator
  867.                 as follows:
  868.  
  869.                     <DLE> B <Sequence> T r <Length> <crc> <ETX> <Trailer>
  870.  
  871.                 where:
  872.  
  873.                     <Length> = current number of bytes in Responder's
  874.                                existing file.
  875.  
  876.                     <crc> = cyclic redundance check value of
  877.                           all existing data in Responder's file.
  878.  
  879.                           Note that <crc> is evaluated utilizing
  880.                           the same algorithm as employed for
  881.                           packets.  If the Standard Checksum is
  882.                           being used, then XMODEM CRC-16, initialized
  883.                           to -1, is used.
  884.  
  885.                 Both <Length> and <crc> are transmitted as an ASCII
  886.                 decimal string and are both followed by at least a single
  887.                 space.
  888.  
  889.                 The Initiator will perform the same <crc> calculation over
  890.                 <Length> bytes and compare the resulting CRC-16 values.  If
  891.                 the calculated and `Tr' values agree, downloading continues
  892.                 with `N` Packets and Responder appends the data to the
  893.                 existing file.  If the files match exactly, a `TC' (Transfer
  894.                 Close) packet is sent.
  895.  
  896.  
  897.                                          16
  898.  
  899.  
  900.                                          17
  901.                 If the <crc> values do not match, or the Initiator's file
  902.                 be shorter than <Length> bytes, the Initiator's response
  903.                 depends on the value of the DR Transport Parameter:
  904.  
  905.                         0x01 - A `Fr' (Failed Resume) Packet is sent
  906.                         0x02 - A `Tf' (CRC Failed) Packet is sent
  907.  
  908.                 Some operating environments complicate Download Recovery.
  909.                 Since the Initiator has no knowledge of any data
  910.                 transformations, such as  Carriage Return and Line Feed
  911.                 mappings, the Responder must take any such transformations
  912.                 into consideration when calculating <length> and <crc>.
  913.                 Under some environments, it is probably simpler to maintain
  914.                 this information during the download and preserve it in a
  915.                 file (Apple Macintosh (TM) for example.)
  916.  
  917.              2) Packet `Tf' : Failed CRC
  918.  
  919.                 The `Tf' packet is sent when a Resume request fails due to
  920.                 CRC failure.  It will be sent only if the Responder and
  921.                 Initiator both specify Transport Parameter DR > 1.  It
  922.                 implies that the transfer is to continue from the beginning
  923.                 of the file.
  924.  
  925.                 Sample packet exchanges for transfer resumption:
  926.  
  927.                         Initiator           Responder      Comments
  928.                         ---------           ---------      -----------------
  929.                 DR = 0x01 or 0x02:
  930.                         TD --------------->                Download Request
  931.                            <--------------- Tr             Resume Download
  932.                         N  --------------->                CRC matched
  933.                                ...
  934.                         TC --------------->                End of transfer
  935.  
  936.                 DR = 0x01:
  937.                         TD --------------->                Download Request
  938.                            <--------------- Tr             Resume Download
  939.                         Fr --------------->                Resume failed
  940.  
  941.                 DR = 0x02:
  942.                         TD --------------->                Download Request
  943.                            <--------------- Tr             Resume Download
  944.                         Tf --------------->                CRC mismatched
  945.                            <--------------- ACK            Transfer entire
  946.                         N  --------------->                Data
  947.                               ...
  948.                         TC --------------->                End of transfer
  949.  
  950.  
  951.  
  952.  
  953.                                          17
  954.  
  955.  
  956.                                          18
  957.              3) Packet `TI' : File Information.
  958.  
  959.                 The `TI' Packet is transmitted by the File Sender, provided
  960.                 that both entities have their Transport Parameter FI > 0x00.
  961.                 It is used to convey specific data concerning the file as it
  962.                 exists on the Sending entity.  The format of the `TI' Packet
  963.                 is as follows:
  964.  
  965.                     <Lead-in> <Sequence> T I <data type> <compression >
  966.                         <file length> <creation date> <creation time>
  967.                         <modification date> <modification time>
  968.                         <true name length> <true name> <Trailer>
  969.  
  970.                 where:
  971.                     <data type> :  A = ASCII, B = Binary.
  972.  
  973.                     <compression> :  Specifies how the file is compressed
  974.                                      during transmission (has nothing to do
  975.                                      with the content of the file).
  976.                                        0x00 = not compressed
  977.                                               (other values reserved for
  978.                                                future use by CompuServe)
  979.  
  980.                     <file length> :  Current length of the file being sent.
  981.                                      (Actual number of file data bytes being
  982.                                      sent, not the number of compressed
  983.                                      bytes).  This value is passed for display
  984.                                      display or media check only.
  985.  
  986.                     <zone> :           Minutes offset from UCT of Sender.
  987.  
  988.                     <creation date> :  Date the file was created.
  989.                                        ASCII decimal string, yyyymmdd
  990.  
  991.                     <creation time> :  Time of day the file was created.
  992.                                        ASCII decimal string, seconds
  993.                                        since midnight.
  994.  
  995.                     <modification date> :  Date the file was last modified.
  996.                                        Same format as <creation date>.
  997.                                        (`0' if unknown)
  998.  
  999.                     <modification time> :  Time of day the file was last
  1000.                                        modified.  Same format as
  1001.                                        <creation time>.  (`0' if unknown)
  1002.  
  1003.                     <true name length> :  Number of bytes in <true name>.
  1004.                                           (This is a single binary byte.)
  1005.  
  1006.                     <true name> : The actual file name with any device,
  1007.                                   directory, or other ancillary information
  1008.                                   removed.
  1009.                                          18
  1010.  
  1011.  
  1012.                                          19
  1013.  
  1014.                 It is not necessary that all fields be transmitted.
  1015.  
  1016.                 A sample TI packet (file information only) is:
  1017.  
  1018.                    "A?55387 300 19880422 52480 0 0 ?BPLUS.DOC"
  1019.                      |       |             |       |
  1020.                     0x00    EST         7:18 PM   0x09
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.                                          19
  1066.  
  1067.  
  1068.                                          20
  1069.  
  1070.     D. B Plus Control Sequences
  1071.  
  1072.        The B Plus Protocol defines several Control Sequences in
  1073.        addition to packets.  Control Sequences are used to manage
  1074.        the progress of the B Plus Session.
  1075.  
  1076.        1. Enquire
  1077.  
  1078.           The Enquire Control Sequence consists of the single
  1079.           character:
  1080.  
  1081.                   <ENQ>
  1082.                    0x05
  1083.  
  1084.           It is sent in one of two circumstances:
  1085.  
  1086.                o  The Responder is in terminal mode and the Initiator
  1087.                   wants to synchronize its <Sequence> number, and to
  1088.                   tell the Responder to set up for normal B Protocol.
  1089.                   When the <ENQ> is received, the Responder must:
  1090.  
  1091.                     >  Prepare for 512 byte data blocks
  1092.                     >  Prepare for Standard Checksum
  1093.                     >  Initialize its Sequence to 0x30
  1094.                     >  Transmit the string:
  1095.  
  1096.                          <DLE> + + <DLE> 0x30
  1097.  
  1098.                     >  Return to terminal mode.  Note:  The terminal
  1099.                        program  definitely should NOT enter B Protocol
  1100.                        mode when the <ENQ> is received.
  1101.  
  1102.                   Note:
  1103.                        It is possible that some remote implementations
  1104.                        of B Plus require longer time-outs.  This is
  1105.                        supported by including an "R" in the <ENQ>
  1106.                        response as follows:
  1107.  
  1108.                            <DLE> + + R <DLE> 0
  1109.  
  1110.                        The presence of the "R" causes the host to
  1111.                        double its time-out values.
  1112.  
  1113.                o  The entity sending the packet has received a
  1114.                   Negative Acknowledge, or timed out while waiting for
  1115.                   an Acknowledge.  The response to an <ENQ> during a B
  1116.                   Plus session is a Positive Acknowledge.
  1117.  
  1118.  
  1119.  
  1120.  
  1121.                                          20
  1122.  
  1123.  
  1124.                                          21
  1125.        2. Positive Acknowledge
  1126.  
  1127.           When a correctly checked and sequenced packet is received,
  1128.           a Positive Acknowledge is transmitted.  This consists of:
  1129.  
  1130.                <DLE> Sequence
  1131.  
  1132.           where Sequence is the Sequence number of the last validly
  1133.           received packet.
  1134.  
  1135.        3. Wait
  1136.  
  1137.           The Wait Control Sequence informs the receiving entity that
  1138.           the sending entity requires additional time to process what
  1139.           it has received.  Wait is sent as:
  1140.  
  1141.               <DLE> ;
  1142.  
  1143.  
  1144.  
  1145.        4. Negative Acknowledge
  1146.  
  1147.           When the receiving entity receives a packet with an
  1148.           unexpected <Sequence>, improper checksum or times out, it
  1149.           sends a Negative Acknowledge to the other entity.  This
  1150.           consists of the single byte:
  1151.  
  1152.                <NAK>  0x15
  1153.  
  1154.           When the sending entity receives a NAK, it initiates a
  1155.           Re synchronization Process by sending two <ENQ> characters
  1156.           and waiting until it receives two identical Positive
  1157.           Acknowledgments.
  1158.  
  1159.  
  1160.        5. Panic Abort
  1161.  
  1162.           The B Plus Protocol recognizes a series of four <DLE>
  1163.           characters as a panic abort.  The need for such a facility
  1164.           can arise if the Responder computer becomes locked up during
  1165.           a transfer, and it is necessary to reboot.  Since <DLE> is
  1166.           really control-P, sending it is a very simple procedure.
  1167.  
  1168.           In addition, the Initiator recognizes the sequence:
  1169.  
  1170.                <DLE> +
  1171.  
  1172.           while waiting for a Positive Acknowledge as being incorrect,
  1173.           and will abort the transfer.  This can happen as above, but
  1174.           before the operator can press control-P the Initiator sends
  1175.           an <ENQ> during a down-load to find out what is happening.
  1176.           The Responder, now in terminal emulation mode, responds
  1177.                                          21
  1178.  
  1179.  
  1180.                                          22
  1181.           with:
  1182.  
  1183.                <DLE> + + <DLE> 0
  1184.  
  1185.           and the Initiator will abort cleanly.  For this reason it is
  1186.           essential that any B Plus implementation observe the rules
  1187.           for <ENQ>:  If in terminal mode, send <DLE> + + <DLE> 0;
  1188.           otherwise send <DLE> Sequence.
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.                                          22
  1234.  
  1235.  
  1236.                                          23
  1237.     D. Negotiation of Transport Parameters
  1238.  
  1239.        The Initiator begins a B Plus protocol session by sending:
  1240.  
  1241.                  <ENQ>
  1242.  
  1243.        while the Responder is in terminal mode.  The Responder sets
  1244.        itself up for:
  1245.  
  1246.            o  Standard Checksum
  1247.            o  Default Quoting
  1248.            o  512 byte data block
  1249.            o  Sets its Sequence to 0x30 (`0')
  1250.            o  transmits the sequence:
  1251.  
  1252.                      <DLE> + + <DLE> 0
  1253.  
  1254.            o  returns to terminal mode.
  1255.  
  1256.        The Initiator, detecting the `<DLE> + +', sends a Transport
  1257.        Parameters Packet using Standard Checksum and quoting of
  1258.        0x00 through 0x1f and 0x80 through 0x9f.  When the Responder
  1259.        properly receives this packet, it must transmit a Transport
  1260.        Parameters Packet indicating its own parameter settings.
  1261.        Once the Initiator Acknowledges the Responder's Transport
  1262.        Parameters Packet, each entity then establishes its
  1263.        operating configuration based on the minimal matching
  1264.        parameters.  In particular, the Initiator and Responder each
  1265.        choose the minimum of:
  1266.  
  1267.           Own       Other's
  1268.        Parameter   Parameter
  1269.  
  1270.           WS           WR    <- Note the cross-comparison of
  1271.           WR           WS    <- these parameters.
  1272.           BS           BS
  1273.           CM           CM
  1274.           TL           TL
  1275.           DR           DR
  1276.           UR           UR
  1277.           FI           FI
  1278.  
  1279.        and the inclusive-or of the Quoting Sets.
  1280.  
  1281.        For example, if the Initiator sends the sequence:
  1282.  
  1283.                 0x01 0x01 0x08 0x01 0x01 0x00
  1284.                 0x14 0xd4 0x00 0x00          <- Quoting Set
  1285.                 0x00 0x00 0x00 0x00          <-
  1286.                 0x01 0x00 0x00               <- DR UR FI
  1287.  
  1288.  
  1289.                                          23
  1290.  
  1291.  
  1292.                                          24
  1293.        and the Responder returns:
  1294.  
  1295.                 0x00 0x01 0x04 0x00 0x01 0x00
  1296.                 0x54 0xd4 0x00 0x00          <- Quoting Set
  1297.                 0x40 0x50 0x00 0x00          <-
  1298.  
  1299.        The following parameters are used by both entities:
  1300.  
  1301.           Parameter  Initiator  Responder
  1302.              WS         0x01      0x00      Initiator sends 1
  1303.                                             packet ahead.
  1304.  
  1305.              WR         0x00      0x01      Responder sends 1
  1306.                                             packet and waits for
  1307.                                             Positive Acknowledge
  1308.              BS         0x04      0x04      Both use 512 byte
  1309.                                             data body
  1310.              CM         0x00      0x00      Standard Checksum
  1311.  
  1312.              The following characters will be quoted when
  1313.              transmitted by either entity:
  1314.  
  1315.                 0x01 0x03 0x05 0x10 0x11 0x13 0x15 0x81 0x91 0x93
  1316.                 SOH  ETX  ENQ  DLE  XON  XOFF NAK  SOH  XON  XOFF
  1317.  
  1318.              This would be the quoting used for a Responder
  1319.              having a modem which treats the 0x01 as "Escape to
  1320.              command mode" and in addition responds to flow
  1321.              control characters (0x11 0x13 0x91 0x93).
  1322.  
  1323.        Since the Responder did not transmit the DR, UR, and FI
  1324.        parameters, the initiator sets them to 0x00.
  1325.  
  1326.        The next packet transmitted will be expected to obey the
  1327.        negotiated Transport Parameters.
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.                                          24
  1346.  
  1347.  
  1348.                                          25
  1349.  
  1350.  
  1351.     F. Terminal Program States
  1352.  
  1353.        This section describes the expected state transitions for a
  1354.        terminal program which supports the B Plus Protocol.
  1355.  
  1356.        Current State      Event     Action         Next State
  1357.        ------------------------------------------------------------
  1358.        Terminal      <ENQ> Rcvd.    Return:        Terminal
  1359.                                 <DLE> + + <DLE> 0
  1360.                                 Set up for normal
  1361.                                 B Protocol
  1362.  
  1363.                      <DLE> Rcvd.    None.          DLE_Seen
  1364.  
  1365.                      <Other>        Process as an
  1366.                                     ASCII char.    Terminal
  1367.  
  1368.        ------------------------------------------------------------
  1369.        DLE_Seen      <B> Rcvd.      None.          Get_First_Packet
  1370.  
  1371.                      <other> Rcvd.  None.          Terminal
  1372.  
  1373.        ------------------------------------------------------------
  1374.        Get_First_Packet        Receive the Packet
  1375.                      Valid packet :
  1376.  
  1377.                      <+>      Process Transport     Terminal
  1378.                                Parameters; set
  1379.                                up for B Plus if
  1380.                                successful exchange
  1381.  
  1382.                      <T>      Invoke Transfer       Terminal
  1383.                                Process
  1384.  
  1385.                      <other>  Return Failure        Terminal
  1386.                                Packet N
  1387.  
  1388.        ------------------------------------------------------------
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.                                          25
  1402.  
  1403.  
  1404.                                          26
  1405.  
  1406.  
  1407.     G. Wait for Acknowledge
  1408.  
  1409.        The Wait for Acknowledge procedure is the work-horse of the
  1410.        B PLUS Protocol.  It is implemented as a Finite State Automaton
  1411.        having thirteen states as follows:
  1412.  
  1413.          State               Description
  1414.        ----------------   ----------------------------------------
  1415.        S_Get_DLE          Wait for <DLE> from Responder.
  1416.        S_DLE_Seen         Get character following the <DLE>.
  1417.        S_DLE_B PLUSSeen       Receive Packet Sequence Number.
  1418.        S_Get_Data         Receive data portion of packet.
  1419.        S_Get_Check        Receive check value.
  1420.        S_Get_CRC          Receive CRC.
  1421.        S_Verify_CRC       Compare received to calculated CRC.
  1422.        S_Verify_CKS       Compare received to calculated checksum.
  1423.        S_Verify_Packet    Check for failure packet; verify packet
  1424.                           sequence number.
  1425.        S_Send_NAK         Count error; send <NAK> to Responder.
  1426.        S_Send_ACK         Send ACK sequence to Responder.
  1427.        S_Send_ENQs        Count error; Send two <ENQ> characters to
  1428.                           Responder.
  1429.        S_Resend_Packets   Retransmit packet(s) to Responder.
  1430.  
  1431.  
  1432.        The State Transition table follows:
  1433.  
  1434.        State              Event          Action              Next State
  1435.        ----------------   ------------   -----------------   -----------
  1436.        S_Get_DLE          <DLE>           ...                S_DLE_Seen
  1437.                           <NAK>           ...                S_Send_ENQ
  1438.                           <ENQ>           ...                S_Send_ACK
  1439.                           <ETX>           ...                S_Send_NAK
  1440.                           timeout         ...                S_Send_ENQ
  1441.                           other           ...                S_Get_DLE
  1442.  
  1443.        S_DLE_Seen         <digit>        Release Packet      return success
  1444.                                              -or-
  1445.                                          If <ENQ> sent       S_Resend_Packets
  1446.                                          else                S_Get_DLE
  1447.                           <B>             ...                S_DLE_B PLUSSeen
  1448.                           <;>             ...                S_Get_DLE
  1449.                           <ENQ>           ...                S_Send_ACK
  1450.                           timeout         ...                S_Send_ENQ
  1451.                           other           ...                S_Get_DLE
  1452.  
  1453.        S_DLE_B PLUSSeen       <ENQ>           ...                S_Send_ACK
  1454.                           <char>         Save <char>
  1455.                                          Intit Check Value   S_Get_Data
  1456.                           timeout         ...                S_Send_NAK
  1457.                                          26
  1458.  
  1459.  
  1460.                                          27
  1461.  
  1462.        S_Get_Data         <ETX>           ...                S_Get_Check
  1463.                           timeout         ...                S_Send_NAK
  1464.                           <ENQ>           ...                S_Send_ACK
  1465.                           <char>         Add <char> to
  1466.                                            check value
  1467.                                          Store <char> in
  1468.                                            buffer            S_Get_Data
  1469.  
  1470.        S_Get_Check        <char>         If Check Method is
  1471.                                            CRC_16            S_Get_CRC
  1472.                                            Checksum          S_Verify_CKS
  1473.                           timeout         ...                S_Send_NAK
  1474.  
  1475.        S_Get_CRC          <char>         Add <char> to
  1476.                                            Received CRC   S_Verify_CRC
  1477.                           timeout         ...                S_Send_NAK
  1478.  
  1479.        S_Verify_CRC        ...           If Received CRC
  1480.                                            = Calc. CRC    S_Verify_Packet
  1481.                                          else                S_Send_NAK
  1482.  
  1483.        S_Verify_CKS        ...           If Received CKS
  1484.                                            = Calc. CKS       S_Verify_Packet
  1485.                                          else                S_Send_NAK
  1486.  
  1487.        S_Verify_Packet    ...            If Saved <char>
  1488.                                            = expected Seq
  1489.                                               number         Return size
  1490.                                             -or-
  1491.                                          If Packet Type
  1492.                                            = `F'             Return size
  1493.                                          If duplicate
  1494.                                            packet            S_Send_ACK
  1495.                                          else                S_Send_NAK
  1496.  
  1497.        S_Send_NAK         ...            Count Receive
  1498.                                             Error
  1499.                                          If too many errors  Return failure
  1500.                                          If not Aborting
  1501.                                          then Send <NAK>
  1502.                                                              S_Get_DLE
  1503.  
  1504.        S_Send_ACK         ...            IF not Aborting
  1505.                                          then Send ACK sequence
  1506.                                                              S_Get_DLE
  1507.  
  1508.        S_Send_ENQ         ...            Send <ENQ><ENQ>     S_Get_DLE
  1509.  
  1510.        S_Resend_Packets   ...            Send all un-ACKed
  1511.                                            packets.          S_Get_DLE
  1512.  
  1513.                                          27
  1514.  
  1515.  
  1516.                                          28
  1517.        Note:  "Aborting" means that a Failure Packet has been sent.  If
  1518.               Failure Packet has been sent, all outstanding packets are
  1519.               assumed to be ACKed.
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.                                          28
  1570.  
  1571.  
  1572.                                          29
  1573.  
  1574.     H. Packet Send Ahead
  1575.  
  1576.        One of the most useful features of the B Plus Protocol, from
  1577.        the user's point of view, is its ability to send more than
  1578.        one packet ahead of receiving the acknowledgment of the
  1579.        oldest one.  This improves through-put by overlapping the I/O
  1580.        performed on both the Initiator and Responder computers,
  1581.        including the time required for the Responder computer's
  1582.        acknowledgment to arrive at the Initiator and wake up the
  1583.        Initiator's application program.
  1584.  
  1585.        The Packet Send Ahead is accomplished by keeping a set of
  1586.        buffers in memory, one for each permitted outstanding
  1587.        packet.  Each buffer contains the corresponding packet's
  1588.        <Sequence>, count, and the data itself.  In addition a
  1589.        counter of outstanding packets (i.e., not yet ACKed) is
  1590.        maintained and incremented whenever a packet is sent for the
  1591.        first time.
  1592.  
  1593.        Two indices into the set of buffers are used to keep track
  1594.        of the Send Ahead status.  One keeps track of which buffer
  1595.        holds the oldest packet and the other which buffer may be
  1596.        filled with new data.
  1597.  
  1598.        When a packet is about to be sent, the outstanding count is
  1599.        checked to see if the maximum number of outstanding packets
  1600.        has been reached.  If so, a routine (GetACK) is invoked
  1601.        which waits for the ACK to arrive for the oldest outstanding
  1602.        packet.  Several possibilities exist:
  1603.            o The oldest packet is ACKed.  In this case, move the
  1604.              Oldest Outstanding index to point to the next oldest
  1605.              packet and decrement the outstanding packet count.
  1606.            o Some other packet in the buffer pool has been ACKed.
  1607.              This implies an ACK has been missed.  Move the Oldest
  1608.              Outstanding index to point to the buffer following the
  1609.              received ACK, and decrement the Outstanding Count
  1610.              accordingly.
  1611.            o A NAK is received.  Retransmit all packets which are
  1612.              outstanding.
  1613.  
  1614.        If the Outstanding count is still at the maximum, stay in
  1615.        GetACK.
  1616.  
  1617.        Finally, a procedure is necessary which calls GetACK until
  1618.        either a failure occurs or the Outstanding count is zero.
  1619.  
  1620.        The Send Ahead Process proceeds as follows:
  1621.  
  1622.                                                    Receiver's
  1623.  
  1624.  
  1625.                                          29
  1626.  
  1627.  
  1628.                                          30
  1629.        Packet   Sequence  Buffer    Outstanding    Response
  1630.          1        `1'       0           1            ...
  1631.          2        `2'       1           2            ...
  1632.          3  GetACK                                 ACK `1'
  1633.                   `3'       0           2            ...
  1634.          4  GetACK                                 ACK `2'
  1635.                   `4'       1           2            ...
  1636.          5  GetACK                                 ACK `3'
  1637.                   `5'       0           2            ...   (Last)
  1638.             GetACK                                 ACK `4'
  1639.                                         1            ...
  1640.             GetACK                                 ACK `5'
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.                                          30
  1682.  
  1683.  
  1684.                                          31
  1685.  
  1686.     I. Implementation Considerations
  1687.  
  1688.  
  1689.        1. Port Parameters
  1690.  
  1691.           The CompuServe B Plus Protocol requires that the communication
  1692.           path provide for 8-bit data.  This is frequently referred to as
  1693.           "8N1" port parameters.  Often terminal programs operate in "7E1"
  1694.           mode (7 bits, even parity), necessitating a shift from 7E1 to
  1695.           8N1 when entering B/B Plus mode.
  1696.  
  1697.           However, such shift in parameters is often difficult to
  1698.           accomplish, particularly in today's multitasking and LAN
  1699.           environments.  With buffered port I/O, it is difficult to make
  1700.           the parameter shift without compromising data already in the
  1701.           buffer.
  1702.  
  1703.           It is highly recommended that a terminal program initialize its
  1704.           port to 8N1.  If necessary, the 7E1 can be accomplished by
  1705.           software in the terminal emulation code.  This can be done by
  1706.           providing a simple routine which the terminal emulation program
  1707.           uses to obtain input from the host.  The routine simply strips
  1708.           off the parity bit by "anding" with 0x7f.  Similarly, output to
  1709.           the port from the terminal program can append a parity bit as
  1710.           needed.  This can be done by a simple 256 byte table, or using
  1711.           the parity test instruction provided in some microprocessors.
  1712.  
  1713.  
  1714.        2. Time-Out
  1715.  
  1716.           A per-character time-out of ten seconds should be used.
  1717.           Using anything less can result in a loss of good control
  1718.           over the exchange of packet and control sequences.  If
  1719.           conditions over a switched network degrade sufficiently, a
  1720.           small time out can lead to excessive retransmissions of
  1721.           data.  On the other hand, longer time-out values will result
  1722.           in a more sluggish detection of protocol breakdown.
  1723.  
  1724.           The receiving entity should be silent when a time-out occurs.
  1725.           That is, a <NAK> should not be sent when a time-out occurs
  1726.           while receiving a packet.  The reason is that under severely
  1727.           degraded network loading it may happen that it takes longer
  1728.           for the sending entity's data to arrive than the receiving
  1729.           entity's time-out interval.  This can lead to many kinds of
  1730.           situations in which there is excessive retransmission of
  1731.           data.  The question to be answered by the implementor is:
  1732.           "Am I more concerned about how fast I can shut down the
  1733.           transfer when the sending entity goes away than I am about
  1734.           getting the transfer to occur regardless of how long it
  1735.           takes?"  If the answer is that response to a vanished sender
  1736.           is more important, then send a <NAK> when a time-out occurs.
  1737.                                          31
  1738.  
  1739.  
  1740.                                          32
  1741.           If getting the job done is more important, then don't send
  1742.           the <NAK> on time-out.
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.                                          32
  1794.  
  1795.  
  1796.                                          33
  1797.        3. Packet Size
  1798.  
  1799.           The following chart shows the percentage of housekeeping overhead
  1800.           for various packet sizes (not including quoted characters):
  1801.  
  1802.                                                     Packet
  1803.              Data  Packet                      Transmission Time
  1804.              Size   Size    Useful    Overhead   300 1200 2400 9600
  1805.              ----  ------   ------    --------  ---- ---- ---- ----
  1806.              128    135     94.8 %    5.2 %      4.5  1.1  0.6  0.2
  1807.              256    263     97.3 %    2.7 %      8.8  2.2  1.1  0.3
  1808.              384    391     97.7 %    2.3 %     13.0  3.3  1.6  0.4
  1809.              512    519     98.7 %    1.3 %     17.3  4.3  2.2  0.5
  1810.              640    647     98.9 %    1.1 %     21.6  5.4  2,7  0.7
  1811.              768    775     99.1 %    0.9 %     25.8  6.5  3,2  0.8
  1812.              896    903     99.2 %    0.8 %     30.1  7.5  3.8  0.9
  1813.             1024   1031     99.3 %    0.7 %     34.4  8.6  4.3  1.1
  1814.             2048   2055     99.6 %    0.03 %    68.5 17.1  8.6  2.1
  1815.  
  1816.           At first glance it might seem reasonable to always use the largest
  1817.           data packets.  However, consideration should be given to the
  1818.           amount of time required to recover from a transmission error.
  1819.           For example, using 1024 byte data packets at 300 baud, over a
  1820.           minute of excessive transmission time would result (two packets)
  1821.           each time an error occurred.  Experience shows that keeping the
  1822.           packet transmission time to between four and five seconds
  1823.           results in a reasonably comfortable recovery time.  So, for best
  1824.           over-all performance, the following packet sizes are
  1825.           recommended:
  1826.  
  1827.              Baud      Size
  1828.              ----      ----
  1829.               300       128
  1830.              1200       512
  1831.              2400      1024
  1832.              9600      2048  (with 4 or 5 packet send-ahead)
  1833.  
  1834.  
  1835.        4. Controlling Excessive Retransmissions
  1836.  
  1837.           Over a very noisy link the send-ahead nature of B Plus might
  1838.           cause the performance to degrade due to retransmission of
  1839.           packets.  To circumvent this degradation, the following
  1840.           heuristic is recommended:
  1841.  
  1842.              Initialize  SA_Error_Count to zero.
  1843.              If packets are retransmitted, increment SA_Error_Count by 3.
  1844.              If SA_Error_Count is greater than or equal to 12, drop out of
  1845.                   Send-Ahead mode (i.e., revert to send and wait mode).
  1846.              When a packet is ACKed, and SA_Error_Count is greater than
  1847.                   zero,  decrement SA_Error_Count by one.
  1848.  
  1849.                                          33
  1850.  
  1851.  
  1852.                                          34
  1853.           The values (increment by 3, limit of 12, decrement by 1) can be
  1854.           varied in accord with the implementor's experience, perhaps
  1855.           being established by user-definable parameters.
  1856.  
  1857.  
  1858.        5. Flow Control
  1859.  
  1860.          When sending data to a CompuServe node, the sender may be
  1861.          told to stop sending.  This can happend if the system (host
  1862.          and/or network) is too busy to support the full data rate
  1863.          in use.  If the terminal program does not honor the flow
  1864.          contol, lost data and excessive retrnnmissions are likely
  1865.          to result.  If B Plus being used, the terminal program may
  1866.          also flow control its incoming data stream.
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.                                          34
  1906.  
  1907.  
  1908.                                          35
  1909.  
  1910.     J. B Plus Transport Layer
  1911.  
  1912.        Some distributed applications (that is, applications in
  1913.        which the Initiator and Responder each perform some of the
  1914.        work) require that blocks of information be exchanged.
  1915.        Running such applications over normal communication channels
  1916.        can cause loss or altering of data, yielding unpredictable
  1917.        results.  To alleviate this possibility, the B Plus Protocol
  1918.        provides the ability to use the underlying packet structure
  1919.        to exchange blocks of data with error detection and
  1920.        retransmission.
  1921.  
  1922.        Entering the Transport Layer operation is more complicated
  1923.        than the File Transfer mode previously described:
  1924.  
  1925.            o  The user invokes a CompuServe application
  1926.            o  The application program transmits a CompuServe
  1927.               Application Protocol escape sequence.
  1928.            o  The user's terminal program responds with an escape
  1929.               sequence which informs the host application that it
  1930.               must use the Transport Layer.
  1931.            o  The host program initializes its B Plus routines,
  1932.               setting the Transport Layer parameter to 0x01.
  1933.            o  The terminal program waits until its own B Plus
  1934.               routines have been initialized, also setting the
  1935.               Transport Layer parameter to 0x01.
  1936.            o  Once the host and remote B Plus routines have
  1937.               exchanged their Transport Layer Parameters, the
  1938.               Transport Layer is in effect.  The succeeding action
  1939.               is a function of the application.
  1940.  
  1941.        From an implementation standpoint, the primary differences
  1942.        from the B Plus Protocol so far described are:
  1943.  
  1944.            o  Separate Packet Sequence Numbers are maintained for
  1945.               sending and receiving.
  1946.            o  Received Packets are placed in a first-in-first-out
  1947.               queue.
  1948.            o  Another level of software is placed between the
  1949.               packet handlers and the application.  This level is
  1950.               responsible for sending and receiving blocks of data,
  1951.               packaging them into protocol-sized packets.
  1952.  
  1953.        The following Packet Types are used in the Transport Layer:
  1954.  
  1955.            `M':  This is a data packet; another data packet follows.
  1956.  
  1957.            `L':  This is the last data packet for the current block.
  1958.  
  1959.        A Failure Packet will terminate the transport layer for both
  1960.        entities.
  1961.                                          35
  1962.  
  1963.  
  1964.                                          36
  1965.  
  1966.     K. Initiation of Master Mode
  1967.  
  1968.        The following state machine describes the process of a host
  1969.        entity initiating a B Plus Session.  Its starting state is
  1970.        Initiate_B PLUSProtocol.
  1971.  
  1972.        Note:
  1973.         CompuServe reserves the right to restrict implementation of
  1974.         this process, termed "Master Mode".  It is necessary for
  1975.         interested parties to obtain a license from CompuServe.
  1976.  
  1977.        State         Received  Action                   Next State
  1978.        ------        --------  ----------------------   ----------
  1979.  
  1980.        Initiate_B PLUSProtocol       Set ENQ_Count to 0
  1981.                                Set Standard Checksum
  1982.                                Set 512 byte Data Block
  1983.                                Set default quote set
  1984.                                Clear Plus_Seen and
  1985.                                Plus_Plus flags          Send_ENQ
  1986.  
  1987.        -----------------------------------------------------------
  1988.  
  1989.        Send_ENQ        ...     Increment ENQ_Count
  1990.                            If ENQ_Count > 5
  1991.                            then Exit with Failure
  1992.                            Transmit <ENQ>       Get_DLE
  1993.  
  1994.        -----------------------------------------------------------
  1995.  
  1996.        Get_DLE       <DLE>     ...                      Get_Digit
  1997.                      <+>       If Plus_Seen true,
  1998.                                  then set Plus_Plus
  1999.                                       ...               Get_DLE
  2000.                   <R>      Set Relaxed_Timing        Get_DLE
  2001.                      timeout                            Send_ENQ
  2002.  
  2003.        ------------------------------------------------------------
  2004.  
  2005.        Get_Digit     <digit>   Initialize Send and
  2006.                                  Receive Sequence
  2007.                                  Numbers                Send_Parameters
  2008.                      <+>       Set Plus_Seen            Get_DLE
  2009.                      timeout       ...                  Send_ENQ
  2010.  
  2011.        ------------------------------------------------------------
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.                                          36
  2018.  
  2019.  
  2020.                                          37
  2021.        Send_Parameters ...     If Plus_Seen true,
  2022.                                  then
  2023.                                     if Plus_Plus true,
  2024.                                       then set to quote
  2025.                                          0x00-0x1f and
  2026.                                          0x80-0x9f
  2027.  
  2028.                                     if Send Parameters Packet Failed
  2029.                                then Exit with Failure
  2030.  
  2031.                                     If Receive Parameters Packet Failed
  2032.                                then Exit with Failure
  2033.  
  2034.                                     Establish session's parameters
  2035.                                Exit with Success
  2036.  
  2037.        -------------------------------------------------------------
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.                                          37
  2074.  
  2075.  
  2076.                                          38
  2077.  
  2078.     L. Supporting the Various B Protocol Versions
  2079.  
  2080.        There are four versions of B Protocol which an implementor must
  2081.        be aware of.  Any new implementation should follow the B Plus
  2082.        Protocol as described in this document to ensure full
  2083.        compatibility with all existing CompuServe Host software.  The
  2084.        four versions are:
  2085.  
  2086.                 o  "Classic" B Protocol
  2087.                 o  An interim version of B Plus (called Interim B)
  2088.                 o  B Plus
  2089.  
  2090.        The differences are:
  2091.  
  2092.            Initial <ENQ> response:
  2093.                 Classic B             <DLE> <digit>
  2094.                 Interim B:           <DLE> + <DLE> <digit>
  2095.                 B Plus:              <DLE> + + <DLE> <digit>
  2096.                   or         <DLE> + + R <DLE> 0
  2097.  
  2098.            Default Quoting Sets:
  2099.                 Classic B:           0x00 -> 0x1f
  2100.                 Interim B:           0x00 0x03 0x05 0x10 0x11 0x13 0x15
  2101.                 B Plus:              0x03 0x05 0x10 0x11 0x13 0x15
  2102.  
  2103.            Extended Quoting:
  2104.                 Classic B:      none
  2105.                 Interim B:      Specified by the DQ Parameter:
  2106.                                 0x00 : 0x00 0x03 0x05 0x10 0x11 0x13 0x15
  2107.                                 0x01 : 0x03 0x05 0x10 0x11 0x13 0x15
  2108.                                 0x02 : 0s03 0x05 0x10 0x11 0x13 0x15 0x91 0x93
  2109.                                 0x03 : 0x00-0x1f and 0x80-0x9f
  2110.                 B Plus:         Established by the Q1 through Q8 parameters.
  2111.  
  2112.            Quoting of the Parameters Packet:
  2113.                 Classic B:           No parameters packet
  2114.                 Interim B:           0x00 -> 0x1f
  2115.                 B Plus:              0x00 -> 0x1f and 0x80 -> 0x9f
  2116.  
  2117.            Response to a <NAK>:
  2118.                 Classic B:           Retransmit the last packet
  2119.                 Interim B:           Resynchronize with <ENQ><ENQ>, wait for
  2120.                                      two identical ACK sequences, retransmit
  2121.                                      as necessary.
  2122.                 B Plus:              Same as Interim B
  2123.  
  2124.        CompuServe Host software will support all three B Protocol
  2125.        versions.  In order to do so, it relies on the initial response
  2126.        to <ENQ> to determine what version is being used in the terminal
  2127.  
  2128.  
  2129.                                          38
  2130.  
  2131.  
  2132.                                          39
  2133.        software.  The defaults given in Section D.1 ("Enquire") are
  2134.        intended to reflect "Classic" B Protocol.  If the Host receives
  2135.  
  2136.            <DLE> <+> <DLE> <digit>
  2137.  
  2138.        it sends its Transport Parameters Packet using "Classic" B data
  2139.        quoting (0x00 -> 0x1f).  If two "+" characters are received, it
  2140.        will quote 0x00 -> 0x1f and 0x80 -> 0x9f.  This is done to
  2141.        maximize the chances of getting the packet through most modems
  2142.        and networks.  Once the Transport Parameters Packets have been
  2143.        successfully exchanged, the Host software uses the negotiated
  2144.        quoting set, and the remote is expected to do likewise.
  2145.        Negotiation of quoted characters allows implementors to provide
  2146.        configuration set up to cope with a wide variety of modems,
  2147.        operating system, network, and other situations which can
  2148.        adversely affect through transmission of 8-bit binary data.
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.                                          39
  2186.  
  2187.  
  2188.                                          40
  2189.  
  2190.     M. Check Value Calculation
  2191.  
  2192.        1. Standard B Protocol Checksum.
  2193.  
  2194.           The following C-language code fragment illustrates the
  2195.           Standard Checksum calculation:
  2196.  
  2197.           int
  2198.             checksum;
  2199.  
  2200.           do_checksum (ch)
  2201.           unsigned int ch;
  2202.           {
  2203.               checksum = checksum << 1;
  2204.  
  2205.               if checksum > 0xff
  2206.                   checksum = (checksum  & 0xff) + 1;
  2207.  
  2208.               checksum += ch & 0xff;
  2209.  
  2210.               if checksum > 0xff
  2211.                   checksum = (checksum & 0xff) + 1;
  2212.           };
  2213.  
  2214.        2. XMODEM-Style CRC-16.
  2215.  
  2216.           /*
  2217.            * Calculates XMODEM-style CRC (uses the CCITT V.41
  2218.            * polynomial but
  2219.            * completely backwards from the normal bit ordering).
  2220.            */
  2221.           static unsigned crc_xmodem_tab[] = {
  2222.           0x0000,0x1021,0x2042,0x3063,0x4084,0x50A5,0x60C6,0x70E7,
  2223.           0x8108,0x9129,0xA14A,0xB16B,0xC18C,0xD1AD,0xE1CE,0xF1EF,
  2224.           0x1231,0x0210,0x3273,0x2252,0x52B5,0x4294,0x72F7,0x62D6,
  2225.           0x9339,0x8318,0xB37B,0xA35A,0xD3BD,0xC39C,0xF3FF,0xE3DE,
  2226.           0x2462,0x3443,0x0420,0x1401,0x64E6,0x74C7,0x44A4,0x5485,
  2227.           0xA56A,0xB54B,0x8528,0x9509,0xE5EE,0xF5CF,0xC5AC,0xD58D,
  2228.           0x3653,0x2672,0x1611,0x0630,0x76D7,0x66F6,0x5695,0x46B4,
  2229.           0xB75B,0xA77A,0x9719,0x8738,0xF7DF,0xE7FE,0xD79D,0xC7BC,
  2230.           0x48C4,0x58E5,0x6886,0x78A7,0x0840,0x1861,0x2802,0x3823,
  2231.           0xC9CC,0xD9ED,0xE98E,0xF9AF,0x8948,0x9969,0xA90A,0xB92B,
  2232.           0x5AF5,0x4AD4,0x7AB7,0x6A96,0x1A71,0x0A50,0x3A33,0x2A12,
  2233.           0xDBFD,0xCBDC,0xFBBF,0xEB9E,0x9B79,0x8B58,0xBB3B,0xAB1A,
  2234.           0x6CA6,0x7C87,0x4CE4,0x5CC5,0x2C22,0x3C03,0x0C60,0x1C41,
  2235.           0xEDAE,0xFD8F,0xCDEC,0xDDCD,0xAD2A,0xBD0B,0x8D68,0x9D49,
  2236.           0x7E97,0x6EB6,0x5ED5,0x4EF4,0x3E13,0x2E32,0x1E51,0x0E70,
  2237.           0xFF9F,0xEFBE,0xDFDD,0xCFFC,0xBF1B,0xAF3A,0x9F59,0x8F78,
  2238.           0x9188,0x81A9,0xB1CA,0xA1EB,0xD10C,0xC12D,0xF14E,0xE16F,
  2239.           0x1080,0x00A1,0x30C2,0x20E3,0x5004,0x4025,0x7046,0x6067,
  2240.           0x83B9,0x9398,0xA3FB,0xB3DA,0xC33D,0xD31C,0xE37F,0xF35E,
  2241.                                          40
  2242.  
  2243.  
  2244.                                          41
  2245.           0x02B1,0x1290,0x22F3,0x32D2,0x4235,0x5214,0x6277,0x7256,
  2246.           0xB5EA,0xA5CB,0x95A8,0x8589,0xF56E,0xE54F,0xD52C,0xC50D,
  2247.           0x34E2,0x24C3,0x14A0,0x0481,0x7466,0x6447,0x5424,0x4405,
  2248.           0xA7DB,0xB7FA,0x8799,0x97B8,0xE75F,0xF77E,0xC71D,0xD73C,
  2249.           0x26D3,0x36F2,0x0691,0x16B0,0x6657,0x7676,0x4615,0x5634,
  2250.           0xD94C,0xC96D,0xF90E,0xE92F,0x99C8,0x89E9,0xB98A,0xA9AB,
  2251.           0x5844,0x4865,0x7806,0x6827,0x18C0,0x08E1,0x3882,0x28A3,
  2252.           0xCB7D,0xDB5C,0xEB3F,0xFB1E,0x8BF9,0x9BD8,0xABBB,0xBB9A,
  2253.           0x4A75,0x5A54,0x6A37,0x7A16,0x0AF1,0x1AD0,0x2AB3,0x3A92,
  2254.           0xFD2E,0xED0F,0xDD6C,0xCD4D,0xBDAA,0xAD8B,0x9DE8,0x8DC9,
  2255.           0x7C26,0x6C07,0x5C64,0x4C45,0x3CA2,0x2C83,0x1CE0,0x0CC1,
  2256.           0xEF1F,0xFF3E,0xCF5D,0xDF7C,0xAF9B,0xBFBA,0x8FD9,0x9FF8,
  2257.           0x6E17,0x7E36,0x4E55,0x5E74,0x2E93,0x3EB2,0x0ED1,0x1EF0};
  2258.  
  2259.  
  2260.  
  2261.  
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.                                          41
  2298.  
  2299.  
  2300.                                          42
  2301.  
  2302.           unsigned CRC;
  2303.           UpdCrc (Byte)
  2304.           unsigned int ByteC;
  2305.          {  CRC =
  2306.                crc_xmodem_tab [(CRC >> 8 ^ Byte) & 0xff] ^ (crc << 8);
  2307.           };
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.                                          42
  2354.  
  2355.  
  2356.                                          43
  2357.  
  2358.        3. CCITT CRC-16 and CRC-32
  2359.  
  2360.    /*
  2361.     * CCITT CRC-32
  2362.     */
  2363.    typedef unsigned long int UNS_32_BITS; /* Need an unsigned type capable of
  2364.    holding 32 bits; */
  2365.  
  2366.    #define CRC_32_POLY           0xedb88320L
  2367.    #define CCITT_CRC_32_COMPARE  0xdebb20e3
  2368.  
  2369.    static UNS_32_BITS crc_32_tab[] = { /* CRC polynomial 0xedb88320 */
  2370.    0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
  2371.    0xe963a535, 0x9e6495a3,
  2372.    0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
  2373.    0xe7b82d07, 0x90bf1d91,
  2374.    0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb,
  2375.    0xf4d4b551, 0x83d385c7,
  2376.    0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
  2377.    0xfa0f3d63, 0x8d080df5,
  2378.    0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447,
  2379.    0xd20d85fd, 0xa50ab56b,
  2380.    0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75,
  2381.    0xdcd60dcf, 0xabd13d59,
  2382.    0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423,
  2383.    0xcfba9599, 0xb8bda50f,
  2384.    0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11,
  2385.    0xc1611dab, 0xb6662d3d,
  2386.    0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
  2387.    0x9fbfe4a5, 0xe8b8d433,
  2388.    0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d,
  2389.    0x91646c97, 0xe6635c01,
  2390.    0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b,
  2391.    0x8208f4c1, 0xf50fc457,
  2392.    0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49,
  2393.    0x8cd37cf3, 0xfbd44c65,
  2394.    0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7,
  2395.    0xa4d1c46d, 0xd3d6f4fb,
  2396.    0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
  2397.    0xaa0a4c5f, 0xdd0d7cc9,
  2398.    0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3,
  2399.    0xb966d409, 0xce61e49f,
  2400.    0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81,
  2401.    0xb7bd5c3b, 0xc0ba6cad,
  2402.    0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af,
  2403.    0x04db2615, 0x73dc1683,
  2404.    0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d,
  2405.    0x0a00ae27, 0x7d079eb1,
  2406.    0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
  2407.    0x196c3671, 0x6e6b06e7,
  2408.  
  2409.                                          43
  2410.  
  2411.  
  2412.                                          44
  2413.    0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9,
  2414.    0x17b7be43, 0x60b08ed5,
  2415.    0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767,
  2416.    0x3fb506dd, 0x48b2364b,
  2417.    0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55,
  2418.    0x316e8eef, 0x4669be79,
  2419.    0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703,
  2420.    0x220216b9, 0x5505262f,
  2421.    0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
  2422.    0x2cd99e8b, 0x5bdeae1d,
  2423.    0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f,
  2424.    0x72076785, 0x05005713,
  2425.    0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d,
  2426.    0x7cdcefb7, 0x0bdbdf21,
  2427.    0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b,
  2428.    0x6fb077e1, 0x18b74777,
  2429.    0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69,
  2430.    0x616bffd3, 0x166ccf45,
  2431.    0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
  2432.    0x4969474d, 0x3e6e77db,
  2433.    0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5,
  2434.    0x47b2cf7f, 0x30b5ffe9,
  2435.    0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693,
  2436.    0x54de5729, 0x23d967bf,
  2437.    0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1,
  2438.    0x5a05df1b, 0x2d02ef8d
  2439.    };
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.                                          44
  2466.  
  2467.  
  2468.                                          45
  2469.  
  2470.    /*
  2471.     * CCITT CRC-16
  2472.     */
  2473.  
  2474.    #define CRC_CCITT_POLY        0x8408L /* X^16+X^12+X^5+X^0 */
  2475.    #define CCITT_CRC_16_COMPARE  0xf0b8
  2476.  
  2477.    static UNS_32_BITS crc_ccitt_tab[] = { /* CRC-CCITT polynomial 0x8408 */
  2478.    0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
  2479.    0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
  2480.    0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
  2481.    0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
  2482.    0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
  2483.    0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
  2484.    0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
  2485.    0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
  2486.    0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
  2487.    0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
  2488.    0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
  2489.    0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
  2490.    0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
  2491.    0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
  2492.    0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
  2493.    0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
  2494.    0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
  2495.    0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
  2496.    0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
  2497.    0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
  2498.    0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
  2499.    0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
  2500.    0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
  2501.    0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
  2502.    0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
  2503.    0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
  2504.    0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
  2505.    0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
  2506.    0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
  2507.    0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
  2508.    0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
  2509.    0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
  2510.    };
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.                                          45
  2522.  
  2523.  
  2524.                                          46
  2525.  
  2526.    /*
  2527.     * This macro calculates an updated CRC value for either the
  2528.     * CCITT CRC-16 or CCITT CRC-32 polynomials.  It will ___                                                         not work
  2529.  
  2530.     * for the XMODEM CRC-16.
  2531.     *
  2532.     *   octet     = new 8-bit value to be added to the CRC
  2533.     *   crc       = current CRC value
  2534.     *   tab       = either crc_32_tab or ccitt_crc_tab
  2535.     */
  2536.  
  2537.    #define updcrc(octet, crc, tab) (tab[((crc) ^ (octet)) & 0xff] ^ ((crc) >> 8))
  2538.  
  2539.    /*
  2540.     * The calculation process is as follows:
  2541.     *
  2542.     *      transmitter                         receiver
  2543.     * ----------------------       -----------------------------------
  2544.     * preset to -1                 preset to -1
  2545.     * for all data octets          for all octets, including rec'd crc
  2546.     *   updcrc                       updcrc
  2547.     * invert (xor 0xffffffff)      compare (0xf0b8 if CCITT CRC-16,
  2548.     * transmit crc, LSB first               0xdebb20e3 if CCITT CRC-32)
  2549.     *
  2550.     */
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.                                          46
  2578.  
  2579.  
  2580.                                          47
  2581.  
  2582.  
  2583.     N. Interrogation
  2584.  
  2585.        Although not part of the B Plus Protocol, implementors are urged
  2586.        to support the CompuServe Interrogation Sequence.  This process
  2587.        passes information to the CompuServe Host to identify the
  2588.        various options supported by the terminal program.  Host
  2589.        software will generally perform an Enquire (Section D.1) first
  2590.        to determine if the terminal program supports B Protocol.  If B
  2591.        Protocol ("Classic," Interim B, or B Plus) is supported, the host
  2592.        then sends the sequence:
  2593.  
  2594.                 <ESC> I
  2595.  
  2596.        When the terminal program receives this sequence of characters,
  2597.        it transmits an Interrogation Response as follows:
  2598.  
  2599.            <#> <<Product> <F-codes> <+> <Check> <CR>
  2600.  
  2601.        where:
  2602.  
  2603.            <#>          Identifies the string as an Interrogation
  2604.                         Response
  2605.  
  2606.  
  2607.           <Product>   Identifies the remote software as
  2608.                       follows:
  2609.  
  2610.                        <PID> <:> <Ver> <:> <Ops>
  2611.  
  2612.                       where:
  2613.                            <PID>      = Product Id
  2614.                                            (1 to 6 char.)
  2615.                            <Ver>      = Version
  2616.                                            (1 to 12 char.)
  2617.                            <Ops>      = Operating System
  2618.                                            (1 to 3 char.)
  2619.  
  2620.                       Example:
  2621.  
  2622.                            WINCIM:1.0.b7:W31
  2623.  
  2624.                       identified CompuServe WinCIM version
  2625.                       1.0.b7 running under Windows 3.1.
  2626.  
  2627.                       The PID and Ops fields will be assigned
  2628.                       by CompuServe Marketing.
  2629.  
  2630.  
  2631.  
  2632.  
  2633.                                          47
  2634.  
  2635.  
  2636.                                          48
  2637.  
  2638.            <F-codes>    A series of character fields giving the
  2639.                         options supported.  Each <F-code> is followed
  2640.                         by a comma.  The currently recognized <F-codes>
  2641.                         are as follows:
  2642.  
  2643.                           Cursor/Screen Control
  2644.                                AC : ANSI Color
  2645.                                CA : ANSI/VT100 Cursor Control
  2646.                                CC : VIDTEX/VT52 Cursor Control
  2647.                                CW : Wide mode (Double width characters
  2648.                                          invoked by <ESC> <m>
  2649.                                          uninvoked by <ESC> <l> (lower
  2650.                                               case L)
  2651.                                SSyx : Screen Size; y gives number of
  2652.                                       lines + 31, x gives number of
  2653.                                       columns Plus 31.  SS7o identifies
  2654.                                       a 24 line by 80 column screen.
  2655.                                       It is suggested that the SS field
  2656.                                       always be present.
  2657.  
  2658.                                       Note: The SS code is not
  2659.                                       currently utilized by CompuServe
  2660.                                       software.
  2661.  
  2662.  
  2663.                           Graphics
  2664.                                GF : GIF graphics
  2665.                                GH : High resolution RLE graphics
  2666.                             GJ : JPEG graphics
  2667.                                GM : Medium resolution RLE graphics
  2668.                                NF : Full NAPLPS graphics
  2669.                             GIvcpwwwhhh : GIF Capabilities
  2670.                                 v  = highest GIF supported:
  2671.                                         0 = 87a
  2672.                                         1 = 89a
  2673.                                 c  = color bits/pixel
  2674.                                 p  = color resolution
  2675.                               www  = width in pixels (hex)
  2676.                               hhh  = heighth in pixels (hex)
  2677.  
  2678.                           Protocols
  2679.                                AP : Recognizes and properly responds to
  2680.                                     the CompuServe Application Protocol
  2681.                                     escape sequences
  2682.                                CB : Capture Buffer
  2683.                                PB : B Protocol (includes Interim B and
  2684.                                     B Plus)
  2685.                                PX : XMODEM
  2686.  
  2687.  
  2688.  
  2689.                                          48
  2690.  
  2691.  
  2692.                                          49
  2693.                          International
  2694.                             CHd   : Character Set
  2695.                             COddd : Country Code
  2696.                             LAd   : Language Preference
  2697.                           (Note: d represents decimal
  2698.                                digits)
  2699.  
  2700.                           Miscellaneous
  2701.                                HC : Hard Copy (printer connected)
  2702.                                XX : Ignored
  2703.  
  2704.                      All other <F-codes> are reserved for future use.
  2705.  
  2706.            <Check>      This is a check value derived by adding
  2707.                         together all characters in the Interrogate
  2708.                         Response up to and including the +,
  2709.                         truncating the sum to 16 bits, and converting
  2710.                         it to an ASCII digit string.
  2711.  
  2712.            <CR>         This is the ASCII Carriage Return and serves to
  2713.                         terminate the Interrogate Response.
  2714.  
  2715.        If the <Check> value does not match, the host will send another
  2716.        <ESC> I and compare the string it receives to the previous one.
  2717.        If the two strings match, it is accepted, otherwise the <ESC> I
  2718.        and matching will continue for ten trials before giving up.
  2719.  
  2720.        A sample Interrogate Response is:
  2721.  
  2722.            #PC3:3.2a:D,CC,GH,GM,GF,PB,+1035<CR>
  2723.  
  2724.        which specifies:
  2725.  
  2726.  
  2727.           o PC3:3.2a:D
  2728.                 CompuServe PC3 v. 3.2a for DOS
  2729.           o CC
  2730.                 Supports standard VIDTEX/VT52 cursor controls
  2731.           o GH
  2732.                 Supports high-resolution RLE graphics
  2733.           o GM
  2734.                 Supports medium-resolution RLE graphics
  2735.           o GF
  2736.                 Supports GIF
  2737.           o PB
  2738.                 Supports B Protocol
  2739.           o 1035
  2740.                 Sum of "#PC3:3.2a:D,CC,GH,GM,GF,PB,+"
  2741.  
  2742.  
  2743.  
  2744.  
  2745.                                          49
  2746.  
  2747.  
  2748.                                          50
  2749.        For additional information concerning the Interrogation
  2750.        Response, please contact CompuServe Incorporated, Microcomputer
  2751.        Software Development.
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.                                          50
  2802.  
  2803.  
  2804.                                          51
  2805.  
  2806.  
  2807.  
  2808.                                         Index
  2809.  
  2810.  
  2811.    B Plus Control Sequences, 20
  2812.    B Plus Packet Types, 10
  2813.    B Plus Transport Layer., 35
  2814.    B Protocol Versions, 38
  2815.    Calculating
  2816.      CCITT CRC-16, 45
  2817.      CCITT CRC-32, 43
  2818.      Standard B Protocol Checksum, 40
  2819.      XMODEM-Style CRC-16, 40
  2820.    Check Value, 9
  2821.    Check Value Calculation, 40
  2822.    Controlling Excessive Retransmissions., 33
  2823.    Enquire, 20
  2824.    Flow Control, 34
  2825.    History of CompuServe B Protocol, 3
  2826.    Initiation of Master Mode, 36
  2827.    Master Mode, 36
  2828.    mplementation Considerations, 31
  2829.    Negative Acknowledge, 21
  2830.    Negotiation of Transport Parameters, 23
  2831.    Notation, 4
  2832.    nterrogation., 47
  2833.    Optional `T' Packets., 16
  2834.    Packet
  2835.      Structure, 5
  2836.         Body, 5
  2837.         Lead-in, 5
  2838.         Sequence, 5
  2839.         Trailer, 5
  2840.         Type, 5
  2841.      Type, 15
  2842.         'F' - Failure, 15
  2843.         'L' - Last transport data, 35
  2844.         'M' - More transport data, 35
  2845.         `+':  Transport Parameters., 10
  2846.         `N':  Data., 15
  2847.         `T':  File Transfer., 13
  2848.         `Tf' : Failed CRC, 17
  2849.         `TI' : File Information., 18
  2850.         `Tr' : Download Resume, 16
  2851.    Packet Send Ahead, 29
  2852.    Packet Size., 33
  2853.    Panic Abort., 21
  2854.    Port Parameters, 31
  2855.    Positive Acknowledge, 21
  2856.    Quoting of characters, 7
  2857.                                          51
  2858.  
  2859.  
  2860.                                          52
  2861.    Sample B Plus packet, 6
  2862.    Standard B Protocol Checksum, 9
  2863.    Supporting the Various B Protocol Versions, 38
  2864.    Terminal Program States., 25
  2865.    Time-Out, 31
  2866.    Time-Outs
  2867.      Relaxed, 20
  2868.    Transport Layer, 35
  2869.    Wait for Acknowledge, 26
  2870.    Wait., 21
  2871.    XMODEM-Style CRC-16., 9
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.                                          52