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