home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc908.txt < prev    next >
Text File  |  1992-09-22  |  98KB  |  3,540 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                           Reliable Data Protocol
  7.  
  8.  
  9.  
  10.                                   RFC-908
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                David Velten
  26.  
  27.                                Robert Hinden
  28.  
  29.                                  Jack Sax
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.                       BBN Communications Corporation
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.                                 July 1984
  44.  
  45.  
  46.  
  47.  
  48.  
  49. Status of This Memo
  50.  
  51.    This RFC specifies a proposed protocol for the ARPA Internet
  52.    community, and requests discussion and suggestions for
  53.    improvements.  Distribution of this memo is unlimited.
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.      RDP Specification                           
  62.  
  63.  
  64.  
  65.                              Table of Contents
  66.  
  67.  
  68.  
  69.  
  70.  
  71.      1   Introduction.......................................... 1
  72.  
  73.      2   General Description................................... 3
  74.      2.1   Motivation.......................................... 3
  75.      2.2   Relation to Other Protocols......................... 5
  76.  
  77.      3   Protocol Operation.................................... 7
  78.      3.1   Protocol Service Objectives......................... 7
  79.      3.2   RDP Connection Management........................... 7
  80.      3.2.1   Opening a Connection.............................. 8
  81.      3.2.2   Ports............................................. 8
  82.      3.2.3   Connection States................................. 8
  83.      3.2.4   Connection Record................................ 11
  84.      3.2.5   Closing a Connection............................. 13
  85.      3.2.6   Detecting an Half-Open Connection................ 14
  86.      3.3   Data Communication................................. 14
  87.      3.4   Reliable Communication............................. 15
  88.      3.4.1   Segment Sequence Numbers......................... 15
  89.      3.4.2   Checksums........................................ 16
  90.      3.4.3   Positive Acknowledgement of Segments............. 16
  91.      3.4.4   Retransmission Timeout........................... 17
  92.      3.5   Flow Control and Window Management................. 17
  93.      3.6   User Interface..................................... 19
  94.      3.7   Event Processing................................... 20
  95.      3.7.1   User Request Events.............................. 21
  96.      3.7.2   Segment Arrival Events........................... 24
  97.      3.7.3   Timeout Events................................... 29
  98.  
  99.      4   RDP Segments and Formats............................. 31
  100.      4.1   IP Header Format................................... 31
  101.      4.2   RDP Header Format.................................. 32
  102.      4.2.1   RDP Header Fields................................ 33
  103.      4.3   SYN Segment........................................ 36
  104.      4.3.1   SYN Segment Format............................... 36
  105.      4.3.2   SYN Segment Fields............................... 37
  106.      4.4   ACK Segment........................................ 38
  107.      4.4.1   ACK Segment Format............................... 38
  108.      4.4.2   ACK Segment Fields............................... 39
  109.      4.5   Extended ACK Segment............................... 40
  110.      4.5.1   EACK Segment Format.............................. 40
  111.      4.5.2   EACK Segment Fields.............................. 40
  112.  
  113.  
  114.  
  115.                                                                 Page i
  116.  
  117.  
  118.  
  119.      RFC-908                                                 July 1984
  120.  
  121.  
  122.  
  123.      4.6   RST Segment........................................ 42
  124.      4.6.1   RST Segment Format............................... 42
  125.      4.7   NUL Segment........................................ 43
  126.      4.7.1   NUL segment format............................... 43
  127.  
  128.      5   Examples of Operation................................ 45
  129.      5.1   Connection Establishment........................... 45
  130.      5.2   Simultaneous Connection Establishment.............. 46
  131.      5.3   Lost Segments...................................... 47
  132.      5.4   Segments Received Out of Order..................... 48
  133.      5.5   Communication Over Long Delay Path................. 49
  134.      5.6   Communication Over Long Delay Path With Lost
  135.        Segments
  136.           .................................................... 50
  137.      5.7   Detecting a Half-Open  Connection  on  Crash
  138.        Recovery
  139.           .................................................... 51
  140.      5.8   Detecting a Half-Open  Connection  from  the
  141.        Active Side
  142.           .................................................... 52
  143.  
  144.      A   Implementing a Minimal RDP........................... 53
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.      Page ii
  174.  
  175.  
  176.  
  177.      RDP Specification                           
  178.  
  179.  
  180.  
  181.                                   FIGURES
  182.  
  183.  
  184.  
  185.  
  186.      1  Relation to Other Protocols............................ 5
  187.      2  Form of Data Exchange Between Layers................... 6
  188.      3  RDP Connection State Diagram.......................... 10
  189.      4  Segment Format........................................ 31
  190.      5  RDP Header Format..................................... 32
  191.      6  SYN Segment Format.................................... 37
  192.      7  ACK Segment Format.................................... 38
  193.      8  EACK Segment Format................................... 41
  194.      9  RST Segment Format.................................... 42
  195.      10  NUL Segment Format................................... 43
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.                                                               Page iii
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.                                  CHAPTER 1
  240.  
  241.  
  242.                                Introduction
  243.  
  244.  
  245.  
  246.           The Reliable Data Protocol (RDP) is designed  to  provide  a
  247.      reliable  data  transport  service  for packet-based applications
  248.      such as remote loading and debugging.  The protocol  is  intended
  249.      to  be simple to implement but still be efficient in environments
  250.      where there may be long transmission  delays  and  loss  or  non-
  251.      sequential delivery of message segments.
  252.  
  253.           Although this protocol was designed with  applications  such
  254.      as  remote  loading and debugging in mind, it may be suitable for
  255.      other applications that require reliable message  services,  such
  256.      as computer mail, file transfer, transaction processing, etc.
  257.  
  258.           Some of the concepts used come from a  variety  of  sources.
  259.      The  authors  wish credit to be given to Eric Rosen, Rob Gurwitz,
  260.      Jack Haverty, and to acknowledge material adapted from  "RFC-793,
  261.      The Transmission Control Protocol", edited by Jon Postel.  Thanks
  262.      to John Linn for the checksum algorithm.
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.                                                                 Page 1
  291.  
  292.  
  293.  
  294.      RFC-908                                                 July 1984
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.      Page 2
  349.  
  350.  
  351.  
  352.      RDP Specification                             General Description
  353.  
  354.  
  355.  
  356.                                  CHAPTER 2
  357.  
  358.  
  359.                             General Description
  360.  
  361.  
  362.  
  363.      2.1  Motivation
  364.  
  365.           RDP is a transport protocol designed to efficiently  support
  366.      the  bulk  transfer  of data for such host monitoring and control
  367.      applications  as  loading/dumping  and  remote   debugging.    It
  368.      attempts to provide only those services necessary, in order to be
  369.      efficient in operation and small in size.  Before  designing  the
  370.      protocol,  it  was  necessary  to  consider  what  minimum set of
  371.      transport  functions  would  satisfy  the  requirements  of   the
  372.      intended applications.
  373.  
  374.           The following is a list of requirements for such a transport
  375.      protocol:
  376.  
  377.  
  378.          o   Reliable delivery of packets is required.   When  loading
  379.              or  dumping  a  memory  image,  it  is necessary that all
  380.              memory segments be  delivered.   A  'hole'  left  in  the
  381.              memory  image  is  not acceptable.  However, the internet
  382.              environment is a lossy  one  in  which  packets  can  get
  383.              damaged  or  lost.   So  a  positive  acknowledgement and
  384.              retransmission mechanism is a necessary component of  the
  385.              protocol.
  386.  
  387.          o   Since loading and  dumping  of  memory  images  over  the
  388.              internet  involves  the bulk transfer of large amounts of
  389.              data over a lossy network with potentially  long  delays,
  390.              it  is necessary that the protocol move data efficiently.
  391.              In particular,  unnecessary  retransmission  of  segments
  392.              should be avoided.  If a single segment has been lost but
  393.              succeeding  segments  correctly  received,  the  protocol
  394.              should  not  require  the  retransmission  of  all of the
  395.              segments.
  396.  
  397.          o   Loading  and  dumping  are  applications  that   do   not
  398.              necessarily  require  sequenced  delivery of segments, as
  399.              long as all segments eventually are  delivered.   So  the
  400.              protocol  need  not  force sequenced delivery.  For these
  401.              types of applications, segments may be delivered  in  the
  402.              order in which they arrive.
  403.  
  404.  
  405.  
  406.                                                                 Page 3
  407.  
  408.  
  409.  
  410.      RFC-908                                                 July 1984
  411.  
  412.  
  413.  
  414.          o   However, some  applications  may  need  to  know  that  a
  415.              particular  piece  of  data  has  been  delivered  before
  416.              sending the next.  For example, a debugger will  want  to
  417.              know  that  a  command inserting a breakpoint into a host
  418.              memory  image  has  been  delivered  before   sending   a
  419.              "proceed"  command.   If  those  segments  arrived out of
  420.              sequence, the intended results  would  not  be  achieved.
  421.              The  protocol  should  allow a user to optionally specify
  422.              that a connection  must  deliver  segments  in  sequence-
  423.              number order.
  424.  
  425.          o   The loading/dumping and debugging applications are  well-
  426.              defined  and lend themselves to easy packetization of the
  427.              transferred data.  They do not require  a  complex  byte-
  428.              stream transfer mechanism.
  429.  
  430.           In order to combine the requirements for bulk  transfers  of
  431.      data   and  reliable  delivery,  it  is  necessary  to  design  a
  432.      connection-oriented  protocol  using  a  three-way  handshake  to
  433.      synchronize   sequence   numbers.    The  protocol  seems  to  be
  434.      approaching TCP in complexity, so  why  was  TCP  not,  in  fact,
  435.      chosen?   The answer is that TCP has some disadvantages for these
  436.      applications.  In particular:
  437.  
  438.          o   TCP  is  oriented  toward  a  more  general  environment,
  439.              supporting  the transfer of a stream of bytes between two
  440.              communicating  parties.   TCP  is  best  suited   to   an
  441.              environment where there is no obvious demarcation of data
  442.              in a communications exchange.  Much of the difficulty  in
  443.              developing a TCP implementation stems from the complexity
  444.              of supporting this general byte-stream transfer, and thus
  445.              a  significant  amount  of  complexity  can be avoided by
  446.              using  another   protocol.    This   is   not   just   an
  447.              implementation consideration, but also one of efficiency.
  448.  
  449.          o   Since TCP does not allow a byte to be acknowledged  until
  450.              all  prior  bytes have been acknowledged, it often forces
  451.              unnecessary retransmission of data.  Therefore,  it  does
  452.              not meet another of the requirements stated above.
  453.  
  454.          o   TCP  provides  sequenced  delivery   of   data   to   the
  455.              application.   If  the  application does not require such
  456.              sequenced delivery,  a  large  amount  of  resources  are
  457.              wasted in providing it.  For example, buffers may be tied
  458.              up  buffering  data  until  a  segment  with  an  earlier
  459.              sequence  number  arrives.  The protocol should not force
  460.              its segment-sequencing desires on the application.
  461.  
  462.  
  463.  
  464.      Page 4
  465.  
  466.  
  467.  
  468.      RDP Specification                             General Description
  469.  
  470.  
  471.  
  472.           RDP supports a much simpler set of functions than TCP.   The
  473.      flow control, buffering, and connection management schemes of RDP
  474.      are considerably  simpler  and  less  complex.   The  goal  is  a
  475.      protocol  that can be easily and efficiently implemented and that
  476.      will serve a range of applications.
  477.  
  478.           RDP functions can also be subset to further reduce the  size
  479.      of  a particular implementation.  For example, a target processor
  480.      requiring down-loading from another host might implement  an  RDP
  481.      module  supporting  only  the  passive Open function and a single
  482.      connection.  The module might also choose not to  implement  out-
  483.      of-sequence acknowledgements.
  484.  
  485.  
  486.  
  487.      2.2  Relation to Other Protocols
  488.  
  489.           RDP is a transport  protocol  that  fits  into  the  layered
  490.      internet protocol environment.  Figure 1 illustrates the place of
  491.      RDP in the protocol hierarchy:
  492.  
  493.  
  494.       +------+   +-----+     +-----+      +------+
  495.       |TELNET|   | FTP |     |Debug|  ... |Loader|  Application Layer
  496.       +------+   +-----+     +-----+      +------+
  497.          |          |           |             |
  498.          +-----+----+           +------+------+
  499.                |                       |
  500.             +------+               +-------+
  501.             |  TCP |               |  RDP  |        Transport Layer
  502.             +------+               +-------+
  503.                |                     |
  504.       +--------------------------------+
  505.       | Internet Protocol & ICMP       |            Internetwork Layer
  506.       +--------------------------------+
  507.                              |
  508.                    +-------------------------+
  509.                    | Network Access Protocol |      Network Layer
  510.                    +-------------------------+
  511.  
  512.  
  513.                         Relation to Other Protocols
  514.                                  Figure 1
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.                                                                 Page 5
  523.  
  524.  
  525.  
  526.      RFC-908                                                 July 1984
  527.  
  528.  
  529.  
  530.           RDP provides the application layer with a  reliable  message
  531.      transport service.  The interface between users and RDP transfers
  532.      data in units of messages.   When  implemented  in  the  internet
  533.      environment,  RDP is layered on the Internet Protocol (IP), which
  534.      provides an unreliable datagram service to RDP.  Data  is  passed
  535.      across  the  RDP/IP  interface in the form of segments.  RDP uses
  536.      the standard IP interface primitives  to  send  and  receive  RDP
  537.      segments  as  IP  datagrams.  At the internet level, IP exchanges
  538.      datagrams with the network layer.  An internet packet may contain
  539.      an entire datagram or a fragment of a datagram.
  540.  
  541.  
  542.                                                         #        %
  543.                                                           ?  *     !
  544.                                                                  @  )
  545.        +------+         +-----+         +----+          $  =   ^   +
  546.        |      |Messages |     |Segments |    | Datagrams   *
  547.        | User |<------->| RDP |<------->| IP |<------->    Internet
  548.        |      |         |     |         |    |          ,            ?
  549.        +------+         +-----+         +----+               !    )
  550.                                                           *   %     $
  551.                                                         @    ^   !
  552.  
  553.                    Form of Data Exchange Between Layers
  554.                                  Figure 2
  555.  
  556.  
  557.  
  558.           If internetwork services are  not  required,  it  should  be
  559.      possible  to  use  the  RDP without the IP layer.  As long as the
  560.      encapsulating protocol  provides  the  RDP  with  such  necessary
  561.      information  as addressing and protocol demultiplexing, it should
  562.      be possible  to  run  RDP  layered  on  a  variety  of  different
  563.      protocols.
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.      Page 6
  581.  
  582.  
  583.  
  584.      RDP Specification                              Protocol Operation
  585.  
  586.  
  587.  
  588.                                  CHAPTER 3
  589.  
  590.  
  591.                             Protocol Operation
  592.  
  593.  
  594.  
  595.      3.1  Protocol Service Objectives
  596.  
  597.           The RDP protocol has the following goals:
  598.  
  599.          o   RDP will provide  a  full-duplex  communications  channel
  600.              between the two ports of each transport connection.
  601.  
  602.          o   RDP will attempt to reliably deliver  all  user  messages
  603.              and  will  report  a  failure  to  the  user if it cannot
  604.              deliver a message.  RDP extends the datagram  service  of
  605.              IP to include reliable delivery.
  606.  
  607.          o   RDP will attempt to detect and discard  all  damaged  and
  608.              duplicate  segments.  It will use a checksum and sequence
  609.              number in each segment header to achieve this goal.
  610.  
  611.          o   RDP  will  optionally  provide  sequenced   delivery   of
  612.              segments.    Sequenced   delivery  of  segments  must  be
  613.              specified when the connection is established.
  614.  
  615.          o   RDP will acknowledge segments received out  of  sequence,
  616.              as  they  arrive.   This  will  free  up resources on the
  617.              sending side.
  618.  
  619.  
  620.  
  621.      3.2  RDP Connection Management
  622.  
  623.           RDP  is  a  connection-oriented  protocol  in   which   each
  624.      connection  acts  as  a full-duplex communication channel between
  625.      two processes.  Segments from a sender are directed to a port  on
  626.      the  destination host.  The two 8-bit source and destination port
  627.      identifiers in the RDP header are used in  conjunction  with  the
  628.      network  source  and  destination  addresses to uniquely identify
  629.      each connection.
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.                                                                 Page 7
  639.  
  640.  
  641.  
  642.      RFC-908                                                 July 1984
  643.  
  644.  
  645.  
  646.      3.2.1  Opening a Connection
  647.  
  648.           Connections are opened by issuing the  Open  request,  which
  649.      can be either active or passive.  A passive Open request puts RDP
  650.      into the Listen state, during which it passively  listens  for  a
  651.      request to open a connection from a remote site.  The active Open
  652.      request attempts to establish a connection with a specified  port
  653.      at a remote site.
  654.  
  655.           The active Open request requires that a specific remote port
  656.      and host address be specified with the request.  The passive Open
  657.      may  optionally  specify  a  specific  remote  port  and  network
  658.      address,  or it may specify that an open be accepted from anyone.
  659.      If a specific remote port and host  address  were  specified,  an
  660.      arriving  request  to  open  a  connection must exactly match the
  661.      specified remote port and address.
  662.  
  663.  
  664.  
  665.      3.2.2  Ports
  666.  
  667.           Valid port numbers range from 1 to 255 (decimal). There  are
  668.      two  types  of  ports:  "well known" ports and "allocable" ports.
  669.      Well-known ports have numbers in the range 1 to 63 (decimal)  and
  670.      allocable ports are given numbers in the range 64 to 255.
  671.  
  672.           The user, when issuing an active Open request, must  specify
  673.      both  the  remote  host  and  port and may optionally specify the
  674.      local port.  If the local port was not specified, RDP will select
  675.      an  unused port from the range of allocable ports. When issuing a
  676.      passive Open request,  the  user  must  specify  the  local  port
  677.      number.   Generally,  in this case the local port will be a well-
  678.      known port.
  679.  
  680.  
  681.  
  682.      3.2.3  Connection States
  683.  
  684.           An RDP connection will progress through a series  of  states
  685.      during  its  lifetime.   The states are shown in Figure 3 and are
  686.      individually described below.  In Figure 3, the  boxes  represent
  687.      the  states  of  the  RDP  FSM  and the arcs represent changes in
  688.      state.  Each arc is annotated with the event  causing  the  state
  689.      change and the resulting output.
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.      Page 8
  697.  
  698.  
  699.  
  700.      RDP Specification                              Protocol Operation
  701.  
  702.  
  703.  
  704.      CLOSED
  705.  
  706.           The CLOSED state exists when no connection exists and  there
  707.           is no connection record allocated.
  708.  
  709.  
  710.      LISTEN
  711.  
  712.           The LISTEN state is entered after a passive Open request  is
  713.           processed.   A  connection record is allocated and RDP waits
  714.           for an active request  to  establish  a  connection  from  a
  715.           remote site.
  716.  
  717.  
  718.      SYN-SENT
  719.  
  720.           The SYN-SENT state is entered  after  processing  an  active
  721.           Open  request.  A connection record is allocated, an initial
  722.           sequence number is generated, and a SYN segment is  sent  to
  723.           the  remote  site.  RDP then waits in the SYN-SENT state for
  724.           acknowledgement of its Open request.
  725.  
  726.  
  727.      SYN-RCVD
  728.  
  729.           The SYN-RCVD state may be reached  from  either  the  LISTEN
  730.           state  or from the SYN-SENT state.  SYN-RCVD is reached from
  731.           the LISTEN state when a SYN segment requesting a  connection
  732.           is  received  from  a  remote host.  In reply, the local RDP
  733.           generates an initial sequence number for  its  side  of  the
  734.           connection,  and  then  sends  the  sequence  number  and an
  735.           acknowledgement of the SYN segment to the remote  site.   It
  736.           then waits for an acknowledgement.
  737.  
  738.           The SYN-RCVD state is reached from the SYN-SENT state when a
  739.           SYN  segment  is  received  from  the remote host without an
  740.           accompanying acknowledgement of the SYN segment sent to that
  741.           remote  host  by the local RDP.  This situation is caused by
  742.           simultaneous attempts to open a  connection,  with  the  SYN
  743.           segments  passing  each  other in transit.  The action is to
  744.           repeat the SYN segment with the same  sequence  number,  but
  745.           now  including  an  ACK  of the remote host's SYN segment to
  746.           indicate acceptance of the Open request.
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.                                                                 Page 9
  755.  
  756.  
  757.  
  758.      RFC-908                                                 July 1984
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.                              +------------+
  766.               Passive Open   |            |<-------------------------+
  767.             +----------------|   CLOSED   |                          |
  768.             |   Request      |            |---------------+          |
  769.             V                +------------+               |          |
  770.      +------------+                                       |          |
  771.      |            |                                       |          |
  772.      |   LISTEN   |                                       |          |
  773.      |            |                                       |          |
  774.      +------------+                                       |          |
  775.             |                                   Active    |          |
  776.             |  rcv SYN                       Open Request |          |
  777.             | -----------                    ------------ |          |
  778.             | snd SYN,ACK                      snd SYN    |          |
  779.             V                   rcv SYN                   V          |
  780.      +------------+          -----------           +------------+    |
  781.      |            |          snd SYN,ACK           |            |    |
  782.      |  SYN-RCVD  |<-------------------------------|  SYN-SENT  |    |
  783.      |            |                                |            |    |
  784.      +------------+                                +------------+    |
  785.             |  rcv ACK                       rcv SYN,ACK  |          |
  786.             | ----------                    ------------- |          |
  787.             |    xxx         +------------+    snd ACK    |          |
  788.             |                |            |               |          |
  789.             +--------------->|    OPEN    |<--------------+          |
  790.                              |            |                          |
  791.                              +------------+                          |
  792.                          rcv RST   |   Close request                 |
  793.                        ----------- |  ---------------                |
  794.                            xxx     |     snd RST                     |
  795.                                    V                                 |
  796.                              +------------+                          |
  797.                              |            |                          |
  798.                              | CLOSE-WAIT |--------------------------+
  799.                              |            |  After a Delay
  800.                              +------------+
  801.  
  802.  
  803.                        RDP Connection State Diagram
  804.                                  Figure 3
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.      Page 10
  813.  
  814.  
  815.  
  816.      RDP Specification                              Protocol Operation
  817.  
  818.  
  819.  
  820.      OPEN
  821.  
  822.           The OPEN state exists when a connection has been established
  823.           by  the successful exchange of state information between the
  824.           two sides of the connection.  Each side  has  exchanged  and
  825.           received  such  data  as  initial  sequence  number, maximum
  826.           segment size, and maximum number of unacknowledged  segments
  827.           that may be outstanding.  In the Open state data may be sent
  828.           between the two parties of the connection.
  829.  
  830.  
  831.      CLOSE-WAIT
  832.  
  833.           The CLOSE-WAIT state is entered from either a Close  request
  834.           or  from the receipt of an RST segment from the remote site.
  835.           RDP has sent an RST segment and is waiting  a  delay  period
  836.           for activity on the connection to complete.
  837.  
  838.  
  839.  
  840.  
  841.  
  842.      3.2.4  Connection Record
  843.  
  844.           The variables that define the  state  of  a  connection  are
  845.      stored  in  a  connection  record maintained for each connection.
  846.      The following describes some  of  the  variables  that  would  be
  847.      stored in a typical RDP connection record.  It is not intended to
  848.      be  an  implementation  specification  nor  is  it   a   complete
  849.      description.   The  purpose  of naming and describing some of the
  850.      connection record fields is to simplify the  description  of  RDP
  851.      protocol operation, particularly event processing.
  852.  
  853.           The connection record fields and their descriptions follow:
  854.  
  855.      STATE
  856.  
  857.           The current state of the connection.  Legal values are OPEN,
  858.           LISTEN, CLOSED, SYN-SENT, SYN-RCVD,  and CLOSE-WAIT.
  859.  
  860.  
  861.      Send Sequence Number Variables:
  862.  
  863.      SND.NXT
  864.  
  865.           The sequence number of the next segment that is to be sent.
  866.  
  867.  
  868.  
  869.  
  870.                                                                Page 11
  871.  
  872.  
  873.  
  874.      RFC-908                                                 July 1984
  875.  
  876.  
  877.  
  878.      SND.UNA
  879.  
  880.           The sequence number of the oldest unacknowledged segment.
  881.  
  882.      SND.MAX
  883.  
  884.           The maximum number of outstanding (unacknowledged)  segments
  885.           that can be sent.  The sender should not send more than this
  886.           number of segments without getting an acknowledgement.
  887.  
  888.      SND.ISS
  889.  
  890.           The initial send sequence  number.   This  is  the  sequence
  891.           number that was sent in the SYN segment.
  892.  
  893.      Receive Sequence Number Variables:
  894.  
  895.      RCV.CUR
  896.  
  897.           The sequence number of the last segment  received  correctly
  898.           and in sequence.
  899.  
  900.      RCV.MAX
  901.  
  902.           The maximum number of segments that can be buffered for this
  903.           connection.
  904.  
  905.      RCV.IRS
  906.  
  907.           The initial receive sequence number.  This is  the  sequence
  908.           number of the SYN segment that established this connection.
  909.  
  910.      RCVDSEQNO[n]
  911.  
  912.           The array of sequence numbers of  segments  that  have  been
  913.           received and acknowledged out of sequence.
  914.  
  915.      Other Variables:
  916.  
  917.      CLOSEWAIT
  918.  
  919.           A timer used to time out the CLOSE-WAIT state.
  920.  
  921.      SBUF.MAX
  922.  
  923.           The largest possible segment (in octets) that can legally be
  924.           sent.  This variable is specified by the foreign host in the
  925.  
  926.  
  927.  
  928.      Page 12
  929.  
  930.  
  931.  
  932.      RDP Specification                              Protocol Operation
  933.  
  934.  
  935.  
  936.           SYN segment during connection establishment.
  937.  
  938.      RBUF.MAX
  939.  
  940.           The  largest  possible  segment  (in  octets)  that  can  be
  941.           received.   This  variable is specified by the user when the
  942.           connection is opened.  The variable is sent to  the  foreign
  943.           host in the SYN segment.
  944.  
  945.      Variables from Current Segment:
  946.  
  947.      SEG.SEQ
  948.  
  949.           The  sequence  number  of  the   segment   currently   being
  950.           processed.
  951.  
  952.      SEG.ACK
  953.  
  954.           The acknowledgement sequence number in the segment currently
  955.           being processed.
  956.  
  957.      SEG.MAX
  958.  
  959.           The maximum number of outstanding segments the  receiver  is
  960.           willing  to  hold,  as  specified  in  the  SYN segment that
  961.           established the connection.
  962.  
  963.      SEG.BMAX
  964.  
  965.           The maximum segment size (in octets) accepted by the foreign
  966.           host  on  a connection, as specified in the SYN segment that
  967.           established the connection.
  968.  
  969.  
  970.  
  971.      3.2.5  Closing a Connection
  972.  
  973.           The closing of a connection can  be  initiated  by  a  Close
  974.      request  from  the  user  process or by receipt of an RST segment
  975.      from the other end of the connection.  In the case of  the  Close
  976.      request,  RDP  will  send an RST segment to the other side of the
  977.      connection and then enter the CLOSE-WAIT state for  a  period  of
  978.      time.   While  in the CLOSE-WAIT state, RDP will discard segments
  979.      received from the other side of the connection.  When  the  time-
  980.      out  period expires, the connection record is deallocated and the
  981.      connection ceases  to  exist.   This  simple  connection  closing
  982.      facility  requires  that  users  determine that all data has been
  983.  
  984.  
  985.  
  986.                                                                Page 13
  987.  
  988.  
  989.  
  990.      RFC-908                                                 July 1984
  991.  
  992.  
  993.  
  994.      reliably delivered before requesting a close of the connection.
  995.  
  996.  
  997.  
  998.      3.2.6  Detecting an Half-Open Connection
  999.  
  1000.           If one side of a connection crashes, the connection  may  be
  1001.      left  with the other side still active.  This situation is termed
  1002.      to be an half-open connection.  For many cases,  the  active  RDP
  1003.      will  eventually  detect the half-open connection and reset.  Two
  1004.      examples of recovery from half-open connections are  provided  in
  1005.      sections  5.7  and  5.8.   Recovery  is  usually achieved by user
  1006.      activity or by the crashed host's attempts  to  re-establish  the
  1007.      connection.
  1008.  
  1009.           However, there are cases  where  recovery  is  not  possible
  1010.      without action by the RDP itself.  For example, if all connection
  1011.      blocks are in use, attempts to re-establish a  broken  connection
  1012.      will  be  rejected.   In  this  case, the RDP may attempt to free
  1013.      resources by verifying  that connections are fully open. It  does
  1014.      this  by  sending  a  NUL  segment to each of the other RDPs.  An
  1015.      acknowledgement indicates the connection is still open and valid.
  1016.  
  1017.           To minimize network overhead,  verification  of  connections
  1018.      should  only  be  done  when  necessary  to  prevent  a  deadlock
  1019.      situation.  Only inactive connections  should  be  verified.   An
  1020.      inactive  connection  is  defined  to be a connection that has no
  1021.      outstanding unacknowledged segments, has no segments in the  user
  1022.      input or output queues, and that has not had any traffic for some
  1023.      period of time.
  1024.  
  1025.  
  1026.  
  1027.      3.3  Data Communication
  1028.  
  1029.           Data  flows  through  an  RDP  connection  in  the  form  of
  1030.      segments.   Each  user  message  submitted with a Send request is
  1031.      packaged for transport as a single RDP segment.  Each RDP segment
  1032.      is packaged as an RDP header and one or more octets of data.  RDP
  1033.      will not attempt to fragment a large user  message  into  smaller
  1034.      segments  and re-assemble the message on the receiving end.  This
  1035.      differs from a byte-stream protocol such as  TCP  which  supports
  1036.      the  transfer  of  an indeterminate length stream of data between
  1037.      ports, buffering data until it is requested by the receiver.
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.      Page 14
  1045.  
  1046.  
  1047.  
  1048.      RDP Specification                              Protocol Operation
  1049.  
  1050.  
  1051.  
  1052.           At the RDP level, outgoing segments, as  they  are  created,
  1053.      are queued as input to the IP layer.  Each segment is held by the
  1054.      sending RDP  until  it  is  acknowledged  by  the  foreign  host.
  1055.      Incoming segments are queued as input to the user process through
  1056.      the user interface.  Segments are  acknowledged  when  they  have
  1057.      been accepted by the receiving RDP.
  1058.  
  1059.           The receiving end of each connection specifies  the  maximum
  1060.      segment  size  it  will  accept.   Any  attempt  by the sender to
  1061.      transmit a larger segment is an error.  If RDP determines that  a
  1062.      buffer  submitted  with  a  Send request exceeds the maximum size
  1063.      segment permitted on the connection, RDP will return an error  to
  1064.      the  user.   In addition, RDP will abort a connection with an RST
  1065.      segment if an  incoming  segment  contains  more  data  than  the
  1066.      maximum  acceptable  segment  size.   No  attempt will be made to
  1067.      recover from or otherwise overcome this error condition.
  1068.  
  1069.           If  sequenced  delivery  of  segments  is  necessary  for  a
  1070.      connection, the requirement must be stated when the connection is
  1071.      established.  Sequenced  delivery  is  specified  when  the  Open
  1072.      request is made.  Sequenced delivery of segments will then be the
  1073.      mode of delivery for the life of the connection.
  1074.  
  1075.  
  1076.  
  1077.      3.4  Reliable Communication
  1078.  
  1079.           RDP implements a reliable message service through  a  number
  1080.      of  mechanisms.   These include the insertion of sequence numbers
  1081.      and checksums into  segments,  the  positive  acknowledgement  of
  1082.      segment  receipt,  and  timeout  and  retransmission  of  missing
  1083.      segments.
  1084.  
  1085.  
  1086.  
  1087.      3.4.1  Segment Sequence Numbers
  1088.  
  1089.           Each segment transporting data has a  sequence  number  that
  1090.      uniquely  identifies  it  among  all  other  segments in the same
  1091.      connection.  The initial  sequence  number  is  chosen  when  the
  1092.      connection  is  opened  and is selected by reading a value from a
  1093.      monotonically increasing clock.  Each time a  segment  containing
  1094.      data   is   transmitted,  the  sequence  number  is  incremented.
  1095.      Segments containing no data do not increment the sequence number.
  1096.      However, the SYN and NUL segments, which cannot contain data, are
  1097.      exceptions.  The  SYN  segment  is  always  sent  with  a  unique
  1098.      sequence number, the initial sequence number.  The NUL segment is
  1099.  
  1100.  
  1101.  
  1102.                                                                Page 15
  1103.  
  1104.  
  1105.  
  1106.      RFC-908                                                 July 1984
  1107.  
  1108.  
  1109.  
  1110.      sent with the next valid sequence number.
  1111.  
  1112.  
  1113.  
  1114.      3.4.2  Checksums
  1115.  
  1116.           Each RDP segment contains a checksum to allow  the  receiver
  1117.      to  detect  damaged  segments.   RDP  uses  a non-linear checksum
  1118.      algorithm to compute a checksum that is 32-bits wide and operates
  1119.      on  data  in  units  of  four octets (32 bits).  The area that is
  1120.      covered by the checksum includes both the RDP header and the  RDP
  1121.      data area.
  1122.  
  1123.           If a segment contains a number of  header  and  data  octets
  1124.      that  is  not an integral multiple of 4 octets, the last octet is
  1125.      padded on the right with zeros to  form  a  32-bit  quantity  for
  1126.      computation  purposes.   The padding zeros are not transmitted as
  1127.      part of the segment.  While computing the checksum, the  checksum
  1128.      field  itself  is  replaced  with zeros.  The actual algorithm is
  1129.      described in Section 4.2.1.
  1130.  
  1131.  
  1132.  
  1133.      3.4.3  Positive Acknowledgement of Segments
  1134.  
  1135.           RDP assumes it has only an unreliable  datagram  service  to
  1136.      deliver  segments.   To  guarantee  delivery  of segments in this
  1137.      environment, RDP uses positive acknowledgement and retransmission
  1138.      of  segments.   Each  segment containing data and the SYN and NUL
  1139.      segments are acknowledged when they are  correctly  received  and
  1140.      accepted  by  the  destination host.  Segments containing only an
  1141.      acknowledgement  are  not  acknowledged.   Damaged  segments  are
  1142.      discarded  and  are not acknowledged.  Segments are retransmitted
  1143.      when there is no timely acknowledgement of  the  segment  by  the
  1144.      destination host.
  1145.  
  1146.           RDP allows  two  types  of  acknowledgement.   A  cumulative
  1147.      acknowledgement  is  used  to  acknowledge  all  segments up to a
  1148.      specified sequence number.  This type of acknowledgement  can  be
  1149.      sent   using   fixed   length   fields  within  the  RDP  header.
  1150.      Specifically,  the  ACK  control  flag  is  set  and   the   last
  1151.      acknowledged  sequence  number  is  placed in the Acknowledgement
  1152.      Number field.
  1153.  
  1154.           The extended or non-cumulative  acknowledgement  allows  the
  1155.      receiver  to  acknowledge segments out of sequence.  This type of
  1156.      acknowledgement is sent using  the  EACK  control  flag  and  the
  1157.  
  1158.  
  1159.  
  1160.      Page 16
  1161.  
  1162.  
  1163.  
  1164.      RDP Specification                              Protocol Operation
  1165.  
  1166.  
  1167.  
  1168.      variable  length  fields in the RDP segment header.  The variable
  1169.      length header fields are used to hold the sequence numbers of the
  1170.      acknowledged out-of-sequence segments.
  1171.  
  1172.           The type of acknowledgement used is simply a function of the
  1173.      order  in which segments arrive.  Whenever possible, segments are
  1174.      acknowledged using the cumulative acknowledgement segment.   Only
  1175.      out-of-sequence  segments  are  acknowledged  using  the extended
  1176.      acknowledgement option.
  1177.  
  1178.           The user process, when  initiating  the  connection,  cannot
  1179.      restrict the type of acknowledgement used on the connection.  The
  1180.      receiver   may   choose   not   to   implement    out-of-sequence
  1181.      acknowledgements.   On  the  other hand, the sender may choose to
  1182.      ignore out-of-sequence acknowledgements.
  1183.  
  1184.  
  1185.  
  1186.      3.4.4  Retransmission Timeout
  1187.  
  1188.           Segments may be lost in transmission for two  reasons:  they
  1189.      may  be  lost  or  damaged  due  to  the  effects  of  the  lossy
  1190.      transmission media; or they may be  discarded  by  the  receiving
  1191.      RDP.   The  positive acknowledgement policy requires the receiver
  1192.      to acknowledge a segment only when the segment has been correctly
  1193.      received and accepted.
  1194.  
  1195.           To detect missing segments,  the  sending  RDP  must  use  a
  1196.      retransmission  timer for each segment transmitted.  The timer is
  1197.      set to a value approximating the transmission time of the segment
  1198.      in  the  network.   When  an  acknowledgement  is  received for a
  1199.      segment, the timer is cancelled for that segment.  If  the  timer
  1200.      expires before an acknowledgement is received for a segment, that
  1201.      segment is retransmitted and the timer is restarted.
  1202.  
  1203.  
  1204.  
  1205.      3.5  Flow Control and Window Management
  1206.  
  1207.           RDP employs a simple flow control mechanism that is based on
  1208.      the  number  of  unacknowledged  segments  sent  and  the maximum
  1209.      allowed number of outstanding  (unacknowledged)  segments.   Each
  1210.      RDP  connection  has an associated set of flow control parameters
  1211.      that include the maximum number of outstanding segments for  each
  1212.      side  of  a  connection.  These parameters are specified when the
  1213.      connection is opened with the Open request, with each side of the
  1214.      connection   specifying  its  own parameters.  The parameters are
  1215.  
  1216.  
  1217.  
  1218.                                                                Page 17
  1219.  
  1220.  
  1221.  
  1222.      RFC-908                                                 July 1984
  1223.  
  1224.  
  1225.  
  1226.      passed from  one  host  to  another  in  the  initial  connection
  1227.      segments.
  1228.  
  1229.           The values specified for these parameters should be based on
  1230.      the  amount  and  size  of  buffers  that  the  RDP is willing to
  1231.      allocate to a connection.  The particular RDP implementation  can
  1232.      set  the  parameters to values that are optimal for its buffering
  1233.      scheme.  Once these parameters  are  set  they  remain  unchanged
  1234.      throughout the life of the connection.
  1235.  
  1236.           RDP employs the concept of  a  sequence  number  window  for
  1237.      acceptable segment sequence numbers.  The left edge of the window
  1238.      is the number  of  the  last  in-sequence  acknowledged  sequence
  1239.      number  plus  one.   The right edge of the window is equal to the
  1240.      left edge plus twice the allowed maximum  number  of  outstanding
  1241.      segments.   The allowed maximum number of outstanding segments is
  1242.      the number of segments the transmitting RDP software  is  allowed
  1243.      to send without receiving any acknowledgement.
  1244.  
  1245.           The flow control and window management parameters  are  used
  1246.      as  follows.   The  RDP  module  in  the  transmitting host sends
  1247.      segments  until  it  reaches  the  connection's   segment   limit
  1248.      specified  by the receiving process.  Once this limit is reached,
  1249.      the transmitting RDP module may only send a new segment for  each
  1250.      acknowledged segment.
  1251.  
  1252.           When a received segment has a  sequence  number  that  falls
  1253.      within  the  acceptance  window,  it  is  acknowledged.   If  the
  1254.      sequence number is equal to the left-hand edge (i.e., it  is  the
  1255.      next  sequence number expected), the segment is acknowledged with
  1256.      a cumulative acknowledgement (ACK).   The  acceptance  window  is
  1257.      adjusted  by  adding  one  to  the  value  of  the edges.  If the
  1258.      sequence number is within the acceptance window  but  is  out  of
  1259.      sequence,    it    is    acknowledged   with   a   non-cumulative
  1260.      acknowledgement (EACK).  The window  is  not  adjusted,  but  the
  1261.      receipt of the out-of-sequence segment is recorded.
  1262.  
  1263.           When  segments  are   acknowledged   out   of   order,   the
  1264.      transmitting  RDP  module must not transmit beyond the acceptance
  1265.      window.  This could occur if one segment is not acknowledged  but
  1266.      all  subsequent  segments  are  received  and acknowledged.  This
  1267.      condition will fix the left edge of the window  at  the  sequence
  1268.      number of the unacknowledged segment.  As additional segments are
  1269.      transmitted, the next  segment  to  be  sent  will  approach  and
  1270.      eventually  overtake  the  right  window edge.  At this point all
  1271.      transmission of new segments will cease until the  unacknowledged
  1272.      segment is acknowledged.
  1273.  
  1274.  
  1275.  
  1276.      Page 18
  1277.  
  1278.  
  1279.  
  1280.      RDP Specification                              Protocol Operation
  1281.  
  1282.  
  1283.  
  1284.      3.6  User Interface
  1285.  
  1286.           The user interface to RDP is  implementation  dependent  and
  1287.      may  use  system  calls,  function calls or some other mechanism.
  1288.      The list of requests that follows is not intended  to  suggest  a
  1289.      particular implementation.
  1290.  
  1291.  
  1292.      OPEN Request
  1293.  
  1294.           Opens a connection.   Parameters  include  type  (active  or
  1295.           passive),  local  port,  remote  port,  remote host address,
  1296.           maximum  segment  size,  maximum  number  of  unacknowledged
  1297.           segments,  delivery  mode (sequenced or non-sequenced).  The
  1298.           connection id,  including  any  allocated  port  number,  is
  1299.           returned to the user.
  1300.  
  1301.  
  1302.      SEND Request
  1303.  
  1304.           Sends  a  user  message.   Parameters   include   connection
  1305.           identifier, buffer address and data count.
  1306.  
  1307.  
  1308.      RECEIVE Request
  1309.  
  1310.           Receives a  user  message.   Parameters  include  connection
  1311.           identifier, buffer address and data count.
  1312.  
  1313.  
  1314.      CLOSE Request
  1315.  
  1316.           Closes a specified connection.  The single parameter is  the
  1317.           connection identifier.
  1318.  
  1319.  
  1320.      STATUS Request
  1321.  
  1322.           Returns the status of a connection.  The parameters  include
  1323.           the  connection  identifier  and  the  address of the status
  1324.           buffer.
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.                                                                Page 19
  1335.  
  1336.  
  1337.  
  1338.      RFC-908                                                 July 1984
  1339.  
  1340.  
  1341.  
  1342.      3.7  Event Processing
  1343.  
  1344.           This section describes one possible sequence for  processing
  1345.      events.    It   is   not   intended   to   suggest  a  particular
  1346.      implementation, but any actual implementation  should  vary  from
  1347.      this   description  only  in  detail  and  not  significantly  in
  1348.      substance.  The following are the kinds of events that may occur:
  1349.  
  1350.           USER REQUESTS
  1351.  
  1352.                 Open
  1353.                 Send
  1354.                 Receive
  1355.                 Close
  1356.                 Status
  1357.  
  1358.  
  1359.           ARRIVING SEGMENT
  1360.  
  1361.                 Segment Arrives
  1362.  
  1363.  
  1364.           TIMEOUTS
  1365.  
  1366.                 Retransmission Timeout
  1367.                 Close-Wait Timeout
  1368.  
  1369.           User request processing always terminates with a  return  to
  1370.      the  caller,  with  a possible error indication.  Error responses
  1371.      are given as a character string.   A  delayed  response  is  also
  1372.      possible  in  some  situations  and  is  returned  to the user by
  1373.      whatever event or pseudo interrupt mechanism is  available.   The
  1374.      term "signal" is used to refer to delayed responses.
  1375.  
  1376.           Processing of arriving segments usually follows this general
  1377.      sequence:  the  sequence  number  is checked for validity and, if
  1378.      valid, the segment is queued  and  processed  in  sequence-number
  1379.      order.   For  all events, unless a state change is specified, RDP
  1380.      remains in the same state.
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.      Page 20
  1393.  
  1394.  
  1395.  
  1396.      RDP Specification                              Protocol Operation
  1397.  
  1398.  
  1399.  
  1400.      3.7.1  User Request Events
  1401.  
  1402.           The following scenarios demonstrate the processing of events
  1403.      caused by the issuance of user requests:
  1404.  
  1405.  
  1406.      Open Request
  1407.  
  1408.  
  1409.        CLOSED STATE
  1410.  
  1411.          Create a connection record
  1412.          If none available
  1413.            Return "Error - insufficient resources"
  1414.          Endif
  1415.  
  1416.          If passive Open
  1417.            If local port not specified
  1418.              Return "Error - local port not specified"
  1419.            Endif
  1420.            Generate SND.ISS
  1421.            Set SND.NXT = SND.ISS + 1
  1422.                SND.UNA = SND.ISS
  1423.            Fill in SND.MAX, RMAX.BUF from Open parameters
  1424.            Set State = LISTEN
  1425.            Return
  1426.          Endif
  1427.  
  1428.  
  1429.          If active Open
  1430.            If remote port not specified
  1431.              Return "Error - remote port not specified"
  1432.            Endif
  1433.            Generate SND.ISS
  1434.            Set SND.NXT = SND.ISS + 1
  1435.                SND.UNA = SND.ISS
  1436.            Fill in SND.MAX, RMAX.BUF from Open parameters
  1437.            If local port not specified
  1438.              Allocate a local port
  1439.            Endif
  1440.            Send <SEQ=SND.ISS><MAX=SND.MAX><MAXBUF=RMAX.BUF><SYN>
  1441.            Set State = SYN-SENT
  1442.            Return (local port, connection identifier)
  1443.          Endif
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                                                Page 21
  1451.  
  1452.  
  1453.  
  1454.      RFC-908                                                 July 1984
  1455.  
  1456.  
  1457.  
  1458.        LISTEN STATE
  1459.        SYN-SENT STATE
  1460.        SYN-RCVD STATE
  1461.        OPEN STATE
  1462.        CLOSE-WAIT STATE
  1463.  
  1464.          Return "Error - connection already open"
  1465.  
  1466.  
  1467.      Close Request
  1468.  
  1469.        OPEN STATE
  1470.  
  1471.          Send <SEQ=SND.NXT><RST>
  1472.          Set State = CLOSE-WAIT
  1473.          Start TIMWAIT Timer
  1474.          Return
  1475.  
  1476.        LISTEN STATE
  1477.  
  1478.          Set State = CLOSED
  1479.          Deallocate connection record
  1480.          Return
  1481.  
  1482.        SYN-RCVD STATE
  1483.        SYN-SENT STATE
  1484.  
  1485.          Send <SEQ=SND.NXT><RST>
  1486.          Set State = CLOSED
  1487.          Return
  1488.  
  1489.  
  1490.        CLOSE-WAIT STATE
  1491.  
  1492.          Return "Error - connection closing"
  1493.  
  1494.        CLOSE STATE
  1495.  
  1496.          Return "Error - connection not open"
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.      Page 22
  1509.  
  1510.  
  1511.  
  1512.      RDP Specification                              Protocol Operation
  1513.  
  1514.  
  1515.  
  1516.      Receive Request
  1517.  
  1518.        OPEN STATE
  1519.  
  1520.          If Data is pending
  1521.            Return with data
  1522.           else
  1523.            Return with "no data" indication
  1524.          Endif
  1525.  
  1526.        LISTEN STATE
  1527.        SYN-RCVD STATE
  1528.        SYN-SENT STATE
  1529.  
  1530.          Return with "no data" indication
  1531.  
  1532.        CLOSE STATE
  1533.        CLOSE-WAIT STATE
  1534.  
  1535.          Return "Error - connection not open"
  1536.  
  1537.  
  1538.      Send Request
  1539.  
  1540.        OPEN STATE
  1541.  
  1542.          If SND.NXT < SND.UNA + SND.MAX
  1543.            Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><Data>
  1544.            Set SND.NXT = SND.NXT + 1
  1545.            Return
  1546.           else
  1547.            Return "Error - insufficient resources to send data"
  1548.          Endif
  1549.  
  1550.  
  1551.        LISTEN STATE
  1552.        SYN-RCVD STATE
  1553.        SYN-SENT STATE
  1554.        CLOSE STATE
  1555.        CLOSE-WAIT STATE
  1556.  
  1557.          Return "Error - connection not open"
  1558.  
  1559.  
  1560.      Status Request
  1561.  
  1562.        Return with:
  1563.  
  1564.  
  1565.  
  1566.                                                                Page 23
  1567.  
  1568.  
  1569.  
  1570.      RFC-908                                                 July 1984
  1571.  
  1572.  
  1573.  
  1574.          State of connection (OPEN, LISTEN, etc.)
  1575.          Number of segments unacknowledged
  1576.          Number of segments received not given to user
  1577.          Maximum segment size for the send side of the connection
  1578.          Maximum segment size for the receive side of the connection
  1579.  
  1580.  
  1581.  
  1582.      3.7.2  Segment Arrival Events
  1583.  
  1584.           The following scenarios describe the processing of the event
  1585.      caused  by  the arrival of a RDP segment from a remote host.  The
  1586.      assumption is made that the segment was addressed  to  the  local
  1587.      port associated with the connection record.
  1588.  
  1589.      If State = CLOSED
  1590.  
  1591.        If RST set
  1592.          Discard segment
  1593.          Return
  1594.        Endif
  1595.  
  1596.        If ACK or NUL set
  1597.           Send <SEQ=SEG.ACK + 1><RST>
  1598.           Discard segment
  1599.           Return
  1600.         else
  1601.           Send <SEQ=0><RST><ACK=RCV.CUR><ACK>
  1602.           Discard segment
  1603.           Return
  1604.        Endif
  1605.  
  1606.      Endif
  1607.  
  1608.  
  1609.      If State = CLOSE-WAIT
  1610.        If RST set
  1611.           Set State = CLOSED
  1612.           Discard segment
  1613.           Cancel TIMWAIT timer
  1614.           Deallocate connection record
  1615.         else
  1616.           Discard segment
  1617.        Endif
  1618.        Return
  1619.      Endif
  1620.  
  1621.  
  1622.  
  1623.  
  1624.      Page 24
  1625.  
  1626.  
  1627.  
  1628.      RDP Specification                              Protocol Operation
  1629.  
  1630.  
  1631.  
  1632.      If State = LISTEN
  1633.  
  1634.        If RST set
  1635.          Discard the segment
  1636.          Return
  1637.        Endif
  1638.  
  1639.        If ACK or NUL set
  1640.          Send <SEQ=SEG.ACK + 1><RST>
  1641.          Return
  1642.        Endif
  1643.  
  1644.        If SYN set
  1645.          Set RCV.CUR = SEG.SEQ
  1646.              RCV.IRS = SEG.SEQ
  1647.              SND.MAX = SEG.MAX
  1648.              SBUF.MAX = SEG.BMAX
  1649.          Send <SEQ=SND.ISS><ACK=RCV.CUR><MAX=RCV.MAX><BUFMAX=RBUF.MAX>
  1650.               <ACK><SYN>
  1651.          Set State = SYN-RCVD
  1652.          Return
  1653.        Endif
  1654.  
  1655.        If anything else (should never get here)
  1656.          Discard segment
  1657.          Return
  1658.        Endif
  1659.      Endif
  1660.  
  1661.      If State = SYN-SENT
  1662.  
  1663.        If ACK set
  1664.          If RST clear and SEG.ACK != SND.ISS
  1665.            Send <SEQ=SEG.ACK + 1><RST>
  1666.          Endif
  1667.          Discard segment; Return
  1668.        Endif
  1669.  
  1670.        If RST set
  1671.          If ACK set
  1672.            Signal "Connection Refused"
  1673.            Set State =  CLOSED
  1674.            Deallocate connection record
  1675.          Endif
  1676.          Discard segment
  1677.          Return
  1678.        Endif
  1679.  
  1680.  
  1681.  
  1682.                                                                Page 25
  1683.  
  1684.  
  1685.  
  1686.      RFC-908                                                 July 1984
  1687.  
  1688.  
  1689.  
  1690.  
  1691.        If SYN set
  1692.          Set RCV.CUR = SEG.SEQ
  1693.              RCV.IRS = SEG.SEQ
  1694.              SND.MAX = SEG.MAX
  1695.              RBUF.MAX = SEG.BMAX
  1696.          If ACK set
  1697.            Set SND.UNA = SEG.ACK
  1698.            State = OPEN
  1699.            Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1700.           else
  1701.            Set State = SYN-RCVD
  1702.            Send <SEQ=SND.ISS><ACK=RCV.CUR><MAX=RCV.MAX><BUFMAX=RBUF.MAX>
  1703.                   <SYN><ACK>
  1704.          Endif
  1705.          Return
  1706.        Endif
  1707.  
  1708.        If anything else
  1709.          Discard segment
  1710.          Return
  1711.        Endif
  1712.      Endif
  1713.  
  1714.      If State = SYN-RCVD
  1715.  
  1716.        If RCV.IRS < SEG.SEQ =< RCV.CUR + (RCV.MAX * 2)
  1717.          Segment sequence number acceptable
  1718.         else
  1719.          Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1720.          Discard segment
  1721.          Return
  1722.        Endif
  1723.  
  1724.  
  1725.        If RST set
  1726.          If passive Open
  1727.             Set State = LISTEN
  1728.          else
  1729.             Set State = CLOSED
  1730.             Signal "Connection Refused"
  1731.             Discard segment
  1732.             Deallocate connection record
  1733.          Endif
  1734.          Return
  1735.        Endif
  1736.  
  1737.  
  1738.  
  1739.  
  1740.      Page 26
  1741.  
  1742.  
  1743.  
  1744.      RDP Specification                              Protocol Operation
  1745.  
  1746.  
  1747.  
  1748.        If SYN set
  1749.          Send <SEQ=SEG.ACK + 1><RST>
  1750.          Set State = CLOSED
  1751.          Signal "Connection Reset"
  1752.          Discard segment
  1753.          Deallocate connection record
  1754.          Return
  1755.        Endif
  1756.  
  1757.        If EACK set
  1758.           Send <SEQ=SEG.ACK + 1><RST>
  1759.           Discard segment
  1760.           Return
  1761.        Endif
  1762.  
  1763.        If ACK set
  1764.          If SEG.ACK = SND.ISS
  1765.             Set State = OPEN
  1766.           else
  1767.             Send <SEQ=SEG.ACK + 1><RST>
  1768.             Discard segment
  1769.             Return
  1770.          Endif
  1771.         else
  1772.          Discard segment
  1773.          Return
  1774.        Endif
  1775.  
  1776.        If Data in segment or NUL set
  1777.          If the received segment is in sequence
  1778.             Copy the data (if any) to user buffers
  1779.             Set RCV.CUR=SEG.SEQ
  1780.             Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1781.           else
  1782.             If out-of-sequence delivery permitted
  1783.                Copy the data (if any) to user buffers
  1784.             Endif
  1785.             Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
  1786.                       ...<RCVDSEQNOn>
  1787.          Endif
  1788.        Endif
  1789.  
  1790.      Endif
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.                                                                Page 27
  1799.  
  1800.  
  1801.  
  1802.      RFC-908                                                 July 1984
  1803.  
  1804.  
  1805.  
  1806.      If State = OPEN
  1807.  
  1808.        If RCV.CUR < SEG.SEQ =< RCV.CUR + (RCV.MAX * 2)
  1809.          Segment sequence number acceptable
  1810.         else
  1811.          Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1812.          Discard segment and return
  1813.        Endif
  1814.  
  1815.        If RST set
  1816.          Set State = CLOSE-WAIT
  1817.          Signal "Connection Reset"
  1818.          Return
  1819.        Endif
  1820.  
  1821.        If NUL set
  1822.          Set RCV.CUR=SEG.SEQ
  1823.          Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1824.          Discard segment
  1825.          Return
  1826.        Endif
  1827.  
  1828.        If SYN set
  1829.          Send <SEQ=SEG.ACK + 1><RST>
  1830.          Set State = CLOSED
  1831.          Signal "Connection Reset"
  1832.          Discard segment
  1833.          Deallocate connection record
  1834.          Return
  1835.        Endif
  1836.  
  1837.        If ACK set
  1838.          If SND.UNA =< SEG.ACK < SND.NXT
  1839.            Set SND.UNA = SEG.ACK
  1840.            Flush acknowledged segments
  1841.          Endif
  1842.        Endif
  1843.  
  1844.        If EACK set
  1845.          Flush acknowledged segments
  1846.        Endif
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.      Page 28
  1857.  
  1858.  
  1859.  
  1860.      RDP Specification                              Protocol Operation
  1861.  
  1862.  
  1863.  
  1864.        If Data in segment
  1865.         If the received segment is in sequence
  1866.           Copy the data to user buffers
  1867.           Set RCV.CUR=SEG.SEQ
  1868.           Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
  1869.          else
  1870.           If out-of-sequence delivery permitted
  1871.              Copy the data to user buffers
  1872.           Endif
  1873.           Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
  1874.                       ...<RCVDSEQNOn>
  1875.         Endif
  1876.        Endif
  1877.      Endif
  1878.  
  1879.  
  1880.  
  1881.      3.7.3  Timeout Events
  1882.  
  1883.           Timeout events occur when a timer expires  and  signals  the
  1884.      RDP.  Two types of timeout events can occur, as described below:
  1885.  
  1886.      RETRANSMISSION TIMEOUTS
  1887.  
  1888.        If timeout on segment at head of retransmission queue
  1889.           Resend the segment at head of queue
  1890.           Restart the retransmission timer for the segment
  1891.           Requeue the segment on retransmission queue
  1892.           Return
  1893.        Endif
  1894.  
  1895.  
  1896.      CLOSE-WAIT TIMEOUTS
  1897.  
  1898.        Set State = CLOSED
  1899.        Deallocate connection record
  1900.        Return
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.                                                                Page 29
  1915.  
  1916.  
  1917.  
  1918.      RFC-908                                                 July 1984
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.      Page 30
  1973.  
  1974.  
  1975.  
  1976.      RDP Specification                        RDP Segments and Formats
  1977.  
  1978.  
  1979.  
  1980.                                  CHAPTER 4
  1981.  
  1982.  
  1983.                          RDP Segments and Formats
  1984.  
  1985.  
  1986.  
  1987.           The segments sent by the application layer are  encapsulated
  1988.      in  headers  by  the  transport,  internet and network layers, as
  1989.      follows:
  1990.  
  1991.  
  1992.                             +----------------+
  1993.                             | Network Access |
  1994.                             |     Header     |
  1995.                             +----------------+
  1996.                             |   IP Header    |
  1997.                             +----------------+
  1998.                             |   RDP Header   |
  1999.                             +----------------+
  2000.                             |     D          |
  2001.                             |      A         |
  2002.                             |       T        |
  2003.                             |        A       |
  2004.                             +----------------+
  2005.  
  2006.                               Segment Format
  2007.                                  Figure 4
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.      4.1  IP Header Format
  2014.  
  2015.           When used in the internet environment, RDP segments are sent
  2016.      using  the  version 4 IP header as described in RFC791, "Internet
  2017.      Protocol."  The RDP protocol number is ??? (decimal).  The  time-
  2018.      to-live  field  should  be  set  to  a  reasonable  value for the
  2019.      network.
  2020.  
  2021.           All other fields should be set as specified in RFC-791.
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.                                                                Page 31
  2031.  
  2032.  
  2033.  
  2034.      RFC-908                                                 July 1984
  2035.  
  2036.  
  2037.  
  2038.      4.2  RDP Header Format
  2039.  
  2040.           Every RDP segment is  prefaced  with  an  RDP  header.   The
  2041.      format  of the header is shown in Figure 5 below.  The RDP header
  2042.      is variable in length and its size is indicated by a field  in  a
  2043.      fixed location within the header.
  2044.  
  2045.  
  2046.                        0             0 0   1         1
  2047.                        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2048.                       +-+-+-+-+-+-+---+---------------+
  2049.                       |S|A|E|R|N| |Ver|    Header     |
  2050.                     0 |Y|C|A|S|U|0|No.|    Length     |
  2051.                       |N|K|K|T|L| |   |               |
  2052.                       +-+-+-+-+-+-+---+---------------+
  2053.                     1 | Source Port   |   Dest. Port  |
  2054.                       +---------------+---------------+
  2055.                     2 |          Data  Length         |
  2056.                       +---------------+---------------+
  2057.                     3 |                               |
  2058.                       +---    Sequence Number      ---+
  2059.                     4 |                               |
  2060.                       +---------------+---------------+
  2061.                     5 |                               |
  2062.                       +--- Acknowledgement Number  ---+
  2063.                     6 |                               |
  2064.                       +---------------+---------------+
  2065.                     7 |                               |
  2066.                       +---        Checksum         ---+
  2067.                     8 |                               |
  2068.                       +---------------+---------------+
  2069.                     9 |     Variable Header Area      |
  2070.                       .                               .
  2071.                       .                               .
  2072.                       |                               |
  2073.                       +---------------+---------------+
  2074.  
  2075.                              RDP Header Format
  2076.                                  Figure 5
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.      Page 32
  2089.  
  2090.  
  2091.  
  2092.      RDP Specification                        RDP Segments and Formats
  2093.  
  2094.  
  2095.  
  2096.      4.2.1  RDP Header Fields
  2097.  
  2098.      Control Flags
  2099.  
  2100.           This 8-bit field occupies the first octet of word one in the
  2101.           header.  It is bit encoded with the following bits currently
  2102.           defined:
  2103.  
  2104.           Bit #  Bit Name   Description
  2105.  
  2106.           0      SYN        Establish connection and
  2107.                               synchronize sequence numbers.
  2108.           1      ACK        Acknowledge field significant.
  2109.           2      EACK       Non-cumulative (Extended) acknowledgement.
  2110.           3      RST        Reset the connection.
  2111.           4      NUL        This is a null (zero data length) segment.
  2112.           5                 Unused.
  2113.  
  2114.  
  2115.  
  2116.           Note that the SYN and RST are sent as separate segments  and
  2117.           may  not  contain  any  data.   The  ACK  may  accompany any
  2118.           message.  The NUL segment must have a zero data length,  but
  2119.           may  be  accompanied by ACK and EACK information.  The other
  2120.           control bit is currently unused and is defined to be zero.
  2121.  
  2122.      Version Number
  2123.  
  2124.           This field  occupies  bits  6-7  of  the  first  octet.   It
  2125.           contains  the  version  number  of the protocol described by
  2126.           this document.  Current value is one (1).
  2127.  
  2128.      Header Length
  2129.  
  2130.           The length of the RDP header in units  of  two  (2)  octets,
  2131.           including  this  field.   This  field allows RDP to find the
  2132.           start of the Data field, given a pointer to the head of  the
  2133.           segment.   This  field  is  8 bits in length.  For a segment
  2134.           with no variable header section,  the  header  length  field
  2135.           will have the value 9.
  2136.  
  2137.      Source and Destination Ports
  2138.  
  2139.           The Source and Destination Ports are used  to  identify  the
  2140.           processes  in the two hosts that are communicating with each
  2141.           other.  The combination of the  port  identifiers  with  the
  2142.           source  and  destination  addresses  in  the  network access
  2143.  
  2144.  
  2145.  
  2146.                                                                Page 33
  2147.  
  2148.  
  2149.  
  2150.      RFC-908                                                 July 1984
  2151.  
  2152.  
  2153.  
  2154.           protocol header serves to fully qualify the  connection  and
  2155.           constitutes  the connection identifier.  This permits RDP to
  2156.           distinguish multiple connections between  two  hosts.   Each
  2157.           field  is  8 bits in length, allowing port numbers from 0 to
  2158.           255 (decimal).
  2159.  
  2160.      Data Length
  2161.  
  2162.           The length in octets of the data in this segment.  The  data
  2163.           length  does  not  include the RDP header.  This field is 16
  2164.           bits in length.
  2165.  
  2166.      Sequence Number
  2167.  
  2168.           The sequence number of this segment.  This field is 32  bits
  2169.           in length.
  2170.  
  2171.      Acknowledgement Number
  2172.  
  2173.           If the ACK bit is set in the header, this  is  the  sequence
  2174.           number  of  the segment that the sender of this segment last
  2175.           received correctly and in sequence.  Once  a  connection  is
  2176.           established  this  should  always be sent.  This field is 32
  2177.           bits in length.
  2178.  
  2179.      Checksum
  2180.  
  2181.           This field is a 32-bit checksum of the  segment  header  and
  2182.           data.    The   algorithm   description  below  includes  two
  2183.           variables,  the  checksum  accumulator  and   the   checksum
  2184.           pointer.   The  checksum  accumulator  is  an  actual 32-bit
  2185.           register in which the  checksum  is  formed.   The  checksum
  2186.           pointer   is   included  for  purposes  of  description,  to
  2187.           represent the operation of advancing through the  data  four
  2188.           octets  (32-bits) at a time.  It need not be maintained in a
  2189.           register by an implementation.
  2190.  
  2191.           1) The checksum pointer is set to zero, to correspond to the
  2192.           beginning  of  the  area  to  be  checksummed.  The checksum
  2193.           accumulator is also initialized to zero before beginning the
  2194.           computation of the checksum.
  2195.  
  2196.           2) The 32-bit memory word located at the address  referenced
  2197.           by  the  checksum  pointer  is  added  arithmetically to the
  2198.           checksum accumulator.   Any  carry  propagated  out  of  the
  2199.           checksum  accumulator is ignored.  The checksum field itself
  2200.           is replaced with zeros when  being  added  to  the  checksum
  2201.  
  2202.  
  2203.  
  2204.      Page 34
  2205.  
  2206.  
  2207.  
  2208.      RDP Specification                        RDP Segments and Formats
  2209.  
  2210.  
  2211.  
  2212.           accumulator.
  2213.  
  2214.           3)  The  checksum  accumulator  is  rotated  left  one   bit
  2215.           position.  The checksum pointer is advanced to correspond to
  2216.           the address of the next 32-bit word in the segment.
  2217.  
  2218.           4) Steps 2 and 3 are repeated until the entire  segment  has
  2219.           been  summed.   If a segment contains a number of header and
  2220.           data octets that is not an integral multiple  of  4  octets,
  2221.           the  last  octet is padded on the right with zeros to form a
  2222.           32-bit quantity for computation purposes.
  2223.  
  2224.      Variable Header Area
  2225.  
  2226.           This area is used to transmit parameters  for  the  SYN  and
  2227.           EACK segments.
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.                                                                Page 35
  2263.  
  2264.  
  2265.  
  2266.      RFC-908                                                 July 1984
  2267.  
  2268.  
  2269.  
  2270.      4.3  SYN Segment
  2271.  
  2272.           The SYN is used to establish a  connection  and  synchronize
  2273.      sequence  numbers  between  two  hosts.   The  SYN  segment  also
  2274.      contains information to inform the remote  host  of  the  maximum
  2275.      number  of  segments  the local RDP  is willing to accept and the
  2276.      maximum segment size it can accept.  The SYN may be combined with
  2277.      an ACK in a segment but is never combined with user data.
  2278.  
  2279.  
  2280.  
  2281.      4.3.1  SYN Segment Format
  2282.  
  2283.  
  2284.  
  2285.                         0             0 0   1         1
  2286.                         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2287.                        +-+-+-+-+-+-+---+---------------+
  2288.                      0 |1|0|0|0|0|0|0 1| Header Length |
  2289.                        +-+-+-+-+-+-+---+---------------+
  2290.                      1 | Source Port   |   Dest. Port  |
  2291.                        +---------------+---------------+
  2292.                      2 |       Data  Length = 0        |
  2293.                        +---------------+---------------+
  2294.                      3 |                               |
  2295.                        +---    Sequence Number      ---+
  2296.                      4 |                               |
  2297.                        +---------------+---------------+
  2298.                      5 |                               |
  2299.                        +--- Acknowledgement Number  ---+
  2300.                      6 |                               |
  2301.                        +---------------+---------------+
  2302.                      7 |                               |
  2303.                        +---        Checksum         ---+
  2304.                      8 |                               |
  2305.                        +---------------+---------------+
  2306.                      9 | Max. # of Outstanding Segments|
  2307.                        +---------------+---------------+
  2308.                     10 |       Max. Segment Size       |
  2309.                        +-------------------------------+
  2310.                     11 |      Options Flag Field       |
  2311.                        +---------------+---------------+
  2312.  
  2313.                             SYN Segment Format
  2314.                                  Figure 6
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.      Page 36
  2321.  
  2322.  
  2323.  
  2324.      RDP Specification                        RDP Segments and Formats
  2325.  
  2326.  
  2327.  
  2328.      4.3.2  SYN Segment Fields
  2329.  
  2330.      Sequence Number
  2331.  
  2332.           Contains the  initial  sequence  number  selected  for  this
  2333.           connection.
  2334.  
  2335.      Acknowledgement Number
  2336.  
  2337.           This field is valid only if the ACK flag is  set.   In  that
  2338.           case, this field will contain the sequence number of the SYN
  2339.           segment received from the other RDP.
  2340.  
  2341.      Maximum Number of Outstanding Segments
  2342.  
  2343.           The maximum number of segments that should be  sent  without
  2344.           getting an acknowledgement.  This is used by the receiver as
  2345.           a means of flow control.   The  number  is  selected  during
  2346.           connection  initiation  and  may not be changed later in the
  2347.           life of the connection.
  2348.  
  2349.      Maximum Segment Size
  2350.  
  2351.           The maximum size segment in octets that  the  sender  should
  2352.           send.   It informs the sender how big the receiver's buffers
  2353.           are.  The specified size  includes  the  length  of  the  IP
  2354.           header,  RDP  header,  and  data.   It  does not include the
  2355.           network access layer's header length.
  2356.  
  2357.      Options Flag Field
  2358.  
  2359.           This field of two octets contains a  set  of  options  flags
  2360.           that  specify the set of optional functions that are desired
  2361.           for this connection.  The flags are defined as follows:
  2362.  
  2363.           Bit #   Bit Name    Description
  2364.  
  2365.           0       SDM         Sequenced delivery mode.
  2366.  
  2367.  
  2368.  
  2369.           The sequenced delivery mode flag specifies whether  delivery
  2370.           of   segments   to  the  user  is  sequenced  (delivered  in
  2371.           sequence-number  order)  or  non-sequenced   (delivered   in
  2372.           arrival order, regardless of sequence number).  A value of 0
  2373.           specifies non-sequenced delivery of segments, and a value of
  2374.           1 specifies sequenced delivery.
  2375.  
  2376.  
  2377.  
  2378.                                                                Page 37
  2379.  
  2380.  
  2381.  
  2382.      RFC-908                                                 July 1984
  2383.  
  2384.  
  2385.  
  2386.      4.4  ACK Segment
  2387.  
  2388.           The ACK segment is used to acknowledge in-sequence segments.
  2389.      It   contains   both  the  next  send  sequence  number  and  the
  2390.      acknowledgement sequence number  in  the  RDP  header.   The  ACK
  2391.      segment  may  be  sent  as  a  separate segment, but it should be
  2392.      combined with data whenever possible.  Data segments must  always
  2393.      include the ACK bit and Acknowledgement Number field.
  2394.  
  2395.  
  2396.  
  2397.      4.4.1  ACK Segment Format
  2398.  
  2399.  
  2400.  
  2401.                         0             0 0   1         1
  2402.                         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2403.                        +-+-+-+-+-+-+---+---------------+
  2404.                      0 |0|1|0|0|0|0|0 1| Header Length |
  2405.                        +-+-+-+-+-+-+---+---------------+
  2406.                      1 | Source Port   |   Dest. Port  |
  2407.                        +---------------+---------------+
  2408.                      2 |          Data  Length         |
  2409.                        +---------------+---------------+
  2410.                      3 |                               |
  2411.                        +---    Sequence Number      ---+
  2412.                      4 |                               |
  2413.                        +---------------+---------------+
  2414.                      5 |                               |
  2415.                        +--- Acknowledgement Number  ---+
  2416.                      6 |                               |
  2417.                        +---------------+---------------+
  2418.                      7 |                               |
  2419.                        +---        Checksum         ---+
  2420.                      8 |                               |
  2421.                        +---------------+---------------+
  2422.                        |                               |
  2423.                        |             Data              |
  2424.                        .                               .
  2425.                        .                               .
  2426.                        +---------------+---------------+
  2427.  
  2428.                             ACK Segment Format
  2429.                                  Figure 7
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.      Page 38
  2437.  
  2438.  
  2439.  
  2440.      RDP Specification                        RDP Segments and Formats
  2441.  
  2442.  
  2443.  
  2444.      4.4.2  ACK Segment Fields
  2445.  
  2446.      Data Length
  2447.  
  2448.           A non-zero Data Length field indicates that  there  is  data
  2449.           present in the segment.
  2450.  
  2451.      Sequence Number
  2452.  
  2453.           The value of the Sequence Number field is  advanced  to  the
  2454.           next  sequence  number  only if there is data present in the
  2455.           segment.  An ACK segment without data does not use  sequence
  2456.           number space.
  2457.  
  2458.      Acknowledgement Number
  2459.  
  2460.           The  Acknowledgement  Number  field  contains  the  sequence
  2461.           number of the last segment received in sequential order.
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.                                                                Page 39
  2495.  
  2496.  
  2497.  
  2498.      RFC-908                                                 July 1984
  2499.  
  2500.  
  2501.  
  2502.      4.5  Extended ACK Segment
  2503.  
  2504.           The EACK segment is used to  acknowledge  segments  received
  2505.      out of sequence.  It contains the sequence numbers of one or more
  2506.      segments received with a correct checksum, but out  of  sequence.
  2507.      The  EACK  is  always combined with an ACK in the segment, giving
  2508.      the sequence number of the last  segment  received  in  sequence.
  2509.      The EACK segment may also include user data.
  2510.  
  2511.  
  2512.  
  2513.      4.5.1  EACK Segment Format
  2514.  
  2515.           The EACK segment has the format shown in Figure 8.
  2516.  
  2517.  
  2518.  
  2519.      4.5.2  EACK Segment Fields
  2520.  
  2521.      Data Length
  2522.  
  2523.           A non-zero Data Length field indicates that  there  is  data
  2524.           present in the segment.
  2525.  
  2526.      Sequence Number
  2527.  
  2528.           The value of the Sequence Number field is  advanced  to  the
  2529.           next  sequence  number  only if there is data present in the
  2530.           segment.  An EACK segment without data does not use sequence
  2531.           number space.
  2532.  
  2533.      Acknowledgement Number
  2534.  
  2535.           The  Acknowledgement  Number  field  contains  the  sequence
  2536.           number of the last segment received in sequential order.
  2537.  
  2538.  
  2539.      Sequence # Received OK
  2540.  
  2541.           Each entry is the sequence number  of  a  segment  that  was
  2542.           received with a correct checksum, but out of sequence.
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.      Page 40
  2553.  
  2554.  
  2555.  
  2556.      RDP Specification                        RDP Segments and Formats
  2557.  
  2558.  
  2559.  
  2560.  
  2561.                         0             0 0   1         1
  2562.                         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2563.                        +-+-+-+-+-+-+---+---------------+
  2564.                      0 |0|1|1|0|0|0|0 1| Header Length |
  2565.                        +-+-+-+-+-+-+---+---------------+
  2566.                      1 | Source Port   |   Dest. Port  |
  2567.                        +---------------+---------------+
  2568.                      2 |          Data  Length         |
  2569.                        +---------------+---------------+
  2570.                      3 |                               |
  2571.                        +---    Sequence Number      ---|
  2572.                      4 |                               |
  2573.                        +---------------+---------------+
  2574.                      5 |                               |
  2575.                        +--- Acknowledgement Number  ---+
  2576.                      6 |                               |
  2577.                        +---------------+---------------+
  2578.                      7 |                               |
  2579.                        +---        Checksum         ---+
  2580.                      8 |                               |
  2581.                        +---------------+---------------+
  2582.                      9 |                               |
  2583.                        +--- Sequence # Received OK  ---+
  2584.                     10 |                               |
  2585.                        +---------------+---------------+
  2586.                     11 |                               |
  2587.                        +--- Sequence # Received OK  ---+
  2588.                     12 |                               |
  2589.                        +---------------+---------------+
  2590.                        :               .               :
  2591.                        :               .               :
  2592.                        :               .               :
  2593.                        +---------------+---------------+
  2594.                        |                               |
  2595.                        |             Data              |
  2596.                        |                               |
  2597.                        +---------------+---------------+
  2598.  
  2599.                             EACK Segment Format
  2600.                                  Figure 8
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.                                                                Page 41
  2611.  
  2612.  
  2613.  
  2614.      RFC-908                                                 July 1984
  2615.  
  2616.  
  2617.  
  2618.      4.6  RST Segment
  2619.  
  2620.           The RST segment is used to  close  or  reset  a  connection.
  2621.      Upon  receipt of an RST segment, the sender must stop sending and
  2622.      must abort any  unserviced  requests.   The  RST  is  sent  as  a
  2623.      separate segment and does not include any data.
  2624.  
  2625.  
  2626.  
  2627.      4.6.1  RST Segment Format
  2628.  
  2629.  
  2630.  
  2631.                         0             0 0   1         1
  2632.                         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2633.                        +-+-+-+-+-+-+---+---------------+
  2634.                      0 |0|0|0|1|0|0|0 1| Header Length |
  2635.                        +-+-+-+-+-+-+---+---------------+
  2636.                      1 | Source Port   |   Dest. Port  |
  2637.                        +---------------+---------------+
  2638.                      2 |       Data  Length = 0        |
  2639.                        +---------------+---------------+
  2640.                      3 |                               |
  2641.                        +---    Sequence Number      ---+
  2642.                      4 |                               |
  2643.                        +---------------+---------------+
  2644.                      5 |                               |
  2645.                        +--- Acknowledgement Number  ---+
  2646.                      6 |                               |
  2647.                        +---------------+---------------+
  2648.                      7 |                               |
  2649.                        +---        Checksum         ---+
  2650.                      8 |                               |
  2651.                        +-------------------------------+
  2652.  
  2653.                             RST Segment Format
  2654.                                  Figure 9
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.      Page 42
  2669.  
  2670.  
  2671.  
  2672.      RDP Specification                        RDP Segments and Formats
  2673.  
  2674.  
  2675.  
  2676.      4.7  NUL Segment
  2677.  
  2678.           The NUL segment is used to determine if the other side of  a
  2679.      connection  is  still active.  When a NUL segment is received, an
  2680.      RDP implementation  must  acknowledge  the  segment  if  a  valid
  2681.      connection  exists  and  the segment sequence number falls within
  2682.      the acceptance window.  The segment is then discarded.   The  NUL
  2683.      may  be  combined  with an ACK in a segment but is never combined
  2684.      with user data.
  2685.  
  2686.  
  2687.  
  2688.      4.7.1  NUL segment format
  2689.  
  2690.  
  2691.  
  2692.                         0             0 0   1         1
  2693.                         0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
  2694.                        +-+-+-+-+-+-+---+---------------+
  2695.                      0 |0|0|0|0|1|0|0 1| Header Length |
  2696.                        +-+-+-+-+-+-+---+---------------+
  2697.                      1 | Source Port   |   Dest. Port  |
  2698.                        +---------------+---------------+
  2699.                      2 |       Data  Length = 0        |
  2700.                        +---------------+---------------+
  2701.                      3 |                               |
  2702.                        +---    Sequence Number      ---+
  2703.                      4 |                               |
  2704.                        +---------------+---------------+
  2705.                      5 |                               |
  2706.                        +--- Acknowledgement Number  ---+
  2707.                      6 |                               |
  2708.                        +---------------+---------------+
  2709.                      7 |                               |
  2710.                        +---        Checksum         ---+
  2711.                      8 |                               |
  2712.                        +-------------------------------+
  2713.  
  2714.                             NUL Segment Format
  2715.                                  Figure 10
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.                                                                Page 43
  2727.  
  2728.  
  2729.  
  2730.      RFC-908                                                 July 1984
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.      Page 44
  2785.  
  2786.  
  2787.  
  2788.      RDP Specification                           Examples of Operation
  2789.  
  2790.  
  2791.  
  2792.                                  CHAPTER 5
  2793.  
  2794.  
  2795.                            Examples of Operation
  2796.  
  2797.  
  2798.  
  2799.      5.1  Connection Establishment
  2800.  
  2801.           This is an example of a connection being established between
  2802.      Host  A  and  Host  B.   Host B has done a passive Open and is in
  2803.      LISTEN state.  Host A  does  an  active  Open  to  establish  the
  2804.      connection.
  2805.  
  2806.  
  2807.                   Host A                         Host B
  2808.  
  2809.      Time State                                              State
  2810.  
  2811.      1.    CLOSED                                             LISTEN
  2812.  
  2813.      2.    SYN-SENT    <SEQ=100><SYN> --->
  2814.  
  2815.      3.                               <--- <SEQ=200><ACK=100><SYN,ACK>
  2816.                                                              SYN-RCVD
  2817.  
  2818.      4.    OPEN    <SEQ=101><ACK=200> --->                    OPEN
  2819.  
  2820.      5.      <SEQ=101><ACK=200><Data> --->
  2821.  
  2822.      6.                               <--- <SEQ=201><ACK=101>
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.                                                                Page 45
  2843.  
  2844.  
  2845.  
  2846.      RFC-908                                                 July 1984
  2847.  
  2848.  
  2849.  
  2850.      5.2  Simultaneous Connection Establishment
  2851.  
  2852.           This is an example  of  two  hosts  trying  to  establishing
  2853.      connections  to  each other at the same time.  Host A sends a SYN
  2854.      request to Host B at the same time Host B sends a SYN request  to
  2855.      Host A.
  2856.  
  2857.           Host A                         Host B
  2858.  
  2859.      Time State                                            State
  2860.  
  2861.      1.   CLOSED                                           CLOSED
  2862.  
  2863.      2.   SYN-SENT <SEQ=100><SYN>  --->
  2864.                                    <--- <SEQ=200><SYN>     SYN-SENT
  2865.  
  2866.      3.   SYN-RCVD                                         SYN-RCVD
  2867.         <SEQ=100><ACK=200><SYN,ACK> --->
  2868.                                    <--- <SEQ=200><ACK=100><SYN,ACK>
  2869.  
  2870.      4.   OPEN                                             OPEN
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.      Page 46
  2901.  
  2902.  
  2903.  
  2904.      RDP Specification                           Examples of Operation
  2905.  
  2906.  
  2907.  
  2908.      5.3  Lost Segments
  2909.  
  2910.           This is an example of what happens when a segment  is  lost.
  2911.      It  shows  how  segments  can be acknowledged out of sequence and
  2912.      that only the missing segment need be retransmitted.   Note  that
  2913.      in  this  and  the  following  examples  "EA"  stands for "Out of
  2914.      Sequence Acknowledgement."
  2915.  
  2916.  
  2917.      Time   Host A                           Host B
  2918.  
  2919.      1.     <SEQ=100><ACK=200><Data>  --->
  2920.  
  2921.      2.                               <--- <SEQ=201><ACK=100>
  2922.  
  2923.      3.     <SEQ=101><ACK=200><Data> (segment lost)
  2924.  
  2925.      4.
  2926.  
  2927.      5.     <SEQ=102><ACK=200><Data>  --->
  2928.  
  2929.      6.                               <--  <SEQ=201><ACK=100><EA=102>
  2930.  
  2931.      7.     <SEQ=103><ACK=200><Data>  --->
  2932.  
  2933.      8.                               <--- <SEQ=201><ACK=100>
  2934.                                              <EA=102,103>
  2935.  
  2936.      9.     <SEQ=101><ACK=200><Data>  --->
  2937.  
  2938.      10.                              <--- <SEQ=201><ACK=103>
  2939.  
  2940.      11.    <SEQ=104><ACK=200><Data>  --->
  2941.  
  2942.      12.                              <--- <SEQ=201><ACK=104>
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.                                                                Page 47
  2959.  
  2960.  
  2961.  
  2962.      RFC-908                                                 July 1984
  2963.  
  2964.  
  2965.  
  2966.      5.4  Segments Received Out of Order
  2967.  
  2968.           This an example of  segments  received  out  of  order.   It
  2969.      further  illustrates  the  use  of  acknowledging segments out of
  2970.      order to prevent needless retransmissions.
  2971.  
  2972.  
  2973.      Time     Host A                           Host B
  2974.  
  2975.      1.   <SEQ=100><ACK=200><Data>  --->
  2976.  
  2977.      2.                             <--- <SEQ=201><ACK=100>
  2978.  
  2979.      3.   <SEQ=101><ACK=200><Data> (delayed)
  2980.  
  2981.      4.
  2982.  
  2983.      5.   <SEQ=102><ACK=200><Data>  --->
  2984.  
  2985.      6.                             <--- <SEQ=201><ACK=100><EA=102>
  2986.  
  2987.      7.   <SEQ=103><ACK=200><Data>  --->
  2988.                                    ---> (delayed segment 101 arrives)
  2989.  
  2990.      8.                             <--- <SEQ=201><ACK=103>
  2991.  
  2992.      9.   <SEQ=104><ACK=200><Data>  --->
  2993.  
  2994.      10.                            <--- <SEQ=201><ACK=104>
  2995.  
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.      Page 48
  3017.  
  3018.  
  3019.  
  3020.      RDP Specification                           Examples of Operation
  3021.  
  3022.  
  3023.  
  3024.      5.5  Communication Over Long Delay Path
  3025.  
  3026.           This is an example of a data  transfer  over  a  long  delay
  3027.      path.   In  this  example, Host A is permitted to have as many as
  3028.      five unacknowledged segments.  The example shows that it  is  not
  3029.      necessary  to  wait  for  an  acknowledgement  in  order  to send
  3030.      additional data.
  3031.  
  3032.  
  3033.      Time        Host A                     Host B
  3034.  
  3035.      1.   <SEQ=100><ACK=200><Data> -1->
  3036.      2.   <SEQ=101><ACK=200><Data> -2->
  3037.      3.   <SEQ=102><ACK=200><Data> -3->
  3038.                                    -1-> (received)
  3039.      4.                           <-4-  <SEQ=201><ACK=100>
  3040.      5.   <SEQ=103><ACK=200><Data> -5->
  3041.                                    -2-> (received)
  3042.      6.                           <-6-  <SEQ=201><ACK=101>
  3043.      7.   <SEQ=104><ACK=200><Data> -7->
  3044.                                    -3-> (received)
  3045.      8.                           <-8-  <SEQ=201><ACK=102>
  3046.                        (received) <-4-
  3047.      9.   <SEQ=105><ACK=200><Data> -9->
  3048.                                    -5-> (received)
  3049.      10.                          <-10- <SEQ=201><ACK=103>
  3050.                        (received) <-6-
  3051.      11.  <SEQ=106><ACK=200><Data> -11->
  3052.                                    -7-> (received)
  3053.      12.                          <-12- <SEQ=201><ACK=104>
  3054.                        (received) <-8-
  3055.      13.                           -9-> (received)
  3056.      14.                          <-13- <SEQ=201><ACK=105>
  3057.                        (received) <-10-
  3058.      15.                           -11-> (received)
  3059.      16.                          <-14- <SEQ=201><ACK=106>
  3060.                        (received) <-12-
  3061.      17.               (received) <-13-
  3062.      18.               (received) <-14-
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.                                                                Page 49
  3075.  
  3076.  
  3077.  
  3078.      RFC-908                                                 July 1984
  3079.  
  3080.  
  3081.  
  3082.      5.6  Communication Over Long Delay Path With Lost Segments
  3083.  
  3084.           This is an example of communication over a long  delay  path
  3085.      with a lost segment.  It shows that by acknowledging segments out
  3086.      of sequence, only the lost segment need be retransmitted.
  3087.  
  3088.  
  3089.      Time       Host A                     Host B
  3090.  
  3091.      1. <SEQ=100><ACK=200><Data>  -1->
  3092.      2. <SEQ=101><ACK=200><Data>  -2->
  3093.      3. <SEQ=102><ACK=200><Data>  -3->
  3094.                                   -1-> (received)
  3095.      4.                          <-4-  <SEQ=201><ACK=100>
  3096.      5. <SEQ=103><ACK=200><Data> (segment lost)
  3097.                                   -2-> (received)
  3098.      6.                          <-5-  <SEQ=201><ACK=101>
  3099.      7. <SEQ=104><ACK=200><Data>  -6->
  3100.                                   -3-> (received)
  3101.      8.                          <-7-  <SEQ=201><ACK=102>
  3102.                       (received) <-4-
  3103.      9. <SEQ=105><ACK=200><Data>  -8->
  3104.      10.
  3105.                       (received) <-5-
  3106.      11. <SEQ=106><ACK=200><Data> -10->
  3107.                                   -6-> (received)
  3108.      12.                         <-11- <SEQ=201><ACK=102><EA=104>
  3109.                       (received) <-7-
  3110.                                   -8-> (received)
  3111.      13.                         <-12- <SEQ=201><ACK=102><EA=104,105>
  3112.                                   -10-> (received)
  3113.      14.                         <-13- <SEQ=201><ACK=102><EA=104-106>
  3114.                       (received) <-11-
  3115.      15. <SEQ=103><ACK=200><Data> -14->
  3116.                       (received) <-12-
  3117.      16.              (received) <-13-
  3118.                                   -14-> (received)
  3119.      17.                         <-15- <SEQ=201><ACK=106>
  3120.      18.
  3121.      19.              (received) <-15-
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.      Page 50
  3133.  
  3134.  
  3135.  
  3136.      RDP Specification                           Examples of Operation
  3137.  
  3138.  
  3139.  
  3140.      5.7  Detecting a Half-Open Connection on Crash Recovery
  3141.  
  3142.           This  is  an  example  of  a  host  detecting  a   half-open
  3143.      connection  due  to the crash and subsequent restart of the host.
  3144.      In this example, Host A crashes during a  communication  session,
  3145.      then  recovers  and  tries  to reopen the connection.  During the
  3146.      reopen attempt, it discovers that a  half-open  connection  still
  3147.      exists and it then resets the other side.  Both sides were in the
  3148.      OPEN state prior to the crash.
  3149.  
  3150.         Host A                                  Host B
  3151.  
  3152.      Time
  3153.  
  3154.      1.  OPEN                                     OPEN
  3155.         (crash!)               <--- <SEQ=200><ACK=100><ACK>
  3156.  
  3157.      2.  CLOSED                                   OPEN
  3158.         (recover)
  3159.  
  3160.      3.  SYN-SENT                                 OPEN
  3161.                  <SEQ=400><SYN> --->             (?)
  3162.  
  3163.      4.  SYN-SENT                                 OPEN
  3164.           (!)                  <--- <SEQ=200><ACK=100><ACK>
  3165.  
  3166.      5.  SYN-SENT                                 OPEN
  3167.                  <SEQ=101><RST> --->             (abort)
  3168.  
  3169.      6.  SYN-SENT                                 CLOSED
  3170.  
  3171.      7.  SYN-SENT <SEQ=400><SYN> --->
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.                                                                Page 51
  3191.  
  3192.  
  3193.  
  3194.      RFC-908                                                 July 1984
  3195.  
  3196.  
  3197.  
  3198.      5.8  Detecting a Half-Open Connection from the Active Side
  3199.  
  3200.           This is another example of detecting a half-open  connection
  3201.      due  to the crash and restart of a host involved in a connection.
  3202.      In this example, host A again crashes and restarts.   Host  B  is
  3203.      still  active and tries to send data to host A.  Since host A has
  3204.      no knowledge of the connection, it rejects the data with  an  RST
  3205.      segment, causing host B to reset the connection.
  3206.  
  3207.               Host A                         Host B
  3208.  
  3209.      Time
  3210.  
  3211.      1.  (crash!)                                            OPEN
  3212.  
  3213.      2.  CLOSED                <--- <SEQ=200><ACK=100><Data> OPEN
  3214.  
  3215.      3.  CLOSED  <SEQ=101><RST> --->                         (abort)
  3216.  
  3217.      4.  CLOSED                                              CLOSED
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.      Page 52
  3249.  
  3250.  
  3251.  
  3252.      RDP Specification                           Examples of Operation
  3253.  
  3254.  
  3255.  
  3256.                                 APPENDIX A
  3257.  
  3258.  
  3259.                         Implementing a Minimal RDP
  3260.  
  3261.  
  3262.  
  3263.           It  is  not  necessary   to   implement   the   entire   RDP
  3264.      specification  to  be  able  to use RDP.  For simple applications
  3265.      such as a loader, where  size  of  the  protocol  module  may  be
  3266.      important,  a  subset  of  RDP  may  be  used.   For  example, an
  3267.      implementation of  RDP  for  loading  may  employ  the  following
  3268.      restrictions:
  3269.  
  3270.      o    Only one connection  and  connection  record  is  supported.
  3271.           This is the connection used to load the device.
  3272.  
  3273.      o    A single, well-known  port  is  used  as  the  loader  port.
  3274.           Allocable ports are not implemented.
  3275.  
  3276.      o    Only the passive Open request is implemented.  Active  Opens
  3277.           are not supported.
  3278.  
  3279.      o    The sequenced delivery option is  not  supported.   Messages
  3280.           arriving  out  of  order  are  delivered  in  the order they
  3281.           arrive.
  3282.  
  3283.      o    If efficiency is less  important  than  protocol  size,  the
  3284.           extended acknowledgement feature need not be supported.
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.                                                                Page 53
  3307.  
  3308.  
  3309.  
  3310.      RFC-908                                                 July 1984
  3311.  
  3312.  
  3313.  
  3314.                                    INDEX
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.      ACK.......................................... 16, 33, 34, 38
  3321.      ACK segment format....................................... 38
  3322.      acknowledgement number field......... 16, 34, 37, 38, 39, 40
  3323.      byte-stream protocols................................. 4, 14
  3324.      checksum................................................. 16
  3325.      checksum field........................................... 34
  3326.      Close request............................................ 13
  3327.      Closed state.......................................... 9, 10
  3328.      CLOSEWAIT................................................ 12
  3329.      Close-Wait state................................. 10, 11, 13
  3330.      CLOSE-WAIT timeouts...................................... 29
  3331.      connection, closing of............................... 13, 42
  3332.      connection, establishment of...................... 8, 11, 45
  3333.      connection identifier................................. 7, 33
  3334.      connection management..................................... 7
  3335.      connection record..................................... 9, 11
  3336.      connection state diagram................................. 10
  3337.      connection states......................................... 8
  3338.      control flags field...................................... 33
  3339.      cumulative acknowledgement............................... 16
  3340.      data communication....................................... 14
  3341.      data length field................................ 34, 39, 40
  3342.      datagrams................................................. 6
  3343.      debugging.............................................. 1, 3
  3344.      dumping................................................... 3
  3345.      EACK......................................... 16, 33, 35, 40
  3346.      EACK segment format...................................... 40
  3347.      event processing......................................... 20
  3348.      extended acknowledgement................................. 16
  3349.      flow control............................................. 17
  3350.      half-open connection, detection of............... 14, 51, 52
  3351.      initial sequence number....................... 9, 11, 12, 15
  3352.      internet protocols........................................ 5
  3353.      IP................................................ 6, 15, 31
  3354.      IP header............................................ 31, 37
  3355.      Listen state................................... 8, 9, 10, 45
  3356.      loading................................................ 1, 3
  3357.      maximum segment size..................... 11, 12, 13, 15, 37
  3358.      maximum unacknowledged segments.............. 11, 12, 17, 37
  3359.      message fragmentation.................................... 14
  3360.      non-cumulative acknowledgement........................... 16
  3361.  
  3362.  
  3363.  
  3364.      Page 54
  3365.  
  3366.  
  3367.  
  3368.      RDP Specification                           Examples of Operation
  3369.  
  3370.  
  3371.  
  3372.      NUL.................................................. 33, 43
  3373.      NUL segment format....................................... 43
  3374.      Open request.......................................... 8, 17
  3375.      Open request, active................................... 8, 9
  3376.      Open request, passive.................................. 8, 9
  3377.      Open state....................................... 10, 11, 45
  3378.      options flag field....................................... 37
  3379.      out-of-sequence acknowledgement.................. 12, 16, 18
  3380.      ports................................................. 7, 33
  3381.      ports, well-known......................................... 8
  3382.      positive acknowledgement............................. 15, 16
  3383.      RBUF.MAX................................................. 13
  3384.      RCV.CUR.................................................. 12
  3385.      RCVDSEQNO................................................ 12
  3386.      RCV.IRS.................................................. 12
  3387.      RCV.MAX.................................................. 12
  3388.      RDP connection........................................... 14
  3389.      RDP header................................... 14, 16, 32, 37
  3390.      RDP header length........................................ 33
  3391.      RDP segment format....................................... 31
  3392.      reliable communication................................... 15
  3393.      retransmission of segments....................... 15, 16, 17
  3394.      retransmission timeout............................... 17, 29
  3395.      RST.................................................. 33, 42
  3396.      RST segment.......................................... 13, 52
  3397.      RST segment format....................................... 42
  3398.      SBUF.MAX................................................. 12
  3399.      SDM...................................................... 37
  3400.      SEG.ACK.................................................. 13
  3401.      SEG.BMAX................................................. 13
  3402.      SEG.MAX.................................................. 13
  3403.      segment arrival events............................... 20, 24
  3404.      segments................................................. 14
  3405.      SEG.SEQ.................................................. 13
  3406.      Send request......................................... 14, 15
  3407.      sequence number...................................... 12, 15
  3408.      sequence number acceptance window........................ 18
  3409.      sequence number field........................ 34, 37, 39, 40
  3410.      sequenced delivery................................. 3, 4, 37
  3411.      sequential acknowledgement................................ 4
  3412.      SND.ISS.................................................. 12
  3413.      SND.MAX.................................................. 12
  3414.      SND.NXT.................................................. 11
  3415.      SND.UNA.................................................. 12
  3416.      STATE.................................................... 11
  3417.      SYN.................................. 12, 13, 15, 33, 35, 36
  3418.      SYN segment........................................... 9, 36
  3419.  
  3420.  
  3421.  
  3422.                                                                Page 55
  3423.  
  3424.  
  3425.  
  3426.      RFC-908                                                 July 1984
  3427.  
  3428.  
  3429.  
  3430.      Syn-Rcvd state........................................ 9, 10
  3431.      Syn-Sent state........................................ 9, 10
  3432.      TCP................................................... 4, 14
  3433.      three-way handshake....................................... 4
  3434.      user request events.................................. 20, 21
  3435.      version number field..................................... 33
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.      Page 56
  3481.  
  3482.  
  3483.  
  3484.      RDP Specification                           Examples of Operation
  3485.  
  3486.  
  3487.  
  3488.  
  3489.  
  3490.  
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.  
  3536.  
  3537.  
  3538.                                                                Page 57
  3539.  
  3540.