University Of Limerick by yaoyufang

VIEWS: 2 PAGES: 8

									                                          Sample Answers
                   CE4208 Distributed Computing AY2002 Exam Paper



This document contains sample/model answers to the AY2002 paper. Please note the following:


       1. These are not necessarily the questions/marks that appeared on the final paper
       2. The answers may be incomplete or vague, and may not be completely correct
       3. These answers are not necessarily the only valid answer, many questions look for an
          understanding of the issues and a reasoned approach to solving any problem given.
       4. Examinable material differs from year to year




                                ANSWERS




v1.3                                            Page 1 of 8
CE4208 Distributed Systems - Spring 2002                      ANSWERS

                                              Question 1
                                                                                            Mar
                                                                                             ks
  a    An experimental file server is up ¾ of the time and down ¼ due to bugs. How          (5)
  )    many times does the file server have to be replicated to ensure an availability of
       at least 99%.
       With k being the number of servers we have (1/4)k < 0.1 this should happen at
       most 1/100 of the time. This gives k = 4.
  b    The ultimate goal of a distributed system is complete transparency, when             (6)
  )    compared non-distributed system. Give two reasons, with examples, why this is
       not achievable.
       Many reasons two include. (1) Timely response mouse click handled remotely
       would be noticeable. (2) Fault tolerance network failure present a new
       dimension of problem that did not exist before.
  c    The C programming language has a union construct, in which a field of a              (5)
  )    structure can hold one of several alternatives. Does this present a problem if the
       structure is being passed as a parameter in an RPC? Explain.
       It does, as the receiving system does not know how to treat the field (e.g. text
       field vs floating point number in a particular format). The type of the field
       needs to be identified in a separate variable (tag) and used to trigger the
       appropriate de-marshalling routine in the server stub.
  d    Is a server that maintains a TCP/IP connection to a client stateful or stateless?    (5)
  )    Explain.
       TCP is a stateful connection as once it is opened state is reserved at both ends
       and it is treated. Bur the server could be either stateful or stateless depending
       on the implementation.
  e    Name three sources of delay that can be introduced between a short wave radio        (6)
  )    transmitting UTC and the processors on a distributed system that have to set
       their internal clocks.
       Propagation delays, delays in process the interrupt at the OS level, delays in
       activating the process that will process the message and modify the clock,
       delays on the local network etc.
  f    Explain how replication in DNS takes place and why it works so well?                 (5)
  )    Name servers cache previously lookup results which can remain in the cache
       for a long time as the name to DNS mapping changes infrequently.
  g    The following code removes a name from a remote context e.g. a remote                (6)
  )    directory.
             while (true) {
                try {
                   context->remove(name);
                   break;
                }
                catch(NotFoundInContext) {
                   break;

v1.3                                       Page 2 of 8
CE4208 Distributed Systems - Spring 2002                    ANSWERS

                 }
                 catch(NetworkServerFailure) {
                    continue;
                 }
             }
       Comment on the code and its performance in the light of network and server
       failures.
       The fact that this code busy waits on network server failures is a problem. If
       the network partitions the name may have been removed by another process an
       re-installed. It would thus, wrongly, be removed again when the network re-
       connects.
  h    The paper Mobile Agents: Motivation and state of the art systems by Robert        (12
  )    Gray et al, discussed six strengths of Mobile Agents. Select the four strengths     )
       you found the most compelling. Justify your choice and briefly discuss each of
       the four.
       The six strengths are:
       Conservation of bandwidth
       Reduction in total completion time
       Reduction in latency
       Disconnected operation and mobile computing
       Load balancing
       Dynamic deployment
                                                                                 Total   50




v1.3                                        Page 3 of 8
CE4208 Distributed Systems - Spring 2002                          ANSWERS

Question 2
                                                                                                     Mar
                                                                                                      ks
  a    Describe the steps involved in making a remote procedure call from a client                   (10
  )    process to a server process. Assume the client and servers are on different                     )
       computers and that the hardware architectures are different. Highlight the
       different processes that are involved, typical function calls, typical message
       formats and any data and naming transformations that may be necessary.
       Assume the client has all the information necessary to locate the server process
       (see part (b) below).
             1. Client first calls the client stub as if it is making a regular procedure call
             2. The stub takes the parameters and marshals them into a packet for
                 transmission it include the interface id (UUID), the method offset
                 (instead of the name which might be mangled), the format of the
                 parameters and the parameters themselves.
             3.The stub then calls the client communications runtime with the request
                message, destination address, protocol to be used and port number. It
                then blocks the thread waiting for the response.
             4. The request message arrives at the server. And gets delivered to the
                 process handling that ports traffic.
             5. The server process created a thread to handle the message. The message
                 gets partially processed e.g. the procedure to be called gets extracted
                 and gets passed to the appropriate server stub to process the method.
             6. The parameters get unmarshalled and a call is made to the user written
                 routime.
             7. The process is then reversed with the response packet being sent back to
                 the client.
  b    Briefly, describe the steps involved in order for a just booted client system to              (7)
  )    locate a generic service (e.g. telephone directory lookup service) to make its
       first remote procedure call. Assume the client system has no built-in knowledge
       on the location of services. Clearly state any assumptions you make regarding
       built in knowledge that the client has, for the purposes of this question these
       should be minimal.
       Client broadcasts a message to request the global location broker to contact it (with its
       address + portn)
       Client sends message to glb asking where it can find the interface it needs.
       Glb responds with a list of machines that can satisfy the request, together with the local
       location broker (llb) port number
       Client picks a server and send a request to the llb for the port number that the service is
       listening on.
       Finally the client makes the request to the server and caches the handle.


  c    Two processes in a distributed system simultaneously detect the demise of the                 (8)
  )    co-ordinator and both decide to hold an election using the token ring algorithm.
       Describe, using diagrams as necessary, the election process, include a

