Verteilte Systeme/Distributed Systems Ch. 5: Various distributed algorithms

Size: px
Start display at page:

Download "Verteilte Systeme/Distributed Systems Ch. 5: Various distributed algorithms"

Transcription

1 Verteilte Systeme/Distributed Systems Ch. 5: Various distributed algorithms Holger Karl Computer Networks Group Universität Paderborn

2 Goal of this chapter Apart from issues in distributed time and resulting questions like global snapshots, there are many additional algorithmic questions This chapter will study some typical problems in distributed systems and their algorithmic solution Leader election algorithms Mutual exclusion Global snapshot Distributed consensus WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 2

3 Overview Leader election Mutual exclusion Global snapshot Distributed consensus WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 3

4 Goal of leader election Suppose a distributed system consists of a collection of homogeneous participants How to pick one out of this group? Purpose: this one might take over certain duties, additional tasks, coordinate other system participants, Break symmetry Crucial requirement: This choice is unambiguously known to all group members! Leader election problem WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 4

5 Leader election algorithms assumptions Basic assumptions Each participant has a unique identifier Goal is to choose that member with the largest identifier as leader Set of all identifiers unknown to all participants Fault assumptions Processes may or may not fail, may behave in a hostile fashion Messages may or may not be lost, corrupted, Different algorithms can handle different fault assumptions Time assumptions Synchronous time model all processes operate in lock-step, bounded message transit time? Asynchronous model no such bounds available? WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 5

6 Leader Election in a Synchronous Ring Assumptions G is a ring consisting of n nodes Nodes are numbered 1 to n Nodes do not know their indices, nor those of their neighbors Node can distinguish its clockwise neighbor from its counterclockwise neighbor WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 6

7 Leader Election in a Synchronous Ring Task Find an algorithm so that at the end of each execution exactly one node declares itself the leader Possible variations All other nodes additionally declare themselves the non-leader G is unidirectional or bidirectional n is known or not Processes can be identical or different (by UID) Possible with identical processes? WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 7

8 LCR Leader-Election-Algorithmus Simple algorithm by Le Lann, Chang, and Roberts (LCR) Assumptions: G unidirectional, n unknown, only leader performs output, nodes know their uniform identifier (UID) Algorithm (informal) Each node sends its UID to its neighbor. A received UID is compared to the own UID. If new UID < own UID: ignore new UID, send largest UID so far If new UID > largest so far occurred UID: pass this UID on If new UID = own UID: claim leadership Invariant: Each node sends in every round the largest so far occurred UID to its neighbor WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 8

9 LCR Leader Election Proof of correctness: induction over number of rounds Time complexity: O(n) Message complexity: O(n 2 ) Time complexity is acceptable, but many messages Algorithm with substantially fewer messages possible? WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 9

10 Leader Election in Arbitrary Graphs FloodMax algorithm Assumption: diameter d of the graph is known Every process sends in every round the so far largest UID to its neighbors After d rounds the process is leader that has not seen a greater UID than its own Improvement Process sends only messages to its neighbors if it received a value larger than its own After d rounds the winner is again determined Synchronization! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 10

11 Leader Election in Arbitrary Graphs Leader Election possible even if neither the number of nodes nor the diameter of the graph are known? Yes! One possibility: search the whole graph How? Tip: breadth-first search Or by intermediate steps first determine the diameter How? Tip: breadth-first search See exercise sheet WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 11

12 Leader Election in Asynchronous Networks Adaptation of optimized FloodMax In the beginning each process sends its UID to every neighbor When a process sees a UID that is greater than the so far greatest, it sends it to its neighbors Properties Eventually, all processes will receive the largest UID But when to terminate??? In the synchronous model it was simple by counting the rounds, but here unclear! Would knowledge about the graph s diameter help? Different solutions possible (spanning tree and the like), but more expensive than in the synchronous model WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 12

13 Spanning Tree Spanning tree for the execution of broadcasts Spanning tree: partial graph that contains all nodes but only edges to create a tree Size or diameter of the graph are unknown Algorithm The root node sends a search message to each neighbor Processes that receive a search message Mark themselves as part of the tree Set the sending node as father node in the tree Send a search message to each neighbor (except for father) Already marked nodes ignore search messages WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 13

14 Spanning Tree Properties Algorithm terminates when no search messages are on the way (how can this be detected?) Algorithm creates spanning tree In a synchronous network this algorithm even creates a breadth-first spanning tree! Send message with search messages for broadcast Child pointer ascertainable by reflected search messages Convergecast: leaves send information along the tree to the root Useful for distributed termination, e.g. with a leader election: each node starts a Broadcast/Convergecast WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 14

15 Bully algorithm Assumption All nodes know already the unique IDs of all other nodes So leader choice is trivial, but nodes, including coordinators, may fail Algorithm Once a node suspects the coordinator of having failed, it sends an ELECTION message to all nodes with a larger ID If initiator does get no answer at all, it becomes the new coordinator If this initiator gets an answer from one of these nodes, that node will take over coordinator role How to handle multiple answering nodes? Recursive process of becoming initiators again, until one node does not get any answers any more WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 15

16 Example: Bully-Algorithm 1 2 Election 5 OK Election OK OK Election Coordinator 4 6 Election Election 0 Election 3 7 Coordinator WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 16

17 Overview Leader election Mutual exclusion Global snapshot Distributed consensus WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 17

18 Mutual exclusion in distributed systems Problem of mutual exclusion: when processes execute concurrently, there may be crucial portions of code which may only be executed by at most one process at any one time This/these piece(s) of code form a so-called critical region In non-distributed systems: semaphores to protect such critical regions But this does not directly carry over to distributed systems! Options Centralized algorithm Distributed algorithm Token-Ring-based algorithm WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 18

19 A centralized algorithm for mutual exclusion Run a leader election algorithm, determine a coordinator for a critical region Known to everybody Coordinator holds a token for the critical region Node who wants to enter into the region sends message to coordinator If coordinator owns token, send it Else, put request into a queue After leaving the critical region, send back token to coordinator WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 19

20 Example: Mutual-Exclusion-Server Queue of requests Server 4 Token p Request token 1. Request token 5. Release token 6. Grant 3. token Request token 2. Grant token p 4 p 2 p 3 WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 20

21 Properties + Mutual exclusion is achieved + Fair requests are served in order + Easy to implement + Per access to critical region, only three messages are required Coordinator is single point of failure When a requester is blocked, impossible to distinguish between a failed coordinator and a long queue Coordinator becomes a performance bottleneck in large systems In particular when serving more than one critical region WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 21

