| ### The Client/Server Model A useful model for implementing distributed applications is the client/server model. In this model, the distributed application is divided into two parts, one part residing on each of the two computers that will be communicating during the distributed computation (see the following figure). The Client/Server Model The client side of the application is the part that resides on the node that initiates the distributed request and receives the benefit of the service (for example, a workstation that requests that a file be printed). The server side of the application is the part that resides on the node that receives and executes the distributed request (for example, the node with the printer). In this model, two different sets of code are produced: one that runs as a client, the other as a server. The following figure shows a workstation running the client side of a distributed print program, and a print server running the server side of the distributed program. Communication Between the Print Client and Print Server Note that the terms client and server can be seen as relative roles rather than as absolutes. For example, in executing the print request, the print server may in turn become a client in a distributed communication; it may ask the file server to send it a copy of the file to be printed (see the following figure). The Print Server Acting as a Client of the File Server The terms client and server are also used to refer to specific nodes. This can be confusing since a given node, or even a given process, can be acting in both the client and server role. Nevertheless, it is often convenient to use the term file server when referring to the node on which the server side of a distributed file system is running, probably a machine that contains a lot of disk storage. Likewise, the directory server is a node that contains a database with names in it, and answers requests for access to those names. When clarification is needed, we use the term machine to indicate the node rather than the role. For example, in the figure above, the print server, which runs on the print server machine, is acting as a client to the file server. Note that it is possible for more than one server to run on a given node. For example, both a security server and a time server can run on the same machine. In this case, the given node is both the security server machine and the time server machine (see the following figure). Two Servers Running on One Node In general, when referring to clients and servers as nodes, the server nodes are specialized; they require software that is found only on that particular server (for example, the directory server); whereas client nodes are generalized; client machines are typically configured with the capability to be many types of client (for example, a directory, file, and security service client). See the following figure. A Client Is General; Servers Are Specialized The reason client nodes are generalized is that the client code is usually relatively small compared to the code that implements a server, and typically many nodes need to be able to run the client side of an application; whereas only one or two nodes may be equipped to run the server side of an application. One final distinction between client and server: the server is typically implemented as a continuous process (daemon); whereas the client is usually implemented as a library. In other words, the client side of an application consists of a call to a routine that executes (sending the request over the network and receiving the result) and then returns and goes on with whatever else it was doing; whereas the server side of an application is a dedicated process that runs continuously - waiting for a request, executing it and returning the answer, then waiting for the next request, and so on. The following figure illustrates this distinction. Client as a Library; Server as a Continuous Process DCE is based on the client/server model. The DCE services are themselves examples of distributed programs with a client and server side. The basic communications mechanism used in DCE, remote procedure call, assumes the presence of a client and a server. Since DCE applications are built using remote procedure call, they are also based on the client/server model of distributed computation. ###