1、CHAPTER 1 PROBLEMS 1. Q: What is the role of middleware in a distributed system?A: To enhance the distribution transparency that is missing in network operating systems. In other words, middleware aims at improving the single-system view that a distributed system should have.2. Q: Explain what is me
2、ant by (distribution) transparency, and give examples of different types of transparency.A: Distribution transparency is the phenomenon by which distribution aspects in a system are hidden from users and applications. Examples include access transparency, location transparency, migration transparenc
3、y, relocation transparency,replication transparency, concurrency transparency, failure transparency, and persistence transparency.3. Q: Why is it sometimes so hard to hide the occurrence and recovery from failures in a distributed system?A: It is generally impossible to detect whether a server is ac
4、tually down, or that it is simply slow in responding. Consequently, a system may have to report that a service is not available, although, in fact, the server is just slow.4. Q: Why is it not always a good idea to aim at implementing the highest degree of transparency possible?A: Aiming at the highe
5、st degree of transparency may lead to a considerable loss of performance that users are not willing to accept.5. Q: What is an open distributed system and what benefits does openness provide?A: An open distributed system offers services according to clearly defined rules. An open system is capable o
6、f easily interoperating with other open systems but also allows applications to be easily ported between different implementationsof the same system.6. Q: Describe precisely what is meant by a scalable system.A: A system is scalable with respect to either its number of components, geographical size,
7、 or number and size of administrative domains, if it can grow in one or more of these dimensions without an unacceptable loss of performance.7. Q: Scalability can be achieved by applying different techniques. What are these techniques?A: Scaling can be achieved through distribution, replication, and
8、 caching.8. Q: What is the difference between a multiprocessor and a multicomputer?A: In a multiprocessor, the CPUs have access to a shared main memory. There is no shared memory in multicomputer systems. In a multicomputer system, the CPUs can communicate only through message passing.9. Q: A multic
9、omputer with 256 CPUs is organized as a 16 16 grid. What is the worst-case delay (in hops) that a message might have to take?A: Assuming that routing is optimal, the longest optimal route is from one corner of the grid to the opposite corner. The length of this route is 30 hops. If the end processor
10、s in a single row or column are connected to each other, the length becomes 15.10. Q: Now consider a 256-CPU hypercube. What is the worst-case delay here, again in hops?A: With a 256-CPU hypercube, each node has a binary address, from 00000000 to 11111111. A hop from one machine to another always in
11、volves changing a single bit in the address. Thus from 00000000 to 00000001 is one hop. From there to 00000011 is another hop. In all, eight hops are needed.11. Q: What is the difference between a distributed operating system and a network operating system?A: A distributed operating system manages m
12、ultiprocessors and homogeneous multicomputers. A network operating system connects different independent computers that each have their own operating system so that users can easily use the services available on each computer.12. Q: Explain how microkernels can be used to organize an operating syste
13、m in a client-server fashion.A: A microkernel can separate client applications from operating system services by enforcing each request to pass through the kernel. As a consequence, operating system services can be implemented by (perhaps different) userlevel servers that run as ordinary processes.
14、If the microkernel has networking capabilities, there is also no principal objection in placing those servers onremote machines (which run the same microkernel).13. Q: Explain the principal operation of a page-based distributed shared memory system.A: Page-based DSM makes use of the virtual memory c
15、apabilities of an operating system. Whenever an application addresses a memory location that is currently not mapped into the current physical memory, a page fault occurs, giving the operating system control. The operating system can then locate the referred page, transfer its content over the netwo
16、rk, and map it to physicalmemory. At that point, the application can continue.14. Q: What is the reason for developing distributed shared memory systems?What do you see as the main problem hindering efficient implementations?A: The main reason is that writing parallel and distributed programs based
17、on message-passing primitives is much harder than being able to use shared memory for communication. Efficiency of DSM systems is hindered by the fact, no matter what you do, page transfers across the network need to take place. If pages are shared by different processors, it is quite easy to get in
18、to a state similar to thrashing in virtual memory systems. In the end, DSM systems can never be faster than message-passing solutions, and will generallybe slower due to the overhead incurred by keeping track of where pages are.15. Q: Explain what false sharing is in distributed shared memory system
19、s. What possible solutions do you see?A: False sharing happens when data belonging to two different and independent processes (possibly on different machines) are mapped onto the same logical page. The effect is that the page is swapped between the two processes, leading to an implicit and unnecessa
20、ry dependency. Solutions include making pages smaller or prohibiting independent processes to share apage.16. Q: An experimental file server is up 3/4 of the time and down 1/4 of the time, due to bugs. How many times does this file server have to be replicated to give an availability of at least 99%
21、?A: With k being the number of servers, we have that (1/4)k#include #define MAX3OBJECTS 100#define NULL 0#define ANY 1METHOD3CALL invokeMAX3OBJECTS; /* array of pointers to stubs */THREAD *root; /* demultiplexer thread */THREAD *adapter3thread /* thread that runs single3thread*/void single3thread(lo
22、ng object3id) message *req, *res; /* request/response message*/unsigned size; /* size of messages */char *results; /* array with all results*/while(TRUE) get3msg( /* block for invocation request */* Pass request to the appropriate stub. The stub is assumed to */* allocate memory for storing the resu
23、lts. */(invokereq-object 3id*)(req-size, req-data, res = malloc(sizeof(message)+size); /* create response message */res-object3id = object3id; /* identify object */res-method3id = req.method3id; /* identify method */res-size = size; /* set size of invocation results */memcpy(res-data, results, size)
24、; /* copy results into response */put3msg(root, sizeof(res), res); /* append response to buffer */free(req); /* free memory of request */free(*results); /* free memory of results*/void invoke3adapter(long oid, message *request) put3msg(adapter3thread, sizeof(request), request);14. Q: Is a server tha
25、t maintains a TCP/IP connection to a client stateful or stateless?A: Assuming the server maintains no other information on that client, one could justifiably argue that the server is stateless. The issue is that not the server, but the transport layer at the server maintains state on the client. Wha
26、t the local operating systems keep track of is, in principle, of no concern to the server.15. Q: Imagine a Web server that maintains a table in which client IP addresses are mapped to the most recently accessed Web pages. When a client connects to the server, the server looks up the client in its ta
27、ble, and if found, returns the registered page. Is this server stateful or stateless?A: It can be strongly argued that this is a stateless server. The important issue with stateless designs is not if any information is maintained by the server on its clients, but rather how accurate that information
28、 has to be. In this example, if the table is lost for what ever reason, the client and server can still properly interact as if nothing happened. In a stateful design, such an interaction would be possible only after the server had recovered from a possible fault.16. Q: To what extent does Java RMI
29、rely on code migration?A: Considering that object references are actually portable proxies, each time an object reference is passed, we are actually migrating code across the network. Fortunately, proxies have no execution state, so that support for simple weak mobility is all that is needed.17. Q:
30、Strong mobility in UNIX systems could be supported by allowing a process to fork a child on a remote machine. Explain how this would work.A: Forking in UNIX means that a complete image of the parent is copied to the child, meaning that the child continues just after the call to fork. A similar appro
31、ach could be used for remote cloning, provided the target platform is exactly the same as where the parent is executing. The first step is to have the target operating system reserve resources and create the appropriate process and memory map for the new child process. After this is done, the parent
32、s image (in memory) can be copied, and the child can be activated. (It shouldbe clear that we are ignoring several important details here.)18. Q: In Fig. 3-13 it is suggested that strong mobility cannot be combined with executing migrated code in a target process. Give a counterexample.A: If strong
33、mobility takes place through thread migration, it should be possible to have a migrated thread be executed in the context of the target process.19. Q: Consider a process P that requires access to file F which is locally available on the machine where P is currently running. When P moves to another m
34、achine, it still requires access to F. If the file-to-machine binding is fixed, how could the systemwide reference to F be implemented?A: A simple solution is to create a separate process Q that handles remote requests for F. Process P is offered the same interface to F as before, for example in the
35、 form of a proxy. Effectively, process Q operates as a file server.20. Q: Each agent in DAgents is implemented by a separate process. Agents can communicate primarily through shared files and by means of message passing. Files cannot be transferred across machine boundaries. In terms of the mobility
36、 framework given in Sec. 3.4, which parts of an agents state, as given in Fig. 3-19, comprise the resource segment?A: The resource segment contains all references to local and global resources. As such, it consists of those variables that refer to other agents, local files, and so on. In DAgents, th
37、ese variables are primarily contained in the part consisting of global program variables. What makes matters simple, is that virtually all resources in DAgents are nontransferrable. Only agents can move betweeen machines. Because agents are already named by global references, namely an (address, loc
38、al-id) pair, transforming references to resources in the presence of migration is relatively simple in DAgents.21. Q: Compare the architecture of DAgents with that of an agent platform in the FIPA model.A: The main distinction between the two is that DAgents does not really have a separate directory
39、 service. Instead, it offers only a low-level naming service by which agents can be globally referenced. The management component in the FIPA architecture corresponds to the server in DAgents, whereas the ACC is implemented by the communication layer. The FIPA model provides no further details on th
40、e architecture of an agent, in contrast to DAgents.22. Q: Where do agent communication languages (ACLs) fit into the OSI model?A: Such languages are part of the application layer.23. Q: Where does an agent communication language fit into the OSI model, when it is implemented on top of a system for h
41、andling e-mail, such as in DAgents? What is the benefit of such an approach?A: It would still be part of the application layer. An important reason for implementing ACLs on top of e-mail, is simplicity. A complete, worldwide communicaton infrastructure is available for handling asynchronous message-
42、passing between agents. Essentially, such an approach comes close to message-queuing systems discussed in Chap. 2.24. Q: Why is it often necessary to specify the ontology in an ACL message?A: In this context, an ontology can best be interpreted as a reference to a standard interpretation of the actu
43、al data contained in an ACL message. Usually, data in message-passing systems is assumed to be correctly interpreted by the sender and receiver of a message. Agents are often considered to be highly independent from each other. Therefore, it can not always be assumed that the receiving side will int
44、erpret the transferred data correctly. Of course, it is necessary that there is common agreement on the interpretation of the ontology field.SOLUTIONS TO CHAPTER 4 PROBLEMS1. Q: Give an example of where an address of an entity E needs to be further resolved into another address to actually access E.
45、A: IP addresses in the Internet are used to address hosts. However, to access a host, its IP address needs to be resolved to, for example, an Ethernet address.2. Q: Would you consider a URL such as http:/www.acme.org/index.html to be location independent? What about http:/www.acme.nl/index.html?A: B
46、oth names can be location independent, although the first one gives fewer hints on the location of the named entity. Location independent means that the name of the entity is independent of its address. By just considering a name, nothing can be said about the address of the associated entity.3. Q:
47、Give some examples of true identifiers.A: Examples are ISBN numbers for books, identification numbers for software and hardware products, employee numbers within a single organization, and Ethernet addresses (although some addresses are used to identify a machine instead of just the Ethernet board).
48、4. Q: How is a mounting point looked up in most UNIX systems?A: By means of a mount table that contains an entry pointing to the mount point. This means that when a mounting point is to be looked up, we need to go through the mount table to see which entry matches a given mount point.5. Q: Jade is a
49、 distributed file system that uses per-user name spaces (see In other words, each user has his own, private name space. Can names from such name spaces be used to share resources between two different users?A: Yes, provided names in the per-user name spaces can be resolved to names in a shared, global name space. For example, two identical names in different name spaces are, in principle, completely independent and may refer to different entities. To share entities, it is necessary to refer to them by names from a shared name space. For example, Jade relies