RFC 467 UNKNOWN HOST-HOST PROTOCOL · NCP · RELIABILITY

Host-Host resync: Proposed change to Host-Host Protocol: Resynchronization of connection status

A proposal to repair a single ARPANET connection whose two ends disagree, without resetting all connections.

On rfc-editor.org ↗
PUBLISHED
February 1973
AUTHORS
J.D. Burchfiel, R.S. Tomlinson
STREAM
Legacy
UPDATED BY
RFC 492 — Response to RFC 467
NEW COMMANDS
RCS and RCR
COMMAND LAYOUT
8-bit command, 8-bit link
UNKNOWN LINK ERROR
ERR code 5
DOI
10.17487/RFC0467

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Network Working Group                                       J. Burchfiel
Request for Comments: 467                                   R. Tomlinson
NIC: 14741                                       Bolt Beranek and Newman
                                                        20 February 1973

                 Proposed Change To Host-Host Protocol
                Resynchronization Of Connection Status

I. Introduction

   The current Host-Host protocol (NIC #8246) contains no provisions for
   resynchronizing the status information kept at the two ends of each
   connection.  In particular, if either host suffers a service
   interruption, or if a control message is lost or corrupted in an
   interface or in the subnet, the status information at the two ends of
   the connection will be inconsistent.

   Since the current protocol provides no way to correct this condition,
   the NCP's at the two ends stay "confused" forever.  A frequent and
   frustrating symptom of this effect is the "lost allocate" phenomenon,
   where the receiving NCP believes that it has bit and message
   allocations outstanding, while the sending NCP believes that it does
   not have any allocation.  As a result, information flow over that
   connection can never be restarted.

   Use of the Host-Host RST (reset) command is inappropriate here, as it
   destroys all connections between the two hosts.  What is needed is a
   way to reset only the affected connection without disturbing any
   others.

   A second troublesome symptom of inconsistency in status information
   is the "half-closed" connection: after a service interruption or
   network partitioning, one NCP may believe that a connection is still
   open, while the other believes that the connection is closed. (Does
   not exist.)  When such an inconsistency is discovered, the "open" end
   of the connection should be closed.

II. The RCR and RCS Commands

   To achieve resynchronization of allocation, we propose the addition
   of the following two commands to the host-host protocol.

         8           8
   +-----------+-----------+
   |    RCS    |   link    |   Reset connection by sender
   +-----------+-----------+

         8           8
   +-----------+-----------+
   |    RCR    |   link    |   Reset connection by receiver
   +-----------+-----------+

   The RCS command is sent from the host sending on "link" to the host
   receiving on "link".  This command may be sent whenever the sending
   host desires to re-synch the status information associated with the
   connection.  Some circumstances in which the sending Host may choose
   to do this are:

      1.) After a timeout when there is traffic to move but no
      allocation. (Assumes that an allocation has been lost)

      2.) When an inconsistent event occurs associated with that
      connection (e.g. an outstanding allocation in excess of 2^32 bits
      or 2^16 messages.

   The mechanics of re-synchronizing the allocations is simply:

      1.) Empty all messages and allocates from the "pipeline".

      2.) Zero the variables at both ends indicating bit and message
      allocation.

      3.) Restart allocate/message exchanges in the normal way.

   This resynchronization scheme is race-free because the RCS and RCR
   commands are used as a positive acknowledgement pair.

