Main Assignment
Main Assignment
Main Assignment
Questions 1
Use the World Wide Web as an example to illustrate the concept of resource sharing,
client and server. What are the advantages and disadvantages of HTML, URLs and
HTTP as core technologies for information browsing?
Resource Sharing: Computer Resources which are made available from one host to
other hosts on a network. It also allows multiple user access data simultaneously. Web
Pages are examples of resources that are shared. The thing that does management of web
pages is web server where these web pages are stored from where different users can
access those web pages at same time where these resources are stored in web server made
available for sharing between users.
Client & Server: Client & Server is an architecture where Client is the users browser
from where requests are generated for web pages and server is also an computer where
these web pages are stored.
HTTP and URLs are acceptable as a basis for client-server computing except that
there is no strong type checking and there is the inefficiency that we have mentioned.
Question 2
Differentiate between connectionless and connection-oriented inter-process
communication using example protocols.
In connectionless service no such guarantee is made, and hence the data packets are
sent with just the destination address, and no routing information. The examples
include IP (Internet Protocol) and UDP Packets. Connectionless means that no effort
is made to set up a dedicated end-to-end connection.
What are the issues relating to UDP Communication? Give an example application
where UDP is used. Why UDP is still used?
UDP is not reliable it does not cares if any packet is lost. UDP has no flow control
option. UDP does not attempt error recovery. In UDP there are more chances of loss
of packets.
Network Management, Routing Protocol, Online Streaming, and Internet telephony
do use UDP.
UDP communication is still used because it has no connection establishment which
can add delay. It is simple no connection state at sender or receiver and its header size
is also small. No congestion control UDP can blast away as fast as desired.
Question 3
Explain clearly what is meant by Remote Method Invocation (RMI). What protocol
is used in RMI?
RMI (Remote Method Invocation) is a way that a programmer, using the Java
programming language and development environment, can write object-oriented
programming in which objects on different computers can interact in a distributed
network. RMI is the Java version of what is generally known as a remote procedure
call (RPC), but with the ability to pass one or more objects along with the request.
The object can include information that will change the service that is performed in
the remote computer. Java Remote Method Protocol or JRMP is used in RMI.
Discuss a scenario in which a client could receive a reply from an earlier call by the
use of the protocol used in RMI.
Client sends request message, times out and then retransmits the request message,
expecting only one reply. The server which is operating under a heavy load eventually
receives both request messages and sends two replies. When the client sends a subsequent
request it will receive the reply from the earlier call as a result. If request identifiers are
copied from request to reply messages, the client can reject the reply to the earlier
message.
Question 4
What are the essential requirements for mutual exclusion? What are the criteria for
measuring algorithmic performance for mutual exclusion solutions?
Requirements:
i. Safety Property: At any instant, only one process can execute the critical section.
ii. Liveness Property: Two or more sites should not endlessly wait for messages
which will never arrive.
iii. Fault Tolerance: Each process gets a fair chance to execute the CS
iv. Freedom from deadlocks and Starvation
v. Fairness
In a certain system, each process typically uses a critical section many times before
another process requires it. Explain why Ricart and Agrawalas multi-cast based
algorithm is inefficient for this case, and describe how to improve its performance.
Does your adaptation satisfy liveness condition ME2?
A server manages the objects a1, a2,... an. The server provides two operations for its clients:
read (i) returns the value of ai; write(i, Value) assigns Value to ai. The transactions T and
U are defined as follows:
Provide a serially equivalent interleaving of the transactions T and U that is strict. Explain
your answer.
The interleavings of T and U are serially equivalent if they produce the same outputs (in x
and y) and have the same effect on the objects as some serial execution of the two transactions. The
two possible serial executions and their effects are:
If T runs before U: xT = aj0 ; yT = ai0 ; xU = ak0 ; yU= 44; ai =55; aj =44; ak = 66.
If U runs before T: xT = aj0 ; yT = 55; xU = ak0 ; yU= aj0 ; ai =33; aj =44; ak = 66,
where xT and yT are the values of x and y in transaction T; xU and yU are the values of x and y in
transaction U and ai0 , aj0 and ak0 , are the initial values of ai, aj and ak
Interleaving 1 Interleaving 2
TU TU
x:=read(j) x:=read(j)
x:= read(k) y:=read (i)
write(i, 55) x= read(k)
y = read(i) write(j, 44)
y = read(j) write(i, 33)
write(k, 66) write(i, 55)
write(j, 44) write(k, 66)
write(i, 33)
Two-phase locking in a distributed transaction requires that it cannot acquire a lock at any
server after it has released a lock at any server.
A transaction that needs to read or write an object must be delayed until other transactions
that wrote the same object have committed or aborted. To enforce this rule, any locks
applied during the progress of a transaction are held until the transaction commits or
aborts. This is called strict two-phase locking. Dirty Reads and Premature Writes are
avoided by strict two phase locking.
The transactions T and U are defined as follows where A, B, and C are bank accounts with
balances of A: $100, B: $400, and C: $800.
T: cb = C.getBalance(); C.withdraw(200); A.deposit(200); (Transfers $200 from Account C to
A)
Apply strict two-phase locking and demonstrate that the results are serially equivalent.
Timestamps for local concurrency control are just local counters. But for distributed
transactions, timestamps at different servers must have an agreed global ordering. For
example, they can be generated as (local timestamp, server-id) to make them different. The
local timestamps must be roughly synchronized between servers. With timestamp ordering, a
transaction may be aborted early at one of the servers by the read or write rule, in which case
the abort result is returned to the client. If a server crashes before the client has done all its
actions at that server, the client will realise that the transaction has failed. In both of these
cases the client should the send an abortTransaction to the coordinator. When the client
request to commit arrives, the servers should all be able to commit, provided they have not
crashed after their last operation in the transaction.
Question 7
Explain the use of leases in a discovery service to cope with the problem of service
volatility.
(a)(ii) Available copies of replication is applied to data items A and B with replicas Ax,
Ay and Bm, Bn. The transactions T and U are defined as:
Show an interleaving of T and U assuming that two-phase locks are applied to the
replicas. Complete the part answer given below.
(b) What are the contextual factors to be taken into account when adapting multimedia
content?
(a) A router separating process p from two others, q and r, fails immediately after p
initiates the multicasting of message m. If the group communication system is view-
synchronous, explain what happens to p next.
Process p must receive a new group view containing only itself, and it must receive the
message it sent. The question is: in what order should these events be delivered to p.
If p received the message first, then that would tell p that q and r received the message;
but the question implies that they did not receive it. So p must receive the group view
first.
(b) You are given a group communication system with a totally ordered multicast
operation, and a failure detector. Is it possible to construct view-synchronous group
communication from these components alone?
If the multicast is reliable, yes. Then we can solve consensus. In particular, we can
decide, for each message, the view of the group to deliver it to. Since both messages and
new group views can be totally ordered, the resultant communication will be view-
synchronous. If the multicast is unreliable, then we do not have a way of ensuring the
consistency of view delivery to all of the processes involved.