22 Distributed mutual exclusion How to achieve mutual exclusion without a coordinator? All processes use multicast All processes have a logical clock When trying to enter into the critical region Send a request to all other nodes All other nodes have to agree to such a request before a node may enter critical region WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 22

23 Example distributed mutual exclusion (1) Timestamp = 8 p p 2 p 3 12 Timestamp = 12 Prozesses p 1 phas 1 and smallest p 3 want timestamp to enter critical and wins region WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 23

24 Example distributed mutual exclusion(2) p 1 enters critical region p 1 OK OK p 2 p 3 OK Prozess p 1 has smallest timestamp and wins WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 24

25 Example distributed mutual exclusion (3) p 1 leaves critical region p 1 OK Any problems if these messages are not delivered in atomic order??? p 2 p 3 p 3 enters critical region Once prozess p 1 is done, it leaves critical region and sends OK to p 3. WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 25

26 Algorithm (Ricart and Agrawala, 1981) On initialization state := RELEASED; To enter the section state := WANTED; Multicast request to all processes; T := request s timestamp; Wait until (number of replies received = (N 1)); state := HELD; On receipt of a request <T i, p i > at p j (i j) if (state = HELD or (state = WANTED and (T, p j ) < (T i, p i ))) then queue request from p i without replying; else reply immediately to p i ; end if To exit the critical section state := RELEASED; reply to all queued requests; WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 26

27 Properties of distributed mutual exclusion In simple form, each node turns into a single point of failure N of them, instead of just one Can be overcome by using additional protocol mechanisms E.g., a more powerful group communication protocol! With terminating reliable multicast Each process is involved in decision about access to critical region, even if not interested Possible improvement: simple majority suffices In total: slower, more complicated, more expensive, less robust Finally, like eating spinach and learning Latin in high school, some things are said to be good for you in some abstract way. (Tanenbaum) WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 27

28 Comparison mutual exclusion Algorithm Messages per entry/ exit Delay before entry (in message times) Problems Centralized 3 2 Coordinator crash, bottleneck Distributed 2 ( n 1 ) 2 ( n 1 ) Crash of any process Token ring 1 to 0 to n 1 Lost token, process crash WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 28

29 Overview Leader election Mutual exclusion Global snapshot Distributed consensus WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 29

30 Applications of logical time: Global states How to find out whether a given property is true of a distributed system in its current state? Distributed garbage collection: Are there still pointers to an object around? Danger: pointers to objects may currently be in transit between processes! Distributed deadlock detection: Look for cycle in wait-for graph Distributed termination detection: Problem again are requests in transit Distributed debugging Deciding whether to deliver group view changes objec t reference p 1 p 1 p 1 passive message wait-for wait-for ac tiv ate p 2 garbage object p 2 p 2 passive WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 30

31 Snapshot algorithm to determine global state Goal: Provide algorithm to compute global state of distributed system Assumptions Neither channels nor processes fail; messages arrive intact, exactly once Channels are unidirectional, pair-wise, FIFO Graphs of processes and channels is strongly connected Any process may initiate a global snapshot at any time Processes may continue execution and send/receive normal messages while the snapshot takes place Snapshot Algorithm, Chandy & Lamport, 1985 WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 31

32 Snapshot algorithm core ideas Each process records Its own state For each incoming channel, messages arrived via this channel after receiver has recorded state, sent before sender has recorded its state Accounts for messages transmitted, but not yet received for different points in time of process state recording Channels also have state, messages sent but not received Algorithm uses marker messages Prompts receiver to record its own state Determines which messages are included in the channel state Start of algorithm: Initiator behaves as if it had received a marker (over a fictive channel) WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 32

33 Snapshot algorithm process model WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 33

34 Snapshot algorithm Marker receiving rule for process p i On p i s receipt of a marker message over channel c: if (p i has not yet recorded its state) it records its process state now; records the state of c as the empty set; turns on recording of messages arriving over other incoming channels; else p i records the state of c as the set of messages it has received over c since it saved its state. end if Marker sending rule for process p i After p i has recorded its state, for each outgoing channel c: p i sends one marker message over c (before it sends any other message over c). WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 34

35 Snapshot algorithm some steps b) Process Q has received marker for the first time; records its local state c) Q records all incoming messages d) Q receives marker on its incoming channel; stops recording further messages on this channel WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 35

36 Snapshot example P 1 State1 P 2 P 3 State2 State3 WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 36!

37 Snapshot example P 1 M M C 21 ={ State1 C 31 ={ P 2 P 3 State2 State3 WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 37

38 Snapshot example P 1 State1 State1 C 21 ={ C 31 ={ } M M C 12 ={} C 32 ={ P 2 M P 3 M State2 State3 WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 38

39 Snapshot example P 1 State1 State1 C 21 ={ C 31 ={ } } M State2 C 12 ={} C 32 ={ } P 2 P 3 M State2 M M State3 C 13 ={ } C 23 ={}! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 39

40 Snapshot algorithm Example 2, initial state p c 2 1 p 2 c 1 $1000 (none) $ ac count widget s ac count widget s WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 40

41 Snapshot algorithm Example 2, progress 1. Global state S 0 <$1000, 0> p 1 c 2 (empty) p 2 <$50, 2000> c 1 (empty) 2. Global state S 1 <$900, 0> p 1 c 2 (Order 10, $100), M p 2 <$50, 2000> c 1 (empty) 3. Global state S 2 <$900, 0> p 1 c 2 (Order 10, $100), M p 2 <$50, 1995> c 1 (five widgets) 4. Global state S 3 <$900, 5> p 1 c 2 (Order 10, $100) p 2 <$50, 1995> c 1 (empty) (M = marker mess age) Resulting recorded state: p 1 = <$1000,0>; p 2 = <$50, 1995>; c 1 = <five widgets>; c 2 = <> WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 41

42 Snapshot summary It is impossible to record a global state simultaneously The Chandy/Lamport algorithm provides a way of taking a snapshot in a distributed fashion A global state exactly equal to this snapshot might never have occurred in this way in the actual system WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 42

43 Overview Leader election Mutual exclusion Global snapshot Distributed consensus WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 43

44 Consensus Problem statement Each process starts the algorithm with an initial value Outputs are required to be the same All processes must decide for some output value Often: a particular value is seen as preferable Different criteria of validity of a solution Areas of application Status of a transaction, equivalence of sensor data, failure detection,... Consensus is simple to solve in the absence of failures With failures? Communication/link failures? Process failures? Time model here: Synchronous model! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 44

45 Consensus with Link Failures Model Coordinated attack Two armies form up for an attack against each other One army is split into two parts that have to attack together alone they will lose Commanders of the parts communicate via messengers who can be captured Which rules shall the commanders use to agree on an attack date? Developed: modeling of data base problems How to coordinate? WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 45

46 Consensus with Link Failures Consensus is impossible to solve in these conditions! Look at graph G with two nodes and bidirectional edge, each node can decide for 0 or 1 (e.g., abort or commit) Requirements for the solution algorithm Agreement: Both processes decide on the same values. Validity: If both processes start with 0, then 0 is the only possible decision value. If both processes start with 1 and all messages are delivered, then 1 is the only possible decision value. Termination: Both processes eventually decide. Very weak requirements only to exclude trivial solutions Just always outputting 0 is not valid solution algorithm But: not even solvable under such relaxed requirements! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 46

47 Proof by Contradiction (sketch) Assumption: algorithm for coordinated attack in G exists Without restriction: both nodes send messages in every round Let α be the execution when both nodes start with value 1 and all messages are delivered Both processes decide in α for the value 1, after r rounds Let α 1 be the same execution as α, when all messages after round r are lost Both processes decide in α 1 for the value 1, after r rounds Let α 2 be the same execution as α 1, except that the last message from node 1 to 2 is lost α 1 ~ 1 α 2 (i.e., executions α 1 and α 2 are not distinguishable for process 1) Since process 1 decides 1 in α 1, it also decides 1 in α 2 By the termination and agreement properties, process 2 also decides 1 in α 2 (possibly after some further state transitions) WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 47

48 Proof by Contradiction (sketch) Let α 3 be the same execution as α 2, except that the last message from node 2 to 1 is lost α 2 ~ 2 α 3 Since process 2 decides 1 in α 2 it also decides 1 in α 3 By the termination and agreement properties, process 1 also decides 1 in α 3 Continue to remove messages in this way until execution α, in which no messages are delivered Both processes are forced to decide 1 in α! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 48

49 Proof by Contradiction (sketch) Now consider the execution α in which process 1 starts with 1 but process 2 starts with 0, and no messages are delivered α ~ 1 α Hence process 1 decides 1 Process 2 decides 1 in α, by termination and agreement In the execution α both processes start with 0, no messages are delivered α ~ 2 α So process 2 decides 1 also in α (because no difference is noticeable!) But contradiction to validity condition requires that both processes decide 0! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 49

50 Consensus with Link Failure a Way Out? Proof is easily expanded to n nodes Consensus with link failures is even with weak assumptions not solvable by deterministic algorithms Possible way out: randomized algorithms Algorithm gives a correct result with high probability Idea: an opponent (may destroy messages) tries to mislead the algorithm into a false decision Modified agreement condition: for each opponent P (some nodes decide 0, others 1) < ε ε can depend, e.g., on the number of rounds WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 50

51 Consensus with Process Failures Assumptions Communication is error-free Processes stop or Processes show Byzantine (arbitrary) behavior Many other assumptions are possible In particular: processes can fail if they have sent only a part of a message Example: Process B sends a broadcast to processes A and C, but fails after the message has been sent to A but not to C WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 51

52 Consensus with Process Failures Correctness conditions Agreement: No two processes decide on different values. Validity: If all processes start with the same value, then this value is the only valid one Sometimes also: The initial value of each process is a valid final value Termination: All nonfaulty processes eventually decide Fault model Why is it necessary to restrict here to nonfaulty processes? At most f processes will fail WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 52

53 Consensus with Failing Processes FloodSet algorithm Each process stores a subset W out of the valid values V Initially: W is the value that the respective process proposes After every round each process broadcasts W to all participants All received elements are added to W After f +1 rounds each process decides Has W only one element, this is the result Otherwise a default value is chosen (e.g. the smallest possible value v 0 ) validity makes no requirements for the case when there is more than a single initial value! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 53

54 Consensus with Failing Processes Why f +1 rounds? At most f nodes may fail With f +1 rounds, there is at least one round in which no node fails in this round consensus is established f +1 rounds, O((f +1)n 2 ) messages Optimizations possible (exponential information gathering algorithms which function also for other failure models) Why not decide after two rounds? See exercise sheet Hint: partly sending before failure WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 54

55 Consensus with Byzantine Processes Correctness conditions Agreement: No two nonfaulty processes decide on different values Validity: If all nonfaulty processes start with the same value, then this value is the only valid one Termination: All nonfaulty processes eventually decide Remark: Restriction of the validity conditions to only nonfaulty processes because conditions for the behavior of Byzantine processes make no sense n > 3f required (triple modular redundancy not sufficient!) For failing processes such a limit does not exist! An algorithm for Byzantine processes does in general not solve the consensus problem for failing processes Reason: In version for failing processes all processes that decide have to agree even processes that fail after they have decided! WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 55

56 n=3, f=1 does not Solve Byzantine Agreement Example algorithm (no failure) Round 1: Everybody sends its own value to its neighbor Round 2: Everybody sends value of each neighbor to the other neighbor B 0 B A C 1 B said 0 1 A B said 0 C 1 1 Initial value WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 56

57 n=3, f=1 does not Solve Byzantine Agreement Execution α 1 : C is faulty Round 1: Round 2: B 1 B B said 1 1 A 0 C 0 A B said 0 C A and B decide 1 because of validity WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 57

58 n=3, f=1 does not Solve Byzantine Agreement Execution α 2 : A is faulty Round 1: Round 2: B 0 B B said 1 1 A 0 C 0 A B said 0 C B and C decide 0 because of validity WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 58

59 n=3, f=1 does not Solve Byzantine Agreement Execution α 3 : B is faulty Round 1: Round 2: B B B said 1 1 A 0 C 0 A B said 0 C A and C would have to decide for the same value because of agreement WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 59

60 n=3, f=1 does not Solve Byzantine Agreement Thus: α 1 ~ 1 α 3 Process A decides 1 in α 1 (because of validity condition) and therefore also in α 3 α 2 ~ 3 α 3 Process C decides 0 in α 2 and therefore also in α 3 Processes A and C violate the agreement condition in α 3 This algorithm cannot solve Byzantine agreement for n = 3f Because no statement was made about the type of decision making this holds for all algorithms with this communication structure Argument can be extended to a proof for arbitrary algorithms with n = 3f (with arbitrary messages, rounds) WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 60

61 Byzantine agreement for n > 4f with 2(f+1) rounds WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 61

62 Example: n=5, f=1, 2(1+1) rounds, 2nd proc is traitor Processor Initial value 7 % Initial preference % Round 1 Preferences % Majority 7 % Multiplicity Round 2 King majority 7 Preference Round 3 Preference Majority Multiplicity Round 4 King majority 1,2,3,4 Preference Decision WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 62

63 Powerful algorithms for Byzantine Agreement: EIG To achieve bound n > 3f for Byzantine Agreement, better algorithms exist Popular: Exponential Information Gathering Each node builds a tree of all the information all other nodes have achieved in all previous rounds Complex information exchange among nodes Relatively complex decisions rules WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 63

64 Conclusions Both leader election and mutual exclusions are building blocks for more complex distributed functions Both algorithms entail non-trivial, but usually acceptable overhead Consensus is even worse: even under mild reality assumptions, it becomes an unsolvable problem And this was only assuming synchronous time! Full distribution is something that needs to be carefully considered as it entails substantial costs as well WS 10/11, v 1.2 Distributed Systems, Ch 5: Various distributed algorithms 64

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers

Clock Synchronization. Synchronization. Clock Synchronization Algorithms. Physical Clock Synchronization. Tanenbaum Chapter 6 plus additional papers Clock Synchronization Synchronization Tanenbaum Chapter 6 plus additional papers Fig 6-1. In a distributed system, each machine has its own clock. When this is the case, an event that occurred after another

More information

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201

Distributed Systems. coordination Johan Montelius ID2201. Distributed Systems ID2201 Distributed Systems ID2201 coordination Johan Montelius 1 Coordination Coordinating several threads in one node is a problem, coordination in a network is of course worse: failure of nodes and networks

More information

Coordination 1. To do. Mutual exclusion Election algorithms Next time: Global state. q q q

Coordination 1. To do. Mutual exclusion Election algorithms Next time: Global state. q q q Coordination 1 To do q q q Mutual exclusion Election algorithms Next time: Global state Coordination and agreement in US Congress 1798-2015 Process coordination How can processes coordinate their action?

More information

Coordination and Agreement

Coordination and Agreement Coordination and Agreement Nicola Dragoni Embedded Systems Engineering DTU Informatics 1. Introduction 2. Distributed Mutual Exclusion 3. Elections 4. Multicast Communication 5. Consensus and related problems

More information

CSE 486/586 Distributed Systems

CSE 486/586 Distributed Systems CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo CSE 486/586 Recap: Consensus On a synchronous system There s an algorithm that works. On

More information

PROCESS SYNCHRONIZATION

PROCESS SYNCHRONIZATION DISTRIBUTED COMPUTER SYSTEMS PROCESS SYNCHRONIZATION Dr. Jack Lange Computer Science Department University of Pittsburgh Fall 2015 Process Synchronization Mutual Exclusion Algorithms Permission Based Centralized

More information

Initial Assumptions. Modern Distributed Computing. Network Topology. Initial Input

Initial Assumptions. Modern Distributed Computing. Network Topology. Initial Input Initial Assumptions Modern Distributed Computing Theory and Applications Ioannis Chatzigiannakis Sapienza University of Rome Lecture 4 Tuesday, March 6, 03 Exercises correspond to problems studied during

More information

Process Synchroniztion Mutual Exclusion & Election Algorithms

Process Synchroniztion Mutual Exclusion & Election Algorithms Process Synchroniztion Mutual Exclusion & Election Algorithms Paul Krzyzanowski Rutgers University November 2, 2017 1 Introduction Process synchronization is the set of techniques that are used to coordinate

More information

Distributed Algorithms 6.046J, Spring, Nancy Lynch

Distributed Algorithms 6.046J, Spring, Nancy Lynch Distributed Algorithms 6.046J, Spring, 205 Nancy Lynch What are Distributed Algorithms? Algorithms that run on networked processors, or on multiprocessors that share memory. They solve many kinds of problems:

More information

Distributed Algorithms 6.046J, Spring, 2015 Part 2. Nancy Lynch

Distributed Algorithms 6.046J, Spring, 2015 Part 2. Nancy Lynch Distributed Algorithms 6.046J, Spring, 2015 Part 2 Nancy Lynch 1 This Week Synchronous distributed algorithms: Leader Election Maximal Independent Set Breadth-First Spanning Trees Shortest Paths Trees

More information

Synchronization. Chapter 5

Synchronization. Chapter 5 Synchronization Chapter 5 Clock Synchronization In a centralized system time is unambiguous. (each computer has its own clock) In a distributed system achieving agreement on time is not trivial. (it is

More information

21. Distributed Algorithms

21. Distributed Algorithms 21. Distributed Algorithms We dene a distributed system as a collection of individual computing devices that can communicate with each other [2]. This denition is very broad, it includes anything, from

More information

Distributed Leader Election Algorithms in Synchronous Networks

Distributed Leader Election Algorithms in Synchronous Networks Distributed Leader Election Algorithms in Synchronous Networks Mitsou Valia National Technical University of Athens School of Applied Mathematics and Physics 1/66 Distributed Computing Distributed computing

More information

Failure Tolerance. Distributed Systems Santa Clara University

Failure Tolerance. Distributed Systems Santa Clara University Failure Tolerance Distributed Systems Santa Clara University Distributed Checkpointing Distributed Checkpointing Capture the global state of a distributed system Chandy and Lamport: Distributed snapshot

More information

Consensus Problem. Pradipta De

Consensus Problem. Pradipta De Consensus Problem Slides are based on the book chapter from Distributed Computing: Principles, Paradigms and Algorithms (Chapter 14) by Kshemkalyani and Singhal Pradipta De pradipta.de@sunykorea.ac.kr

More information

Last Class: Clock Synchronization. Today: More Canonical Problems

Last Class: Clock Synchronization. Today: More Canonical Problems Last Class: Clock Synchronization Logical clocks Vector clocks Global state Lecture 12, page 1 Today: More Canonical Problems Distributed snapshot and termination detection Election algorithms Bully algorithm

More information

Distributed Synchronization. EECS 591 Farnam Jahanian University of Michigan

Distributed Synchronization. EECS 591 Farnam Jahanian University of Michigan Distributed Synchronization EECS 591 Farnam Jahanian University of Michigan Reading List Tanenbaum Chapter 5.1, 5.4 and 5.5 Clock Synchronization Distributed Election Mutual Exclusion Clock Synchronization

More information

Chapter 16: Distributed Synchronization

Chapter 16: Distributed Synchronization Chapter 16: Distributed Synchronization Chapter 16 Distributed Synchronization Event Ordering Mutual Exclusion Atomicity Concurrency Control Deadlock Handling Election Algorithms Reaching Agreement 18.2

More information

Mutual Exclusion. A Centralized Algorithm

Mutual Exclusion. A Centralized Algorithm Mutual Exclusion Processes in a distributed system may need to simultaneously access the same resource Mutual exclusion is required to prevent interference and ensure consistency We will study three algorithms

More information

Distributed Systems Coordination and Agreement

Distributed Systems Coordination and Agreement Distributed Systems Coordination and Agreement Allan Clark School of Informatics University of Edinburgh http://www.inf.ed.ac.uk/teaching/courses/ds Autumn Term 2012 Coordination and Agreement Overview

More information

To do. Consensus and related problems. q Failure. q Raft

To do. Consensus and related problems. q Failure. q Raft Consensus and related problems To do q Failure q Consensus and related problems q Raft Consensus We have seen protocols tailored for individual types of consensus/agreements Which process can enter the

More information

Chapter 18: Distributed

Chapter 18: Distributed Chapter 18: Distributed Synchronization, Silberschatz, Galvin and Gagne 2009 Chapter 18: Distributed Synchronization Event Ordering Mutual Exclusion Atomicity Concurrency Control Deadlock Handling Election

More information

CMPSCI 677 Operating Systems Spring Lecture 14: March 9

CMPSCI 677 Operating Systems Spring Lecture 14: March 9 CMPSCI 677 Operating Systems Spring 2014 Lecture 14: March 9 Lecturer: Prashant Shenoy Scribe: Nikita Mehra 14.1 Distributed Snapshot Algorithm A distributed snapshot algorithm captures a consistent global

More information

11/7/2018. Event Ordering. Module 18: Distributed Coordination. Distributed Mutual Exclusion (DME) Implementation of. DME: Centralized Approach

11/7/2018. Event Ordering. Module 18: Distributed Coordination. Distributed Mutual Exclusion (DME) Implementation of. DME: Centralized Approach Module 18: Distributed Coordination Event Ordering Event Ordering Mutual Exclusion Atomicity Concurrency Control Deadlock Handling Election Algorithms Reaching Agreement Happened-before relation (denoted

More information

Distributed Systems 11. Consensus. Paul Krzyzanowski

Distributed Systems 11. Consensus. Paul Krzyzanowski Distributed Systems 11. Consensus Paul Krzyzanowski pxk@cs.rutgers.edu 1 Consensus Goal Allow a group of processes to agree on a result All processes must agree on the same value The value must be one

More information

Synchronization Part 2. REK s adaptation of Claypool s adaptation oftanenbaum s Distributed Systems Chapter 5 and Silberschatz Chapter 17

Synchronization Part 2. REK s adaptation of Claypool s adaptation oftanenbaum s Distributed Systems Chapter 5 and Silberschatz Chapter 17 Synchronization Part 2 REK s adaptation of Claypool s adaptation oftanenbaum s Distributed Systems Chapter 5 and Silberschatz Chapter 17 1 Outline Part 2! Clock Synchronization! Clock Synchronization Algorithms!

More information

Algorithms for COOPERATIVE DS: Leader Election in the MPS model

Algorithms for COOPERATIVE DS: Leader Election in the MPS model Algorithms for COOPERATIVE DS: Leader Election in the MPS model 1 Leader Election (LE) problem In a DS, it is often needed to designate a single processor (i.e., a leader) as the coordinator of some forthcoming

More information

Self Stabilization. CS553 Distributed Algorithms Prof. Ajay Kshemkalyani. by Islam Ismailov & Mohamed M. Ali

Self Stabilization. CS553 Distributed Algorithms Prof. Ajay Kshemkalyani. by Islam Ismailov & Mohamed M. Ali Self Stabilization CS553 Distributed Algorithms Prof. Ajay Kshemkalyani by Islam Ismailov & Mohamed M. Ali Introduction There is a possibility for a distributed system to go into an illegitimate state,

More information

6.852: Distributed Algorithms Fall, Instructor: Nancy Lynch TAs: Cameron Musco, Katerina Sotiraki Course Secretary: Joanne Hanley

6.852: Distributed Algorithms Fall, Instructor: Nancy Lynch TAs: Cameron Musco, Katerina Sotiraki Course Secretary: Joanne Hanley 6.852: Distributed Algorithms Fall, 2015 Instructor: Nancy Lynch TAs: Cameron Musco, Katerina Sotiraki Course Secretary: Joanne Hanley What are Distributed Algorithms? Algorithms that run on networked

More information

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf

Distributed systems. Lecture 6: distributed transactions, elections, consensus and replication. Malte Schwarzkopf Distributed systems Lecture 6: distributed transactions, elections, consensus and replication Malte Schwarzkopf Last time Saw how we can build ordered multicast Messages between processes in a group Need

More information

CSc Leader Election

CSc Leader Election CSc72010 Leader Election Reading Skim 3.5 Read 3.6, General synchronous networks Read 4.1 Leader election algorithms Lelann/Chang/Roberts: O(n) time complexity O(n 2 ) message complexity Hirschberg/Sinclair

More information

Distributed Systems 8L for Part IB

Distributed Systems 8L for Part IB Distributed Systems 8L for Part IB Handout 3 Dr. Steven Hand 1 Distributed Mutual Exclusion In first part of course, saw need to coordinate concurrent processes / threads In particular considered how to

More information

6.852: Distributed Algorithms Fall, Class 12

6.852: Distributed Algorithms Fall, Class 12 6.852: Distributed Algorithms Fall, 2009 Class 12 Today s plan Weak logical time and vector timestamps Consistent global snapshots and stable property detection. Applications: Distributed termination.

More information

Introduction to Distributed Systems Seif Haridi

Introduction to Distributed Systems Seif Haridi Introduction to Distributed Systems Seif Haridi haridi@kth.se What is a distributed system? A set of nodes, connected by a network, which appear to its users as a single coherent system p1 p2. pn send

More information

Silberschatz and Galvin Chapter 18

Silberschatz and Galvin Chapter 18 Silberschatz and Galvin Chapter 18 Distributed Coordination CPSC 410--Richard Furuta 4/21/99 1 Distributed Coordination Synchronization in a distributed environment Ð Event ordering Ð Mutual exclusion

More information

Lecture 1: Introduction to distributed Algorithms

Lecture 1: Introduction to distributed Algorithms Distributed Algorithms M.Tech., CSE, 2016 Lecture 1: Introduction to distributed Algorithms Faculty: K.R. Chowdhary : Professor of CS Disclaimer: These notes have not been subjected to the usual scrutiny

More information

CSE 5306 Distributed Systems. Synchronization

CSE 5306 Distributed Systems. Synchronization CSE 5306 Distributed Systems Synchronization 1 Synchronization An important issue in distributed system is how processes cooperate and synchronize with one another Cooperation is partially supported by

More information

Broadcast: Befo re 1

Broadcast: Befo re 1 Broadcast: Before 1 After 2 Spanning Tree ffl assume fixed spanning tree ffl asynchronous model 3 Processor State parent terminated children 4 Broadcast: Step One parent terminated children 5 Broadcast:Step

More information

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson

Last time. Distributed systems Lecture 6: Elections, distributed transactions, and replication. DrRobert N. M. Watson Distributed systems Lecture 6: Elections, distributed transactions, and replication DrRobert N. M. Watson 1 Last time Saw how we can build ordered multicast Messages between processes in a group Need to

More information

Fault Tolerance. Distributed Software Systems. Definitions

Fault Tolerance. Distributed Software Systems. Definitions Fault Tolerance Distributed Software Systems Definitions Availability: probability the system operates correctly at any given moment Reliability: ability to run correctly for a long interval of time Safety:

More information

Verteilte Systeme (Distributed Systems)

Verteilte Systeme (Distributed Systems) Verteilte Systeme (Distributed Systems) Karl M. Göschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 6: Clocks and Agreement Synchronization of

More information

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016 Distributed Systems 2016 Exam 1 Review Paul Krzyzanowski Rutgers University Fall 2016 Question 1 Why does it not make sense to use TCP (Transmission Control Protocol) for the Network Time Protocol (NTP)?

More information

Homework #2 Nathan Balon CIS 578 October 31, 2004

Homework #2 Nathan Balon CIS 578 October 31, 2004 Homework #2 Nathan Balon CIS 578 October 31, 2004 1 Answer the following questions about the snapshot algorithm: A) What is it used for? It used for capturing the global state of a distributed system.

More information

Distributed Computing over Communication Networks: Leader Election

Distributed Computing over Communication Networks: Leader Election Distributed Computing over Communication Networks: Leader Election Motivation Reasons for electing a leader? Reasons for not electing a leader? Motivation Reasons for electing a leader? Once elected, coordination

More information

Consensus and related problems

Consensus and related problems Consensus and related problems Today l Consensus l Google s Chubby l Paxos for Chubby Consensus and failures How to make process agree on a value after one or more have proposed what the value should be?

More information

Concurrency and OS recap. Based on Operating System Concepts with Java, Sixth Edition, 2003, Avi Silberschatz, Peter Galvin e Greg Gagne

Concurrency and OS recap. Based on Operating System Concepts with Java, Sixth Edition, 2003, Avi Silberschatz, Peter Galvin e Greg Gagne Concurrency and OS recap Based on Operating System Concepts with Java, Sixth Edition, 2003, Avi Silberschatz, Peter Galvin e Greg Gagne 64 Process Concept An operating system executes a variety of programs:

More information

Exam 2 Review. Fall 2011

Exam 2 Review. Fall 2011 Exam 2 Review Fall 2011 Question 1 What is a drawback of the token ring election algorithm? Bad question! Token ring mutex vs. Ring election! Ring election: multiple concurrent elections message size grows

More information

Arvind Krishnamurthy Fall Collection of individual computing devices/processes that can communicate with each other

Arvind Krishnamurthy Fall Collection of individual computing devices/processes that can communicate with each other Distributed Systems Arvind Krishnamurthy Fall 2003 Concurrent Systems Collection of individual computing devices/processes that can communicate with each other General definition encompasses a wide range

More information

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Shrideep Pallickara Computer Science Colorado State University L23.1 Frequently asked questions from the previous class survey

More information

Today: Fault Tolerance. Fault Tolerance

Today: Fault Tolerance. Fault Tolerance Today: Fault Tolerance Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Paxos Failure recovery Checkpointing

More information

Today: Fault Tolerance

Today: Fault Tolerance Today: Fault Tolerance Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Paxos Failure recovery Checkpointing

More information

Last Time. 19: Distributed Coordination. Distributed Coordination. Recall. Event Ordering. Happens-before

Last Time. 19: Distributed Coordination. Distributed Coordination. Recall. Event Ordering. Happens-before Last Time 19: Distributed Coordination Last Modified: 7/3/2004 1:50:34 PM We talked about the potential benefits of distributed systems We also talked about some of the reasons they can be so difficult

More information

Distributed Systems (5DV147)

Distributed Systems (5DV147) Distributed Systems (5DV147) Mutual Exclusion and Elections Fall 2013 1 Processes often need to coordinate their actions Which rocess gets to access a shared resource? Has the master crashed? Elect a new

More information

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey Yes. But what really is a second? 1 second ==time for a cesium 133 atom

More information

Recall our 2PC commit problem. Recall our 2PC commit problem. Doing failover correctly isn t easy. Consensus I. FLP Impossibility, Paxos

Recall our 2PC commit problem. Recall our 2PC commit problem. Doing failover correctly isn t easy. Consensus I. FLP Impossibility, Paxos Consensus I Recall our 2PC commit problem FLP Impossibility, Paxos Client C 1 C à TC: go! COS 418: Distributed Systems Lecture 7 Michael Freedman Bank A B 2 TC à A, B: prepare! 3 A, B à P: yes or no 4

More information

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol

Global atomicity. Such distributed atomicity is called global atomicity A protocol designed to enforce global atomicity is called commit protocol Global atomicity In distributed systems a set of processes may be taking part in executing a task Their actions may have to be atomic with respect to processes outside of the set example: in a distributed

More information

Chapter 8 Fault Tolerance

Chapter 8 Fault Tolerance DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 8 Fault Tolerance Fault Tolerance Basic Concepts Being fault tolerant is strongly related to what

More information

Byzantine Consensus in Directed Graphs

Byzantine Consensus in Directed Graphs Byzantine Consensus in Directed Graphs Lewis Tseng 1,3, and Nitin Vaidya 2,3 1 Department of Computer Science, 2 Department of Electrical and Computer Engineering, and 3 Coordinated Science Laboratory

More information

Consensus and agreement algorithms

Consensus and agreement algorithms CHAPTER 4 Consensus and agreement algorithms 4. Problem definition Agreement among the processes in a distributed system is a fundamental requirement for a wide range of applications. Many forms of coordination

More information

Frequently asked questions from the previous class survey

Frequently asked questions from the previous class survey CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED COORDINATION/MUTUAL EXCLUSION] Shrideep Pallickara Computer Science Colorado State University L22.1 Frequently asked questions from the previous

More information

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University Frequently asked questions from the previous class survey CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED COORDINATION/MUTUAL EXCLUSION] Shrideep Pallickara Computer Science Colorado State University

More information

殷亚凤. Synchronization. Distributed Systems [6]

殷亚凤. Synchronization. Distributed Systems [6] Synchronization Distributed Systems [6] 殷亚凤 Email: yafeng@nju.edu.cn Homepage: http://cs.nju.edu.cn/yafeng/ Room 301, Building of Computer Science and Technology Review Protocols Remote Procedure Call

More information

Distributed Systems Leader election & Failure detection

Distributed Systems Leader election & Failure detection Distributed Systems Leader election & Failure detection He Sun School of Informatics University of Edinburgh Leader of a computation Many distributed computations need a coordinator of server processors

More information

Event Ordering Silberschatz, Galvin and Gagne. Operating System Concepts

Event Ordering Silberschatz, Galvin and Gagne. Operating System Concepts Event Ordering Happened-before relation (denoted by ) If A and B are events in the same process, and A was executed before B, then A B If A is the event of sending a message by one process and B is the

More information

Mutual Exclusion in DS

Mutual Exclusion in DS Mutual Exclusion in DS Event Ordering Mutual Exclusion Election Algorithms Reaching Agreement Event Ordering Happened-before relation (denoted by ). If A and B are events in the same process, and A was

More information

Distributed Systems. Fault Tolerance. Paul Krzyzanowski

Distributed Systems. Fault Tolerance. Paul Krzyzanowski Distributed Systems Fault Tolerance Paul Krzyzanowski Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License. Faults Deviation from expected

More information

Several of these problems are motivated by trying to use solutiions used in `centralized computing to distributed computing

Several of these problems are motivated by trying to use solutiions used in `centralized computing to distributed computing Studying Different Problems from Distributed Computing Several of these problems are motivated by trying to use solutiions used in `centralized computing to distributed computing Problem statement: Mutual

More information

Exam 2 Review. October 29, Paul Krzyzanowski 1

Exam 2 Review. October 29, Paul Krzyzanowski 1 Exam 2 Review October 29, 2015 2013 Paul Krzyzanowski 1 Question 1 Why did Dropbox add notification servers to their architecture? To avoid the overhead of clients polling the servers periodically to check

More information

Distributed Deadlock

Distributed Deadlock Distributed Deadlock 9.55 DS Deadlock Topics Prevention Too expensive in time and network traffic in a distributed system Avoidance Determining safe and unsafe states would require a huge number of messages

More information

2. Time and Global States Page 1. University of Freiburg, Germany Department of Computer Science. Distributed Systems

2. Time and Global States Page 1. University of Freiburg, Germany Department of Computer Science. Distributed Systems 2. Time and Global States Page 1 University of Freiburg, Germany Department of Computer Science Distributed Systems Chapter 3 Time and Global States Christian Schindelhauer 12. May 2014 2. Time and Global

More information

Agreement in Distributed Systems CS 188 Distributed Systems February 19, 2015

Agreement in Distributed Systems CS 188 Distributed Systems February 19, 2015 Agreement in Distributed Systems CS 188 Distributed Systems February 19, 2015 Page 1 Introduction We frequently want to get a set of nodes in a distributed system to agree Commitment protocols and mutual

More information

Leader Election in Rings

Leader Election in Rings Leader Election Arvind Krishnamurthy Fall 2003 Leader Election in Rings Under different models: Synchronous vs. asynchronous Anonymous vs. non-anonymous (knowledge of unique id) Knowledge of n (non-uniform)

More information

UNIT IV 1. What is meant by hardware and software clock? Clock devices can be programmed to generate interrupts at regular intervals in orders that, for example, time slicing can be implemented.the operating

More information

Dep. Systems Requirements

Dep. Systems Requirements Dependable Systems Dep. Systems Requirements Availability the system is ready to be used immediately. A(t) = probability system is available for use at time t MTTF/(MTTF+MTTR) If MTTR can be kept small

More information

How Bitcoin achieves Decentralization. How Bitcoin achieves Decentralization

How Bitcoin achieves Decentralization. How Bitcoin achieves Decentralization Centralization vs. Decentralization Distributed Consensus Consensus without Identity, using a Block Chain Incentives and Proof of Work Putting it all together Centralization vs. Decentralization Distributed

More information

Distributed Systems Fault Tolerance

Distributed Systems Fault Tolerance Distributed Systems Fault Tolerance [] Fault Tolerance. Basic concepts - terminology. Process resilience groups and failure masking 3. Reliable communication reliable client-server communication reliable

More information

Synchronization. Clock Synchronization

Synchronization. Clock Synchronization Synchronization Clock Synchronization Logical clocks Global state Election algorithms Mutual exclusion Distributed transactions 1 Clock Synchronization Time is counted based on tick Time judged by query

More information

Failures, Elections, and Raft

Failures, Elections, and Raft Failures, Elections, and Raft CS 8 XI Copyright 06 Thomas W. Doeppner, Rodrigo Fonseca. All rights reserved. Distributed Banking SFO add interest based on current balance PVD deposit $000 CS 8 XI Copyright

More information

Selected Questions. Exam 2 Fall 2006

Selected Questions. Exam 2 Fall 2006 Selected Questions Exam 2 Fall 2006 Page 1 Question 5 The clock in the clock tower in the town of Chronos broke. It was repaired but now the clock needs to be set. A train leaves for the nearest town,

More information

Failure Models. Fault Tolerance. Failure Masking by Redundancy. Agreement in Faulty Systems

Failure Models. Fault Tolerance. Failure Masking by Redundancy. Agreement in Faulty Systems Fault Tolerance Fault cause of an error that might lead to failure; could be transient, intermittent, or permanent Fault tolerance a system can provide its services even in the presence of faults Requirements

More information

BYZANTINE GENERALS BYZANTINE GENERALS (1) A fable: Michał Szychowiak, 2002 Dependability of Distributed Systems (Byzantine agreement)

BYZANTINE GENERALS BYZANTINE GENERALS (1) A fable: Michał Szychowiak, 2002 Dependability of Distributed Systems (Byzantine agreement) BYZANTINE GENERALS (1) BYZANTINE GENERALS A fable: BYZANTINE GENERALS (2) Byzantine Generals Problem: Condition 1: All loyal generals decide upon the same plan of action. Condition 2: A small number of

More information

Distributed Systems. Chapman & Hall/CRC. «H Taylor S* Francis Croup Boca Raton London New York

Distributed Systems. Chapman & Hall/CRC. «H Taylor S* Francis Croup Boca Raton London New York Distributed Systems An Algorithmic Approach Sukumar Ghosh University of Iowa Iowa City, U.S.A. Chapman & Hall/CRC «H Taylor S* Francis Croup Boca Raton London New York Chapman & Hall/CRC is an imprint

More information

Today: Fault Tolerance. Failure Masking by Redundancy

Today: Fault Tolerance. Failure Masking by Redundancy Today: Fault Tolerance Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Failure recovery Checkpointing

More information

Distributed Deadlocks. Prof. Ananthanarayana V.S. Dept. of Information Technology N.I.T.K., Surathkal

Distributed Deadlocks. Prof. Ananthanarayana V.S. Dept. of Information Technology N.I.T.K., Surathkal Distributed Deadlocks Prof. Ananthanarayana V.S. Dept. of Information Technology N.I.T.K., Surathkal Objectives of This Module In this module different kind of resources, different kind of resource request

More information

Chapter 8 Fault Tolerance

Chapter 8 Fault Tolerance DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 8 Fault Tolerance 1 Fault Tolerance Basic Concepts Being fault tolerant is strongly related to

More information

Distributed Coordination! Distr. Systems: Fundamental Characteristics!

Distributed Coordination! Distr. Systems: Fundamental Characteristics! Distributed Coordination! What makes a system distributed?! Time in a distributed system! How do we determine the global state of a distributed system?! Event ordering! Mutual exclusion! Reading: Silberschatz,

More information

Lecture 2: Leader election algorithms.

Lecture 2: Leader election algorithms. Distributed Algorithms M.Tech., CSE, 0 Lecture : Leader election algorithms. Faculty: K.R. Chowdhary : Professor of CS Disclaimer: These notes have not been subjected to the usual scrutiny reserved for

More information

Today: Fault Tolerance. Replica Management

Today: Fault Tolerance. Replica Management Today: Fault Tolerance Failure models Agreement in presence of faults Two army problem Byzantine generals problem Reliable communication Distributed commit Two phase commit Three phase commit Failure recovery

More information

Distributed Systems. Before We Begin. Advantages. What is a Distributed System? CSE 120: Principles of Operating Systems. Lecture 13.

Distributed Systems. Before We Begin. Advantages. What is a Distributed System? CSE 120: Principles of Operating Systems. Lecture 13. CSE 120: Principles of Operating Systems Lecture 13 Distributed Systems December 2, 2003 Before We Begin Read Chapters 15, 17 (on Distributed Systems topics) Prof. Joe Pasquale Department of Computer Science

More information

Snapshot Protocols. Angel Alvarez. January 17, 2012

Snapshot Protocols. Angel Alvarez. January 17, 2012 Angel Alvarez January 17, 2012 1 We have seen how to monitor a distributed computation in a passive manner We have also seen how to do active monitoring, and an instance of an inconsistent observation

More information

June 22/24/ Gerd Liefländer System Architecture Group Universität Karlsruhe (TH), System Architecture Group

June 22/24/ Gerd Liefländer System Architecture Group Universität Karlsruhe (TH), System Architecture Group Distributed Systems 12 Coordination June 22/24/29 2009 Gerd Liefländer System Architecture Group 2009 Universität Karlsruhe (TH), System Architecture Group 1 Overview Outline: Next Lectures Coordination

More information

Distributed Systems. Rik Sarkar James Cheney Global State & Distributed Debugging February 3, 2014

Distributed Systems. Rik Sarkar James Cheney Global State & Distributed Debugging February 3, 2014 Distributed Systems Rik Sarkar James Cheney Global State & Distributed Debugging Global State: Consistent Cuts The global state is the combination of all process states and the states of the communication

More information

Distributed systems. Consensus

Distributed systems. Consensus Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory Consensus B A C 2 Consensus In the consensus problem, the processes propose values and have to agree on one among these

More information

CSE 5306 Distributed Systems. Fault Tolerance

CSE 5306 Distributed Systems. Fault Tolerance CSE 5306 Distributed Systems Fault Tolerance 1 Failure in Distributed Systems Partial failure happens when one component of a distributed system fails often leaves other components unaffected A failure

More information

Distributed Operating Systems. Distributed Synchronization

Distributed Operating Systems. Distributed Synchronization 2 Distributed Operating Systems Distributed Synchronization Steve Goddard goddard@cse.unl.edu http://www.cse.unl.edu/~goddard/courses/csce855 1 Synchronization Coordinating processes to achieve common

More information

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University

CprE Fault Tolerance. Dr. Yong Guan. Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Fault Tolerance Dr. Yong Guan Department of Electrical and Computer Engineering & Information Assurance Center Iowa State University Outline for Today s Talk Basic Concepts Process Resilience Reliable

More information

Distributed Algorithmic

Distributed Algorithmic Distributed Algorithmic Master 2 IFI, CSSR + Ubinet Françoise Baude Université de Nice Sophia-Antipolis UFR Sciences Département Informatique baude@unice.fr web site : deptinfo.unice.fr/~baude/algodist

More information

Consensus in Distributed Systems. Jeff Chase Duke University

Consensus in Distributed Systems. Jeff Chase Duke University Consensus in Distributed Systems Jeff Chase Duke University Consensus P 1 P 1 v 1 d 1 Unreliable multicast P 2 P 3 Consensus algorithm P 2 P 3 v 2 Step 1 Propose. v 3 d 2 Step 2 Decide. d 3 Generalizes

More information

Chapter 6 Synchronization (2)

Chapter 6 Synchronization (2) DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN Chapter 6 Synchronization (2) Plan Clock synchronization in distributed systems Physical clocks Logical

More information

Distributed Systems (ICE 601) Fault Tolerance

Distributed Systems (ICE 601) Fault Tolerance Distributed Systems (ICE 601) Fault Tolerance Dongman Lee ICU Introduction Failure Model Fault Tolerance Models state machine primary-backup Class Overview Introduction Dependability availability reliability

More information