III. Resynchronization by Sender

   To initiate resynchronization, the sending NCP should:

      1.) Put the connection in a "waiting-for-RCR-reply" state.  No
      more regular messages may be transmitted over this connection
      until the RCR reply is received.

      2.) Wait until the message pipeline is empty, i.e. until a RFNM
      has been received for each regular message sent over this
      connection.  This synchronizes the control and data activity, and
      also assures that the data stream will not be corrupted during the
      control re-synchronization exchange.

      3.) Send the RCS command.

      4.) Continue to process allocates normally, updating the variables
      which indicate outstanding bit and message allocation.

   When the receiving NCP receives the RCS, it should:

      1.) Zero the variables indicating outstanding bit and message
      allocation.

      2.) Reset the connection to the state which indicates readiness to
      accept a message.

      3.) Confirm the re-synchronization by sending the RCR reply.

      4.) Reconsider bit and message allocation, and send an ALL command
      for any allocation it cares to do.

   When the sending host receives the RCR reply, it should:

      1.) Zero the variables indicating outstanding bit and message
      allocate.

      2.) Put the connection into the "ready-to-send-message" state in
      preparation for any forthcoming ALL commands.

   At this point, the "pipeline" contains no messages and no allocates,
   and the outstanding allocation variables at both ends are in
   agreement. (With value zero)

IV. Resynchronization By Receiver

   The re-synchronization sequence may be triggered by the receiving
   NCP.  Such resynchronization could be initiated manually by TIP and
   TELNET users who are expecting output but receiving none.  Again
   assuming that allocation has been lost, the appropriate action is to
   reset the connection by sending an RCR command.  This action is also
   appropriate if an inconsistent event occurs with respect to the
   connection.  (e.g. arrival of a message which exceeds allocation).

   To initiate re-synchronization, the receiving NCP should:

      1.) Put the connection into a "waiting-for-RCS-reply" state.  No
      more allocates may be transmitted for this connection until the
      RCS reply is received.

      2.) Send the RCR command.

      3.) Continue to process regular messages normally, updating the
      variables which indicate outstanding bit and message allocation.

   When the sending NCP receives the RCR command, it should:

      1.) Wait until the message pipeline is empty, i.e. until the RFNM
      has been received for each regular message sent over the
      connection.  This synchronizes the control and data activity, and
      also assures that the data stream will not be corrupted during the
      control re-synchronization exchange.

      2.) Zero the variables indicating outstanding bit and message
      allocation.

      3.) Put the connection into the "ready-to-send-message" state in
      preparation for any forthcoming ALL commands.

      4.) Confirm the re-synchronization by sending the RCS reply.

   When the receiving host receives the RCS reply, it should:

      1.) Zero the variables indicating outstanding bit and message
      allocation.

      2.) Reset the connection to the state which indicates readiness to
      accept a message.

      3.) Reconsider bit and message allocation, and send an ALL command
      for any allocation it cares to do.

V. Simultaneous Resynchronization

   This specification for a re-synchronization exchange is guaranteed to
   restore the allocation information at the two ends to a consistent
   state.  This happens correctly whether the re-synchronization is
   triggered by the sender, the receiver, or both at the same time.
   When both ends initiate a command at the same time, (the RCS and RCR
   commands cross in the pipeline) each interprets the other's command
   as a confirmation reply; thus, the resynchronization happens
   correctly independent of the relative timing.

   The essential factor here is that when either end receives the reset
   request, it is sure that the other end will take no further actions
   which could affect the allocation variables.  The activity which
   occurs during simultaneous resynchronization by both ends is as
   follows:

   The sending NCP:

      1. Puts the connection into a "waiting-for-RCR-reply" state.  No
      more regular messages may be transmitted over this connection
      until the RCR reply is received.

      2. Waits until the message pipeline is empty, i.e. until a RFNM
      has been received for each regular message sent over this
      connection.  This synchronizes the control and data activity, and
      also assures that the data stream will not be corrupted during the
      control re-synchronization exchange.

      3. Sends the RCS command.

      4. Continues to process allocates normally, updating the variables
      which indicate outstanding bit and message allocation.

   Concurrently with 1, 2, 3 and 4 above, the receiving NCP:

      5. Puts the connection into a "waiting-for-RCS-reply" state.  No
      more allocates may be transmitted for this connection until the
      RCS reply is received.

      6. Sends the RCR command.

      7. Continues to process regular messages normally.

   The RCS and RCR commands cross somewhere in the pipeline.  When the
   sender receives the RCR command, it interprets it as a reply to its
   own RCS command.  It then:

      8. Zeroes the variables indicating outstanding bit and message
      allocation.

      9. Puts the connection into the "ready-to-send-message" state in
      preparation for any forthcoming ALL commands.

   Concurrently with 8 and 9 above, the receiving NCP will receive the
   RCS command.  It will interpret it as a reply to its own RCR command.
   It then:

      10. Zeroes the variables indicating outstanding bit and message
      allocation.

      11. Resets the connection to the state which indicates readiness
      to accept a message.

      12. Reconsiders bit and message allocation, and sends an ALL
      command for any allocation it cares to do.

