IV. Declarative Specifications
Message Format
All Host-to-Host messages which conform to this protocol shall be constructed as follows:
Bits 1-96: Leader - This field is as specified in BBN Report No. 1822, with the following additional specifications.
Bits 38-40: Maximum Message Size - This field should be zero for all control messages. For messages sent over data connections, the value of this field should be calculated from the size received in the RFC which established the connection.
Bits 65-76: Message-id - This field is subdivided into eight bits giving the index of the connection of which the message is a part, and four bits giving the sequence number of the message. The index is contained in bits 65-72, and the sequence number in bits 73-76.
Bits 97-100: Acknowledgement - This field contains the four-bit sequence number of the highest-numbered data message to the left of the window for this connection; that is, the sequence number identifying the highest-numbered of the sequence of consecutively numbered (none missing) data messages which have been correctly received over this connection. If no data messages have been received since the connection was established, this field must contain the value zero. This field is not used (i.e., may have any value) in control messages.
Bits 101-104: Credit - This field contains a number in the range 0-7. Adding this number (modulo 16) to the sequence number in the acknowledgement field (bits 97-100) gives the highest sequence number which the foreign Host is permitted to send over this data connection. Thus, a value of zero in this field indicates that no new data messages should be sent, and a value of seven indicates that the foreign Host may send up to seven messages beyond the message whose sequence number is specified by the acknowledgement bits. Since flow control does not apply to messages sent over the control connection, this field may have any value in control messages.
Bits 105 - ... : Text and padding - A sequence of 8-bit bytes of text, followed by padding, as specified in BBN Report No. 1822.
Index Assignment
Index values must be assigned (in bits 65-72) as follows:
Number Assignment
0 Identifies a control connection
1 Reserved for revisions to this protocol
2-191 Identify data connections
192-255 Reserved for expansion or for other protocols
Sequence Number Assignment
Every data message contains a sequence number in bits 73-76. The sequence number is used by the receiver to detect the fact that a transmitted message has been lost, to identify the correct location in the data stream to insert a retransmitted (and therefore probably out of order) message which was previously lost (or to detect the retransmitted message as a duplicate) and to identify acknowledged messages (or sequences of messages) to the sender. The sequence number is also used by the flow control mechanism. Since the IMP subnetwork itself contains elaborate mechanisms to achieve these same goals, it is not anticipated that the error-recovery mechanisms based on the sequence numbers will be called into play frequently, and thus their efficiency is not of primary importance.
Sequence numbers are assigned to the two directions of a connection independently. For a given direction of a connection, the first data message transmitted after the connection is established must have sequence number one. Subsequent messages are assigned sequentially increasing (modulo 16) sequence numbers; that is, sequence number zero is assigned to the message following message number 15.
Sequence numbers are not assigned to control messages, since the protocol is designed to permit these messages to be delivered out-of-sequence without ill effect, and since flow control cannot be applied to the control link.
Control Messages
Messages sent over the control connection have the same format as other Host-to-Host messages, with the exceptions noted above. However, control messages may not contain more than 120 8-bit bytes of text. Further, control messages must contain an integral number of control commands; a single control command must not be split into parts which are transmitted in different control messages.
Message Transmission and Retransmission
Control messages may be transmitted whenever they are required. Data messages, however, may be transmitted only when permitted by the flow control mechanism; that is, whenever the sequence number assigned to the message is within the "window" for the appropriate direction of the given connection. The "left window edge" (LWE) is defined by the highest sequence number (modulo 16) which has been acknowledged (or zero, if no messages have been acknowledged). The "right window edge" (RWE) is defined by adding (modulo 16) the most recently received credit to the left window edge. [Note that LWE=RWE if the most recently received credit is zero.] A message with sequence number SEQ may be transmitted only if, prior to the (possible) reduction modulo 16 of the SEQ and/or RWE, it is true that
LWE less-than SEQ less-than-or-equal RWE
Messages should be retransmitted whenever any of the following conditions occur:
-
The IMP subnetwork has returned an "Incomplete transmission" (type 9) or "Error in Data" (type 8) response to the message (identified by having bits 41-76 of the response equal to those bits of the transmitted message). Note that this condition applies to control messages as well as data messages.
-
The sequence number of this message is equal to (LWE + 1), and it has been more than 30 seconds since the message was last transmitted.
-
The sequence number of the message is specifically identified in a NACK command for this connection from the foreign Host.
Since messages may occasionally have to be retransmitted, it is clear that they should not be discarded by the transmitting NCP until they have been acknowledged. A message is considered to be acknowledged when its sequence number, or the sequence number of any message to the right of it in the same direction of the given connection, is returned in the acknowledgement field of a data message transmitted in the other direction over this connection, or is returned in an ACK command for this connection from the foreign Host.
Control Commands
Control commands are formatted in terms of 8-bit bytes. Each command begins with a one byte opcode. Opcodes are assigned the sequential values 0, 1, 2, ... to permit table lookup upon receipt. The conditions underlying the design and anticipated use of the control commands are described in Section III.
NOP - No Operation
8
---------
! NOP !
---------
The NOP command may be sent at any time and should be discarded by the receiver. It may be useful for formatting control messages.
RST - Reset
8
---------
! RST !
---------
The RST command is used by one Host to inform another that all information regarding any previously existing connections between the two Hosts should be purged from the NCP tables of the Host receiving the RST. Except for responding to RSTs, the Host which sent the RST should not communicate further with the other Host until an RRP is received in response. When a Host is about to begin communicating (e.g., send an RFC command) to another Host with which it has no open connections, it is good practice to first send an RST command and wait for an RRP command.
RRP - Reset Reply
8
---------
! RRP !
---------
The RRP command must be sent in reply to an RST command.
RFC - Request for Connection
8 16 16 8 16 8
---------------------------------------------------------
! RFC ! my-socket ! your-socket ! index ! size ! credit !
---------------------------------------------------------
The RFC command is used to establish a connection. The "my-socket" field specifies the socket local to the Host transmitting the RFC; the "your-socket" field specifies the socket local to the Host to which the RFC is transmitted. The "index" field specifies the index value which will be given in bits 65-72 of each data message sent from "my-socket" to "your-socket". The "size" field specifies the maximum number of 8-bit bytes which may be transmitted in any single message from "your-socket" to "my-socket". The "credit" field specifies the size of the initial sequence number window (in the range 0-7) in the "your-socket" to "my-socket" direction.
CLS - Close
8 16 16
-----------------------------------
! CLS ! my-socket ! your-socket !
-----------------------------------
The CLS command is used to terminate a connection. The connection need not be completely established before CLS is sent.
RCP - Re-Initialize Connection Parameters
8 16 16 8
-------------------------------------------
! RCP ! my-socket ! your-socket ! index !
-------------------------------------------
The RCP command is used by one Host to inform another that all information regarding a possibly previously-existing connection between "my-socket" and "your-socket" AND all information regarding a possibly previously-existing connection identified by "index" (between these Hosts) should be purged from the tables of the Host receiving the RCP. The "my-socket", "your-socket", and "index" fields are defined as in the RFC command.
ACK - Acknowledgement
8 8 4 4
---------------------------------
! ACK ! index ! seq ! crd !
---------------------------------
The ACK command may be used to acknowledge received data, or to assign credit, without sending a data message. The value in the index field identifies the data connection which uses the same index value (in the direction from the sender of the ACK to the receiver of the ACK). The eight bits following the index field (the "seq" and "crd" field) have the same meaning as bits 97-104 of the data message identified by the index value.
NACK -- Negative Acknowledgement
8 8 8
--------------------------
! NACK ! index ! seq !
--------------------------
The NACK command informs the receiver of the NACK that it should immediately retransmit the data message identified by the remaining fields. The index field is defined exactly as for the ACK command. The "seq" field gives the 4-bit sequence number (right-justified) which should be immediately retransmitted. Note that the data message to be retransmitted does not have an index value equal to "index", but instead is transmitted over the other direction of the data connection which the Host sending the NACK identifies by "index". No Host is ever required to transmit or act upon a NACK command; however, use of the NACK may occasionally permit a decrease in retransmission delay.
INT - Interrupt
8 8 8
-------------------------
! INT ! index ! seq !
-------------------------
The INT command is sent over the control link to provide an "out-of-band" (and hence not subject to flow control) signal for the data connection denoted by the index field. The index value is the value which would appear in bits 65-72 of a data message sent from the sender of the INT command to the receiver of the INT command. The means of synchronizing this signal with the data being transmitted over the data connection is the inclusion of a 4-bit sequence number (right-justified) in the "seq" field. The number specified by this field denotes the first data message which "follows" the out-of-band signal.
ECO - Echo Request
8 8
------------------
! ECO ! data !
------------------
The ECO command is used only for test purposes. The data field may be any bit configuration convenient to the Host sending the ECO command.
ERP - Echo Reply
8 8
------------------
! ERP ! data !
------------------
The ERP command must be sent in reply to an ECO command. The data field must be identical to the data field in the incoming ECO command.
Opcode Assignment
Opcodes are defined to be 8-bit unsigned binary numbers. The values assigned to opcodes are:
NOP = 0
INT = 1
RFC = 2
CLS = 3
ACK = 4
NACK = 5
RCP = 6
RST = 7
RRP = 8
ECO = 9
ERP = 10
[ This RFC was put into machine readable form for entry ]
[ into the online RFC archives by Alex McKenzie with ]
[ support from BBN Corp. and its successors. 7/2000 ]