Tenex NCP finite state machine for connections
RFC 689

Document Type RFC - Unknown (May 1975; No errata)
Last updated 2013-03-02
Stream Legacy
Formats plain text pdf html bibtex
Stream Legacy state (None)
Consensus Boilerplate Unknown
RFC Editor Note (None)
IESG IESG state RFC 689 (Unknown)
Telechat date
Responsible AD (None)
Send notices to (None)
Request for Comments: 689                                              May 1975
NIC #32656

             TENEX NCP Finite State Machine for connections
                        TENEX Memo Number 155

The attached figure describes the finite state machine used in TENEX
version 1.33 to implement the ARPANET Host to Host protocol. This
memo updates that of 27 August 1971, TENEX memo number 113, with
regard to the finite state machine. Other parts of that memo have
been incorporated into the JSYS manual and other documents.



TENEX NCP Finite State Machine for Connections                           Page 2

The components of a finite state machine (FSM) are States,
Events, and Actions. These are listed below:

States Events Actions

01 CLZD 00 RRFC 00 ANOP
02 PNDO 01 CLSR 01 AFNY
03 LSNG 02 CLSS 02 ACLS
04 RFCR 03 CLZR 03 ARFC
05 CLW1 04 CLZS 04 AOPB
06 RFCS 05 ACPT 05 AOPL
07 OPND 06 CONN 06 ACLL
10 CLSW 07 LISN 07 ACLO
11 DATW 10 RRFN 10 AEOR
12 RFN1 11 TIME 11 AEOS
13 CLZW 12 RRFB 12 AES1
16 FREE 13 AABT
14 ACKA

Note that there are two kinds of "close" events and actions: a close
at the JSYS level (CLOSF) and one at the host-to-host protocol level
(CLS). The names in the above list contain "CLS" if they are
concerned with host-to-host CLS, and CLZ if the are concerned with
CLOSF.

Each state will be briefly described below, along with events
which may occur while a connection is in that state, and actions which
are taken as the state is advanced.

A few overall notes: Actions are shown on the state diagram
following a "/''. Any transition without an action shown generates
"ANOP", a null action. The action "AFNY" means a "funny" event (i.e.,
one not expected in this state -- probably a bug) has occurred. The
result of this action is an IMPBUG error printout. Any event NOT
shown on the state diagram causes the state to loop back to itself and
an AFNY to be generated. These are not shown explicitly on the
diagram. Another "funny" event is the execution of an "accept" MTOPR
by the user program when the state is not RFCR. However, an errant
user program can do this, and no IMPBUG should be generated as a
result, so most states show a loop to self with no action (i.e., an
"ANOP") as a result of the ACPT event. The event "TIME" (also called
"HUNG") simply means that the socket has not changed state for a
specified time interval and may need to be prodded along. This time
is currently two minutes, except for connections in error states where
the FSM is stepped faster to clear the connection out.

State 16 - FREE - Free connection
A connection in this state has never existed, or is almost completely
deleted. No events are expected in this state except a program CLOSF
(events CLZR or CLZS), or an erroneous Accept. The Accept causes an
error status bit to be set (AABT - Action: abort). A connection
leaves the FREE state by the creation of a socket. This can be the
result of a user OPENF or an incoming RFC. This causes the connection


TENEX NCP Finite State Machine for Connections                           Page 3

to move into the CLZD state.

State 01 - CLZD - Closed
This state is very transitory. Events which cause a socket to be
created also immediately cause a further state change to either PNDG
(if the event was the receipt of an RFC), LSNG if the event was a
Listen JSYS - i.e., an OPENF with a null extension), or RFCS (if the
event was an OPENF with a foreign socket specified). In the latter
case, an RFC is sent to the foreign socket (ARFC).

State 02 - PNDG - Pending
In this state, an RFC has been received, but no local program has
indicated any interest in it. Events which may occur here are:
LISN - a program decides to listen on the socket. Since an RFC has
arrived, the FSM is stepped to the same place it would have been if
the LISN and RRFC had occurred in the other order; namely RFCR.
CONN - a program decides to connect to the foreign socket. This steps
the FSM to OPND and causes the AOPB action (open the link and send the
matching RFC).
TIME - The RFC (which was unsolicited) has sat around for two minutes
without any local program deigning to act upon it. Therefore, to
clear out the tables, it is refused (ACLS - a close is sent) and the
next state is CLSW to await the matching CLS.
CLSR or CLSS - The site who sent the RFC has changed its mind and sent
a CLS, so we send the matching CLS and return the socket to the FREE
state.

State 10 - CLSW - Wait for CLS
This state is entered when no further activity is required on a
connection except the receipt of a CLS from the far end. The CLS has
already been sent to the far end. In some cases, the file system
CLOSF has not been done, so events CLZR and CLZS cause loops into
CLSW. The expected events are CLSR or CLSS, the receipt of the CLS
from the far end of the connection, and these step the connection to
state FREE. Also, if two minutes go by without the CLS, it is assumed
that the required CLS response was lost by the foreign site so TIME
causes the same action.
Show full document text