v1.3                                          Page 4 of 8
CE4208 Distributed Systems - Spring 2002                   ANSWERS

       description of the messages and any optimisations that can be made.
       Both create an election message and send it from successor to successor
       bypassing processes that are down. Each process puts its ID into the message
       and eventually the message arrives at the original sender with a complete list
       of active processes. The process then selects the new coordinator using a well
       known algorithm (e.g. largest process id). Each process holding an election
       will arrive at the same decision. Optimisations include only putting process
       into the messages if it is larger than the one already there – reduces message
       size. Having processes remove election messages if they have a higher process
       id than the originator and are holding an election themselves.
                                                                               Total    25




v1.3                                     Page 5 of 8
CE4208 Distributed Systems - Spring 2002                      ANSWERS



Question 3
                                                                                            Mar
                                                                                             ks
  a    Briefly compare the Sun Network File System and the Coda system found on             (9)
  )    many Linux implementations by discussing what you consider to be the three
       most significant differences.
       Many differences:
       Statefull vs stateless
       Single global view vs arbitary mounting or remote systems
       Security
       Disconnection from network
  b    Describe what is meant by Unix semantics as they relate to file sharing and          (4)
  )    explain why it is difficult for distributed systems to support this mode of file
       sharing.
       Unix semantics mean that changes to a file are immediately visible to all
       processes. This works well on a single system but not on a distributed system
       as it is highly likely that caches of files or part of files will exist.
  c    The Byzantine generals problem is used to model systems with faulty processes        (12
  )    and reliable communication. Illustrate how it works on a system of 4 processes         )
       with one process faulty? Does it work on a system with 9 processes of which
       three are faulty? Justify your answer




       It does not work with 3 faulty process out of 9 an Lamport proved that in order
       to work there must be number of correct processes must the twice the number
       of faulty processes plus 1 i.e. 7 correct processes in this example.
                                                                                    Total   25




v1.3                                       Page 6 of 8
CE4208 Distributed Systems - Spring 2002                    ANSWERS


Question 4
                                                                                          Mar
                                                                                           ks
  a    A file is replicated on 10 servers. List all the combinations of read quorum and   (8)
  )    write quorum that are permitted by the voting algorithm proposed by Thomas
       and Gifford.


       The following possibilities of (read quorum, write quorum) are legal.
       (1,10), (2,9), (3,8), (4,7), (5,6)
  b    Describe with the aid of an example how a debugger could be implemented to         (8)
  )    debug a distributed application. The key requirement is that each process in the
       application must send modified state information to the debugger, which must
       then build a consistent event history. Demonstrate how this can be achieved
       assuming three processes and the debugger
       The requirement is for causal delivery of all messages to the debugger this can
       be achieved using vector clocks as shown below:




  c    a) Comment on the following snippet of code that is supposed to solve any          (9)
  )       concurrency problems. In particular argue that it meets all the concurrency
          requirements or if it doesn’t demonstrate how it fails and how it may be
          improved.
             boolean flag[2] = {FALSE,FALSE};
             void proc ( int i )
             {
                while(TRUE) {
                   compute();
                   while ( flag[i + 1 mod 2]);
                   flag[i] = TRUE;
                   critical_section();
                   flag[i] = FALSE;
             }
             main ( )


v1.3                                        Page 7 of 8
CE4208 Distributed Systems - Spring 2002                          ANSWERS

             {
                 proc(0) AND proc(1);      // runs proc(0) and proc(1) in parallel
             }


       If process 0 executes the while statement and that process 1 in not in the critical region it
       proceeds. However it is possible that process 1 may have just executed the while
       statement and was about to assign flag[0] to TRUE. This sequence results in both
       processes entereing the critical region simultaneously.
       To improve the operation a single atomic operation needs control access the the critical
       region this is often achived by increment a shared ‘turn’ varaible e.g. turn =
       ++turn%NUMBER_OF_PROCESSES.



                                                                                          Total        25




v1.3                                          Page 8 of 8

								
To top