Skip to main content

I. Protocol for Reconnecting Telnet Communication Paths

A process initiates the reconnection of two of its Telnet connections by sending (or requesting its "system" to send) the <IAC><DO><RECONNECT> Telnet command sequence over each of the two send connections. The process initiating the reconnection is attempting to cause the direct connection of the objects of the two Telnet connections. In this manner, the initiating process can remove itself from the communication path between Telnet objects.

The initiating process awaits positive responses to both reconnection requests before proceeding further with the reconnection. A reconnection request may be accepted by replying with the Telnet sequence <IAC><WILL><RECONNECT>. It may be rejected by sending the Telnet sequence <IAC><WONT><RECONNECT>. Rejection of both requests means normal communication may resume at once. Rejection of one request (but not the other) requires that the process agreeing to the reconnection be notified by sending it the Telnet sequence <IAC><DONT><RECONNECT> in response to its acceptance reply.

After receiving positive responses to both requests, the initiating agent next selects the object of one of the Telnet connections for a passive role in the subsequent connection attempt. The other is designated as the active participant. The passive participant is to listen on a set of sockets, and the active participant is to send Request for Connections (RFCs) for those sockets. By designating roles, we are trying to reduce the probability of synchronization problems.

The initiating process next enters into subnegotiation with the process designated as being passive. This subnegotiation involves sending the Telnet sequence <IAC> <SB> <RECONNECT> <PASSIVE> <NEWHOST> <NEWSOCKET1> <NEWSOCKET2> <NEWSOCKET3> <NEWSOCKET4> <IAC> <SE>. The <PASSIVE> parameter indicates that the recipient is to listen for RFCs from the socket pair denoted by <NEWHOST> <NEWSOCKET1-4>. The "NEWHOST" is one 8-bit byte designating the address of the host on which the active process (i.e., the one to reconnect to) resides. NEWSOCKET1-4 are four 8-bit bytes indicating the 32-bit send socket number of the Telnet pair from the active process. The <IAC><SE> fields terminate the subnegotiation parameters. The initiating agent awaits a response from the passive process before proceeding. The legal responses are:

  1. Telnet sequence <IAC><WONT>(RECONNECT>

    Meaning: The passive process has decided not to complete the reconnection, after having initially indicated willingness. This may be due to unexpected parameters during the subnegotiation (e.g., it refuses to connect to NEWHOST), or perhaps some error condition at the passive host.

  2. Telnet sequence <IAC><SE>

    Meaning: Positive acknowledgement of the subnegotiation sequence. The passive process has accepted the reconnection parameters and will proceed with reconnection.

If the reply was <WONT><RECONNECT>, the initiator is obliged to send the Telnet <IAC><DONT><RECONNECT> to the active participant, to cancel the outstanding reconnection request. A confirming <IAC><WONT><RECONNECT> should follow.

The <IAC><SE> reply means that the passive participant has begun its connection shutdown, and will listen on the appropriate sockets. The initiator may now close its connections to the passive participant and supply the parameters to the active participant. This can be done with the assurance that it (the initiator) has done all it can to ensure that the passive process listens before the active process sends its RFCs. Failure to coordinate these actions may result in the failure of the reconnection, if, for example, the passive host does not queue unmatched RFCs. Persistence on the part of the active participant should be an integral part of the protocol, due to uncertainties of synchronization.

The parameter list sent to the active participant is the Telnet sequence <IAC> <SB> <RECONNECT> <ACTIVE> <NEWHOST> <NEWSOCKET1> <NEWSOCKET2> <NEWSOCKET3> <NEWSOCKET4> <IAC> <SE>. The <ACTIVE> parameter indicates to the recipient that it is to send RFCs to the socket pair denoted by <NEWHOST><NEWSOCKET1-4>. The initiator again waits for a reply. The legal replies are:

  1. Telnet sequence <IAC><WONT><RECONNECT>

    Meaning: Process will not complete the reconnection (e.g., it couldn't parse the parameter string).

    Possible action of initiator: Attempt to re-establish communication with the passive participant by sending RFCs for the sockets on which the passive participant is listening. This will succeed if the listener is willing to accept connections from either the host/socket specified by the reconnect parameters or the host/socket of the former connection. If it is successful in reestablishing the connection, the initiator could send the Telnet sequence <IAC><DONT><RECONNECT> to confirm that reconnection has been aborted.

  2. Telnet sequence <IAC><SE>

    Meaning: Positive confirmation of the reconnection subnegotiation. The active participant indicates with this reply that it will close the connections to the initiator and send the necessary RFCs to connect to the passive participant. The initiator may close the connections to the active participant, thereby removing itself from the communication path between the objects of the reconnection.