Skip to main content

Default Conditions and Races

The default for this option is as for most other Telnet options: DONT and WONT. An initiator uses the <DONT><RECONNECT> Telnet sequence to return to the default state, while a participant uses <WONT><RECONNECT> to maintain or return to the default state. The reconnection state is only a transient one. When accepted by all parties, the reconnection state lasts only until the reconnection is completed. Upon completion, and without further interaction among the parties, the state of the new connection is the default state, with the negotiated reconnection forgotten.

Since reconnection is an option concerning the entire Telnet connection, the asynchronous nature of the option processing mechanism exemplified by many other Telnet options (e.g., echo), is not applicable. That is, a race condition occurs when two <IAC><DO><RECONNECT> requests cross each other in the network. A solution to this problem was presented in RFC 426; the following is a modified version of that protocol extension. The modification is concerned mainly with preserving the right of a process to deny a reconnection attempt by another process, while having its own reconnection request pending.

The race condition is detected when a process receives a <DO><RECONNECT> while awaiting a reply to a <DO><RECONNECT> it has previously issued on the same Telnet connection. (This condition is detected at both ends of the connection). The strategy to resolve the race utilizes a function, evaluated at both ends of the connection, to determine which reconnection request shall take precedence. The evaluation involves comparing the numbers obtained by concatenating the host address (which becomes the high order 8 bits) and the receive socket number (becomes the low order 32 bits) for the two ends of the Telnet connection. The process owning the receive socket with the larger of the two concatenated numbers will have its reconnection attempt precede that of the other process. Thus, if there is a Telnet connection between host A local sockets X,X+1 and host B local sockets Y,Y+1, and if <A><X> is greater than <B><Y>, then the reconnect request from <A><X> must he completed (or aborted) before the reconnection request from <B><Y> can be considered. This is achieved by requiring that the process with the higher <host><socket> number reply to the reconnect request of the other process with an <IAC><WONT><RECONNECT>, thereby canceling (temporarily) the reconnection attempted from the lower numbered <host><socket>. Since the request emanating from the higher <host><socket> process is given precedence, the process with the lower <host><socket> can reply to the reconnection request as if it had not issued a reconnection request of its own. That is, it may reply <IAC><WILL><RECONNECT> to accept the reconnection attempt or <IAC><WONT><RECONNECT> to refuse the attempt. This process should note, however, that the rejection it receives to its reconnect request is due to protocol requirement, and may not reflect the actual desire of the corresponding process. It should also note that its reconnection request may be re-issued after the first reconnection activity is complete. This is an example of a situation where an option change request can be re-issued after a denial, without a corresponding change in state.

ASIDE​

The usefulness of reconnection is severely limited by its specification as an option for Telnet (i.e., terminal like) connections, rather than as part of a host-host protocol, which would allow it to be applied to general connections. First, it is questionable whether most systems will allow a user task to maintain more than one Telnet connection. If not, a process on such a system can not readily initiate a reconnection request.

Second, there are certain indirect benefits that would result from including reconnection in a host-host protocol. Placing it at that level could simplify some of the timing problems in establishing the new connection. For example, an NCP would be aware when a reconnection was in progress, and therefore would not need to act as hastily with an RFC for a socket currently in use (i.e., connection still open) but involved in the reconnection. Since it is dealing with another NCP directly, it can expect to receive the "reconnect go ahead" reasonably soon, barring system crash. Also, the information necessary to complete the reconnection subnegotiation is available at the NCP level, whereas it must be duplicately maintained by the Telnet service routine when the potential for reconnection exists.

Finally, the entire notion of reconnection is framed in terms of the entities of host-host protocol. By placing it at a higher level without adequate provision at the host-host level, an artificial and rigid constraint is placed on the type of communication path, which may be part of a reconnection. Since host-host protocol is the basis for function oriented levels, the notion of redirecting communication paths certainly is more suited to the semantically uninterrupted realm of OPENing and CLOSEing connections, rather than the realm of "open an 8 bit ASCII path with the conventions that ..."