Skip to main content

Lost Message Detection and Recovery Protocol

This protocol is proposed as an amendment to the Host-to-Host Protocol for the purpose of letting hosts detect the loss of messages in the network. It also provides recovery procedures from such losses. This protocol is divided into two parts. Part 1 states the compatibility requirements. Part 2 states the new protocol and must be implemented by hosts that desire to have the ability to recover from loss of messages in the network. The reader will find many comments interspersed throughout the description of this protocol. These comments are not part of the protocol and are provided solely for the purpose of improving the reader's understanding of this protocol.

The terminology used in this protocol is similar to that used in the Host-to-Host protocol. We speak of a "network connection" between a pair of hosts, called the "receiver" and the "sender." A network connection is described by a pair of socket numbers, and once established, a network connection is associated with a link (which is described by a link number.) A network connection is a logical communication path and the link assigned to it is a physical communication path. In addition to links associated with the network connections, there are "control-links" for the transmission of "control commands." When we use the term "connection" it may refer to either a network connection or the link assigned to it; the context decides which one. The term "links" encompasses the connection-associated-links as well as control-links. Notice that a receiver of a connection may transmit control commands regarding this connection.

3.1 Definitions​

3.1.1 Host Type "A"​

Those hosts that have not adopted the part 2 of this protocol amendment will be known as type A hosts.

(Comment: All existing hosts are type A hosts.)

3.1.2 Host Type "B"​

Those hosts, that adopt the part 2 of this protocol amendment will be known as type B hosts.

3.1.3 Message Sequence Number (MSN)​

A four bit number associated with regular messages and contained in the bits 25 through 28 of the Host-to-IMP and IMP-to-Host leaders for regular messages [BBN Report No. 1822]. This number is used by the type B hosts to detect loss of messages on a given link. Type A hosts always set the MSN (for the messages they send out) to zero. When in use by a type B host, the first message on a link (after the connection has been established) has the MSN value of one. For each successive message on this link, the MSN value is increased by one until it reaches a value of 15. The next message has the MSN value of one.

(Comments: Type B hosts will use the MSN mechanism only when communicating with other type B hosts. If a type B host is communicating with a type A host, the type B host will essentially simulate the behaviour of a type A host and use zero MSN values for this communication.)

The Link Resynch Number is an eight bit number associated with a link and used for resynchronizing the communication. For links associated with a network connection (i.e. user links), it is intially set to zero. For control links, it is set to zero at the time of the Network Control Program (NCP) initialization. For a given link, its current LRN value is copied into the LRN field of all messages sent out on the link. The LRN values may be manipulated by type B hosts in accordance with the protocol described later.

(Comments: Our protocol specifies that for all communication involving a type A host, the LRN value will never change from zero. Since the LRN field is presently unused, all hosts set it to zero even though they do not explicitly recognize this field as an LRN field. This guarantees compatibility.)

3.1.5 LRN Field​

An eight bit field in the bits 33 through 40 of the Host-to-Host message header.

3.2 New Control Commands​

3.2.1 LMR - Lost Message from Receiver​

___8______8_______8_______8____
| I I I I
I LMR | link | LRN | MSN I
I______I_______I_______I______I_

The LMR command is sent by a receiving host to let the sending host know that one or more messages have been lost. The MSN field specifies the message sequence number of the first message lost. The LRN field specifies the new LRN value that must be used if and when communication is restored.

(Comments: As will be seen later, the LMR command also has the effect of resetting the bit and message allocation in the sending host to zero. In order to permit a sender to restore communication, an LMR command will be usually accompanied with an allocate command. However notice that these comments do not apply to the control links because there is no allocation mechanism for the control links.)

3.2.2 LMS - Lost Message from Sender​

____8_________8________8__________8_________8_____
I I I I I I
I LMS I Link I LRN I MSN I COUNT I
I__________I________I_________I__________I________I_

This command is sent by a sender host in reply to an LMR command if it (the sender) can not retransmit the lost messages specified by the LMR command. The purpose of this command is to query the receiver whether or not the loss of messages is acceptable. After sending this command, the sender waits for a reply before transmitting any messages over the link involved. This command may not be sent for control links. The LRN and MSN values are same as those specified by the LMR command. COUNT specifies the number of messages lost.

