📄 rfc121.txt
字号:
Network Working Group M. KrilanovichRequest for Comments: 121 Computer Research Lab, UCSBNIC: 5833 21 April 1971 NETWORK ON-LINE OPERATORSPREFACE The operators described in this document have been implemented within UCSB's On-Line System and make the Network (via the NCP) accessible to On-Line System users. A set of operators is provided to facilitate the use of the Network by On-Line System users. The operators are defined on LVL I on system 'NET', and serve an an interface between the users and the Network Control Program (NCP), which supervises all Network operations at this site. A concept fundamental to On-Line System Network operations is that of a completion code variable. Associated with each socket that is not in the closed state is a unique variable, called a completion code variable. This variable serves two purpose: it identifies the local socket referenced, and upon completion of the operation it contains a completion code to indicate the outcome of the operation to the user. It may be used at any time for any purpose other than Network operations. Its value at the beginning of a Network operation is immaterial rather it is the variable itself that is important. In all Network operations, whenever a completion code variable is called for, the only acceptable type variable is a LO storage location, either case 1 or case 2. In those operations requiring a socket to be specified by its socket identifier, the following format is used: the site number of UCSB is always used for local sockets, and so this item is never specified. The site number of a foreign socket, if specified, must be a positive integer or a LO storage location, and must be less then 256 in value. If not specified, the site number of a foreign socket will default to the site number of UCSB. A socket number is specified as an integer, either unsigned, in which case it is assumed to be positive, or with an explicit minus sign, or a LO storage location, of any value. Negative socket numbers are represented internally in two's complement form and therefore for the purpose of the gender of a socket, a socket number is even or odd according to whether its absolute value is even or odd, respectively.Krilanovich [Page 1]RFC 121 Network On-Line Operators April 1971 In all operations involving the On-Line System Network operators, there are certain conventions concerning the format of the data sent and received. The data is grouped in 'messages' consisting of three fields, op code, length, an text, in that order. The op code is one byte in length and is a code which indicates how the text field is to be interpreted. The length field is two bytes long, and gives the length, in bits, of the text field, which contains the actual data. (The op code and length fields together are termed a header.) The following op codes are presently defined: op code meaning 0 This op code is a NOP. No text field exists, and the contents of the length field are unpredictable. (This op code is used mainly as a delimiter.) 1 The text field contains EBCDIC characters, one character per byte. The On-Line System operators consider the characters as intended for display as soon as the text field has been received. 2 The text contains codes for keypushes, one byte per key. The On-Line operators consider the keys as intended for execution as soon as the text field has been received. 3 The same as for an op code of 2, except that the On- Line operators consider that the execution of the keys will be delayed until all data for that receive operation has been received. The standard format of data sent or received by the On-Line System operators is a string of messages, with the last message indicated by a header with a NOP op code, called a trailer. These conventions are the default situation; any of them may be overridden by appropriate programming. Following is a description of each operator, its function and key sequence. (1) OPEN By invoking this operator, the user requests that the specified local socket be removed from the closed state and thus be prepared to participate in data transfer. There are three distinct operations that can be performed by this operator and these are described below:Krilanovich [Page 2]RFC 121 Network On-Line Operators April 1971 (A) CONNECT By invoking this operator, the user requests that the specified local socket be logically connected to the specified foreign socket, and that transfer of data be enabled between the two sockets. Processing at the terminal is suspended until the foreign sockets either accepts or rejects the connection attempt. This operation is valid only when the local socket is in the closed state. The key sequence is as follows: UP Q1 Q2,Q3[,Q4] RETURN where Q1 is the completion code variable to be associated with the local socket. Q2 is the socket number of the local socket. Q3 is the socket number of the foreign socket. Q4 is the site number of the foreign socket. The following completion codes are possible for this operation: 0, The operation was successful and the connection has been established 4, The specified completion code variable is already assigned to a socket; the operation was suppressed 8, The specified local socket is not in the closed state; the operation was suppressed 12, All communication paths to the specified foreign site are in use; the operator was suppressed 16, Local resources are insufficient to support another connection; the operation was suppressed 20, The connection attempt was rejected by the foreign process 28, The specified foreign site is invalid; the operation was suppressed 36, Either hardware at the foreign site is inoperative or the NCP's counter-part at the foreign site does not exist or has failed 40, Local and foreign sockets are both either send or receive sockets; the operation was suppressed 44, By operator command, all Network operations were terminated; the socket will be closed 60, An NCP control transmission error occurred; the operation as suppressedKrilanovich [Page 3]RFC 121 Network On-Line Operators April 1971 (B) LISTEN This operation is a request for notification of any connection attempt directed toward the specified local socket. Processing at the terminal is suspended until such a call is received. This operation is valid only when the designated local socket is in the closed state. The key sequence is as follows: UP Q1 Q2 RETURN where Q1 is the completion code variable to be associated with the local socket. Q2 is the socket number of the local socket. The following completion codes are possible for this operation: 0, The operation was successful and a call has been received 4, The specified completion code variable is already assigned to a socket; the operation was suppressed 8, The specified local socket is not in the closed state; the operation was suppressed 12, Local resource are insufficient to support another connection; the operation was suppressed 44, By operator command, all Network operations were terminated; the socket will be closed (C) ACCEPT This operation accepts connection with the foreign socket whose call caused successful completion of a previous LISTEN operation by the specified local socket. After completion of this operation, data may be transferred to or from the local socket, depending on its gender. This operation is valid only when the last operation referencing the local socket as a LISTEN operation. Processing at the terminal is suspended until the operation is completed. The key sequence is as follows: UP Q RETURNKrilanovich [Page 4]RFC 121 Network On-Line Operators April 1971 where Q is the completion code variable associated with the local socket by a previous LISTEN operation. The following completion codes are possible for this operation: 0, The operation as successful, and the connection is established 4, The specified local socket is in the closed state (the NCP may have received an abort notification from the foreign process); the operation was suppressed 8, The previous operation specifying the designated local socket was not a LISTEN; the operation was suppressed 12, All communication paths to the specified foreign site are in use; the socket has been returned to the closed state (2) CLOSE This operation is a request that the specified local socket be returned to the closed state. If the last operation involving this socket was a LISTEN, this operation refuses the foreign process connection attempt. If the last operation was a CONNECT, the attempt is aborted. If a connection is established, any data in transit form the local socket is allowed to reach the foreign socket and to be either received or flushed before the local socket is closed. Processing at the terminal is suspended until the socket has been returned to the closed state. The key sequence is as follows: DWN QKrilanovich [Page 5]RFC 121 Network On-Line Operators April 1971 where Q is the completion code variable associated with the local socket. The following completion codes are possible for this operation: 0, The operation was successful, and the socket has been returned to the closed state 8, The specified completion code variable is not currently assigned to a socket; the operation was suppressed 12, The specified local socket is in the process of being closed the operation was suppressed, but the local socket will be closed 36, Either hardware at the foreign site is inoperative, or the NCP's counterpart at the foreign site does not exist or has failed 44, By operator command, all Network operations were terminated; the socket will be closed 60, An NCP control transmission error occurred; the operation was aborted 64, A transmission error occurred the operation was aborted, but the socket will be closed (3) SEND This operation caused data to be sent to the foreign socket. Processing at the terminal is suspended until the data has been received by the foreign socket, or until it has been queued locally by the NCP. The possible key sequence are as follows: STORE Q1 Q2 text Q2 STORE +Q1 Q2 text Q2 STORE -Q1 Q2 text Q2 STORE .Q1[X]Q3 RETURN where Q1 is the completion code variable associated with the local socket. Q2 is any key except RESET. 'Text' is a string of any length of any keys except Q2 and RESET. Q3 is an unsigned integer. If it is preceded by 'X', theKrilanovich [Page 6]RFC 121 Network On-Line Operators April 1971 integer is assumed to be in hexadecimal. [X]Q3 should have a value less then 256. If Q1 is the first key after STORE, the keys comprising 'text' are not executed but rather are sent as a one byte code per key, in one or more standard messages. They are preceded by a header with the op code which indicates keys to be executed as soon as they are received, and followed by a trailer. If a '+' precedes Q1, the headers and the text will be sent, but no trailer. If a '-' precedes Q1, only the text will be sent. If a '.' precedes Q1, [X]Q3 will be sent as a one byte number, with no header or trailer. The following completion codes are possible for this operation: 0, The operation was successful, and the data has been sent 4, The specified local socket is not a send socket; the operation was suppressed 8, The specified completion code variable is not assigned to a socket; the operation was suppressed 12, A previous send operation is in progress ;the operation was suppressed 16, The connection is not fully open; the operation was suppressed
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -