Вы находитесь на странице: 1из 16

Distributed Computing Systems

Submitted by,
C.Annamalai(09z204) J.Gowtham(09z213) L.Sabarishan(09z236) S.Vignesh(09z255)

M.Karthick(10z424)
K.Selvakumar(10z428)

1) Suggest suitable mechanisms to implement IPC semantics for A) last one B) at least one C) exactly one

A) Last one Server Type: Stateless Server Creation: Instance per call servers Operation Type: Idempotent

client Request

Server

Reply

Blocked State Executing State

B)ATLEAST ONCE Server Type: Stateless Server Creation: Instance per call servers Operation Type: Idempotent

client Send request Timeout Send request Request message lost Retransmit Request message

server

Timeout Send request

crash Retransmit Request message

Unsuccessful request execution Restarted Successful request execution

Timeout

Response message lost Send request Retransmit Request message

Send response

These two successful execution Of the same request may produ Different results.

Successful request execution

Send response Response message

C)EXACTLY ONCE Server Type: State full Server Creation: Instance per session servers OPeration Type: Non-Idempotent

Reply cache Client send request-1 request-1 debit(100) Check replay cache for request-1 No match found, so process request-1. Save reply

server

Request identifier
Request-1

Reply to be sent (success,900)

Time out
Lost send request-1

response
(success,900)

Return(success,900)

Retransmit request-I debit(100) Check replay cache for request-1 Match found Extract reply

response
Receive balance=900 (success,900)

Return (success,900)

2. Suggest Atleast once/Exactly once can be used for the following . justify your answer.
for making a request to file server to read a file. Answer:
a.

For this case atleast once can be used. The client can make multiple calls to the server and the server generates response for all the calls. In this case the response of any call can be returned to the client as all the response imply only the content of the file.

b. for making a request to file server to append to an existing file. Answer:


In this case exactly once can be used. The client can make many calls to the server to append data to the existing file. But the server here performs the append operation for only one call. For all the other calls the response is not generated as if the append operation is performed multiple times then it will lead to redundancy of data.

c. for making a request to compilation server to compile a file Answer:


For this case atleast once can be used as the same result will be obtained no matter how many times the same file is compiled by the server.So the response of any call can be returned to the client as all the response imply only the same result.

d. for making a request to DB server to update a bank account. Answer:


In this case exactly once can be used. The server here performs the update operation for only one call. For all the other calls the update operation will not be performed as it will lead to inconsistency of account details.

e. for making a request to DB server to get current balance for a bank account.

Answer:
For this case atleast once can be used. Here the response of any call can be returned to the client as all the response imply only the current balance of the bank account.

f. for making a request to booking server to cancel a booked seat.


Answer: In this case both Exactly once and atleast once are possible. 1)Exactly once-When first call is made the server performs the cancel operation. 2)Atleast once-For all the other calls made by the client an error msg stating that the ticket has been already cancelled is displayed.

BERKELEY ALGORITHM:
Here

the time server is active polling the other machines to ask for their times. Based on the answers it computes an average time and instructs the others machines to correct their clock to this new system time. The time server instructs the other machines either to advance their clocks or to slow down their clocks to the new system time. The Berkeley algorithm is a method that is used in a system where no machine has a WWV receiver.

THANK YOU

Вам также может понравиться