CS计算机代考程序代写 javascript dns chain Java file system IOS flex android distributed system concurrency cache COMP90015 DISTRIBUTED SYSTEMS:

COMP90015 DISTRIBUTED SYSTEMS:
PRINCIPLES AND PARADIGMES
SEMESTER 1, 2014 FINAL EXAMINATION

Questions and Answers

Q.1. (a) [4 marks] List and briefly explain four reasons why resource
sharing is beneficial.

• Reduces cost by allowing a single resource for a number of
users, rather than a identical resource for each user.

•  Facilitates interactions among users, e.g. through a shared file
system.

•  Increases capacity, e.g. by allowing otherwise unused local disk
space to be used remotely.

•  Increases availability, e.g. through redundancy of resources.

(b) [1 marks] In the context of distributed systems, what is meant by the
term independent failure?
• An independent failure is where the failure of a part of a

distributed system can occur obliviously to the operation of the
remaining parts of the system.

Q.2. (a) [4 marks] For each of the following distributed system challenges,
explain why it is a challenge, giving an example for each case:
i. Transparency
Transparency is a challenge because sometimes the application or user is required to make
sensible decisions at the lower, otherwise transparent, layer. E.g. it is sometimes better to tell
the user about Internet failure, rather than make such failure transparent, so that the user can
perhaps fix the problem.
ii. Security
Security is a challenge because not all security problems are known in advance – the attacker
is continuously trying new forms of attacks. E.g. the Heartbleed bug was “discovered” only
recently and presumably was being used to attack some systems.
iii. Heterogeneity
Heterogeneity is a challenge because supporting a number of different platforms
requires more development, including more debugging. E.g. supporting both Android
and iOS adds extra development effort.
iv. Openness
Openness is a challenge because defining an API that is flexible and easy to use, as well as
ensuring that implementations adhere to it, requires significant effort. E.g. different browser
vendors will interpret HTML in different ways and JavaScript engines may not work the
same.

(b) [1 marks] What is middleware in the context of
distributed systems?
•  Middleware is a software layer that sits between the application

and the platform, that provides distributed services of some
kind, usually transparently to the application.

[4 marks] Draw a high level architecture diagram for each of the
following architectural models and briefly explain each diagram:

Correct and clear diagrams are required with logical consistency between
diagrams.
i.  Client/Server

Client Server

invocation

result

iii. A service provided by multiple servers

Client Server

invocation

result

Server

Client Server

invocation

result

•  ii. Peer-to-Peer

Peer Peer

Peer

•  Proxy Server

Client

Proxy
Server

Server

Client
Server

(b) [4 marks] Draw an interaction diagram to explain the RRA protocol.
Explain the diagram. Explain what problem(s) the RRA protocol solves
that the RR protocol does not.

•  [The diagram should include the messages, as well as the timers
used and the fact that the server will cache results.] The RRA
protocol addresses the problem of recomputing responses,
where the server can properly discard results when it receives
an acknowledgement. The RR protocol does not allow this.

(c) [2 marks] Consider a client/server system where the server is sending
a stream of temperature readings to the client. Each temperature reading
is a 32bit floating point number. Design a format for the stream, using
either a well-known data representation, or your own representation.
Explain your design exactly, so that a third person could implement it
without ambiguity.

The stream can a binary stream over TCP. The 32 bit floating
point numbers can be written in big endian format, i.e. 4 bytes.
The start of the stream can be a single unsigned byte that
represents how many 32 bit floating point numbers will follow. If
this byte is 0 then the stream is to be closed. An arbitrary length
stream can be constructed using this format.

Q.4. (a) [4 marks] Answer the following questions about Java RMI:

i. Can objects be created remotely? Explain your answer.
Objects can not be directly created remotely, i.e. with the new command, but a
servant factory object can be used to indirect create an object on a remote
machine.
ii. Explain the dierence between a local invocation and a remote invocation. If
two Java Virtual Machines are on the same physical machine, and invocation is
made between them, is this local or remote?
A local invocation takes place between objects with the same Java virtual
machine; whereas a remote invocation takes place between objects on different
Java virtual machines. If the two Java virtual machines are on the same physical
machine, it is still considered a remote invocation.
iii. What is a remote reference? Explain how an object obtains a remote
reference.
A remote reference is a reference to an object that is not within the local Java
virtual machine. An object can obtain a remote reference by using the Registry
server, knowing the objects name.

(b) [2 marks] Explain the following aspects of a publish subscribe
system:

i.  Event : An Event is some change of state that is of interest.
ii.  Notification: is information regarding an event that is sent to a

subscriber.
iii.  Subscriber: is an entity that is waiting for Notifications.
iv.  Publisher: is an entity that sends Notifications to Subscribers.

Q.5. (a) [2 marks] Explain what is a persistent asynchronous invocation
and describe an example application that would benefit from this
technique.
• A persistent asynchronous invocation is one that will continue

