rfc908.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 2,193 行 · 第 1/5 页

TXT
2,193
字号
       If EACK set
          Send <SEQ=SEG.ACK + 1><RST>
          Discard segment
          Return
       Endif

       If ACK set
         If SEG.ACK = SND.ISS
            Set State = OPEN
          else
            Send <SEQ=SEG.ACK + 1><RST>
            Discard segment
            Return
         Endif
        else
         Discard segment
         Return
       Endif

       If Data in segment or NUL set
         If the received segment is in sequence
            Copy the data (if any) to user buffers
            Set RCV.CUR=SEG.SEQ
            Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
          else
            If out-of-sequence delivery permitted
               Copy the data (if any) to user buffers
            Endif
            Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
                      ...<RCVDSEQNOn>
         Endif
       Endif

     Endif







                                                               Page 27



     RFC-908                                                 July 1984



     If State = OPEN

       If RCV.CUR < SEG.SEQ =< RCV.CUR + (RCV.MAX * 2)
         Segment sequence number acceptable
        else
         Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
         Discard segment and return
       Endif

       If RST set
         Set State = CLOSE-WAIT
         Signal "Connection Reset"
         Return
       Endif

       If NUL set
         Set RCV.CUR=SEG.SEQ
         Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
         Discard segment
         Return
       Endif

       If SYN set
         Send <SEQ=SEG.ACK + 1><RST>
         Set State = CLOSED
         Signal "Connection Reset"
         Discard segment
         Deallocate connection record
         Return
       Endif

       If ACK set
         If SND.UNA =< SEG.ACK < SND.NXT
           Set SND.UNA = SEG.ACK
           Flush acknowledged segments
         Endif
       Endif

       If EACK set
         Flush acknowledged segments
       Endif









     Page 28



     RDP Specification                              Protocol Operation



       If Data in segment
        If the received segment is in sequence
          Copy the data to user buffers
          Set RCV.CUR=SEG.SEQ
          Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK>
         else
          If out-of-sequence delivery permitted
             Copy the data to user buffers
          Endif
          Send <SEQ=SND.NXT><ACK=RCV.CUR><ACK><EACK><RCVDSEQNO1>
                      ...<RCVDSEQNOn>
        Endif
       Endif
     Endif



     3.7.3  Timeout Events

          Timeout events occur when a timer expires  and  signals  the
     RDP.  Two types of timeout events can occur, as described below:

     RETRANSMISSION TIMEOUTS

       If timeout on segment at head of retransmission queue
          Resend the segment at head of queue
          Restart the retransmission timer for the segment
          Requeue the segment on retransmission queue
          Return
       Endif


     CLOSE-WAIT TIMEOUTS

       Set State = CLOSED
       Deallocate connection record
       Return













                                                               Page 29



     RFC-908                                                 July 1984





















































     Page 30



     RDP Specification                        RDP Segments and Formats



                                 CHAPTER 4


                         RDP Segments and Formats



          The segments sent by the application layer are  encapsulated
     in  headers  by  the  transport,  internet and network layers, as
     follows:


                            +----------------+
                            | Network Access |
                            |     Header     |
                            +----------------+
                            |   IP Header    |
                            +----------------+
                            |   RDP Header   |
                            +----------------+
                            |     D          |
                            |      A         |
                            |       T        |
                            |        A       |
                            +----------------+

                              Segment Format
                                 Figure 4





     4.1  IP Header Format

          When used in the internet environment, RDP segments are sent
     using  the  version 4 IP header as described in RFC791, "Internet
     Protocol."  The RDP protocol number is ??? (decimal).  The  time-
     to-live  field  should  be  set  to  a  reasonable  value for the
     network.

          All other fields should be set as specified in RFC-791.








                                                               Page 31



     RFC-908                                                 July 1984



     4.2  RDP Header Format

          Every RDP segment is  prefaced  with  an  RDP  header.   The
     format  of the header is shown in Figure 5 below.  The RDP header
     is variable in length and its size is indicated by a field  in  a
     fixed location within the header.


                       0             0 0   1         1
                       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
                      +-+-+-+-+-+-+---+---------------+
                      |S|A|E|R|N| |Ver|    Header     |
                    0 |Y|C|A|S|U|0|No.|    Length     |
                      |N|K|K|T|L| |   |               |
                      +-+-+-+-+-+-+---+---------------+
                    1 | Source Port   |   Dest. Port  |
                      +---------------+---------------+
                    2 |          Data  Length         |
                      +---------------+---------------+
                    3 |                               |
                      +---    Sequence Number      ---+
                    4 |                               |
                      +---------------+---------------+
                    5 |                               |
                      +--- Acknowledgement Number  ---+
                    6 |                               |
                      +---------------+---------------+
                    7 |                               |
                      +---        Checksum         ---+
                    8 |                               |
                      +---------------+---------------+
                    9 |     Variable Header Area      |
                      .                               .
                      .                               .
                      |                               |
                      +---------------+---------------+

                             RDP Header Format
                                 Figure 5











     Page 32



     RDP Specification                        RDP Segments and Formats



     4.2.1  RDP Header Fields

     Control Flags

          This 8-bit field occupies the first octet of word one in the
          header.  It is bit encoded with the following bits currently
          defined:

          Bit #  Bit Name   Description

          0      SYN        Establish connection and
                              synchronize sequence numbers.
          1      ACK        Acknowledge field significant.
          2      EACK       Non-cumulative (Extended) acknowledgement.
          3      RST        Reset the connection.
          4      NUL        This is a null (zero data length) segment.
          5                 Unused.



          Note that the SYN and RST are sent as separate segments  and
          may  not  contain  any  data.   The  ACK  may  accompany any
          message.  The NUL segment must have a zero data length,  but
          may  be  accompanied by ACK and EACK information.  The other
          control bit is currently unused and is defined to be zero.

     Version Number

          This field  occupies  bits  6-7  of  the  first  octet.   It
          contains  the  version  number  of the protocol described by
          this document.  Current value is one (1).

     Header Length

          The length of the RDP header in units  of  two  (2)  octets,
          including  this  field.   This  field allows RDP to find the
          start of the Data field, given a pointer to the head of  the
          segment.   This  field  is  8 bits in length.  For a segment
          with no variable header section,  the  header  length  field
          will have the value 9.

     Source and Destination Ports

          The Source and Destination Ports are used  to  identify  the
          processes  in the two hosts that are communicating with each
          other.  The combination of the  port  identifiers  with  the
          source  and  destination  addresses  in  the  network access



                                                               Page 33



     RFC-908                                                 July 1984



          protocol header serves to fully qualify the  connection  and
          constitutes  the connection identifier.  This permits RDP to
          distinguish multiple connections between  two  hosts.   Each
          field  is  8 bits in length, allowing port numbers from 0 to
          255 (decimal).

     Data Length

          The length in octets of the data in this segment.  The  data
          length  does  not  include the RDP header.  This field is 16
          bits in length.

     Sequence Number

          The sequence number of this segment.  This field is 32  bits
          in length.

     Acknowledgement Number

          If the ACK bit is set in the header, this  is  the  sequence
          number  of  the segment that the sender of this segment last
          received correctly and in sequence.  Once  a  connection  is
          established  this  should  always be sent.  This field is 32
          bits in length.

     Checksum

          This field is a 32-bit checksum of the  segment  header  and
          data.    The   algorithm   description  below  includes  two
          variables,  the  checksum  accumulator  and   the   checksum
          pointer.   The  checksum  accumulator  is  an  actual 32-bit
          register in which the  checksum  is  formed.   The  checksum
          pointer   is   included  for  purposes  of  description,  to
          represent the operation of advancing through the  data  four
          octets  (32-bits) at a time.  It need not be maintained in a
          register by an implementation.

          1) The checksum pointer is set to zero, to correspond to the
          beginning  of  the  area  to  be  checksummed.  The checksum
          accumulator is al

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?