VI. The Problem Of Half-closed Connections

   The above procedures provide a way to resynchronize a connection
   after a brief lapse by a communications component, which results in
   lost messages or allocates for an open connection.

   A longer and more severe interruption of communication may result
   from a partitioning of the subnet or from a service interruption on
   one of the communicating hosts.  It is undesirable to tie up
   resources indefinitely under such circumstances, so the user is
   provided with the option of freeing up these resources (including
   himself) by unilaterally dissolving the connection.  Here
   "unilaterally" means sending the CLS command and closing the
   connection without receiving the CLS acknowledgement.  Note that this
   is legal only if the subnet indicates that the destination is dead.

   When service is restored after such an interruption, the status
   information at the two ends of the connection is out of
   synchronization.  One end believes that the connection is open, and
   may proceed to use the connection.  The disconnecting end believes
   that the connection is closed (does not exist), and may proceed to
   re-initialize communication by opening a new connection (RTS or STR
   command) using the same local socket.

   The re-synchronization needed here is to properly close the open end
   of the connection when the inconsistency is detected.  We propose to
   accomplish this by changing the semantics of three existing host-host
   protocol commands.

VII. Redefinition of RTS, STR, ERR (link) to Handle Half-closed
   Connections

   The "missing CLS" situation described above can manifest itself in
   two ways.  The first way involves action taken by the NCP at the
   "open" end of the connection.  It may continue to send regular
   messages on the link of the half-closed connection, or control
   messages referencing its link.  The NCP at the "closed" end should
   respond with the ERR message, specifying that the link is unknown.
   (Error code = 5 does not correspond to an open connection).  On
   receipt of such an ERR message, the NCP at the "open" end should
   close the connection by modifying its tables, (without sending any
   CLS command) thereby bringing both ends into agreement.

   The second way this inconsistency can show up involves actions
   initiated by the NCP at the "closed" end.  It may (thinking the
   connection is closed) send an STR or RTS to reopen the connection.
   The NCP at the "open" end will detect an inconsistency when it
   receives such an RTS or STR command, because it specifies the same
   foreign socket as an existing open connection.  In this case, the NCP
   at the "open" end should close the connection (without sending any
   CLS command) to bring the two ends into agreement before responding
   to the RTS/STR.

VIII. Conclusions

   The scheme presented in Section II to resynchronize allocation has
   one very important property: the data stream is preserved through the
   exchange.  Since no data is lost, it is safe to initiate re-
   synchronization from either end at any time.  When in doubt, re-
   synchronize.

   The changes in the semantics of RTS, STR, and ERR(code 5) commands
   provide the synchronization needed to complete the closing of "half-
   closed" connections.

   The protocol changes above will make the host-host protocol far more
   robust, in that useful work can continue in spite of lapses by the
   communications components.


         [ This RFC was put into machine readable form for entry ]
            [ into the online RFC archives by Via Genie 08/00]

ISO Plain Language

On this page
PROBLEMIf a host was interrupted or a control message was lost, the two ends of a connection disagreed about its state, and the Host-Host protocol had no way to repair only that connection.
MECHANISMTwo new commands, RCS (reset connection by sender) and RCR (reset connection by receiver), zero the allocation counters at both ends, and the meanings of RTS, STR and ERR are changed so half-closed connections get closed.
THE PROPOSALThe authors argue the data stream is preserved, so resynchronizing is safe at any time, and the protocol would become far more robust.

