7
Review for Exam 2

Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Embed Size (px)

Citation preview

Page 1: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Review for Exam 2

Page 2: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Topics includedDeadlock detectionResource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election etcShortest path computationDistance vector and Link State Routing Compact routingSpanning tree and MSTLeader electionSynchronizers: alpha and beta Fault and fault-tolerance: various protocolsBe familiar with different types of failure, like omission,

transient, ByzantineStudy different types of fault-toleranceTolerating omission failures: network protocolsClassifying fault-tolerance •

Distributed ConsensusSpecification of the consensus problemSimple cases of impossibility with asynchronous processes: understand the spirit of itByzantine Generals problem and solutions:

Understand OM(1) and SM(1)Failure detectors: completeness and accuracy properties: What is the big deal about implementing consensus using failure detectors?

This list is not exhaustive

Page 3: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Sample question 1(a) A (non-real-time) system deadlocks whenever a security breach is about to occur.

What kind of fault-tolerance is this? (a) Masking (b) non-masking (c) fail-safe (d) the system is not fault tolerant. (b) Many problems in distributed computing can be reduced to the consensus problem.

Which one of the following is NOT a consensus problem?

Mutual exclusionLeader electionDistributed snapshotTotal order multicast (means: all processes receiving one another’s message in timestamp order).

(c) In a system of five processes 0 through 4, processes 2 and 3 crashed. The following is the list of

suspects recorded by the correct processes:

Process 0: {1, 2, 3} Process 1: {2, 3, 4} Process 4: {2, 3} What kind of completeness and accuracy properties does the failure detector satisfy? Justify your answer.

Page 4: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Sample question 2In the following network, the propagation delays of the different edges are shown as edge labels. With node 0 as the root, compute the spanning tree using Chang’s algorithm. Assume that the probes or the echoes spend negligible amount of time at the various nodes.

Answer. To answer this question, you have to mark the edges of the spanning tree using the (X) sign.

0 2

3 4 5

6 7 8

12 25

1 10 3

1 4

7 123

5 1

Page 5: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Sample question 3

Four travelers A, B, C, D were lost in a desert. Each of them looked at the starry night, and tried to decide whether to head north (N), or south (S), or east (E), or west (W). For their safety, it is important that all of them travel together and move in the same direction. D has bad motives - he wants the group to split, so that he could rob some of his travel companions. However, the others do not know about this – they only know that at most one of them is not trustworthy. The remaining ones have to reach a consensus about the direction they will head to – so they run the OM(1) version of Byzantine Generals Algorithm.

If A wants to go north, B wants to go north, C wants to go south, and D tells A to go east, but tells B and C to head south, then what direction with A, B, and C head to? What is the basis of their judgment? (You can assume that in the absence of a clear majority, everyone will decide to head east.)

Page 6: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Sample question 4

In a completely connected network of seven processes, up to two can crash. The model of computation is asynchronous, and the goal is to reach consensus. Each process has a perfect failure detector, The basic idea for each process is to broadcast its input value to every other process, and make sure that eventually all processes collect the same set of values, applies a (commonly agreed) choice function, and generates the final decision.

Assume that processes broadcast in rounds, and in each round every process sends (or forwards) a value to every other process, and receives a value from every other process. Each broadcast consists of a sequence of unicasts (i.e. point-to-point communication), and the crash can occur at any time. To make sure that any input value that has been generated by some process at least once eventually reaches all non-faulty processes, each process has to broadcast the input (or received) values for several rounds. What is the minimum number of rounds for which the broadcast must be continued, so that eventually all processes collect the same set of values? For a complete answer, provide a brief justification for your answer.

Page 7: Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election

Sample question 5

Here is a description of Peterson's algorithm for leader election on a unidirectional ring: Processes communicate using aliases. Each process two colors: red and black. Initially every process is red. A red process turns black when it quits the race for being a leader. A black process is passive - it only forwards the incoming messages to its neighbor.

(Description of the algorithm included here)

For a ring of eight processes 0 through 7, figure out an initial configuration, so that theleader is elected in the second round.