







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








INRIA, ∗^ B.P. 105, 78153 Le Chesnay Cedex – France, tel.: +33 (1) 39-63-55-
Exact transcription of article from Proc. 6th Int. Conf. on Distributed Computing Systems (ICDCS), Cambridge MA (USA), May 1986, pages 198–204.
Abstract We present a novel view of the structuring of distributed systems, and a few examples of its utilization in an object-oriented context. In a distributed system, the structure of a service or subsystem may be complex, being implemented as a set of communicating server objects; how- ever, this complexity of structure should not be apparent to the client. In our proposal, a client must first acquire a local object, called a proxy, in order to use such a service. The proxy represents the whole set of servers. The client directs all its communication to the proxy. The proxy, and all the objects it represents, collectively form one distributed object, which is not decompos- able by the client. Any higher-level communication protocols are internal to this distributed object. Such a view provides a powerful structuring framework for distributed systems; it can be implemented cheaply without sacrificing much flexibility. It subsumes may previous proposals, but encourages better information-hiding and encapsulation.
Structuring programs into their logical components, and encapsulation (hiding a structure into a single module with a clear, restricted communication interface), are universally considered good programming practice. We consider its application to distributed systems. First, let us consider the situation in a conventional OS like Unix [Ritchie74]. A simple program is a process; within it, structuring and encapsulation may be achieved by using suitable programming techniques and/or languages. A complex program may be written as a collection of communicating processes. The use of distinct processes, in addition to allowing parallel processing, gives structure to a program because each process is totally independent of the other. However, the communication interface between them is clumsy and ambiguous; the semantics of the data in a pipe or a socket is purely a matter of convention between processes, implying that its knowledge is spread throughout the system. This is acceptable in Unix because of the typical life cycle of a program: if some part of it needs to be changed, the program stopped, re-compiled, and run again; if the kernel itself needs to be changed, the machine must be halted and re-booted. In a modern distributed system, the situation should be quite different. Such a system is a collection of distributed services, and runs continuously, even if one of
∗This research was supported in part by the ESPRIT program of the European Community, under contract no. 367, “Secure Open Multimedia Integrated Workstation” (SOMIW).
its machines is halted. New services are continuously being erected, and running ones modified. Communication between remote objects may involve a complex protocol. Connections between objects are subject to continuous change. The conventional approach is no longer satisfactory: for instance, a service might be upgraded; this should not force its clients across the network to be re-compiled or re-linked. There is a need for run-time support for encapsulation, for the definition of clear communication interfaces. The system should help check agreement on the interface and communication protocols, even when these may change over time. Some proposed architectures for distributed systems are extremely flexible but, being low-level designs, provide inadequate structuring tools. Other architectures instead are very high-level, but appear inflexible and expensive to use. It is desir- able to strike a middle ground: to provide structure without sacrificing too much flexibility, at a low implementation cost. The outline of this paper is as follows. First, we present the object-oriented model of computation, and a previously proposed incremental design method, and introduce our proxy concept. The following section gives three significant examples of the utility of the proxy principle. An other section compares our approach to related work, and discusses the various properties of proxies. Finally, we conclude by an assessment of our current proposal, with respect to our goals, and by indicating future directions of research.
Our model of computation is based on the object-oriented approach [Jones79]. A program is a collection of intelligent entities, or objects. An object contains both data (its internal representation) and code. The representation is accessible only by calling the procedures defined in the code, and is not accessible outside of the object. This allows to ensure that some representation invariant holds between calls. The interface of an object is well-defined, being restricted to its procedures.^1 The object model is well adapted to distributed systems, as it allows to abstract processors, processes, services, servers, resources, etc., into one concept. One popu- lar implementation of distributed system, is one where each object is a server process (or a closed group of processes), communicating with other servers by exchanging messages; every message carries an opcode field, containing a conventional constant which identifies a request type [Zimmermann84]. The meaning of the constant is not manifest; its knowledge is spread across all the servers. We advocate, instead, an implementation where objects are passive and communicate through a procedural interface, allowing the use of standard program production tools and the checking of procedure names and types.
Our structuring concepts derive from the design method described in [Hoare79]. Briefly, the first step in a design consists of the specification of a set of naive com- municating objects (in this case, CSP processes [Hoare78]). At each subsequent
(^1) Note that in the literature on object-oriented programming, invoking a procedure of an object is often called “sending a message to the object” [Goldberg83]. This does not imply any asyn- chronous processing; it simply means that a particular procedure name, when applied to different objects, may have a different meaning, as decoded by the object’s manager itself. For instance, the code a+b (also noted a.plus(b)), may be read “send message + to a with argument b.” If a is an integer, this will be interpreted (by the code of a) to mean “add a to b”; or, if a is a set, as “compute the union of a and b.”
Figure 2: A proxy for a distributed service
procedure call, viz. network connections or shared data, is considered unsafe, and is allowed only within a single group. (However, one object may be part of more than one group.) This ensures that any communication with a service is filtered by a valid representative of that service. This turns out to be a very powerful structure. We will illustrate some of its properties by examples in the following chapter, then discuss them more at length in the next one.
We will now present a few examples, to illustrate the use of proxies. These are: Unix-style conventional file access and pipes, and a distributed game. Each example involves the use of application-specific objects, as well as system-defined ones (name service, storage service, communication). We postulate the existence of an object-oriented kernel, supporting object cre- ation and deletion, procedure invocation, and controlled migration of objects be- tween sites. The kernel shall also enforce the properties of proxies, listed in the previous section, namely that a proxy is always local, that unsafe communication may take place only within a group, and that a group is indistinguishible from the proxy which represents it. These properties may be implemented cheaply, e.g. by restricting the visibility of each object to its group(s). Note that, for the kernel, there need not be any difference in nature between a “principal” and a “proxy” (this is just a useful terminology). In the following examples, we use a notation similar to the C language. Invoca- tion of operation y of object x with parameter z will be noted x.y(z).
Our first example will show the structure of conventional (i.e. Unix-style) file access. Although it may be argued that files, viewed as uninterpreted strings of bits, are rendered obsolete by storage of objects, we will use this simple and familiar example. We make no attempt at optimal algorithms, as this is solely an example.
A file is an object, which normally supports operations read, write, dup and close, with the same semantics as the similarly-named Unix primitives. Some files may have additional operations, such as seek for disk and tape files, ring bell for interactive terminals, or connect for sockets.^3
client otherfile
myfile
read
close
dup
read close
read
read
buffers
create
/users/shapiro/sthg
Figure 3: Disk access
Please refer to Figure 3. Suppose we want to access the data named “/users/shapiro/sthg”. One must locate the hardware location corresponding to this name, and start the correct driver for that location. These two steps are accomplished by the following sequence:
file myfile; myfile = nameservice.open(”/users/shapiro/sthg”, ”r”); This causes the nameservice object to invoke its open operation, with the two string parameters indicated. The file location is sought and found. What is returned is an object in charge of that location, with sufficient knowledge to access and use it; this object is migrated and installed in the calling context under the name myfile. This object has the data needed to access the file (location, seek pointer, buffers). If the file is on a local disk, the location information will include inode or block numbers; myfile is actually a driver for the local disk. If the file is remote, the information includes a network address for the remote disk driver; myfile is a network driver. If the name “/users/shapiro/sthg” happens to correspond to a terminal, then the imported myfile is a terminal driver. Suppose now that the file is remote. Execution of int i; char str[100]; i = myfile.read(&str, sizeof(str));
will read up to 100 bytes of file data into the string str. One way of doing this might be to copy buffers from myfile into str. (Thus one use of proxies is better locality; some requests can be answered locally without an expensive access to the remote resource.) If these buffers are empty, a request for data will be sent over the network. (An other use of proxies is as a “stub”, to copy data in and out of network packets [Birrell84].) Any attempt to execute the instruction i = myfile.write(&str, sizeof(str)); will fail; since myfile was opened as a read-only file, it lacks a write entry point. (Thus as stub can act as a “capability” protecting a resource. Here the file data is totally protected against writing by the lack of a write procedure.) The following sequence: (^3) Note that the operation open(pathname) is not an operation on files; it is an operation on the name service which returns the object stored under the specified pathname. This may or may not happen to be a file of one type or an other.
simplest construction is shown in Figure 5b. The read proxy reproduces the same procedural interface (read, dup, close, alpha, omega) as its principal, and simply relays every call to the other site. Setting up the network pipe involves the following steps: (1) create a local pipe with pipeserver.pipe() which returns two file-like objects, readpipe and writepipe; (2) give away a handle to the read end by executing readpipe.export(X); this in turn will look up an object to do the remote procedure calls, and instantiate it on the site of X. A proxy which simply reproduces its principal’s interface, a “remote procedure call object” (similar to Birrell and Nelson’s stubs [Birrell84]) is generally useful; it will be one of a library of generic communication objects to be supplied with such a system. A remote procedure call proxy is parameterized by the names and types of the procedures it represents; these must be checked either when the proxy is bound to the client or when it is called. When such an object is called, it must send and re-create the argument stack on the called machine; invoke the correct procedure; and return the results and modified stack to the caller. Appropriate time-outs must be set, in case of lost packets, which must be retransmitted [Birrell84].
In this section, we will present the structure of a hypothetical distributed game, along the line of Amaze [Berglund84]. This example uses a different proxy structure than the others, and shows the usefulness of the become primitive. The game is a starship pursuit; each player has her own starship. A player may join or leave a game at any time. Once the game is joined, her commands are restricted to launching only one starship or quitting; and once launched, to changing its direction or speed (faster, slower, left, right), firing shells straight ahead (fire), and leaving the game (close). A shell, once fired, continues in a straight line until it encounters a starship or another shell. The same is true for a starship, unless its owner changes its direction or speed. When a starship encounters a shell (or another starship), they are both destroyed, but the starship owner is given a chance to launch a new ship from her base.
comndinter− preter
move local DB
Paul Mary
move
John
move
move display
inter−comnd preter
local move DB
John Paul
move
Mary
move
display move
Paul
move
Fig. 6a Distributed Game with Proxies
comnd inter− preter
move
display
move Game
comnd inter− preter
move
display
move Game
Mary
Paul
Fig. 6a Distributed Game Object
John
distributed Game
Figure 6 illustrates the structure of the game with three players, Paul, John and Mary. Each player program maintains a database of the locations, directions and velocities of all pieces (spaceships and shells); the contents of the database are displayed graphically on the screen. At every clock tick, the position of every piece is re-computed from its previous position and momentum. As long as no player takes a move, no network traffic is generated; each site computes the new position of all the pieces using only local information. When a player does move, the new
absolute coordinates and velocity of its piece is sent to all the other players, whose database is updated accordingly. One possible structure is proposed in Fig. 6a; this is a straightforward extension of the previous examples. Each player program carries a proxy for every other player. This structure is clumsy. Moves are sent to (the proxy of) each opponent in turn, precluding broadcasting. The player can communicate only its move, i.e. acceleration, to the others, and not absolute co-ordinates and momentum. In these conditions, the different databases might rapidly become inconsistent with each other, due to variable network delays and lost messages. A better solution is proposed in Fig. 6b. Here it is recognized that the Game is in fact one distributed object, represented locally by the database. All moves (both of the owner, John, and of his opponents, Mary and Paul) are sent to Game. It is now possible to broadcast interesting information to all the players. Exchang- ing absolute information is possible. Since all network communication takes place within the Game group, an efficient ad-hoc communication protocol may be used. It is interesting to consider starting a new game, and joining and leaving an ongoing game. To start a game, the first player, John, instantiates a Game object (from the program library). As part of initialization, this will register a proxy for it with the name service. Mary, who wishes to play too, will look it up, and instantiate it as her own proxy for the Game. The “joining” proxy has a very restricted interface, just enough to get the information to decide to accept her or not (possibly asking John for advice). When Mary is accepted, John’s site enters her into the database, and makes a copy of the database, which is sent to Mary’s machine. The joining proxy installs the database copy, and does a become; it is replaced and the variable Game now denotes (for Mary) the up-to-date database with its full interface for doing all the moves. In order to leave the game, Mary simply closes her Game. The omega procedure will broadcast this information to the other sites, before closing up shop. Care must be taken to remove the entry for the joining proxy in the name service when the last player leaves the game, and the game group is terminated. This will not work if the group is terminated by a failure. This example illustrates a few more uses of proxies. Access control (“capability”) is performed by the “joining” proxy. No access is allowed until the “joining” proxy has verified Mary’s rights (possibly by asking John); when this is done, the “joining” proxy replaces itself with a full-fledged Game. At his point, no more access control is necessary. Since network messages can only come from partners in the group, it is possible to use an ad-hoc, efficient encoding of messages (it is not necessary to use a general- purpose data encoding). It is not necessary either to check the rights of the sender, since they have already been tested by the sending proxy. The communication protocol is entirely encapsulated within the distributed Game group. Finally, there is the question of protocol agreement. The approach taken in this example is that it is not necessary to check that the partners in a distributed communication protocol agree on a common protocol: since all partners in the game are proxies of the same generation (all created by copying the same initial object) there is no need to check protocol. However, this approach is insufficient to cope with failures.
agreement. Other authors propose the separation of communication from the part- ners in the communication, e.g. the activity messages of [Banino85] or circulating tasks of [Betourne85], where the knowledge of a protocol is centralized in an ac- tive object, circulating between the partners; or the Scripts of [Francez83], i.e. the abstraction of a distributed communication described as a series of roles, to which actual processes enroll. We plan to develop research along these lines, interpreting a protocol as an object.
Many existing systems may be classified as low-level, promoting flexibility by offer- ing primitive, unstructured communication; for instance Chorus [Zimmermann84], the V-System [Cheriton84] and Accent [Rashid81]. Although in Chorus and the V-System it is possible to broadcast a message to a group of entities [Cheriton85], the address space is flat and there is no simple way to hide the functionality of a subsystem behind a black-box boundary. Communication is unstructured and there is no way to verify that communicating entities are actually using the same protocol. In the high-level system Argus [Liskov83], on the contrary, protocol agreement is not an issue: the only communication primitive, the “remote procedure call within an atomic action” ensures that a transaction will either terminate correctly without failures and without any interference by concurrent transactions, or will not take place at all. There is a price to pay for this generality of mechanism, which is loss of potential concurrency, and high complexity of the support system. Every application will pay the price, even if it didn’t need the full generality of atomic transactions. We wish to strike a desirable middle ground: enough flexibility to allow many applications and satisfy the operating system builder; and sufficient control to al- low the use of atomic transactions (with only its users paying the price). Hence the provision of subsystems represented by a local proxy with a clear, restricted interface. The idea of using a local representative for a remote service is nothing new. For instance, even though Chorus is a message-based system, a library of (hand- built) procedures, to be bound with the client at link-edit time, gives a procedural interface to services. Accent’s Matchmaker [Wri82] builds a similar procedural library automatically from the service specification. Closer to the preoccupations of this article, LeBlanc [LeBlanc85] advocates the hierarchical composition of processes. In his proposal, a program is a set of pro- cesses connected by anonymous communication channels. The output of one process is connected to the input of another by an overseeing process. Any collection of connected processes may be encapsulated by a boundary, forming a new process. The interface to the new process is given by the unconnected channels of its com- ponents. He gives the example of a distributed file system, for which there is a local representative on each processor. The proposal most similar to ours is Nelson’s [Nelson81]. He proposes a client- service structure within a flat address space. The link between clients and services is accomplished by so-called “stubs” which give a local procedural interface to the (possibly remote) service. A stub does “marshalling”, i.e. stuffs data into packets, and performs the remote call, setting up time-outs and retransmitting packets when necessary. Stubs are brought in at link-edit time or at run time; importing of stubs is controlled by a special configuration language. The system checks that a stub imported at run-time conforms to its compile-time declaration, by checking a timestamp which is incremented every time the service is re-compiled. The normal way of creating a stub is by invoking the “stub translator” at compile time; this
program automatically translates the interface specifications of the service into a conforming stub program. Nelson notes that arbitrary code might be included in a stub by writing it by hand (instead of invoking the translator), allowing access controls for instance; however he gives no examples of this. What sets our proposal apart from previous ones is our insistence that all access to any subsystem must be mediated by procedure calls to a proxy. To ensure this, the underlying kernel simply checks that any other form of communication takes place only within a single distributed object group. (We have devised a very simple and efficient implementation of this property.) A proxy is created dynamically by the subsystem it represents, and is bound dynamically to the client. This implies some form of dynamic link-editing, as well as checking that the proxy, imported at run time, conforms to its interface declared at compile time.
We have proposed to structure a distributed system as a set of services or subsys- tems, each of which may be made of a number of communicating objects across the network. The interface of any client to any such subsystem is a local proxy. The system ensures that all access must go through a proxy; this allows the subsystem components to be confident that the messages it receives are correct. The proxy subsumes and generalizes many previous proposals: ports, stubs, capabilities. It is more complex but provides more structure than a simple broadcasting facility like process groups. Since proxies are imported at the time of use, and may be (with some care) replaced while running, a service may be changed without having to stop the whole systsem. The proxy principle gives better facilities for structuring and encapsulation than previous low-level proposals, while allowing more flexibility than the high-level ones. The proxy-based structure also takes one step towards allowing agreement on pro- tocol by ensuring that only agreeing partners may communicate. However, the view taken in this paper is too simple-minded to cope with failures. Future work planned includes: the implementation of an object kernel support- ing the properties listed here, and building an object-oriented operating system based on the proxy principle (currently in progress); work on tools for writing and importing proxies; and developping protocol agreement, including reliable protocols, through the use of a library of communication objects, along the lines of activity messages [Banino85] and Scripts [Francez83].
[Banino85] J.-S. Banino, G. Morisset, M. Rozier, “Controlling Distributed Processing with Chorus Activity Messages”, Proc. 18th Hawaii Conf. on Syst. Science (Jan. 85).
[Berglund84] E.J. Berglund, D.R. Cheriton, “Amaze: a Distributed Multi- Player Game Program Using the Distributed V Kernel”, Proc. 4th. Int. Conf. on Dist. Computing Syst., San Francisco CA (May 84).
[Betourne85] C. Betourne, M. Filali, G. Padiou, A. Sayah, “Distributed Control Through Task Migration via Abstract Networks”, Proc. 5th Int. Conf. on Dist. Computing Syst., Denver CO (May 85).
[Birrell84] A.D. Birrell, B.J. Nelson, “Implementing Remote Procedure Calls”, ACM Trans. on Comp. Syst., vol. 2 no. 1 (Feb. 84).
[Zimmermann84] H. Zimmermann, M. Guillemont, G. Morisset, J.-S. Banino, “Chorus: a Communication and Processing Architecture for Dis- tributed Systems,” Rapport de Recherche no. 328, INRIA, Roc- quencourt (Sept. 84).