You are on page 1of 12

Birla Institute of Technology & Science, Pilani

Work Integrated Learning Programmes Division


Second Semester 2021-2022
Comprehensive Examination
(EC-3 Regular)

Course No. : SS ZG526


Course Title : Distributed Computing
Nature of Exam : Open Book
Weightage : 50% No. of Pages = 12
Duration : 2 Hours No. of Questions = 7
Date of Exam : 21/05/2022 (AN)
Note to Students:
1. Answer all questions.
2. Please follow all the Instructions to Candidates given on the cover page of the answer book.
3. All parts of a question should be answered consecutively. Each answer should start from a fresh page.
4. Assumptions made if any, should be stated clearly at the beginning of your answer.

Q.1 Set. (A) Consider the space-time diagram consisting of 5 processes shown in Fig. 1. Initially,
the vector clocks of all the 5 processes are [0 0 0 0 0]. Using Singhal-Kshemkalyani’s differential
technique, determine the progress of vector clocks at each of the processes and the timestamps of
the messages exchanged among them. Assume d = 1. Note that no marks will be awarded for
incorrect or partially correct event and message timestamps. [9]

P1

P2

Processes
P3

P4

P5
Fig. 1 Time
Q.1 Set. (B) Consider the space-time diagram consisting of 5 processes shown in Fig. 1. Initially,
the vector clocks of all the 5 processes are [0 0 0 0 0]. Using Singhal-Kshemkalyani’s differential
technique, determine the progress of vector clocks at each of the processes and the timestamps of
the messages exchanged among them. Assume d = 1. Note that no marks will be awarded for
incorrect or partially correct event and message timestamps. [9]

P1

P2

Processes
P3

P4

P5
Fig. 1
Time
Q.1 Set. (C) Consider the space-time diagram consisting of 5 processes shown in Fig. 1. Initially,
the vector clocks of all the 5 processes are [0 0 0 0 0]. Using Singhal-Kshemkalyani’s differential
technique, determine the progress of vector clocks at each of the processes and the timestamps of
the messages exchanged among them. Assume d = 1. Note that no marks will be awarded for
incorrect or partially correct event and message timestamps. [9]

P1

P2

Processes
P3

P4

P5
Fig. 1 Time
Q.2 Set. (A) Suppose a distributed system contains 13 sites – S1, S2, S3, S4, S5, S6, S7, S8, S9,
S10, S11, S12 and S13. Here K = 4. Consider the following request sets:
 R3 = {S3, S5, S6}
 R5 = {S2, S5, S8, S9}
 R6 = {S5, S10, S11, S12}
 R10 = {S5, S9, S10, S13}
 R11 = {S2, S5, S11, S13}
 R13 = {S1, S6, S10, S13}

Determine which of the conditions of M1, M2, M3 and M4 have been violated while constructing
the above request sets. Give proper explanation. You do not have to worry about the request sets of
the remaining sites. [6]

Q.2 Set. (B) Suppose a distributed system contains 13 sites – S1, S2, S3, S4, S5, S6, S7, S8, S9,
S10, S11, S12 and S13. Here K = 4. Consider the following request sets:
 R3 = {S1, S3, S8, S9}
 R5 = {S3, S10, S11}
 R6 = {S3, S6, S7, S9}
 R10 = {S2, S3, S5, S10}
 R11 = {S4, S6, S8, S11}
 R13 = {S3, S8, S12, S13}

Determine which of the conditions of M1, M2, M3 and M4 have been violated while constructing
the above request sets. Give proper explanation. You do not have to worry about the request sets of
the remaining sites. [6]

Q.2 Set. (C) Suppose a distributed system contains 13 sites – S1, S2, S3, S4, S5, S6, S7, S8, S9,
S10, S11, S12 and S13. Here K = 4. Consider the following request sets:
 R3 = {S3, S8, S11, S13}
 R5 = {S5, S8, S9, S10}
 R6 = {S6, S8, S12}
 R10 = {S2, S8, S11, S13}
 R11 = {S1, S11, S12, S13}
 R13 = {S2, S7, S8, S13}

