Skip to main content

4. Reconnection in TELNET Protocol

Independently of whether Host-Host protocol directly supports reconnection, the reconnection mechanism could be included in TELNET with the addition to the TELNET protocol of the five commands:

RRQ
ROK
RNO
RDO <host> <socket>
RWT <host> <socket>

where RRQ, ROK, RNO, RDO, and RWT are appropriately chosen characters in the range 128 to 255. The first three commands require no parameters since they refer to the connections they are received on. For RDO and RWT, <host> is an 8 bit (= 1 TELNET character) host address and <socket> is a 32 bit (= 4 TELNET characters) number that specifies a TELNET receive socket at the specified host.

A pending reconnection can be activated with either RDO or RWT. The response to either is to first break the TELNET connection with the sender and then reopen the TELNET connection to the host and sockets specified. For RDO, the connection is to be reopened by sending two RFC's; for RWT, by waiting for two RFC's.

The RWT command is introduced to avoid races such as the one between the STR and CLS (RDO) discussed above. In Host-Host protocol the race is avoided by putting a connection into "reconnect pending" state upon transmission of ROK. For TELNET the race can be avoided by the initiator of the reconnection by judicious use of RWT and RDO. For example the reconnection:

  H2                           H3          H2           H3
+---+ +---+ +---+ M +---+
| |----+ +---->| | | |------->| |
| Y | N | | Q | Z | ==> | Y | N | Z |
| |<-+ | H1 | +---| | | |<-------| |
+---+ | | M +---+ P | | +---+ +---+ +---+
| +--->| |----+ |
| | X | | H1
+------| |<-----+ +---+
+---+ | |
H1 | X |
| |
+---+

could be accomplished as follows:

X->Y:  RRQ
X->Z: RRQ
Y->X: ROK
Z->X: ROK
X->Y: RWT H3 P
X closes connections to Y
Y closes connections to X
Y waits for STR and RTS from H3
X->Z: RDO H2 N
X closes connections to Z
Z closes connections to X
Z sends STR and RTS to H2 which Y answers with
matching RTS and STR to complete reconnection

The reconnection mechanism for TELNET can be made to fit nicely into the command format suggested by Cosell and Walden in RFC #435. Consider the addition of three new commands to TELNET:

Prepare for Reconnect:                 RCP
Begin Reconnect by sending RFC's: RCS
Begin Reconnect by waiting for RFC's: RCW

Using these three command and the DO, DON'T, WILL, WON'T commands of RFC #435, the commands proposed earlier become:

RRQ => DO RCP
ROK => WILL RCP
RNO => WON'T RCP ;for responses to DO RCP
DON'T RCP ;for responses to WILL RCP
;i.e. used to cancel an RCP.
RDO <host> <socket> => DO RCS <host> <socket>
RWT <host> <socket> => DO RCW <host> <socket>

As RFC #435 notes the nice thing about this structure is that a host choosing not to implement reconnection does not even have to know what RCP means. All that it need do in response to DO RCP is to transmit WON'T RCP.