CPNETART.WS4 (CP/NET ARTicle)
------------
"An Analysis of CP/NET"
George H. Clapp
ACM "SIGPC Notes", Vol.6, No.2, 1983, p.117
(1983 ACM Conference on Personal and Small Computers)
(Retyped by Emmanuel ROCHE.)
Abstract
--------
CP/NET, a software package designed to add networking
capabilities to microcomputers running under the CP/M-80
Operating System, is examined with respect to internal logical
organization, separation of functions, and correspondence with
the ISO OSI reference model.
Introduction
------------
CP/NET, or "Control Program for a NETwork", is a software
package which adds networking capabilities to a computer running
under the CP/M-80 Operating System. CP/M-80, or "Control Program
for Microcomputers", is an operating system for 8080-, 8085-,
and Z-80-based microcomputers produced by Digital Research,
Inc., of Pacific Grove, California. CP/NET is designed to
enhance the currently dominant version, CP/M-80 2.2. Another
Digital Research product, MP/M II, or "MultiProgramming for
Microcomputers", provides multiprogramming capabilities on a Z-
80- or 8086-based microcomputer. CP/NET is designed to connect
computers running under these two operating systems, creating a
network in which CP/M-80 machines are single user workstations
which make requests to be serviced by an MP/M II machine. In the
parlance of Digital Research, the CP/M-80 machines are
"requesters", and the MP/M II machines are "servers". Only
requesters can initiate actions; a server merely responds. The
CP/NET package includes software written for both the CP/M-80
and the MP/M II machines. Our analysis shall focus on the CP/M-
80 software for two reasons: as the initiator, the CP/M-80
software defines the network; and, second, the goal of the
author is to support CP/NET with a Unix server, in which case
the software at the MP/M II server is irrelevant.
CP/NET [Ref: DIGI82] is capable of supporting a variety of
network architectures. This capability results from a design
philosophy in which the logical machine is separated from the
physical machine. CP/M-80 exemplifies this design approach; it
consists of three components: the BDOS, or "Basic Disk Operating
System", the CCP, or "Console Command Processor", and the BIOS,
or "Basic Input/Output System". The BDOS deals with a logical
machine, and remains unchanged across a spectrum of
microcomputers. The CCP intercepts and interprets operator
input, and passes requests to a logical machine; it remains
unchanged as well. The BIOS alone deals with the physical
machine, and must therefore be "fitted" to each particular
microcomputer architecture.
The following figure depicts the relationships between the
operator, application program, the CCP, BDOS, and BIOS:
+-------------+
| Application |--->-------+
| program | |
| CCP |--->-------+
+-------------+ |
| BDOS |--->---+<--+
+-------------+ |
| BIOS |---+<--+
+-------------+ |
| Physical |<--+
| machine |
+-------------+
Figure 1. Logical diagram of a CP/M machine.
The diagram represents layers of logical machines: as one
traverses outwards, the machines become more logical, or
"abstract"; as one traverses inwards, the machines become more
physical until, at the center, one encounters the actual
hardware. A boundary between two layers depicts the interface
which the inner layer presents to the outer, and the arrows
represent requests for service which one layer may make upon
another. Notice that an arrow goes only from an outer to an
inner layer, indicating that a less "abstract" machine does not
(or should not) request a service from one more abstract.
The BIOS requests services from the physical machine, and the
BDOS, in turn, requests services from the logical machine
presented at the BDOS/BIOS interface. The emphasized boundary
about the BDOS layer represents the CP/M-80 machine. This
strictly defined interface is the logical machine used by all
CP/M-80 compatible application programs. The CCP and application
programs are peers which use the CP/M-80 machine to provide
services to the operator. Notice that an application program may
circumvent the BDOS, and call directly upon the BIOS. This is
done relatively infrequently, however.
The CP/M-80 software modules BIOS, BDOS, and CCP reside in
memory as indicated below:
+-------+
high | BIOS | 4 KB
+-------+
| BDOS | 3.5 KB
+-------+<--+
| CCP | |
+-------+ |
| | 56.25 KB
| TPA | |
| | |
+-------+<--+
| Base | 0.25 KB
low | Page |
+-------+
Figure 2. Memory layout of a CP/M machine.
The BIOS resides in highest memory. The BDOS is placed
immediately below the BIOS, and the CCP immediately below the
BDOS. The first 256 bytes is called the "Base Page", and is
reserved for system use. Memory from the end of the Base Page to
the beginning of the BDOS is available to an application
program. Digital Research refers to this region of memory as the
"Transient Program Area", or TPA. Since the CCP and application
programs are peers, an application program may overwrite the
CCP, and make use of the memory in which the CCP resides. The
BDOS copies the CCP back into memory as part of the "warm boot"
process, which occurs upon termination of an application
program.
The typical BIOS requires 4 KB; BDOS consumes 3.5 KB. Taking the
Base Page into consideration, a 64 KB CP/M-80 microcomputer is
left with 56.25 KB available to application programs.
Digital Research has extended the philosophy of separating the
logical from the physical to the design of CP/NET. The logical
network is supported by a software module entitled NDOS, or
"Network Disk Operating System", and the physical network is
supported by a second module entitled SNIOS, or "Slave Network
I/O System". Due to this separation, CP/NET may be implemented
on several of the currently available physical network
architectures.
The logical machine diagram for a CP/M-80 machine in which
CP/NET resides in given below:
+---------------+---------------+
| Application : CCP |
+-+---| program : |---+
| | +---------------+---------------+ |
| +-->| NDOS |<--+
| +-------------------------------+
| +---| BDOS |---+
| | +-------------------------------+ |
+-+-->| BIOS : SNIOS |<--+
+---------------+---------------+
| Local : Remote |
+---------------+---------------+
Figure 3. Logical diagram of a CP/NET machine.
There are several noteworthy attributes of this "CP/NET"
machine. Most important, the physical hardware consists of two
entities: the local machine, and the network machine. The BIOS
requests service from the local machine only; the SNIOS deals
only with the network machine. Another attribute is that the
NDOS, rather than the BDOS, presents the CP/M-80 interface to
the CCP or to an application program. Digital Research has taken
pains to maintain compatibility with existing CP/M-80
application software. With only a few extensions (not
exceptions), the interface presented by NDOS mimics that of
BDOS. An CP/M-80 application program will typically run on a
CP/NET machine with no modifications.
As indicated by the diagram, a primary function of NDOS is to
route requests to the appropriate destination: a request for a
local resource to the local machine, a request for a remote
resource to the network machine. NDOS routes requests for local
resources to the BDOS. It transforms a request for a remote
resource into a logical message, and passes the message to
SNIOS, which in turn transmits the message to a network server.
NDOS routes requests immediately upon receipt for all resources,
except for two I/O devices. In Digital Research's terminology,
these are the console and the list (i.e., printer) devices.
Rather than route these requests upon receipt, NDOS passes these
requests directly to the BDOS, where they are translated to BIOS
calls. It is not until the BDOS calls upon the BIOS that the
NDOS intercepts and routes these requests according to the
location of the resource. Therefore, a SECOND logical entry
point exists in NDOS, which intercepts BIOS rather than BDOS
service requests. Presently, only the BIOS routines related to
the console and list devices, and to the warm boot process, are
intercepted in this manner.
A possible rationale for this approach is that it allows
application programs to make direct calls upon the BIOS, yet
retains the mapping from logical to local/remote resources. The
remaining non-disk I/O devices, reader and punch, are not
intercepted in this manner, because they cannot be networked.
However, direct BIOS calls for disk resources are not
intercepted in this manner. The reason may lie in a practical
necessity related to the Control-P function. Control-P is a
toggle which enables program output to be echoed to the list, as
well as the console, device. Yet, there are ample opportunities
for NDOS to determine the destination(s) of output prior to
entry to BIOS. The approach taken by Digital Research requires a
less "abstract" machine, the BIOS, to request a service from one
more "abstract", the NDOS. The result is a product more
conceptually complex, less theoretically "clean" than might be
desired.
The CP/NET software modules reside in memory as indicated in the
next diagram:
+-------+
high | BIOS | 4 KB
+-------+
| BDOS | 3.5 KB
+-------+
| SNIOS | 0.75 KB
+-------+
| NDOS | 3 KB
+-------+<--+
| CCP | |
+-------+ |
| | 52.5 KB
| TPA | |
| | |
+-------+<--+
| Base | 0.25 KB
low | Page |
+-------+
Figure 4. Memory layout of a CP/NET machine.
As before, the BIOS and BDOS together occupy 7.5 KB. The NDOS
requires 3 KB, and a sample SNIOS included in the CP/NET package
consumes 0.75 KB. After taking the Base Page into consideration,
an application program has 52.5 KB of memory available for use.
Given the logical organization and memory layout of the CP/NET
machine, it is instructive to follow the paths taken by a
request. These paths are depicted in the following diagrams.
There are three possibilities: 1) a request for a local
resource, 2) for a networked disk resource, and 3) for a
networked console or list (printer) resource.
+-------+
+---| BIOS |<--+
4 | +-------+ | 3
+-->| BDOS |---+
+---| |<--+
| +-------+ |
5 | | SNIOS | | 2
| +-------+ |
+-->| NDOS |---+
+---| |<--+
| +-------+ |
6 | | CCP | | 1
| +-------+ |
+-->| |---+
| TPA |
| |
+-------+
| Base |
low | Page |
+-------+
Figure 5. (1) Path taken by a request for local resource.
+-------+
| BIOS |
+-------+
| BDOS |
| |<--+
3 <-- 4 -->+-------+ |
+---| SNIOS | | 2
5 | +-------+ |
+-->| NDOS |---+
+---| |<--+
| +-------+ |
6 | | CCP | | 1
| +-------+ |
+-->| |---+
| TPA |
| |
+-------+
| Base |
low | Page |
+-------+
Figure 6. (2) Path taken by a request for a remote disk.
+-------+
| BIOS |
+-------+
| BDOS |--->---+
| |<--+ |
5 <-- 6 -->+-------+ | | 3
+---| SNIOS |<--|-2-|---+
7 | +-------+ | | | 4
+-->| NDOS |---+<--+ |
+---| |<--+--->---+
| +-------+ |
8 | | CCP | | 1
| +-------+ |
+-->| |---+
| TPA |
| |
+-------+
| Base |
low | Page |
+-------+
Figure 7. (3) Path taken by a request for a remote
console or list device.
With this understanding of CP/NET, it is possible to place
CP/NET in context. The International Standards Organization
(ISO) has proposed the "Reference Model of Open Systems
Interconnection", or the "ISO OSI reference model", in an effort
towards network standardization [Ref: TANE81, LARS83]. The ISO
reference model consists of seven layers as depicted below:
+--------------+ +--------------+
| Application |<-->| Application |
+------+-------+ +------+-------+
| Presentation |<-->| Presentation |
+------+-------+ +------+-------+
| Session |<-->| Session |
+------+-------+ +------+-------+
| Transport |<-->| Transport |
+------+-------+ +------+-------+
+--------|-------------------|---------+
| +------+-------+ +------+-------+ |
| | Network |<-->| Network | |
| +------+-------+ +------+-------+ |
| | Data-Link |<-->| Data-Link | |
| +------+-------+ +------+-------+ |
| | Physical |<-->| Physical | |
| +--------------+ +--------------+ |
+--------------------------------------+
Communication Subnet
Figure 8. The ISO OSI reference model.
Each layer is briefly described below:
Application layer
This layer is the entry point into the network, and presents the
interface experienced by the operator. It deals with the
problems of human engineering, network transparency, and optimal
solutions to user tasks. Sample services are query optimization
in distributed data bases, security checks, and address
validation.
Presentation layer
The presentation layer provides frequently requested utilities,
typically conversion utilities, such as text compression,
encryption, and file format conversion.
Session layer
A session is a communications connection between two application
processes, and an appropriate title for the session layer is
"communications connection manager". This layer is responsible
for establishing and maintaining the logical connection between
two users. In addition, the session layer may reorder, or group,
transmitted messages, as required by the application program.
Transport layer
While the session layer manages the connection between two
application PROCESSES, the transport layer is responsible for
establishing, maintaining, and terminating the connection
between the ultimate source and destination NODES. The transport
layer establishes the connection at the request of the session
layer, divides the message into smaller units, if necessary, and
transmits the message to the destination node(s). It ensures
that the message is received correctly, and that the destination
node is not swamped with messages.
The application, session, and transport layers of the source
node communicate "directly" with their peers at the destination
node. It is truly "end to end" communication. In contrast, the
lower layers, the network, data-link, and physical layers,
communicate only with their immediate neighbors, which may or
may not be the ultimate source or destination nodes. In more
complex networks, the neighbors often are not the end
communicators. Therefore, the lower three levels present a
logical network to the higher levels, and are collectively
referred to as the "communication subnet".
Network layer
This layer accepts messages from the transport layer, "packets",
and routes them over an existing virtual circuit. In short, the
functions of the network layer are packetization, routing, and
congestion control.
Data-link layer
The data-link layer provides the error-free circuit expected by
the network layer. Frequently a collaboration of hardware and
software, the data-link layer implements a data-link protocol
which ensures that a message transmitted over the "raw" circuit
is received correctly. Messages descending from the network
layer are "enveloped", or "framed", and sent to a remote node.
The destination node acknowledges the message, informing the
sender whether or not the message was received intact. If the
message was garbled, the sender retransmits, and again awaits
acknowledgment. The process is repeated until success occurs.
physical layer
This layer is the only "non-virtual" circuit in the ISO model,
and consists of the electrical and mechanical components which
provide the raw transmission medium used by the higher levels.
With the ISO reference model in mind, the functions performed by
NDOS and SNIOS may be explored more fully. The NDOS provides the
following functions:
1. It intercepts and routes disk, console, and printer
resource requests to the appropriate location.
2. It transforms requests for remote resources into
packets, and passes the packets to the SNIOS for
transmission.
3. It receives packets from the SNIOS, and transforms the
packet information into the form expected by CP/M-80.
4. It intercepts and executes certain BDOS system
information and control functions, circumventing the
BDOS entirely.
5. It provides extensions to the CP/M-80 2.2 functions.
These extensions serve two purposes: to reconcile the
discrepancies between the CP/M-80 and MP/M II operating
systems, which occur primarily in the file systems, and
to support network functions, such as "login" and "send
message".
Unlike NDOS, which is sold only in load module form, sample
SNIOS's are sold to the customer in the form of 8080 assembler
source code. The SNIOS functions are strictly defined, as are
those of CP/M-80's BIOS, and consist of the following:
1. Network system information and control functions, such
as network interface initialization and returning the
network status.
2. Transmit and receive a message on the network.
NDOS is static, and acts as an interface between CP/M-80 and the
logical network provided by the SNIOS. The simple SNIOS function
titles, "send/receive a message", hide a mass of network
functions which may range from routing to data-link protocols.
The flexibility gained by shoving the physical network onto the
SNIOS comes at the price of a less than clear delineation of the
ISO reference model layer functions between the NDOS and the
SNIOS, and of requiring the customer to have knowledgeable
programming support. The division of the ISO reference model
layer functions between the NDOS and SNIOS will be discussed
shortly. Digital Research has attempted to alleviate the latter
problem by providing sample SNIOS's written to support three
network architectures: 1) the Corvus OMNINET, 2) the ULCnet of
Orange Compuco, Inc., and 3) a simple, default architecture, in
which the requester is connected to one or more servers via a
serial I/O port.
In addition to NDOS and SNIOS, Digital Research sells several
other programs as part of the CP/NET package. These include a
CCP customized for the CP/NET environment, an electronic MAIL
program, LOGIN and LOGOFF utilities, and a program entitled
CPNETLDR, which loads NDOS and SNIOS below the BDOS. Two
important programs are NETWORK and LOCAL, which enable the
operator to declare system resources as either remote or local.
The correspondence of CP/NET with the ISO reference model can
now be examined.
Application layer
-----------------
The CP/NET programs CPNETLDR, CCP, MAIL, NETWORK, and LOCAL
belong in this layer. Until the operator executes CPNETLDR, the
network does not even exist, and although network initialization
is not specifically mentioned as a function of the application
layer, it is a necessary precursor to all the functions provided
by lower levels. The CCP serves as a network interface in which
the primary concern is network transparency. Its interaction
with the server is relatively minor, and its functions are
restricted to such housekeeping chores as ensuring that file
attributes are compatible across the network, and releasing
allocated server drives upon termination of a local application
program. MAIL, NETWORK, and LOCAL are application programs whose
purposes were described earlier.
Presentation layer
------------------
The session layer is the primary interface between the
application program and the network. The application layer sends
a suitably formatted message to the session layer, and the
presentation layer usually plays a minor supporting role. In
CP/NET, however, the application programs were written before
CP/NET existed. They have no conception of messages, or of
remote resources. An important function of NDOS, therefore, is
to convert a system call made by an application program into a
message suitable for transmission over the network, and to
convert a message from the network into a form acceptable to the
application program.
Session layer
-------------
The session layer manages communications between application
PROCESSES. A CP/NET requester identifies the destination of a
message by a server ID number, and by his own requester ID
number. The server ID specifies the destination NODE; the
requester ID specifies the destination PROCESS. The programs
LOGIN and LOGOFF fit neatly into the session layer. LOGIN
establishes the logical connection between requester and server
processes; LOGOFF dismantles the connection.
However, to clarify the architecture of CP/NET, it should be
noted that it is impossible for a requester to communicate with
more than one process at a server node. CP/M-80 is a SINGLE
tasking operating system. The designers of CP/NET did not
envisage a situation in which multiple processes at a requester
would interleave service requests to a single MP/M II server.
Therefore, CP/NET makes no distinction between a destination
node and a destination process.
The session layer has the additional responsibilities of
maintaining the communications connection, and of reordering or
grouping messages as required by the application program. NDOS
maintains the connection in a negative sense: if a message
cannot be sent or received, NDOS simply returns an error to the
application program, and allows it to make any attempt at
recovery it desires. With regard to message sequencing, NDOS
orders the messages in strict request/response pairs: each
request requires a response.
Digital Research offers to the application programmer the
capacity both to evade the ordering normally imposed upon
messages, and to circumvent the conversion performed by NDOS at
the presentation level. The system calls "Send Message on
Network" and "Receive Message on Network" cause NDOS to pass
messages between the application layer and the transport layer
virtually untouched. The action taken by NDOS at the session
layer is merely to indicate the success or failure of the
transmission. These system calls are the means by which future
application programs can exploit the extended facilities offered
by CP/NET.
In summary, the functions of the session layer are provided by
three elements of the CP/NET package: LOGIN and LOGOFF provide
session creation and termination; NDOS provides connection
maintenance.
Digital Research has left the next three ISO reference model
layers: the transport, network, and data-link layers, to the
SNIOS. In effect, the communication subnet has been extended to
include the transport layer, and left in the hands of the SNIOS.
The lowest layer, the physical layer, is a matter of electrical
hardware, and is beyond the scope of CP/NET.
Transport layer
---------------
Since CP/NET does not distinguish between destination nodes and
processes, the problem of managing nodal communication is
subsumed by NDOS in the session layer. Also, since NDOS acts in
the presentation layer to convert system calls to messages which
are suitable at the data-link layer, it is not necessary to
split a message into smaller units. The transport layer is
unnecessary in CP/NET, and no module performs its functions. The
SNIOS could be modified to provide these functions, in the event
that a network architecture required them.
Network layer
-------------
It is difficult, or at least improbable, to imagine a CP/NET
topology in which routing represents a significant problem.
CP/NET lends itself most readily to a star topology in which
each requester has a dedicated port on the central server.
Routing is then a trivial affair, and is no more difficult with
a bus or ring topology. Although surprising, a ring topology is
possible under CP/NET. The requester must respond to I/O
interrupts on the network port, and execute an interrupt routine
which will pass the message on to the next requester.
Packetization and congestion control, like routing, are
functions unlikely to occur, except in the most sophisticated
implementations of CP/NET. As is the case with all the
communication subnet layers, the SNIOS can be modified to
provide the desired function.
Data-link layer
---------------
Digital Research has proposed a simple byte count oriented data-
link protocol, in an effort towards cross-system compatibility
[Ref: MCNA77]. The logical messages are clearly defined; the
figure given below depicts the standard format:
+-----+-----+-----+-----+-----+-...-+
| FMT | DID | SID | FNC | SIZ | MSG |
+-----+-----+-----+-----+-----+-...-+
Figure 9. CP/NET logical message format.
Each field, except the MSG field, occupies a single byte, and is
defined as follows:
FMT: message ForMaT code
DID: message Destination ID
SID: message Source ID
FNC: message FuNCtion code
SIZ: data field length - 1
MSG: MeSsaGe data (SIZ + 1 bytes)
The data-link protocol devised by Digital Research is
demonstrated in the next figure.
Source Destination
------ -----------
ENQ -->
<-- ACK
SOH -+
FMT |
DID |
SID |-->
FNC |
SIZ |
HCS -+
<-- ACK
STX -+
DB0 |
... |
DBn |-->
ETX |
CKS |
EOT -+
<-- ACK
Figure 10. CP/NET data-link protocol.
Although not indicated in the diagram, timeouts and
retransmissions are part of the protocol as well. The checksum,
which is simply the negative of the sum, modulo 256, of the
logical message bytes, is not as rigorous as a cyclic redundancy
code, which can be implemented in a simple and short subroutine.
Also, the ENQ and ACK characters exchanged in the handshaking
sequence are transmitted naked over the physical link. Control
messages might be sent in the headers of messages, with no data
but with checksums, as is done with other byte count oriented
protocols. Despite these failings, however, the protocol is
workable and simple to implement.
Physical layer
--------------
As mentioned previously, CP/NET leaves the physical layer in
other hands.
Conclusion
----------
The following diagram shows the relationship between CP/NET and
the ISO reference model.
+------------------+ CCP,
| +--------------+ | CPNETLDR, MAIL,
| | Application | | LOCAL, NETWORK
| +------+-------+ |
+--------|---------+
| +------+-------+ |
| | Presentation | |
| +------+-------+ | NDOS
| | Session | |
| +------+-------+ |
+--------|---------+
| +------+-------+ |
| | Transport | |
| +------+-------+ |
| | Network | | SNIOS
| +------+-------+ |
| | Data-Link | |
| +------+-------+ |
+--------|---------+
+------+-------+
| Physical |
+--------------+
Figure 11. CP/NET and the ISO OSI reference model.
NDOS and SNIOS separate cleanly at the session-transport
interface. NDOS provides the functions at the presentation and
session layers; SNIOS provides the communication subnet, which
is expanded by CP/NET to include the transport layer.
CP/NET logical message formats cannot presently support an
addressing scheme which will distinguish between processes at a
destination node. It is true that CP/M-80 machines are presently
single tasking, but sixteen bit microprocessors will become the
predominant architecture in personal workstations, and
multiprogramming will be the norm, rather than the exception.
Digital Research itself sells a multiprogramming version of
CP/M-80 designed for the 8086, their "Concurrent CP/M". The
authors of CP/NET may come to regret this melding of the
destination process and node.
Another flaw in the design of CP/NET is the decision to have the
NDOS intercept calls at the BIOS, as well as the BDOS, level.
Perhaps they were forced to do so by practical necessity, but
the result is a more cluttered, less straightforward design.
CP/NET's strengths are its compatibility with existing
application programs, and the variety of architectures which it
can support. The wealth of CP/M-80 software, and the large and
increasing number of CP/M-80 machines, represent an important
market to innovative manufacturers of inexpensive networks. By
placing the communication subnet in the SNIOS, Digital Research
has offered these vendors an avenue into this market.
Bibliography
------------
[CORT82]
"Inside CP/M: A guide for users and programmers, with CP/M-86
and MP/M II"
David E. Cortesi
Holt, Rinehart and Winston, 1982
[DIGI78]
"CP/M 2.2 Manual"
Digital Research, Inc.
[DIGI82]
"CP/NET Reference Manual"
Digital Research, Inc.
5th Edition, November, 1982
[DITL83]
"Idealism Spawns Realism"
Steve Ditlea
"Collegiate Microcomputer", Vol.1, No.1, February, 1983, pp.57-65
[LARS83]
"Adding another layer to the ISO net architecture reduces costs"
Kenneth N. Larson & W. Roy Chestnut
"Data Communications", Vol.12, No.3, March, 1983, pp.215-222
[MCNA77]
"Technical Aspects of Data Communication"
John E. McNamara
Digital Press, 1977
[ROLA82]
"Network software borrows design from microcomputer operating system"
Thomas A. Rolander, Randall Baird, & John Wharton
"Data Communications", Vol.11, No.13, pp.123-133
[TANE81]
"Computer Networks"
Andrew S. Tanenbaum
Prentice-Hall, Inc., 1981
EOF