Skip to main content

III. Environment

We assume that the typical host will have a time-sharing operating system in which the cpu is shared by processes.

Processes​

We envision that each process is tagged with a user_number. There may be more than one process with the same user number, and if so, they should all be cooperating with respect to using the network.

We envision that each process contains a set of ports which are unique to the process. These ports are used for input to or output from the process, from or to files, devices or other processes.

We also envision that each process has an event channel over which it can receive very short messages (several bits). We will use this mechanism to notify a process that some action external to the process has occurred.

To engage in network activity, a process attaches a local_socket to one of its ports. Sockets are identified by user number, host and AEN, and a socket is local to a process if their user numbers match and they are in the same host. A process need only specify an AEN when it is referring to a local socket.

Each port has a status which is modified by system calls and by concurrent events outside the process. Whenever the status of a port is changed, the process is sent an event over its event channel which specifies which port's status has changed. The process may then look at a port's status.

These assumptions are used descriptive material which follows. However, these assumptions are not imposed by the network protocol and the implementation suggested by section IV is in no way binding.

We wish to make very clear that this material is offered only to provide clues as to what the implementation difficulties might be and not to impose any particular discipline.

For example, we treat <RFC>'s which arrive for unattached local sockets as valid and queue them. If desired, an NCP may reject them, as Meyer suggests, or it might hold them for awhile and reject them if they're not soon satisfied. The offered protocol supports all these options.

Another local option is the one mentioned before of attaching multiple ports to a socket. We have shown one-one correspondence but this may be ignored. Similarly, the system calls are merely suggestive.

System Calls​

These are typical system calls which a user process might execute. We show these only for completeness; each site will undoubtedly implement whatever equivalent set is convenient.

We use the notation

        Syscall ( arg , arg ...; val ... )
1 2 1

where

  1. Syscall is the system call

  2. arg₁ etc. are the parameters supplied with the call, and

  3. val₁ etc. are any values returned by the system call.

Init (P,AEN,FS,Bsiz;C)​

  1. P: Specifies a port of the process.

  2. AEN: Specifies a local socket. The user number of this process and host number of this host are implicit.

  3. FS: Specifies a socket with any user number in any host, with any AEN.

  4. Bsiz: Specified the amount of storage in bits the user wants to devote to buffering messages.

  5. C: The condition code returned.

Init attempts to attach the local socket specified by AEN to the port P and to initiate a connection with socket FS. Possible returned values of C are

  1. C = ok: The Init was legal and the socket FS is being contacted. When the connection is established or when FS refuses, the process will receive an event.

  2. C = busy: The local socket was in use by a port on this or some other process with the same user number. No action was taken.

  3. C = homosex: The AEN and FS were either both send or both receive sockets.

  4. C = nohost: The host designated within FS isn't known.

  5. C = bufbig: Bsiz is too large.

Listen (P,AEN,Bsize;C)​

  1. P: Specifies a port of the process.

  2. AEN: Specifies a local socket.

  3. Bsiz: Specified a buffer size.

  4. C: The returned legality code.

Codes for C are

C = ok

C = busy

C = bufbig

The local socket specifies by AEN is attached to P. If there is a waiting call, it is processed; otherwise no action is taken. When a call comes in, a connection will be established and the process notified via an event.

Close (P)​

P Specifies a port of the process.

Any activity is stopped, and the port becomes free for other use.

Transmit (P,M,L1;L2,C)​

  1. P: Specifies port with an open connection.

  2. M: The text to be transmitted.

  3. L1: Specifies the length of the text.

  4. L2: The length actually transmitted.

  5. C: The error code.

Transmission between the processes on either side of the port takes place.

Codes for C are

C = ok

or

  1. C = not open: if no connection is currently open and otherwise uninhibited

Status (P;C)​

The status of port P is returned as C.