This document is obsolete. Please
refer to RFC 165.
Network Working Group W. Naylor Request for Comments #143 J. Wong NIC #6728 C. Kline Categories: D.1, D.3 J. Postel Obsoletes: None UCLA - NMC Updates: 123, 145 3 May 1971
Regarding Proferred Official ICP
We should like to comment on a race condition discovered in the ICP as proposed in NWG/RFC #123. The problem arises when the server attempts to initiate a second connection to the user's receive socket and the first connection is not yet closed. Using a similar notation to that of NWG/RFC #123 the following table illustrates the sequence of events in the proferred and proposed ICP. The last two columns indicate which actions must be completed before the current action may be initiated. User and Server are third level programs, and UNCP and SNCP are the users NCP and Servers NCP respectively. Allocates have not been included since they add nothing to the argument.
Note that in the Proferred Order column, 16 can occur before 12 in which case UNCP would find socket U in use and probably return a CLS (U,S+1). The Server would probably then assume the User was finished with the conversation.
The above problem is resolved by eliminating the Close from one side and causing that side to wait for the CLS from the other side before doing an Init. We propose that eliminating the user's Close (U) is the best solution. (The user NCP must of course return a CLS in response to the CLS sent by the server NCP).
The Server's Close (L) leads more quickly to the reuse of socket L thus the serving of another user.
To clarify the above discussion which may seem confusing at first glance, let us demonstrate the problem in the language of RFC #123.
Server User ------ ---- (S1) Listen(L,32) (U1) Init(U,L,32)
(S2) [Wait for match] (U2)
(S3) Send(L,S) (U3) Receive(U,S)
(S4) Close(L) (U4) Close(U)
(S5) Init(S,U+1,B ) (U5) Init(U+1,S,B ) u u
(S6) Init(S+1,U,B ) (U6) Init(U,S+1,B ) s s
Notice that since server and user are independent (probably in different hosts), server could execute (S6) before user executes (U4) and could receive an error back from user's NCP that socket U is busy. Similarly, user could execute (U6) before server executes (S4) and could receive an error back from his own NCP that socket U is not yet closed (assuming an implementation where sockets are kept busy until a CLS match).
Various modifications could be made to ICP to solve this problem. We propose the following ICP: