📄 rfc55.txt
字号:
Newkirk, et al. [Page 18]RFC 55 Prototypical Implementation of NCP June 1970 ______________ | | CLOSE CONN/ | CLOSED |<---------------------------+ send RFC | (0) | LISTEN | +----------------| |-----------------------+ | | |______________| | | | | ^ | | | [E]RFC | | CLS/send CLS | | | ___V____|____ ___V____|____ | non-matching | | | | | CONN/send RFC | PENDING | LISTEN RFC | LISTENING | | +-------------| (1) |----------+ +----| (2) | | | |_____________| | | |_____________| | | matching | | | ___V___V_____ CONN/send RFC| __V___V______| | | ACCEPT/ | | CLS/| RFC-SENT | RFC | send RFC | RFC-RECD | send CLS| (5) |----------+ | +----------| (3) |---------+|_____________| | | | |_____________| | | | | | | | | | | ___V___V___V___ SND&CLOSE | ____________ | | | RCV&CLS/ | |-----------)->| | | | | send CLS | OPEN | SND&CLS | | DATA-WAIT | | | | +---------| (6) |--------+ | | (8) | | | | | |_______________| | | |____________| | | | | RCV&CLOSE/ | | | | | | | | send CLS | | | | | | | | | | | | CLS | | | | ______V______ | | | | | | | CLOSE/ | |CLOSE/ | | | | | | | send CLS| CLS-WAIT |send CLS | | | | | +---)--------->| (8) |<--------)--+ | | | | |_____________| | | | | | | ___V______V_ ______V___ | | | | | | | | | | | RFNM-WAIT | | ABORT | | | CLS | | (9) | | (4) | | | | |____________| |__________| | | | | | | | ______V_______ RFNM/ | | | | | | send CLS | | | CLS/ +--------->| CLOSED |<----------+ | | send CLS | (0) | ACCEPT|CLOSE | +----------------->| |<----------------------------+ |______________| Figure 7.1 Connection State DiagramNewkirk, et al. [Page 19]RFC 55 Prototypical Implementation of NCP June 1970VIII. Algorithms for the Input Interpreter The following is a concise description of the NCP's responses to incoming network commands. CS always indicates Connection State. Note, CLOSE is a system call executed by the local user process, and CLS is a network command. NOP Discard. RFC (RTS or STR) If no entry exists, create one with status = PENDING CALL, and queue the message. If CS = LISTENING, then queue the entry, enter the RFC-RCVD state, and inform the user of the request. If CS = RFC-SENT but the new RFC does not match the request, refuse the RFC. In all other cases, check the RFC for a match. If none exists, queue the RFC. If the RFC matches, then if: CS = RFC-SENT, we enter the OPEN state. CS = CLOSE-WAIT, the RFC is ignored. otherwise, the request is illegal in all states which indicate it has already been received (these states are 1,3,4,6,8,9). In any case, if processing the RFC causes an overflow condition (resources are exhausted), refuse the connection (send a CLS). CLS The pending call queue is searched. If the CLS doesn't match the current request, but does match some other request, then delete that request and issue a CLS. If there is no match, the CLS is ignored. If the CLS matches the current request, and CS = PENDING, then delete the current request. If the request queue is empty, delete the entry; otherwise, leave the entry alone.Newkirk, et al. [Page 20]RFC 55 Prototypical Implementation of NCP June 1970 RFC-RCVD, Issue a CLS and enter the ABORT state. ABORT, ignore. RFC-SENT, issue a CLS. If the pending call queue is empty delete the entry, else enter the PENDING state. OPEN, If we are on the receive side, response is identical to the response for RFC-SENT. If we are on the send side, clear the data queue, and if a RFNM is still pending enter the RFNM-WAIT state. Otherwise response is identical to the response for RFC-SENT. CLS-WAIT, Issue a CLS and if the pending call queue is empty, delete the entry, otherwise CS = PENDING. DATA-WAIT, clear the data queue and enter the RFNM-WAIT state. A matching CLS cannot occur in the CLOSED or LISTENING states. ERR Errors are queued for later attention by system programmers, and are considered to be a system error in the host that originated the exchange. (Not associated with any state). ECO The op code is changed to ERP and retransmitted (Not associated with any state). ERP Upon receipt of an ERP, the system passes the text of the command back to the process which issued the ECO. INR, INS These commands are enabled only in the OPEN state. Upon receiving an INTERRUPT, the system causes an event to be sent to the associated process. An INTERRUPT is ignored in the CLS-WAIT, DATA-WAIT, and RFNM-WAIT states. In any other state it is an error.Newkirk, et al. [Page 21]RFC 55 Prototypical Implementation of NCP June 1970 ALL ALLOCATE is valid only in the OPEN state, and may be sent only to a send socket. The NCP increments the 'Their Size' field in the associated rendezvous table entry by the size specified in the ALLOCATE command. In the CLS-WAIT and DATA-WAIT states this command is ignored; in any other state it is an error. Data-RFNM If in the OPEN state, mark the Flow Control Status field in the appropriate rendezvous table entry as RFNM-RECVD, and send more data if required. If in the DATA-WAIT state, maintenance the Flow Control Status. If the data queue is empty issue a CLS and enter the CLS-WAIT state; otherwise, transmit the next message. If in the RFNM-WAIT state, maintenance the Flow Control Status and issue a CLS. If the Pending Call queue is empty delete the rendezvous table entry, otherwise CS = PENDING. A Data-RFNM is an error in all other states.IX. Algorithms for the System Call Interpreter Each System Call is discussed, giving the state changes it may effect: CONNECT If there is no entry, create one, issue an RFC, and enter the RFC-SENT state. If CS = PENDING, search the queue and reject all non-matching requests. If no match is found issue an RFC and enter the RFC-SENT state. If a match is found, issue an RFC and enter the OPEN state. Transmission can commence as soon as buffer space has been allocated. In any other state this command is illegal. LISTEN If an entry doesn't exist, create one, and enter the LISTENING state.Newkirk, et al. [Page 22]RFC 55 Prototypical Implementation of NCP June 1970 If CS = PENDING, inform the user and enter the RFC-RCVD state. In any other state this command is illegal. ACCEPT If CS = RFC-RCVD, then issue an RFC and enter the OPEN state. Data transmission can occur as soon as buffer space is allocated. If CS = ABORT, inform the user of the premature termination of the connection. If the pending call queue is empty, delete the entry; otherwise, enter the PENDING state. This command cannot be legally executed in any other state. CLOSE If CS = LISTENING, then delete the entry. RFC-RCVD, then issue a CLS and enter the CLS-WAIT state. ABORT, inform the user of the premature termination of the connection. If the pending call queue is empty, delete the entry; otherwise, enter the PENDING state. RFC-SENT, then issue a CLS and enter the CLS-WAIT state. OPEN, if we are on the send side, and the data queue is not empty, or if a Data-RFNM is still outstanding, enter the DATA-WAIT state; otherwise, issue a CLS and enter the CLS-WAIT state. CLS-WAIT, issuing a CLOSE in this state is a USER ERROR. DATA-WAIT, issuing a CLOSE in this state is also an illegal sequence. RFNM-WAIT, ignore the CLOSE. A valid CLOSE cannot be issued if an entry does not exist, or if a socket is in the PENDING state. [ This RFC was put into machine readable form for entry ] [ into the online RFC archives by Anthony Anderberg 5/00 ]Newkirk, et al. [Page 23]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -