Professional Documents
Culture Documents
CS 403/534 - Distributed Systems Spring 2003 Homework #1
CS 403/534 - Distributed Systems Spring 2003 Homework #1
Homework #1
Note: Only hardcopy and printed submissions are acceptable.
1. Consider that a file server is up half of the time due to hardware problems. How many
more replicated servers have to be used to give an availability of at least 99 percent? (10
points)
2. Which protocol do you think it should be used to implement the following services, TCP
or UDP? Explain you choices.
a. telnet, ssh
b. ftp, scp
c. rwho, finger
d. http
e. RPC
(20 points)
a. The long duration of sessions, the need for reliability and the unstructured sequences
of characters make connection-oriented communication most suitable for this
application. Performance is not critical, so the overheads are generally unimportant.
c. Connectionless service is preferable since the messages are short and a single message
is sufficient for each transaction. The request is also easily re-issued if necessary.
d. Either could be used. Requests can be easily re-issued in the event of a problem (the
“Reload" button). However, the volume of data issued for a request can be quite large,
so TCP is used in practice.
3. You wish to execute a Java code, which resides at remote server. The speed of the
network connecting your machine and the server is 10 Mbit/s. You have two options to
execute it:
a. Local Execution: Download and run the Java code on your local computer. The code is
100 kilobytes and execution time of it is 500 milliseconds on your machine
b. Remote Execution (RMI): Download a proxy for the remote object implementing the
service and use it to invoke the method of the remote object. The following are given:
The size of the proxy is 10 kilobytes. Marshalling the arguments takes 5 ms and
Assuming that the web server is identical to your computer, except that it may have a
different clock frequency. How much faster (percentage-wise) does the server have to
be before it is better to use the proxy than download and run the applet? (20 points)
a. For the downloading the applet to your machine, noting that 100kbytes = 800kbits =
0.8Mbits:
where P is the percentage by which the server is faster than the PC.
We want the value of P for which the following inequality will hold:
The applet is big and it takes too long to download it. The server needs to be only 94% as
fast as the PC to get the job done faster. This means that it is still better to use the remote
invocation even if the server is slightly slower than the client machine.
4. Java and other languages support exceptions, which are raised when an error occurs. Such
languages enable developer to code their own exception handling routines. How would
you implement exceptions in RMI? Why is it important to catch the “RemoteException”
with every remote method call? (10 points)
Because exceptions are initially raised at the server side, the server stub can do nothing
else but catch the exception and marshal it as a special error response back to the client.
The client stub, on the other hand, will have to unmarshal the message and raise the same
exception if it wants to keep access to the server transparent. Consequently, exceptions
now also need to be described in an interface definition language. It is important catch the
exceptions since the remote invocations are more vulnerable to failures than local
invocations.
6. Explain, with your own words, what is meant by separating policies from mechanisms in
distributed systems, why it is necessary and give an example of such a separation. (15
points)
A policy in a distributed system dictates, for example, when and how data is replicated.
However, such policies may be good for one application but bad for another. Therefore,
ideally, a system should provide only the means for enforcing policies. In the case of
replication, a distributed system could permit an application to specify the constraints that
need to be satisfied before some data is actually replicated.
7. What are the differences between the client server and the peer process model? What are the main
advantages of the peer process model, in which situations would you use it? (15 points)
In peer process model all of the processes play similar roles, interacting cooperatively as
peers to perform a distributed activity or computation without any distinction between
clients and servers. In client-server architecture, the server is always the performance
bottleneck. Furthermore, in the case of server failures, the operation cannot continue. The
peer process model is used in situations where cooperation is essential and there is no
clear distinction between the processes.