1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
|
Network Working Group Richard Schantz
RFC # 671 BBN-TENEX
NIC # 31439 December 6, 1974
A Note on Reconnection Protocol
INTRODUCTION
This note documents the experience we have had in implementing a
modified, experimental version of the Telnet reconnection protocol
option within the context of the Resource Sharing Executive (RSEXEC).
The reconnection protocol specifies a procedure for transforming a
configuration from one in which the initiating process has
connections to two correspondent processes, to one in which there is
a direct connection between the correspondents. When the procedure is
successfully completed, the initiating process is no longer in the
communication path between the correspondents.
Resource sharing computer networks and distributed computing will
increasingly give rise to specialization by task among the computer
installations. In such an environment, a "job" is the dynamically
varying interconnection of a subset of these specialized modules.
Connections are the "glue" in "bonding" the job together.
Reconnection provides for a dynamically changing "bonding" structure.
(For a more complete discussion of the utility of reconnection, see
RFC 426).
This document deals with reconnection in terms of its current ARPANET
definition as a Telnet protocol option. The first section defines a
modified reconnection protocol. The second section discusses general
network implementation details, while the final section describes
aspects of the TENEX/RSEXEC implementation.
Familiarity with the new ARPANET Telnet protocol (RFC 495) is
assumed.
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.
Schantz [Page 1]
^L
RFC 671 A Note on Reconnection Protocol December 1974
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.
Schantz [Page 2]
^L
RFC 671 A Note on Reconnection Protocol December 1974
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.
Schantz [Page 3]
^L
RFC 671 A Note on Reconnection Protocol December 1974
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
Schantz [Page 4]
^L
RFC 671 A Note on Reconnection Protocol December 1974
<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 ..."
II. IMPLEMENTATION DETAILS
1. A process initiating a reconnection designates one of the object
processes as passive (i.e., to listen for RFCs), and the other as
active (i.e., to send RFCs). The reconnection protocol does not
specify the assignment of the active/passive roles, so the process
Schantz [Page 5]
^L
RFC 671 A Note on Reconnection Protocol December 1974
is free in its selection. However, information regarding the types
of participants in the reconnection attempt may dictate a role
selection which will contribute to the eventual successful
completion of the reconnection. Ignoring such information could
conceivably force cancellation of the attempt. Certain types of
hosts (e.g., space limited TIPs) may be better suited for active
participation, since it need not go through the procedure of
verifying the identity of the sender. The passive process should
go through such verification. Other types of hosts (e.g., one
whose NCP will not let an arbitrary process listen on a socket)
may be better suited for the active role. As more systems
implement the reconnection option, the preferences of various
types of systems will become known, and more definitive rules may
emerge.
2. To avoid possible deadlock, the active (passive) process must
simultaneously send (listen for) RFCs for both send and receive
connections, which will form the new Telnet connection. Since the
reconnection protocol does not specify an ordering for
establishing the connections, it is important that passive
processes listen in parallel on both the potential send and
receive sockets, and that active processes send RFCs in parallel
for both the potential send and receive sockets.
3. There are two levels of error recovery involved in reconnection.
One level is required to handle the conditions where network and
system delays cause the attempt to establish the new connection to
get out of synchrony (e.g., the RFC arrives at the passive host
before the passive process listens), or cause system timeouts.
When these conditions occur the sockets/connections should be
returned to a state in which the faulting operation can be
automatically retried. The second level of recovery involves the
failure of all such attempts to establish communication with the
active (passive) process, the duration of these attempts may be
influenced by such factors as the recovery procedures available,
and whether or not a human user is awaiting the outcome. Recovery
at this point is difficult since the connections with the
initiating process have already been broken. Attempts to connect
to some reasonable alternative (perhaps local, perhaps attempting
to connect back to the original source of the reconnection) should
be initiated if second level error recovery is necessary,
indicating complete reconnection failure.
4. A useful addition to the reconnection mechanism would be the
definition of a standard way to reestablish contact with the
reconnection initiator on task termination (including can't
complete reconnection).
Schantz [Page 6]
^L
RFC 671 A Note on Reconnection Protocol December 1974
III. TENEX RELATED DETAILS
The context for our experiments was that of a TIP user using a
TIPSER/RSEXEC. The TIPSER/RSEXEC would first authenticate the TIP
user and then serve as a command interpreter. Among the available
commands was one called TELCONN (TELnet CONNect) for connecting to
other sites for service. A TELCONN command would trigger an attempt
by the TIPSER/RSEXEC to reconnect the "TIP" directly to the host,
which was the target of the TELCONN request (normally this would
usually be a logger process at the host). When the reconnection is
completed, the TIP is directly connected to the new job, and the
TIPSER/RSEXEC is completely eliminated from the communication path.
To avoid programming the TIP, a TENEX process was used to simulate
the TIP.
Certain features of TENEX caused problems in creating the desired
interaction between the TENEX jobs involved in the reconnection
experiment. They are presented here because there may be similar
problems in other systems.
1. Along with the features supplied by the TENEX Telnet interface via
the ATPTY system call (which transforms a pair of unused network
connections into a Telnet connection pair), comes a loss of
certain control functions. A program loses the ability to control
when data is sent (i.e., loss of the use of the MTOPR system call
to force transmission of buffered data), and can no longer
determine the remote host/socket for the network connection (i.e.,
GDSTS system call). In a highly interactive mode, such as option
negotiation, short messages remaining in system buffers can result
in a deadlock. A process must be able to override the buffering
strategy at the conclusion of a logical message. Failure to have
access to such a mechanism (e.g., MTOPR) requires that the
connection be opened in a non-buffered mode, which is wasteful
most of the time. Similarly, the inability to obtain the remote
host/socket names of the connection requires that this information
be remembered by the program for the duration of the connection in
case it is needed. (This is the case despite the fact that the
operating system maintains the information in any event. The need
to access this information arises when we wish to reconnect the
Telnet connection which linked the "TIP" to the TIPSER/RSEXEC.)
2. There is no facility in TENEX for handling (initiating or
responding to) Telnet options not recognized by the Telnet server.
An interface between a user program and the option negotiation
mechanism would be useful for testing new options and for
implementing privates ones. Lack of this interface can be
circumvented by switching the connection to binary mode
transmission and reception. This works only if option negotiation
Schantz [Page 7]
^L
RFC 671 A Note on Reconnection Protocol December 1974
is between two user processes (both aware of the binary
transmission), since if a user process tried to negotiate with a
system Telnet server obeying the binary transmission option, the
required doubling of IACs for binary output would cause the
request to be misinterpreted at the system Telnet.
3. The switch to binary transmission requires two option
negotiations. During this period data transfer is possible.
However, the actual data transferred is dependent on the state of
the negotiation at that point (e.g., depending upon the state, the
IAC character may or may not be doubled). There does not seem to
be a facility for alerting the process that the option has been
accepted (rejected) and that all further transmissions will be in
the new mode (binary). Perhaps suspending the process for the
duration of the (timed out) option negotiation would eliminate
this period of uncertainty in the mode switch. In TENEX, this
could be coupled with pseudo-interrupts to note option negotiation
failure for certain critical user initiated options.
4. During peak load conditions, RFCs sent by the operating system
(NCP) in response to program requests (OPENF system calls) were
frequently timed out by the system. The passive process listening
for the RFCs did not get rescheduled quickly enough to reply to
the RFCs (acceptance or rejection) before they were timed out by
the system. A confusing situation arose because of the difference
in initiating the two connections (send and receive) that were to
form the full-duplex path between the processes. One OPENF
specified immediate return, while the other waited for completion
of the RFC. If both requests timed out, the states of the
corresponding connections were different, and therefore the retry
mechanism had to handle each differently (i.e., the "immediate
return" connection had to he closed via CLOSF, whereas the other
did not). This seems to be an unnecessary complication. Also, the
frequency of timeout during heavy load conditions may indicate
that the RFC timeout interval is too short.
5. In the TENEX user interface to the network there is no concept of
logical messages when more than one process (fork) shares a
network connection. Telnet option negotiation sequences are
examples of strings, which must be sent in proper order, without
interceding characters of any nature in order to have correct
meaning. Even when a TENEX "string out" (SOUT) operation is
executed by a process, which is indicative of some logical
relationship between the characters of the string, the
transmission is not guaranteed to be free from interference from
other processes sending data over the same connection. (Multi-
process organization for managing network connections is very
common. One process is typically used to handle user output to the
Schantz [Page 8]
^L
RFC 671 A Note on Reconnection Protocol December 1974
network, while another process reads data from the network and
replies as required by protocol to certain network input). These
processes must synchronize on every output (and input) to assure
the logical integrity of their messages. This synchronization
would seem to be more suitably handled by the system routines,
which manage network connections and handle string I/O.
[ This RFC was put into machine readable form for entry ]
[ into the online RFC archives by Alex McKenzie with ]
[ support from BBN Corp. and its successors. 7/2000 ]
Schantz [Page 9]
^L
|