The DCCS Implementation
The DCCS will initially be described on a network of CCS systems. We will assume that there exists a network capability:
8. Network Capability
a. "Input"; > Host no., message;
b. "Output", Host no., message > ;
It is assumed that the "Output" invocation returns immediately after queuing the message for output and that the "input" invocation waits until message is available.
For pedagogical purposes, the description of the DCCS will be broken into two parts. First a brief overview of the important mechanisms will be given. The overview will gloss over some important issues that will be resolved individually in the more complete description that follows the overview.
The intent of the DCCS is to allow capabilities on one host to be referenced by processes on other hosts having the appropriate capabilities. To do this, each host keeps a list of capabilities that it supports for use by other hosts. Each host also supports a server, which gives out requestors that are made to appear as if they were the corresponding capability supported by the remote host. When one of these emulated requestors is invoked, its parameters are passed by the emulating host through the network to the supporting host. The supporting host then sees to it that the proper capability is invoked and passed the parameters. When the invoked parameters are passed back through the network to the emulating host. The emulating host then returns the return parameters to the requesting process.
For example, let us take the "Read" request on a file diagrammed in figure 4. When the emulated file (a requestor) is invoked, the emulating process receives "invoke", requestor number, PD; request. The requestor number that is returned is actually a descriptor consisting of two numbers: Host number, capability number. These descriptors are called Remote Capability Descriptors (RCDs). An RCD identifies a host and a capability in the list of capabilities supported by that host. After receiving a request, the emulating process reads the parameters passed by the requesting process and sends them along with the Parameters Descriptor to the remote host in an "invoke" message.
When the remote host receives this information, it passes the parameters to the supported file capability by invoking it and specifies the proper return parameters as noted in the Parameter Descriptor. When the invoked file return parameters, the returned data is passed back through the network to the emulating host in a "Return" message. The returned data is then returned to the requesting process by performing a "Return" invocation on the request capability initially received by the emulating host. When the requesting process is awakened by the return, it will appear to it exactly as if a local file had been invoked.
This works fine when the parameters being passed and returned consist simply of information, but what happens when there are capabilities involved? In this case the routines use the existing remote capability access mechanism and pass the appropriate descriptor. As an example, the "Take" invocation on a directory is diagrammed in figure 5. The only essential difference is the fact that a capability has to be returned. When the capability is returned by the invoked directory (or whatever it really is), the supporting host allocates a new slot in its supported capability list for the capability and returns a new descriptor to the emulating host. When the emulating host receives the descriptor, it creates a new requestor with the returned descriptor as its requestor number and returns the requestor to the invoking process. The requestor so returned acts as the capability taken from the remotely accessed directory and can be invoked exactly as if were the real capability.
One important thing to notice about this mechanism is that neither the emulating host nor the supporting host need to have any idea what kind of capabilities they are supporting. The mechanism is independent of their type. Also important is the fact that neither host need trust the other host with anything more than the capabilities that it has been rightfully granted. Even the DCCS processes themselves need only be trusted with the network capabilities and with the supported capabilities. Finally, note that no secret passwords which might be disclosed are needed for security. The DCCS directly extends the CCS protection mechanisms,
A more complete description of the DCCS will now be given. To avoid unnecessary complication, however, several issues such as error indications, system restart and recovery, network malfunctions, message size limitations, resource problems, etc. are not discussed. These issues are not unique to the DCCS and their solutions are not pertinent here.
As noted earlier, the complete DCCS must address several issues that were glossed over in the initial overview. As these issues are discussed, several message types are introduced beyond the "Invoke" and "Return" messages discussed in the overview. The formats for all the DCCS messages are summarized in figure 6.
A. Timing -
Invocations can take a very long time to complete. We saw an example in the semaphore capability earlier. An even more graphic example might be a clock capability that was requested to return nothing AFTER 100 years had passed. Clearly we don't want to have the emulating process wait until it receives a "Return" message from the remote host before servicing more invocations.
What is done in the emulating host is to add the request capability to a list of pending requests after sending the "invoke" message to the supporting host (this is somewhat like the semaphore example earlier). The emulator can then go back and wait for more local requests.
There is a similar problem on the supporting side. We don't want the process waiting on the network input capability to simply invoke the supported capability and wait for return. What it must do is to set up an invocation process to actually invoke the supported capability so that pending network input can be promptly serviced. The invoking process must then return the parameters after it receives them.
These additional mechanisms add complication of multiple requests active between hosts. These requests are identified by a Remote Request Number (RRN). The RRN is an index into the list of pending requests.
B. Loops -
If host A passes a capability to host B, and B is requested to pass the requestor that is being used to emulate the capability back to host A, should B simply add the requestor to its support list and allow A to access it remotely? If it did, when the new requestor was invoked on A, the parameters would be passed to B where they would be passed to the requestor by the invoking process. Invoking the requestor would cause the parameters to be passed back through the network to A where the real capability would finally be invoked. Then the return parameters would have to go through the reverse procedure to get back A via B. This is clearly not an optimal mechanism,
The solution to this problem makes use of the "My requestor?" invocation on a server capability described in 5b. When B checks a capability that is to be returned to A with the "My requestor?" invocation and finds that the capability is one of its requestors with a requestor number indicating that it is supported on A, it can simply return the requestor number (recall that is this is really a Remote Capability Descriptor, RCD) to A, containing the fact that the capability specified is one that is local to A and giving A the index to the capability in its supported capability list.
C. Security
The mechanism presented in B. brings up something of a security issue. If B. tries to invoke a capability in A's supported list, should A allow B access without question? If it did, any host on the network could maliciously invoke any capability supported by any other host. To allow access only if it has been granted through the standard invocation mechanism, each host can maintain a bit vector indicating which hosts have access to a given capability. If a host does receive an invalid request, it is an error condition.
D. Indirection
There is an additional twist on a Loop problem noted in B.. This variation comes up when A passes a capability to B who then wants to pass it to C. Here again B may unambiguously specify which capability is to be passed by simply sending the Remote Capability Descriptor (RCD) that is knows it by. The RCD indicates that the capability, however, A would probably not believe that C should have access to it.
B must tell A. "1, who have access to your 1'th capability, want to grant it to host C". To do this, another message type is used. The "Give" message specifies the supported capability and the host that it should be given to (refer to figure 6). Here again, giving away a capability that you don't have is an error condition.
E. Acknowledgement -
There is one last problem with the "Give" message. If B sends the "Give" message to A and then continues to send the Remote Capability Descriptor (RCD) to C, C may try to use the RCD before the "Give" is received by A. For this reason, B must wait until A has "ACK"nowledged the "Give" message before sending the RCD to C. This mechanism requires that hosts queue un"ACK"nowledged "Give"s. The format for an "ACK" is given in figure 6. This queueing may be avoided for most "Give"s after the first for a given RCD, but only at the cost of much additional memory and broadcasting "Delete"s (See F. below).
F. Deletion -
If all the requestors on A for a given capability supported on B are deleted. A may tell B so that B may:
a. Delete A's validation bit in the bit vector for the specified capability and
b. If there are no hosts left that require support of the given capability, the capability may be deleted from the supported capability list.
This function requires a new "Delete" message.
Figure 6 is a summary of the message formats. Figure7-11 flow chart the complete DCCS. In the flow charts, abbreviations are used to indicates the directories:
CSL - Capability Support List
RRL - Remote Request List
IPL - Invocation Process List
The table manipulation is not given in detail. Three tables are needed. The first is associated with the CSL and contains the bit vectors indicating access as noted in C. above. The second table is associated with the RRL. It contains a host number for each active request. An attempted return on a request by a host other that the requested host is an error. The final table is a message buffer containing the pending "Invoke" and "Return" requests.
In order to avoid hazards in referencing the CSL and its table, a semaphore called the CSLS is used. A message buffer semaphore, MBS, is similarly used to lock the message buffer. For the RRL and IPL no locks are needed with the algorithms given.