§1The Problem: Inconsistent Connection State

The Host-Host protocol had no provision for resynchronizing the status information kept at the two ends of a connection. After a service interruption, or a control message lost or corrupted in an interface or in the subnet, the two NCPs stay confused forever.

One symptom is the lost allocate: the receiving NCP believes bit and message allocations are outstanding, while the sending NCP believes it has none, so information flow over that connection can never restart. The RST command is inappropriate because it destroys all connections between the two hosts. The other symptom is the half-closed connection, where one NCP believes the connection is open and the other believes it is closed; the open end should then be closed.

Two computers can end up disagreeing about whether a connection is still open. Before this proposal the only way to fix that was to hang up every connection between them, which threw away working traffic.

§2The RCS and RCR Commands

Two new commands are proposed, each an 8-bit command code followed by an 8-bit link field. RCS (reset connection by sender) is sent from the host sending on the link to the host receiving on it. RCR (reset connection by receiver) is sent the other way. A sender might use RCS after a timeout when there is traffic to move but no allocation, or when an inconsistent event occurs, such as an outstanding allocation in excess of 2^32 bits or 2^16 messages.

Resynchronizing means emptying messages and allocates from the pipeline, zeroing the bit and message allocation variables at both ends, and restarting the normal allocate and message exchange. Because RCS and RCR work as a positive acknowledgement pair, the scheme is race-free.

Two new commands, one for each side, let either end say: forget the old counts and start again from zero. Because each command acts as the other's reply, the two ends cannot get out of step.

§3Sender, Receiver and Simultaneous Resynchronization

To start, the sending NCP enters a waiting-for-RCR-reply state, waits until a RFNM has been received for every regular message sent over the connection, then sends RCS. The receiving NCP zeros its allocation variables, returns to the state ready to accept a message, replies with RCR, and may send an ALL command for any allocation it wants. On receiving the RCR reply, the sending host zeros its variables and becomes ready to send messages.

The receiving NCP may also trigger the same sequence by sending RCR, for example when a TIP or TELNET user expects output but receives none. The sending NCP waits for its pipeline to empty, zeros its variables, and answers with RCS.

If both ends start at once, the RCS and RCR commands cross in the pipeline and each end interprets the other's command as the confirmation reply, so resynchronization happens correctly regardless of timing.

Either side can start the reset. The other waits until all messages already in flight have been acknowledged, agrees, and both begin fresh. If both start at the same moment, each simply reads the other's command as the agreement.

SENDER-INITIATED RESYNCHRONIZATION (RFC 467)
Sending NCPReceiving NCP
  1. RCSSent once a RFNM has arrived for every regular message.
  2. RCRConfirms the reset after zeroing its allocation variables.
  3. ALLOptional new allocation.

§4Half-Closed Connections

A longer interruption can leave one end believing the connection is open and the other believing it is closed, perhaps because a user unilaterally dissolved the connection by sending CLS and closing without the acknowledgement, which is legal only if the subnet indicates the destination is dead. The proposal changes the meaning of three existing commands rather than adding new ones.

If the open end keeps sending messages or control messages for its link, the closed end replies with an ERR saying the link is unknown (error code 5). On receiving that ERR, the open end closes the connection in its tables without sending any CLS. If instead the closed end sends an RTS or STR naming the same foreign socket as an existing open connection, the open end closes the old connection first, again without CLS, and then responds.

When one end finds that the other treats the connection as closed, the reply tells the open end to close it too, so both agree again. No new command is needed for this; three existing commands are given new meanings.

§5References

[NIC8246]Current Host-Host protocol, NIC #8246, which this proposal would change.
[RFC492]RFC 492Response to RFC 467, RFC 492, April 1973.April 1973