2. A Reconnection Mechanism
The mechanism proposed here could be added to the existing Host-Host protocol or to the TELNET protocol. The mechanism is first described and then its adaptation to each of the protocols is discussed.
The reconnection mechanism includes four commands:
Reconnect Request: RRQ <path>
Reconnect OK: ROK <path>
Reconnect No: RNO <path>
Reconnect Do: RDO <path> <new destination>
where <path> is the communication path to be redirected to <new destination>.
Assume that H1 wants to move its end of communication path A-C from itself to port D at H3 (See figure 4).
(a) situation (b) desired situation
H2 H3 H2 H3
___ ___ ___ ___
| | | | | | | |
| C|<-+ |D | | C|<------>|D |
|___| | |___| |___| |___|
|
|
| ___ ___
| | | | |
+->|A | |A |
|___| |___|
H1 H1
Figure 4
The reconnection proceeds by steps:
a. H1 arranges for the reconnection by sending RRQ to H2:
H1->H2: RRQ (path A-C)
b. H2 agrees to reconnect and acknowledges with ROK:
H2->H1: ROK (path C-A)
c. H1 notes that H2 has agreed to reconnect and instructs H2 to perform the reconnection:
H1->H2: RDO (path A-C) (Host H3, Port D)
d. H1 breaks paths A-C. H2 breaks path C-A and initiates path C-D.
In order for the reconnection to succeed H1 must, of course, have arranged for H3's cooperation. One way H1 could do this would be to establish the path B-D and then proceed through the reconnection protocol exchange with H3 concurrently with its exchange with H2 (See Figure 5):
H1->H3: RRQ (path B-D)
H3->H1: ROK (path D-B)
H1->H3: RDO (path B-D) (Host H2, Port C)
H2 H3
______ ______
| | | |
| C | | D |
---\-- -/----
\ /--> <--\ /
\- -/--- --- --- --- --- \---/
\ / \ /
X X
/ \ / \
/ \ / \
reconnection \ / reconnection
\ ________ /
---|A B|---
| |
|________|
H1
Figure 5
Either of the parties may use the RNO command to refuse or abort the reconnection. H2 could respond to H1's RRQ with RNO; H1 can abort the reconnection by responding to ROK with RNO rather than RDO.
It is easy to insure that messages in transit are not lost during the reconnection. Receipt of the ROK message by H1 is taken to mean that no further messages are coming from H2; similarly receipt of RDO from H1 by H2 is taken to mean that no further messages are coming from H1.
To complete the specification of the reconnection mechanism consider the situation in which two "adjacent" entities initiate reconnections:
(a) situation (b) desired situation
H1 H4 H1 H4
____ ____ ____ ____
| | | | | | | |
| C| |E | | C|--------|E |
|____| |____| |____| |____|
H2 H3 H2 H3
____ ____ ____ ____
| | | | | | | |
| B|--------|D | | B| |D |
|____| |____| |____| |____|
H2 and H3 "simultaneously" try to arrange for reconnection:
H2->H3: RRQ (path B-D)
H3->H2: RRQ (path D-B)
Thus, H2 sees an RRQ from H3 rather than an ROK or RNO in response to its RRQ to H3. This "race" situation can be resolved by having the reconnections proceed in series rather than in parallel: first one entity (say H2) performs its reconnect and then the other (H3) performs its reconnect. There are several means that could be used to decide which gets to go first. Perhaps the simplest is to base the decision on sockets and site addresses: the entity for which the 40 bit number formed by concatenating the 32 bit socket number with the 8 bit site address is largest gets to go first. Using this mechanism the rule is the following:
If H2 receives an RRQ from H3 in response to an RRQ of its own: (let NH2,NH3 = the 40 bit numbers corresponding to H2 and H[2])
a. if NH2>NH3 then both H2 and H3 interpret H3's RRQ as an ROK in response to H2's RRQ.
b. if NH2<NH3 then both interpret H3's RRQ as an RNO in response to H2's RRQ. This would be the only case in which it makes sense to "ignore" the refusal and try again - of course, waiting until completion of the first reconnect before doing so.
Once an ordering has been determined the reconnection proceeds as though there was no conflict.
The following diagram describes the legal protocol command/response exchange sequences for a reconnection initiated by P:
___ ___
| P |---------------| Q |
|___| |___|
____________________
| P --> Q || R R Q |
|_________||_________|
|
+---------+
|
____V_______________________________________
| || | | |
| Q --> P || R O K | R N O ----| R R Q |
| || | | E | |
|_________||_________|_________|___|_________|
| |
+------------+ v
| Yes +----------+ No
| +------------------------| NP > NQ? |------+
| | +----------+ |
__v___v_______________________________ |
| || | | |
| P --> Q || R D O ----| R N O ----| |
| || | E | | E | |
|_________||_________|___|_________|___| |
|
+--------------------------------------------+
|
____v_________________________________
| || | |
| Q --> P || R D O ----| R N O ----|
| || | E | | E |
|_________||_________|___|_________|___|
NP and NQ are the 40 bit numbers for P and Q; E indicates end of sequence.