Determine which of the conditions of M1, M2, M3 and M4 have been violated while constructing
the above request sets. Give proper explanation. You do not have to worry about the request sets of
the remaining sites. [6]
Q.3 Set. (A) Consider a synchronous distributed system consisting of 10 processes – P1, P2, P3, P4,
P5, P6, P7, P8, P9 and P10. Every process puts forth an initial integer value. The initial values put
forth by P1, P2, P3, P4, P5, P6, P8 and P10 are 4, 3, 5, 4, 5, 6, 2 and 3 respectively. P7 and P9 do
not send any value. P2, P7 and P9 are faulty processes and the non-faulty processes are aware of
this fact. Using your knowledge of the interactive consistency problem, determine the values of the
final agreement array. Assume that for a faulty process, the agreed upon value by all the non-faulty
processes is 8. No marks will be awarded for incorrect values of the final agreement array.
[3]

Q.3 Set. (B) Consider a synchronous distributed system consisting of 10 processes – P1, P2, P3, P4,
P5, P6, P7, P8, P9 and P10. Every process puts forth an initial integer value. The initial values put
forth by P1, P2, P3, P4, P5, P6, P7 and P9 are 7, 4, 6, 7, 8, 4, 6 and 4 respectively. P8 and P10 do
not send any value. P3, P8 and P10 are faulty processes and the non-faulty processes are aware of
this fact. Using your knowledge of the interactive consistency problem, determine the values of the
final agreement array. Assume that for a faulty process, the agreed upon value by all the non-faulty
processes is 5. No marks will be awarded for incorrect values of the final agreement array.
[3]

Q.3 Set. (C) Consider a synchronous distributed system consisting of 10 processes – P1, P2, P3, P4,
P5, P6, P7, P8, P9 and P10. Every process puts forth an initial integer value. The initial values put
forth by P1, P2, P3, P5, P6, P7, P8 and P9 are 9, 5, 3, 9, 3, 8, 4 and 5 respectively. P1 and P4 do not
send any value. P1, P4 and P10 are faulty processes and the non-faulty processes are aware of this
fact. Using your knowledge of the interactive consistency problem, determine the values of the final
agreement array. Assume that for a faulty process, the agreed upon value by all the non-faulty
processes is 6. No marks will be awarded for incorrect values of the final agreement array.
[3]

Q.4 Set. (A) Suppose a synchronous system consists of a certain number of processes out of which
some processes are faulty. Assume that the Byzantine agreement tree algorithm is executed on this
system. If a message gets sent to 11 nodes in round 2, calculate the number of rounds for which the
Byzantine agreement tree algorithm will execute. [1]

Q.4 Set. (B) Suppose a synchronous system consists of a certain number of processes out of which
some processes are faulty. Assume that the Byzantine agreement tree algorithm is executed on this
system. If a message gets sent to 14 nodes in round 2, calculate the number of rounds for which the
Byzantine agreement tree algorithm will execute. [1]

Q.4 Set. (C) Suppose a synchronous system consists of a certain number of processes out of which
some processes are faulty. Assume that the Byzantine agreement tree algorithm is executed on this
system. If a message gets sent to 17 nodes in round 2, calculate the number of rounds for which the
Byzantine agreement tree algorithm will execute. [1]
Q.5 Set. (A) Consider the money transfer scenario shown in the timing diagram of a distributed
system of Fig. 2. The system consists of 2 bank accounts B1 and B2. Process P1 is executing at B1
and process P2 is executing at B2. Communication channel from P1 to P2 is denoted as C 12 and the
communication channel from P2 to P1 is denoted as C21. The communication channels are non-
FIFO in nature. The dashed vertical lines denote the different time instants of this timing diagram.
Initially, at time instant T1, account B1 has 900 INR and account B2 has 600 INR. Between time
instants T1 and T2, P1 initiates a transfer of 40 INR from account B1 to account B2 and P2 receives
this money transfer message between T4 and T5. P1 initiates a transfer of 30 INR from account B1
to account B2 between time instants T2 and T3 which P2 receives between T3 and T4. P1 also
initiates a transfer of 50 INR from account B1 to account B2 between T4 and T5 which P2 receives
between T6 and T7. P2 initiates a transfer of 80 INR between T2 and T3 and P1 receives this
money transfer message between T6 and T7. The money transfer messages are shown using bold
arrows in Fig. 2. For reducing clutter, the denomination INR are not shown in the diagram. Assume
that the Lai-Yang algorithm is executed by this distributed system for recording the global snapshot.
P1 initiates the algorithm and turns red at time instant T2.

900 860 830 830780 780860

P1: B1

40 30

Fig. 2
80
50

P2: B2

600 600 520 550 590 590 640


T1 T2 T3 T4 T5 T6 T7

Identify the white and the red messages in the above mentioned scenario. Note that you have to
individually identify each messageFig.
as white
2 or red. [1]

Describe how and when the Lai-Yang algorithm records the local states of P1 and P2 and the states
of the channels C12 and C21. You have to clearly mention the history of white messages sent and
received by each of the processes. For the channel states, describe with proper reasoning how are
they recorded. [7]
Q.5 Set. (B) Consider the money transfer scenario shown in the timing diagram of a distributed
system of Fig. 2. The system consists of 2 bank accounts B1 and B2. Process P1 is executing at B1
and process P2 is executing at B2. Communication channel from P1 to P2 is denoted as C 12 and the
communication channel from P2 to P1 is denoted as C21. The communication channels are non-
FIFO in nature. The dashed vertical lines denote the different time instants of this timing diagram.
Initially, at time instant T1, account B1 has 300 INR and account B2 has 900 INR. Between time
instants T2 and T3, P1 initiates a transfer of 10 INR from account B1 to account B2 and P2 receives
this money transfer message between T3 and T4. P1 initiates a transfer of 30 INR from account B1
to account B2 between time instants T3 and T4 which P2 receives between T5 and T6. P2 initiates a
transfer of 40 INR from account B2 to account B1 between T2 and T3 which P1 receives between
T6 and T7. P2 initiates another transfer of 60 INR between T4 and T5 and P1 receives this money
transfer message between T5 and T6. The money transfer messages are shown using bold arrows in
Fig. 2. For reducing clutter, the denomination INR are not shown in the diagram. Assume that the
Lai-Yang algorithm is executed by this distributed system for recording the global snapshot. P1
initiates the algorithm and turns red at time instant T2.

300 300 290 260260 320360

P1: B1
30 60
10 40

Fig. 2

P2: B2

900 900 860 870 810 840 840


T1 T2 T3 T4 T5 T6 T7

Identify the white and the red messages in the above mentioned scenario. Note that you have to
individually identify each messageFig.
as white
2 or red. [1]

Describe how and when the Lai-Yang algorithm records the local states of P1 and P2 and the states
of the channels C12 and C21. You have to clearly mention the history of white messages sent and
received by each of the processes. For the channel states, describe with proper reasoning how are
they recorded. [7]
Q.5 Set. (C) Consider the money transfer scenario shown in the timing diagram of a distributed
system of Fig. 2. The system consists of 2 bank accounts B1 and B2. Process P1 is executing at B1
and process P2 is executing at B2. Communication channel from P1 to P2 is denoted as C 12 and the
communication channel from P2 to P1 is denoted as C21. The communication channels are non-
FIFO in nature. The dashed vertical lines denote the different time instants of this timing diagram.
Initially, at time instant T1, account B1 has 400 INR and account B2 has 700 INR. Between time
instants T1 and T2, P1 initiates a transfer of 50 INR from account B1 to account B2 and P2 receives
this money transfer message between T4 and T5. P1 initiates a transfer of 70 INR from account B1
to account B2 between time instants T5 and T6 which P2 receives between T6 and T7. P2 initiates a
transfer of 30 INR from account B2 to account B1 between T1 and T2 which P1 receives between
T4 and T5. P2 initiates another transfer of 20 INR between T2 and T3 and P1 receives this money
transfer message between T3 and T4. The money transfer messages are shown using bold arrows in
Fig. 2. For reducing clutter, the denomination INR are not shown in the diagram. Assume that the
Lai-Yang algorithm is executed by this distributed system for recording the global snapshot. P1
initiates the algorithm and turns red at time instant T3.
400 350 350 370400 330330

P1: B1
50
20

Fig. 2
70

30
P2: B2

700 670 650 650 700 700 770


T1 T2 T3 T4 T5 T6 T7

Identify the white and the red messagesFig.


in 2the above mentioned scenario. Note that you have to
individually identify each message as white or red. [1]

Describe how and when the Lai-Yang algorithm records the local states of P1 and P2 and the states
of the channels C12 and C21. You have to clearly mention the history of white messages sent and
received by each of the processes. For the channel states, describe with proper reasoning how are
they recorded. [7]
Q.6 Set. (A) Consider a distributed system consisting of 10 processes spanning across 4 sites as
depicted in Fig. 3. The WFG is shown in the figure. Assume all nodes to be AND nodes.

Site 2
P2
P4 P5
P1 P3
Site 1

P7

P9 P10 P6 P8
Site 3
Site 4

Fig. 3
SSite 4
Identify the locally dependent processes. You should clearly mention which process is locally
dependent on which process. [1.5]

Execute Chandy-Misra-Haas algorithm for the AND model on this distributed system to determine
whether any deadlock exists in the system. Assume P1 initiates the deadlock detection and initially,
the dependent arrays of all the processes contain false as values. Note that the deadlock is to be
detected by using the algorithm and not by any other means. Also, you have to write the steps of the
algorithm in text and mention the messages exchanged and the contents of the dependent arrays of
the different processes. NO MARKS WILL BE AWARDED IF YOU ANSWER THE QUESTION
BY ANNOTATING THE DIAGRAM. [10.5]
Q.6 Set. (B) Consider a distributed system consisting of 10 processes spanning across 4 sites as
depicted in Fig. 3. The WFG is shown in the figure. Assume all nodes to be AND nodes.

P3

P2
P1 P4 P5
Site 1 Site 2

P9

P8 P6 P7
P10
Site 3
Site 4

Fig. 3
SSite 4process is locally
Identify the locally dependent processes. You should clearly mention which
dependent on which process. [1.5]

Execute Chandy-Misra-Haas algorithm for the AND model on this distributed system to determine
whether any deadlock exists in the system. Assume P2 initiates the deadlock detection and initially,
the dependent arrays of all the processes contain false as values. Note that the deadlock is to be
detected by using the algorithm and not by any other means. Also, you have to write the steps of the
algorithm in text and mention the messages exchanged and the contents of the dependent arrays of
the different processes. NO MARKS WILL BE AWARDED IF YOU ANSWER THE QUESTION
BY ANNOTATING THE DIAGRAM. [10.5]
Q.6 Set. (C) Consider a distributed system consisting of 10 processes spanning across 4 sites as
depicted in Fig. 3. The WFG is shown in the figure. Assume all nodes to be AND nodes.

Site 2
P2
P6
P4
P1 P3
Site 1 P5

P7

P9 P10 Site 3 P8

Site 4

Fig. 3
SSite 4
Identify the locally dependent processes. You should clearly mention which process is locally
dependent on which process. [1.5]

Execute Chandy-Misra-Haas algorithm for the AND model on this distributed system to determine
whether any deadlock exists in the system. Assume P3 initiates the deadlock detection and initially,
the dependent arrays of all the processes contain false as values. Note that the deadlock is to be
detected by using the algorithm and not by any other means. Also, you have to write the steps of the
algorithm in text and mention the messages exchanged and the contents of the dependent arrays of
the different processes. NO MARKS WILL BE AWARDED IF YOU ANSWER THE QUESTION
BY ANNOTATING THE DIAGRAM. [10.5]

Q.7 Set. (A) A Chord ring with m = 8 contains the following nodes – N5, N11, N23, N35, N56,
N78, N93, N121, N153, N160, N188, N201, N230 and N252.

Determine the entries of the finger tables of N93, N160 and N201. You have to clearly show the
calculation using which you are determining each finger table entry. Marks will be deducted if
calculations are not shown. [6]

Suppose for this Chord ring, a lookup for K17 is initiated at N201. Describe the step-by-step
procedure by which K17 can be located using the scalable lookup algorithm. Write the steps of the
algorithm clearly in text. You are not required to draw any diagram. If you answer this question by
only drawing a diagram, no marks will be awarded. [5]
Q.7 Set. (B) A Chord ring with m = 8 contains the following nodes – N8, N14, N29, N47, N62,
N88, N101, N133, N149, N171, N195, N210, N227 and N250.

Determine the entries of the finger tables of N88, N171 and N210. You have to clearly show the
calculation using which you are determining each finger table entry. Marks will be deducted if
calculations are not shown. [6]

Suppose for this Chord ring, a lookup for K39 is initiated at N210. Describe the step-by-step
procedure by which K39 can be located using the scalable lookup algorithm. Write the steps of the
algorithm clearly in text. You are not required to draw any diagram. If you answer this question by
only drawing a diagram, no marks will be awarded. [5]

Q.7 Set. (C) A Chord ring with m = 8 contains the following nodes – N3, N21, N35, N41, N77,
N89, N96, N111, N125, N141, N163, N185, N199 and N230.

Determine the entries of the finger tables of N41, N111 and N199. You have to clearly show the
calculation using which you are determining each finger table entry. Marks will be deducted if
calculations are not shown. [6]

Suppose for this Chord ring, a lookup for K62 is initiated at N199. Describe the step-by-step
procedure by which K62 can be located using the scalable lookup algorithm. Write the steps of the
algorithm clearly in text. You are not required to draw any diagram. If you answer this question by
only drawing a diagram, no marks will be awarded. [5]

***********************

You might also like