to be attempted over a long period of time if errors occurs. E.g.
sending an SMS from a mobile phone in the presence of
connection problems.

(b) [2 marks] Explain what is meant by process migration.
Explain two major complications with process migration.

Process migration is check-pointing a running process on a local
machine, move the processes address space to a remote machine,
and re-starting the process on the remote machine. Two
complications are that the local and remote machine may not
share the same instruction set, and the process may have
references to resources that are bound to the local machine.

(c) [4 marks] Apart from actual network delay, list and briefly explain
four factors that contribute to the delay incurred when making an RMI
call.
•  system transitions, when the process makes a system call to

initiated the RMI call
• marshalling/unmarshalling, when converting objects to a format

for transmission
•  buffering, copying data between the process and the system and

perhaps internally within the system
•  dispatching, where the object at the remote machine needs to be

looked up in order to call its remote interface

(d) [6 marks] Considering your second project, answer the following
questions:

i. Draw an architectural diagram that shows the threads used in a possible
implementation, the main resources and the interactions between the threads and
resources. Briefly explain the diagram, including an explanation of each thread and
resource, and any concurrency control needed.
[diagram needs to focus on what is asked for, be clear and consistent]

Class Discussion

ii. Considering the overall performance of the application, what would you say is the
main limiting factor to obtaining a good quality stream of
images? Explain your answer.
The biggest problem for obtaining a good quality stream of images is the bandwidth
required; a better encoding method would help a lot here.

Q.6. (a) [3 marks] List and briefly explain three worst-case assumptions
when designing a secure system.

• All communications between processes can be copied, modified
and retransmitted. Attackers can obtain information that they
should not and can pretend to be a legitimate party.

• All of the source code is known to the attacker. Knowing the
source code can help the attack discover vulnerabilities.

•  The attacker has unlimited computing resources. Encryption can
eventually be broken.

(b) [4 marks] Explain what is a digital certificate, including what is the
basic technique used to create a digital certificate, and what is a
certificate chain.
A digital certificate is a document that binds information
together, most usually an entities identification with its public
key, and is digitally signed by an entity. A digital signature is
created by an entity by taking the relevant information and
encrypting a digest of it with that entities private key, from a
public/private key pair. A series of certificates where each
certificate’s signature is authenticated by the subsequent
certificate is a certificate chain, finishing at a self-signed
certificate.

(c) [2 marks] Briefly explain the infamous Heartbleed Bug, as discussed in lectures. What
popular security system did it affect and basically how did it
work?

The Heartbleed bug was found in the OpenSSL implementation.
A client sending a heartbeat packet could fake how many bytes it
sent, to fool the server into copying data (possibly sensitive) from
its buffer into the return packet.

Q.7. [3 marks] Consider a distributed le system that implements le replication. What is le replication
and what benefit(s) does it have? What problem(s) can occur in a system that uses le replication?
Explain your answers.

•  File replication is where the same file is stored on different
nodes of the distributed system and it is kept synchronised, i.e.
changes at one node are reflected at all nodes. It can provide
fault tolerance and increased performance. However changes
can lead to inconsistency between the replicas. This can take
time and network overhead to overcome.

Q.8. [3 marks] Before DNS, a single le was used to store all name information for
computers on the Internet. This le was downloaded by everyone on the Internet on a daily
basis, from the well known host that provided it. List and briefly explain three problems
with this approach, that prompted people to develop DNS.

•  The well known host became a bottleneck, as the Internet grew
to include many millions of nodes that needed the file.

• Organizations wanted to administer the Internet names in their
own networks.

• A more general naming service was required, rather than one
that just looks up Internet addresses.

Q.9. [5 marks] Consider an image-resizing service. Clients submit an image to the service along with
a resize factor and the service returns the image scaled by the resize factor. The service is expected to
act in real time { e.g. for images of less than 1 megabyte in size the service should respond in less than
500ms for 99% of the requests. Also, the system should provide 99.9% availability in a month,
meaning that the system is rarely unavailable. Using your knowledge of distributed systems, propose
an overall approach for this system, draw an architecture diagram, and explain the protocol that you
propose. Your approach should address the common challenges of a distributed system and specially
the challenges suggested above. Explain how it does so. Your answer should be less than one page.

•  [Emphasis is on the architecture of the system that is best suited to
provide availability and low response times. E.g. a multi-server
architecture, perhaps with layers, using DNS to load balance.
Description should included the protocol with details about the
messages. E.g. TCP might be used to initially upload the image (since
images can be several megabytes) to an I/O server in a multi-server
system, and then I/O server could use a shared file system with a
second layer of CPU servers that resize the image, and then the I/O
server can respond on the TCP socket with the resized image; finally
closing the socket.]

Client
I/O

Server TCP Connection

Server

Server

Server

Disk

Shared File System

resized image

image
DNS