📄 rfc908.txt
字号:
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 also initialized to zero before beginning the computation of the checksum. 2) The 32-bit memory word located at the address referenced by the checksum pointer is added arithmetically to the checksum accumulator. Any carry propagated out of the checksum accumulator is ignored. The checksum field itself is replaced with zeros when being added to the checksum Page 34 RDP Specification RDP Segments and Formats accumulator. 3) The checksum accumulator is rotated left one bit position. The checksum pointer is advanced to correspond to the address of the next 32-bit word in the segment. 4) Steps 2 and 3 are repeated until the entire segment has been summed. If a segment contains a number of header and data octets that is not an integral multiple of 4 octets, the last octet is padded on the right with zeros to form a 32-bit quantity for computation purposes. Variable Header Area This area is used to transmit parameters for the SYN and EACK segments. Page 35 RFC-908 July 1984 4.3 SYN Segment The SYN is used to establish a connection and synchronize sequence numbers between two hosts. The SYN segment also contains information to inform the remote host of the maximum number of segments the local RDP is willing to accept and the maximum segment size it can accept. The SYN may be combined with an ACK in a segment but is never combined with user data. 4.3.1 SYN Segment Format 0 0 0 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+---+---------------+ 0 |1|0|0|0|0|0|0 1| Header Length | +-+-+-+-+-+-+---+---------------+ 1 | S
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -