Appendix 1: Commands
COMMANDS
(Note that all commands may be sent by either the FE or the Host.)
1. BEGIN INDEX HOST SOCKET TRANSLATION-TYPE CONNECTION-TYPE
The begin command establishes a "connection" between the Host and the FE. Regardless of internal representation, the duplex data stream the connection represents will be referred to by the value specified in the next (INDEX) field that is, for example, the FE will send input from and receive output for a given Telnet connection "on" a given INDEX, even though it is actually managing two "sockets" for the purpose in its dealings with the Network.
a) INDEX is a two-byte field. Both the Host and the FE may choose arbitrary values for it when opening connection with a BEGIN command (H-FP implementations will probably simply increment INDEX by 1 whenever they need a new connection); however, the value of 0 is reserved to apply to the "global" connection between the Host and the FE -- thus, when either machine "come up" the first thing it does is send a BEGIN for INDEX=0. (The END and ACKNOWLEDGE commands also follow this convention; for that matter, there is no reason why the MESSAGE command could not also, should it be desired to extend the FE's functions in the future. At present, however, this is merely a potential extension.) Note that all other fields should be set to 0 for INDEX 0 BEGINS.
b) HOST is a two-byte field. It specifies the Host number associated with the socket in the next field. On FE to Host BEGINS this is purely informational. However, on Host to FE BEGINS it is necessary to enable the FE to identify the foreign Host with which to communicate at the NCP level.
c) SOCKET is a four-byte field. If SOCKET=1, a Telnet connection is to be established. If SOCKET=3, an FTP connection is to be established. If SOCKET=5, an ARPANET RJE Protocol connection is to be established (no known current utility). If SOCKET=77, a Host- specific connection is to be established for RJE/batch. All other values are for connections for unspecified purposes, to be opened at the NCP level according to the CONNECTION-TYPE field. Note that sockets 1, 3, 5 and 77 are "known about" and special-cased by the FE.
d) TRANSLATION-TYPE is a one-byte field. From FE Host, it is informational. From Host to FE, it specifies character set mapping if desired, or characterizes the data to be transmitted over the connection. 0 request / specifies ASCII data 1; binary data (note that this value will not be sent from FE to Host under current assumptions, and that word size is to be a per-installation parameter); 2, mapping of ASCII to/from local character set. Other types will be defined if needs are identified.
e) CONNECTION-TYPE is a one-byte field. For FE to Host BEGINS it is informational. For Host to FE BEGINS it instructs the FE as to which kind of NCP connection discipline to follow. 1 requests a duplex connection (i.e., that the Initial Connection Protocol of the ARPANET be employed) 2, a simplex connection (i.e., that the appropriate ARPANET "request for connection" Host-Host Protocol commmand be employed for the gender of the socket at hand). Note that this extended use of the H-FP will be of interest when (and if) User-level programs on the Host begin to use the Network. (The FE will open 8- bit connections at the Network level unless otherwise directed.)
2. ACKNOLEDGE INDEX CODE
The ACKNOWLDEGE command is multi-purpose. It must be sent in response to all commands from the other machine (other than ACKNOWLEDGES, of course), and is primarily used to indicate the success or failure of the command just received on INDEX. Note that this implies that each MESSAGE on a given INDEX must be ACKNOWLEDGEd before the next can be sent.
a) INDEX is as above.
b) CODE is a two-byte field. CODE=0 indicates success / acceptance of the command most recently received for INDEX. CODE=1 indicates failure /rejection of the most recent command. (E.g., if a MESSAGE, buffering was unavailable so the other machine must retransmit; if a BEGIN, the indicated protocol / socket cannot be serviced.) CODE=3 indicates an invalid or inactive INDEX has been used. CODE=4 indicates (HOST to FE) that no mapping is to be performed on the connection just opened. Other values (for such meanings as "foreign Host down", "undefined type requested" and the like) will be assigned as identified.
3. MESSAGE INDEX COUNT PAD TEXT
The MESSAGE command is employed for the transmission of data.
a) INDEX is as above.
b) COUNT is a two-byte field which specifies the number of bits of data in the TEXT field.
c) PAD is a 1-to-n-byte field. Its width is a per-installation parameter used to enable the TEXT field to start on a word boundary if the local H-FP implementers so desire. (This is not only a kindness, but it's also a placeholder if we decide to go to a flow control mechanism involving sequence numbers.)
d) TEXT is a field wherein byte structure is coincidental. It consists of COUNT bits of data to be sent to the process implicitly associated with INDEX by a BEGIN command (which has not been ENDed.)
4. INTERRUPT INDEX
The INTERRUPT command, when sent from the FE to the Host, indicates that an FCP interrupt command (INS or INR) has been received for the process associated with INDEX; the Host should interrupt the associated process and whatever fashion is "normal" to it. (The most common use of the NCP is in Telnet, where it is defined as being the functional equivalent of having struck a terminal's ATTN, INT, of BREAK key, or input a "control-c" on certain character-at-a-time systems; essentially, it requests a "quit button" push. Note that the FE will take care of the associated Telnet control code in the input stream.) When sent from the Host to the FE (in process to process applications), it will indicate that an appropriate NCP interrupt be sent, according to the gender of the socket associated with INDEX.
5. END INDEX CODE
The END command is used to terminate a connection. It may be sent either because one system or the other is about to go down, or because the FE have received an NCP "CLS" command or because the destination system or IMP has gone down, or at the behest of a Host user process.
a) INDEX is as above. Note that if INDEX=0 the END refer to the "global" connection between the Host and the FE in such case, the high-order bit of CODE will be set to 1 and the low-order bits will specify the number of the minutes to shutdown if this information is available. (Furnished because the associated IMP often informs the FE of such a condition.)
b) CODE is a two-byte field. CODE=1 indicates the general "close" case (either received or ordered) 2, foreign systems has gone down; 3, foreign IMP has gone down; 4, local IMP has gone down. Other values will be assigned as identified.