📄 rfc908.txt
字号:
sequence number arrives. The protocol should not force its segment-sequencing desires on the application. Page 4 RDP Specification General Description RDP supports a much simpler set of functions than TCP. The flow control, buffering, and connection management schemes of RDP are considerably simpler and less complex. The goal is a protocol that can be easily and efficiently implemented and that will serve a range of applications. RDP functions can also be subset to further reduce the size of a particular implementation. For example, a target processor requiring down-loading from another host might implement an RDP module supporting only the passive Open function and a single connection. The module might also choose not to implement out- of-sequence acknowledgements. 2.2 Relation to Other Protocols RDP is a transport protocol that fits into the layered internet protocol environment. Figure 1 illustrates the place of RDP in the protocol hierarchy: +------+ +-----+ +-----+ +------+ |TELNET| | FTP | |Debug| ... |Loader| Application Layer +------+ +-----+ +-----+ +------+ | | | | +-----+----+ +------+------+ | | +------+ +-------+ | TCP | | RDP | Transport Layer +------+ +-------+ | | +--------------------------------+ | Internet Protocol & ICMP | Internetwork Layer +--------------------------------+ | +-------------------------+ | Network Access Protocol | Network Layer +-------------------------+ Relation to Other Protocols Figure 1 Page 5 RFC-908 July 1984 RDP provides the application layer with a reliable message transport service. The interface between users and RDP transfers data in units of messages. When implemented in the internet environment, RDP is layered on the Internet Protocol (IP), which provides an unreliable datagram service to RDP. Data is passed across the RDP/IP interface in the form of segments. RDP uses the standard IP interface primitives to send and receive RDP segments as IP datagrams. At the internet level, IP exchanges datagrams with the network layer. An internet packet may contain an entire datagram or a fragment of a datagram. # % ? * ! @ ) +------+ +-----+ +----+ $ = ^ + | |Messages | |Segments | | Datagrams * | User |<------->| RDP |<------->| IP |<-------> Internet | | | | | | , ? +------+ +-----+ +----+ ! ) * % $ @ ^ ! Form of Data Exchange Between Layers Figure 2 If internetwork services are not required, it should be possible to use the RDP without the IP layer. As long as the encapsulating protocol provides the RDP with such necessary information as addressing and protocol demultiplexing, it should be possible to run RDP layered on a variety of different protocols. Page 6 RDP Specification Protocol Operation CHAPTER 3 Protocol Operation 3.1 Protocol Service Objectives The RDP protocol has the following goals: o RDP will provide a full-duplex communications channel between the two ports of each transport connection. o RDP will attempt to reliably deliver all user messages and will report a failure to the user if it cannot deliver a message. RDP extends the datagram service of IP to include reliable delivery. o RDP will attempt to detect and discard all damaged and duplicate segments. It will use a checksum and sequence number in each segment header to achieve this goal. o RDP will optionally provide sequenced delivery of segments. Sequenced delivery of segments must be specified when the connection is established. o RDP will acknowledge segments received out of sequence, as they arrive. This will free up resources on the sending side. 3.2 RDP Connection Management RDP is a connection-oriented protocol in which each connection acts as a full-duplex communication channel between two processes. Segments from a sender are directed to a port on the destination host. The two 8-bit source and destination port identifiers in the RDP header are used in conjunction with the network source and destination addresses to uniquely identify each connection. Page 7 RFC-908 July 1984 3.2.1 Opening a Connection Connections are opened by issuing the Open request, which can be either active or passive. A passive Open request puts RDP into the Listen state, during which it passively listens for a request to open a connection from a remote site. The active Open request attempts to establish a connection with a specified port at a remote site. The active Open request requires that a specific remote port and host address be specified with the request. The passive Open may optionally specify a specific remote port and network address, or it may specify that an open be accepted from anyone. If a specific remote port and host address were specified, an arriving request to open a connection must exactly match the specified remote port and address. 3.2.2 Ports Valid port numbers range from 1 to 255 (decimal). There are two types of ports: "well known" ports and "allocable" ports. Well-known ports have numbers in the range 1 to 63 (decimal) and allocable ports are given numbers in the range 64 to 255. The user, when issuing an active Open request, must specify both the remote host and port and may optionally specify the local port. If the local port was not specified, RDP will select an unused port from the range of allocable ports. When issuing a passive Open request, the user must specify the local port number. Generally, in this case the local port will be a well- known port. 3.2.3 Connection States An RDP connection will progress through a series of states during its lifetime. The states are shown in Figure 3 and are individually described below. In Figure 3, the boxes represent the states of the RDP FSM and the arcs represent changes in state. Each arc is annotated with the event causing the state change and the resulting output. Page 8 RDP Specification Protocol Operation CLOSED The CLOSED state exists when no connection exists and there is no connection record allocated. LISTEN The LISTEN state is entered after a passive Open request is processed. A connection record is allocated and RDP waits for an active request to establish a connection from a remote site. SYN-SENT The SYN-SENT state is entered after processing an active Open request. A connection record is allocated, an initial sequence number is generated, and a SYN segment is sent to the remote site. RDP then waits in the SYN-SENT state for acknowledgement of its Open request. SYN-RCVD The SYN-RCVD state may be reached from either the LISTEN state or from the SYN-SENT state. SYN-RCVD is reached from the LISTEN state when a SYN segment requesting a connection is received from a remote host. In reply, the local RDP generates an initial sequence number for its side of the connection, and then sends the sequence number and an acknowledgement of the SYN segment to the remote site. It then waits for an acknowledgement. The SYN-RCVD state is reached from the SYN-SENT state when a SYN segment is received from the remote host without an accompanying acknowledgement of the SYN segment sent to that remote host by the local RDP. This situation is caused by simultaneous attempts to open a connection, with the SYN segments passing each other in transit. The action is to repeat the SYN segment with the same sequence number, but now including an ACK of the remote host's SYN segment to indicate acceptance of the Open request. Page 9 RFC-908 July 1984 +------------+ Passive Open | |<-------------------------+ +----------------| CLOSED | | | Request | |---------------+ | V +------------+ | | +------------+ | | | | | | | LISTEN | | | | | | | +------------+ | | | Active | | | rcv SYN Open Request | | | ----------- ------------ | | | snd SYN,ACK snd SYN | | V rcv SYN V | +------------+ ----------- +------------+ | | | snd SYN,ACK | | | | SYN-RCVD |<-------------------------------| SYN-SENT | | | | | | | +------------+ +------------+ | | rcv ACK rcv SYN,ACK | | | ---------- ------------- | | | xxx +------------+ snd ACK | | | | | | | +--------------->| OPEN |<--------------+ | | | | +------------+ | rcv RST | Close request | ----------- | --------------- | xxx | snd RST | V | +------------+ | | | | | CLOSE-WAIT |--------------------------+ | | After a Delay +------------+ RDP Connection State Diagram Figure 3 Page 10 RDP Specification Protocol Operation OPEN The OPEN state exists when a connection has been established by the successful exchange of state information between the two sides of the connection. Each side has exchanged and received such data as initial sequence number, maximum segment size, and maximum number of unacknowledged segments that may be outstanding. In the Open state data may be sent between the two parties of the connection. CLOSE-WAIT The CLOSE-WAIT state is entered from either a Close request or from the receipt of an RST segment from the remote site. RDP has sent an RST segment and is waiting a delay period for activity on the connection to complete. 3.2.4 Connection Record The variables that define the state of a connection are stored in a connection record maintained for each connection. The following describes some of the variables that would be stored in a typical RDP connection record. It is not intended to be an implementation specification nor is it a complete description. The purpose of naming and describing some of the connection record fields is to simplify the description of RDP protocol operation, particularly event processing. The connection record fields and their descriptions follow: STATE The current state of the connection. Legal values are OPEN, LISTEN, CLOSED, SYN-SENT, SYN-RCVD, and CLOSE-WAIT. Send Sequence Number Variables: SND.NXT The sequence number of the next segment that is to be sent. Page 11 RFC-908 July 1984 SND.UNA The sequence number of the oldest unacknowledged segment. SND.MAX The maximum number of outstanding (unacknowledged) segments that can be sent. The sender should not send more than this number of segments without getting an acknowledgement. SND.ISS The initial send sequence number. This is the sequence number that was sent in the SYN segment. Receive Sequence Number Variables: RCV.CUR The sequence number of the last segment received correctly and in sequence. RCV.MAX The maximum number of segments that can be buffered for this connection. RCV.IRS The initial receive sequence number. This is the sequence number of the SYN segment that established this connection. RCVDSEQNO[n] The array of sequence numbers of segments that have been received and acknowledged out of sequence. Other Variables:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -