Ss Zg526 Ec-2r First Sem 2018-2019

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Birla Institute of Technology & Science, Pilani

Work-Integrated Learning Programmes Division


First Semester 2018-2019

Mid-Semester Test
(EC-2 Regular)

Course No. : SS ZG526


Course Title : DISTRIBUTED COMPUTING
Nature of Exam : Closed Book
Weightage : 30% No. of Pages =3
Duration : 2 Hours No. of Questions = 5
Date of Exam : 29/09/2018 (AN)
Note:
1. Please follow all the Instructions to Candidates given on the cover page of the answer book.
2. All parts of a question should be answered consecutively. Each answer should start from a fresh page.
3. Assumptions made if any, should be stated clearly at the beginning of your answer.

Q.1 (a) Consider the space-time diagram shown in Fig. 1. The scalar clock values of the events a,
b and c are 2, 3 and 1 respectively and initially, the scalar clock of process p4 is 0.
Identify the scalar clock values of the events and the timestamps of the messages
exchanged among the 4 processes. Use R1 and R2 for updating the scalar clocks. Assume
d = 2. [5]

Q.1 (b) Define open group and closed group multicast algorithms. [0.5 + 0.5 = 1]

Q.2 (a) Explain termination detection using weight throwing [2]

Q.2 (b) Describe the steps of Lamport’s algorithm for distributed mutual exclusion. [3]

Q.2 (c) Explain message queue using a diagram [1]

Q.3 (a) Discuss the 3 properties of a synchronous system. [1]

SS ZG526 (EC-2 Regular) First Semester 2018-2019 Page 1 of 3


SS ZG526 (EC-2 Regular) First Semester 2018-2019 Page 2

Q.3 (b) Describe the steps of the broadcast and the convergecast algorithms on the spanning tree
shown in Fig. 2. [2 + 2 = 4]

B C D
3 2

H Fig. 2
F4 G
E 12 25
6

J K2 L
I 0 17

M N
16

Q.4 (a) Consider the spanning tree shown in Fig. 3. Node N3 holds the privilege.

N1 N2 N3 N4
F H

N9 N6 N5

Fig. 3
N8 N7

Using the knowledge of Raymond’s tree-based algorithm, answer the following questions.
i) Determine the values of the HOLDER variables of each of the nodes. [3]
ii) Redraw the spanning tree of Fig. 3 by replacing the undirected edges with directed edges. [1]

Q.4 (b) Explain isomorphism and event counting properties of vector time. [1 + 1 = 2]

SS ZG526 (EC-2 Regular) First Semester 2018-2019 Page 2 of 3


SS ZG526 (EC-2 Regular) First Semester 2018-2019 Page 3

Q.5. Consider the money transfer scenario shown in the timing diagram of Fig. 4. S1, S2 and S3
are three sites of a distributed system which maintain bank accounts A, B and D respectively.
C12 is the communication channel from site S1 to site S2, C 21 is the communication channel
from site S2 to site S1, C23 is the communication channel from site S2 to site S3, C32 is the
communication channel from site S3 to site S2, C 13 is the communication channel from site
S1 to site S3 and C31 is the communication channel from site S3 to site S1. The dashed
vertical lines denote the different time instants of this timing diagram. Initially, at time
instant t1, account A has $500, account B has $800 and account D has $300. Between time
instants t1 and t2, S1 initiates a transfer of $20 from account A to account B. S2 receives this
money transfer message after t2. Between time instants t3 and t4, S1 initiates a transfer of $30
from account A to account D. S3 receives S1’s money transfer message after t 4. Between
time instants t3 and t4, S3 initiates a transfer of $80 from account D to account A. S1 receives
S3’s money transfer message after t5. These 3 money transfer messages are shown by bold
arrows in the diagram. The amounts present in the 3 accounts at the different time instants
are shown in the following table.
t1 t2 t3 t4 t5 t6
A $500 $480 $480 $450 $450 $530
B $800 $800 $820 $820 $820 $820
D $300 $300 $300 $220 $250 $250

Assume that the Chandy-Lamport algorithm is executed on this distributed system for
recording the global snapshot. S1 initiates the snapshot recording algorithm by sending
markers to S2 and S3 after time instant t1. S2 receives S1’s marker between time instants t1
and t2 and sends a marker to S1 and S3. S1 receives S2’s marker after t3 and S3 receives S2’s
marker after t3. S3 receives S1’s marker after t2 and sends markers to S1 and S2. S2 receives
S3’s marker after t3 and S1 receives S3’s marker between t4 and t5. The sending and the
receiving of markers are shown using dotted arrows. Describe how and when the Chandy-
Lamport algorithm records the local states of S1, S2 and S3 and the states of the channels
C12, C21, C23, C32, C13 and C31. Note that the recorded global state should be a consistent one.
[7]

S1: A

$20 $30 $80

S2: B

S3: D

t1 t2 t3 t4 t5 t6

Fig. 4

SS ZG526 (EC-2 Regular) First Semester 2018-2019 Page 3 of 3

You might also like