3.2.3 LMA - Loss of Messages Acceptable​

This command is identical to the LMS command accept for the command code. Upon receipt of an LMS command, a receiver may send this command to the sender to let the sender know that loss of messages is acceptable. All fields in this command are set to corresponding values in the LMS command.

3.2.4 CLS2 - Close2​

____8___________3_2_______________3_2_____________8_______8______
I I I I I I
I CLS2 I my socket I your socket I LRN I MSN I
I________I_______________I__________________I________I_______I_

The CLS2 command is similar to the current CLS command except for the LRN and MSN fields included in the new command. Both the receiving and sending hosts copy their values of LRN and MSN into the CLS2 command. Upon receiving a CLS2 command, a host compares the LRN and MSN values contained in the CLS2 command with its own values for the connection involved. If these values do not match, then an error has occurred and a host may initiate recovery procedures.

(Comments: The purpose of this command is to ensure that the last message transmitted on a connection has been received succesfully.)

3.2.5 ECLS - Error Close​

_____8___________3_2___________3_2_________
I I I I
I ECLS I my socket I your socketI
I_________I______________I______________I_

The ECLS command is similar to the current CLS command. It is used for closing connections which have sufferred an irrecoverable loss of messages.

(Comments: A connection may be closed in any one of the following three ways:

  1. A connection which has not yet been opened succesfully may be closed by the CLS command. All connections involving type A hosts must be closed using the CLS command.
  2. Connections between type B hosts may be closed using CLS2 command. A connection is considered closed only if matching CLS2 commands have been exchanged between the sender and the receiver.
  3. Those connections between type B hosts, that have sufferred an irrecoverable loss of messages, must be closed by the ECLS command.)

3.2.6 RSS - Request Status from Sender​

____8_______8______
I I I
I RSS I LINK I
I_______I_________I_

A sending host may issue an RSS command to find out about the status of transmission on a particular connection or the control link.

3.2.7 RSR - Request Status from Receiver​

____8_________8_____
I I I
I RSR I LINK |
I________I_________I_

A receiver can issue an RSR command to find out about the status of transmission on a particular connection or the control link.

3.2.8 SFR - Status from Receiver​

____8_________8_________8_________8____
I I I I I
I SFR I LINK I LRN I MSN I
I_________I_________I_________I________I_

A receiving host may issue this command to inform the sender about the state of a particular connection or the control link.

3.2.9 SFS - Status from Sender​

____8_________8_________8_________8____
I I I I I
I SFS I LINK I LRN I MSN I
I_________I_________I_________I________I_

A sending host may issue this command to inform the receiver about the state of a particular connection or the control link.

3.3 The Protocol​

3.3.1 Part One​

All type A hosts must use zero MSN and LRN values on the messages sent out by them. When communicating with a host of type A, a type B host must simulate the behaviour of type A host.

(Comments: Notice that this simulation is not complicated at all. All that is required is that hosts that adopt this protocol must not use it when communicating with the hosts that have not adopted it.)

3.3.2 Part Two​

This part of the protocol is stated as a set of rules which must be observed by all type B hosts when communicating with other type B hosts.

3.3.2.1 Responsibilities of Hosts as Senders​

  1. A type B sending host must use message sequence numbers on all regular messages that it sends to other type B hosts as specified in the definition of the message sequence numbers (Section 3.1.3).
  2. A type B sending host must use link resynch numbers on all regular messages that it sends to other type B hosts as specified in the definition of link resynch number (Section 3.1.4).
  3. A sending host may retransmit a message if it suspects that the message may have been lost in the network during previous transmission.
  4. A sending host may issue an RSS command to the receiver to determine the state of transmission on any link.
  5. A sending host must use the ECLS command to close a connection, if the connection is being closed due to an irrecoverable transmission error. Otherwise, it must the CLS2 command.

