Appendix C: Front-End Implementation
APPENDIX C
Front-End Implementation
Introduction
A Network Access System (NAS), developed for a DEC PDP/11 computer, supports the current Imp-Host, Host-Host and ICP protocols. The implementation of these protocols facilitate process-process communications across the network and multi-user TELNET access to foreign hosts. This NAS provides the FE environment in which FEP is implemented.
The NAS system is comprised of a Kernel or executive section and a Network Control Program (NCP) plus a collection of modules to support device interfaces, handle terminals, and implement applications, as appropriate. The software is modular and extensible.
The KERNEL
The Kernel of the system consists of a set of functional modules which perform the task of resource management in a multiprocessing environment. This allows processes to be created, vie for processor service according to priority, intercommunicate, and be terminated. System primitives exist for various tasks such as process creation and synchronization, storage allocation, and sharing of the interval timer.
The term process used here describes an autonomous sequence of states brought about by the PDP-11 processor; a process' state is characterized by the set of processor registers, a stock, and process-owned storage areas. Process share storage areas which are accessed only (eq. pure code). Processes also share storage areas which may be updated (eq. control tables). In this case an allocation mechanism is utilized to prevent simultaneous ownership of an updatable storage area. The storage area is thus viewed as a sequentially sharable resource which is allocated by the process, modified, and then released.
Processes are given control of the processor by a single procedure called the Dispatcher. Processes are said to be in a ready state or in a waiting state. When a process blocks itself, control is given to the highest priority ready process.
Each process has an associated input message queue. This queue is the vehicle for interprocess communication. A process is blocked (put into a wait state) when its input message queue becomes empty (voluntary wait), or when an interrupt occurs (involuntary wait) because a higher priority process is to receive control of the processor. A process may voluntarily block itself waiting for any signal, or it may block itself for a specific event to be posted to its input message queue.
The Network Control Program
The NCP provides "third level" protocol functions to local processes. It contains a process which decodes and passes messages which have been received from the IMP and placed on the IMP-Host queue. This process interacts with other processes which call the NCP to establish connections or to transmit data. Thus the NCP is essentially divided into two parts:
- a process which handles incoming messages from the network, interprets IMP-Host and Host-Host control messages, and forwards regular messages on established connections; and
- a set of primitives which allow local processes to establish connections to other processes across the network, and to perform requests for data to be transferred on these connections.
There are two primary data structures used by the NCP to monitor the status of network connections. The first is called the Host Table, and describes that which is peculiar to each given host; the second is referred to as a Connection Table and contains all information on the state of a local NCP socket (connection). Connection Tables may be created either through external requests (e.q., an RFC is received from a remote host) or through internal requests (e.g., a local process performs a LISTEN).
Flow control is that portion of the NCP which governs the flow of data on connections. There are two procedures which perform this task; one which handles receive connections and one which handles send connections. These procedures receive control when an event has occurred which may now make it possible to transfer data on a connection.
Both send and receive flow control procedures have the responsibility of moving data between local process buffers and messages being received or transmitted over the network. In addition, they handle the formatting and unpacking of messages received. Local processes are unaware that data is being transmitted as discrete messages.
The NCP watchdog process monitors the state of network connections, checking for error conditions and performing garbage collection tasks. It receives control at periodic intervals and scans the list of known hosts, looking for existing connections. For each host to which an input or output connection exists, the Watchdog causes a Host-Host NOP message to be sent. Thus if a remote Host crashes while data is being awaited, local processes are informed of the error condition. The NCP takes notice of the remote crash when it receives a IMP--Host type 7 control message (Destination Host Dead). It then automatically closes all connections to that Host, and notifies using processes of that fact.
A second function of the NCP Watchdog is to check for connections hung because of an outstanding RFNM. If a RFNM is not received for a specified interval, the message is discarded, and the associated connection closed.
The FEP Handler
The Front-End Protocol is implemented as a collection of related, but specialized processes which manage network connections on the one side, and manage FEP paths and indexes on the other. Some FEP processes are NCP users. They cause network connections to be made, rule on incoming RFCs, and both accept and generate network data. Other FEP processes support the Host. These processes parse incoming commands, create indexes and paths, control the generation of replies and generally manage the paths. Certain FEP processes control specialized tasks such as translation of data, servicing of LISTEN commands and generation of RESPONSE commands.
Two data structures provide control information for FEP activities. An Index Table exists for each active index. Each Index Table associates one or more Path Table entries. Information in the Path Table reflects the state of the path, the translation type specified for data on this path, and necessary information to associate the path to any appropriate NCP Connection Tables. The Path Table is the common interface for all of the FEP modules. Most FEP processes are activated to service some event which is usually associated to a path. The action of the process will likely be dictated by the state of the path as indicated by the Path Table entry, and may result in altering the state of the path or the activation of one or more other FEP processes.
Two message queues provide Host input and output to the FEP modules. A line protocol mechanism services these queues. Commands from the Host are placed on the FEP Input queue by the line protocol process and the FEP Host Input process is signaled. When an FEP Host Output module places a Command for the Host on the host Output queue it signals the line protocol process.
The FEP implementation is basically Host independent down to the level of the Host Input and Host Output queues.
The Line Protocol Mechanism
The device interface and the line protocol between the FE and the Host are installation dependent. Because of this dependency, only a general discussion of the Line Protocol Mechanism is possible in this context. Detailed descriptions of the specific line protocols are included in the section for each Host.
The communications discipline and physical device characteristics may vary considerably from host to host. All FEP line protocols, however, will show certain common characteristics. The interface between the FEP handler and the Line Protocol Mechanism will always be Host Input and Host Output queues. All line protocol mechanisms will be expected to guarantee the integrity of the data. This implies some form of flow control, error detection/correction and retransmission capability, as well as normal transmit/receive responsibilities. The Line Protocol Mechanism will be expected to report failure after unsuccessfully attempting to perform an I/O operation. The number of retries etc. before reporting failure is an installation parameter. The FEP Handler works only in terms of FEP commands. The line protocol may provide for block transfers where each physical block is comprised of one or more FEP commands. If such is the case, it is encumbent upon the Line Protocol Mechanism to deblock the incoming Host commands before placing them in the Host Input queue.
The Line Protocol Mechanism will, in the general case, not manage any buffers. After successfully transmitting a command to the Host it is responsible for reporting the I/O complete, but the buffer space is freed or reused only by the FEP process which "owns" that space. The FEP Handler might use buffer assignment to control the rate of incoming traffic. When the FEP Host Input queue is ready to accept an additional command, it would acquire a buffer and signal the Line Protocol Mechanism, passing it a pointer to a buffer. This is effectively a "read" request. When the line protocol handler has filled the buffer, it adds it to the Host Input queue and signals I/O complete to the appropriate FEP process.
If the nature of the physical connection is such that the FE must accept unsolicited input, it may be necessary for the Line Protocol Mechanism to have its own buffer pool, in addition. If this is the case, it must be entirely managed by the line handler and transparent to the FEP Handler.
Data Translations
The TRANS-TYPE provisions in FeP may be employed for at least two general services. First, it can be used for normal character set substitutions. This is where, in the general case, there is a one-to-one relationship between the two character sets.
The second service addresses the problem of data transformation. In this case, there need not be a one-to-one relationship between incoming data and outgoing data.
The translation mechanism uses a token (e.g., a character) from the incoming data stream to index into a translation table. The result may be one of the following:
- a) do nothing, drop the character
- b) output the character unchanged
- c) substitute input character by output character
- d) substitute input character by output string
- e) activate a procedure indicated by the table
- f) change the translation
- g) test the translation mode and do any of the above depending on the result.
For each translation/transformation required by the Host a translation table must be defined. For simplicity and clarity the TRANS-TYPE field in the FEP commands allows the user to specify Host side and Network side as independent entities. In actual execution the Host/Network pair addresses a translation table which must have been previously defined. Note that for a duplex path two translation tables are necessary (A->B is not the same as A<-B).
A collection of "standard" character sets will be addressed initially (EBCDIC, ASC117, ASCII8, BCD, etc.) and at least NVT. As new requirements are defined these will be added to a library which will then be available to subsequent users.