3.3.2.2 Responsibilities of Hosts as Receivers​

  1. A receiver host will maintain LRN and MSN values for each link on which it receives messages. Initial value of LRN will be zero, and initial value of MSN will be one. For each receive link, the host should be prepared to receive a message with LRN and MSN values specified by its tables. When the host has received the expected message on a given link, it will change its table MSN value as specified in the definition of MSN.

  2. On a given link, if a host receives a message with an LRN value smaller than the one in use, it will ignore the message.

  3. If a host receives a duplicate message (same LRN and MSN values), it will ignore the duplicate.

  4. A host will examine the MSN values on all regular messages that it receives to detect loss of messages. If on any link, one or more messages are found missing, it will concern itself with only the first message lost and take the following series of action:

    1. Increase its own LRN value for this link by one.
    2. Send an LMR command to the sending host with LRN field set to the new value and MSN field set to the sequence number of the first message lost.
    3. Realizing that LMR command will cause the allocation to be reset to zero, it will send more allocation. This is not applicable to the control links.

    However, if a host does not want to initiate the recovery procedures, it may simply close the connection by an ECLS command.

  5. A receiver host may issue the RSR command to determine the state of transmission on any link.

  6. If a connection is being closed due to an irrecoverable error, a receiving host must use the ECLS command. Otherwise it must use the CLS2 command.

3.3.2.3 Sending Host's Response to Control Messages​

  1. RSR command: the sender must transmit a SFS command to the receiver for the link involved.

  2. ECLS command: The sender must cease transmission, if it has not already done so, and issue an ECLS command if it has not already issues either a ECLS or CLS2 command.

  3. CLS2 command: The sender must compare the LRN and MSN values of the CLS2 command with its own values of the LRN and MSN for the connection involved. If an error is indicated, it may either close the connection with an ECLS, or initiate recovery action as specified in the section 3.3.2.1.

  4. LMR command for a connection (i.e., not a control link): The sender may follow any one of the following three courses of action:

    1. Close the connection with an ECLS command.
    2. Set the allocations for the link involved to zero, set LRN to that specified in the LMR command, and restart communication at the point of break.
    3. Set the allocations for the link involved to zero, set the LRN to that specified in the LMR command, and send an LMS command to the receiver host informing him that one or more of the lost messages can not be retransmitted. After sending an LMS command, a sending host must not transmit any more messages on the link involved until and unless it receives an LMA command from the receiver host.

    (Comments: As we have mentioned before (Section 2.3), the decision regarding which course of action to follow depends upon a number of factors. For example, if a host has implemented only the detection of lost messages aspect of our protocol (and no recovery), then it will chose the first option of closing the connection.)

  5. LMR for a control link: The sender may take one of the following two actions:

    1. Set the LRN to that specified in the LMR command and begin retransmission of lost messages
    2. Set the LRN to that specified by the LMR command, and insert a Reset command at the break point.

    (Comment: If a sending host can not retransmit messages lost on a control link, then this protocol requires that all communication between the two host be broken, and reinitialized. We do not explicitly specify the actions that are associated with the exchange of Reset commands. These actions are specified by the Host-to-Host protocol.)

  6. LMA command: When a sending host receives an LMA command matching an LMS command previously issued by it, it may resume transmission.

(Comments: The protocol does not require the sending host to take any specific action with regard to a SFR. However, a sending host may use the information contained in the SFR command regarding the state of transmission. From a SFR command a sender host may determine what messages have been received properly. The sender may use this information to cleanup its buffer space or retransmit messages that it might suspect are lost.)

3.3.2.4 Receiving Host's Response to Control Messages​

  1. RSS command: A receiver is obligated to transmit a SFR to the sender for the link involved.

  2. ECLS command: The receiver must close the connection by issuing an ECLS command if it has not already done so.

  3. CLS2 command: A receiver must compare the LRN and MSN values of the command with its own values for the connection involved. If an error is indicated, it may either close the connection by an ECLS command or initiate recovery procedures as specified in section 3.3.2.2.

  4. LMS command: The receiver may take one of the following two courses of action:

    1. Close the connection specified by the LMS command, by issuing an ECLS command.
    2. Set the link involved to be prepared to receive messages starting with the sequence number MSN + COUNT, where MSN and COUNT are those specified by the LMS command. (Comment: This action implies that receiver is willing to accept the loss of messages specified by the LMS command.)

(Comments: The protocol does not require the receiver to take any specific action with regard to a SFS command. However a receiver host may use the information contained in it.)