CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.

Slides:



Advertisements
Similar presentations
CPSC 411 Design and Analysis of Algorithms Set 2: Sorting Lower Bound Prof. Jennifer Welch Spring 2011 CPSC 411, Spring 2011: Set 2 1.
Advertisements

Impossibility of Distributed Consensus with One Faulty Process
Outline. Theorem For the two processor network, Bit C(Leader) = Bit C(MaxF) = 2[log 2 ((M + 2)/3.5)] and Bit C t (Leader) = Bit C t (MaxF) = 2[log 2 ((M.
The Byzantine Generals Problem Leslie Lamport, Robert Shostak, Marshall Pease Distributed Algorithms A1 Presented by: Anna Bendersky.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
Deterministic Selection and Sorting Prepared by John Reif, Ph.D. Analysis of Algorithms.
CPSC 668Set 7: Mutual Exclusion with Read/Write Variables1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 668Set 5: Synchronous LE in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
The Byzantine Generals Problem (M. Pease, R. Shostak, and L. Lamport) January 2011 Presentation by Avishay Tal.
CPSC 668Set 4: Asynchronous Lower Bound for LE in Rings1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 13: Clocks1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
CPSC 668Set 16: Distributed Shared Memory1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 6: Synchronous Byzantine.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 411, Fall 2008: Set 2 1 CPSC 411 Design and Analysis of Algorithms Set 2: Sorting Lower Bound Prof. Jennifer Welch Fall 2008.
CPSC 411, Fall 2008: Set 2 1 CPSC 311 Analysis of Algorithms Sorting Lower Bound Prof. Jennifer Welch Fall 2009.
Bit Complexity of Breaking and Achieving Symmetry in Chains and Rings.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 6: Synchronous Byzantine.
CPSC 668Set 11: Asynchronous Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Sorting Lower Bound Andreas Klappenecker based on slides by Prof. Welch 1.
CPSC 668Set 11: Asynchronous Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Systems of Distributed systems Module 2 - Distributed algorithms Teaching unit 2 – Properties of distributed algorithms Ernesto Damiani University of Bozen.
Ch. 8 & 9 – Linear Sorting and Order Statistics What do you trade for speed?
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 11: Asynchronous Consensus 1.
Ch11 Distributed Agreement. Outline Distributed Agreement Adversaries Byzantine Agreement Impossibility of Consensus Randomized Distributed Agreement.
1 Lectures on Parallel and Distributed Algorithms COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski Lectures on Parallel and Distributed.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 8 Instructor: Haifeng YU.
DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch Set 11: Asynchronous Consensus 1.
6.852: Distributed Algorithms Spring, 2008 Class 4.
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 9 Consensus I Section Klara Nahrstedt.
Chap 15. Agreement. Problem Processes need to agree on a single bit No link failures A process can fail by crashing (no malicious behavior) Messages take.
CSCE 411H Design and Analysis of Algorithms Set 10: Lower Bounds Prof. Evdokia Nikolova* Spring 2013 CSCE 411H, Spring 2013: Set 10 1 * Slides adapted.
Chapter 21 Asynchronous Network Computing with Process Failures By Sindhu Karthikeyan.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 16: Distributed Shared Memory 1.
Alternating Bit Protocol S R ABP is a link layer protocol. Works on FIFO channels only. Guarantees reliable message delivery with a 1-bit sequence number.
Fault tolerance and related issues in distributed computing Shmuel Zaks GSSI - Feb
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 9: Fault Tolerant Consensus 1.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
1 SECOND PART Algorithms for UNRELIABLE Distributed Systems: The consensus problem.
Randomized Algorithms for Distributed Agreement Problems Peter Robinson.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Algorithms for UNRELIABLE Distributed Systems:
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CPSC 411 Design and Analysis of Algorithms
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CPSC 411 Design and Analysis of Algorithms
CSCE 411 Design and Analysis of Algorithms
CSCE 411 Design and Analysis of Algorithms
Distributed Consensus
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
6.852: Distributed Algorithms Spring, 2008
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
CPSC 411 Design and Analysis of Algorithms
Switching Lemmas and Proof Complexity
Presentation transcript:

CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch

CPSC 668Set 10: Consensus with Byzantine Failures2 Consensus with Byzantine Failures How many processors total are needed to solve consensus when f = 1 ? Suppose n = 2. If p 0 has input 0 and p 1 has 1, someone has to change, but not both. What if one processor is faulty? How can the other one know? Suppose n = 3. If p 0 has input 0, p 1 has input 1, and p 2 is faulty, then a tie-breaker is needed, but p 2 can act maliciously.

CPSC 668Set 10: Consensus with Byzantine Failures3 Processor Lower Bound for f = 1 Theorem (5.7): Any consensus algorithm for 1 Byzantine failure must have at least 4 processors. Proof: Suppose in contradiction there is a consensus algorithm A = (A,B,C) for 3 processors and 1 Byzantine failure. p0p0 p2p2 p1p1 A C B

CPSC 668Set 10: Consensus with Byzantine Failures4 Specifying Faulty Behavior Consider a ring of 6 nonfaulty processors running components of A like this: This execution  probably doesn't solve consensus (it doesn't have to). But the processors do something -- this behavior is used to specify the behavior of faulty processors in executions of A in the triangle. p0p0 A p2p2 C p1p1 B p3p3 A p4p4 B p5p5 C

CPSC 668Set 10: Consensus with Byzantine Failures5 Getting a Contradiction Let  0 be this execution: p0p0 p2p2 p1p1 C B 00 0 act like p 0 to p 1 in  act like p 0 to p 5 in  p 1 and p 2 must decide 0

CPSC 668Set 10: Consensus with Byzantine Failures6 Getting a Contradiction Let  1 be this execution: p0p0 p2p2 p1p1 B 11 1 act like p 2 to p 1 in  act like p 5 to p 0 in  p 0 and p 1 must decide 1 A

CPSC 668Set 10: Consensus with Byzantine Failures7 The Contradiction Let  be this execution: p0p0 p2p2 p1p1 C 01 ? act like p 4 to p 5 in  act like p 1 to p 0 in  What do p 0 and p 2 decide? A view of p 0 in  = view of p 0 in  = view of p 0 in  1  p 0 decides 1 view of p 2 in  = view of p 2 in  = view of p 2 in  0  p 2 decides 0

CPSC 668Set 10: Consensus with Byzantine Failures8 Processor Lower Bound for Any f Theorem: Any consensus algorithm for f Byzantine failures must have at least 3f+1 processors. Proof: Use a reduction to the 3:1 case. Suppose in contradiction there is an algorithm A for f > 1 failures and n = 3f total processors. Use A to construct an algorithm for 1 failure and 3 processors, a contradiction.

CPSC 668Set 10: Consensus with Byzantine Failures9 The Reduction Partition the n ≤ 3f processors into three sets, P 0, P 1, and P 2, each of size at most f. In the n = 3 case, let –p 0 simulate P 0 –p 1 simulate P 1 –p 2 simulate P 2 If one processor is faulty in the n = 3 system, then at most f processors are faulty in the simulated system. Thus the simulated system is correct. Let the processors in the n = 3 system do the same as the simulated processors, and it will also be correct.

CPSC 668Set 10: Consensus with Byzantine Failures10 Exponential Tree Algorithm This algorithm uses –f + 1 rounds (optimal) –n = 3f + 1 processors (optimal) –exponential size messages (sub-optimal) Each processor keeps a tree data structure in its local state Values are filled in the tree during the f + 1 rounds At the end, the values in the tree are used to calculate the decision.

CPSC 668Set 10: Consensus with Byzantine Failures11 Local Tree Data Structure Each tree node is labeled with a sequence of unique processor indices. Root's label is empty sequence ; root has level 0 root has n children, labeled 0 through n - 1 Child node labeled i has n - 1 children, labeled i : 0 through i : n-1 (skipping i : i) Node at level d labeled v has n - d children, labeled v : 0 through v : n-1 (skipping any index appearing in v) Nodes at level f + 1 are leaves.

CPSC 668Set 10: Consensus with Byzantine Failures12 Example of Local Tree The tree when n = 4 and f = 1 :

CPSC 668Set 10: Consensus with Byzantine Failures13 Filling in the Tree Nodes Initially store your input in the root (level 0) Round 1: –send level 0 of your tree to all –store value x received from each p j in tree node labeled j (level 1); use a default if necessary –"p j told me that p j 's input was x" Round 2: –send level 1 of your tree to all –store value x received from each p j for each tree node k in tree node labeled k : j (level 2); use a default if necessary –"p j told me that p k told p j that p k 's input was x" Continue for f + 1 rounds

CPSC 668Set 10: Consensus with Byzantine Failures14 Calculating the Decision In round f + 1, each processor uses the values in its tree to compute its decision. Recursively compute the "resolved" value for the root of the tree, resolve ( ), based on the "resolved" values for the other tree nodes: resolve (  ) = value in tree node labeled  if it is a leaf majority{ resolve (  ') :  ' is a child of  } otherwise (use a default if tied)

CPSC 668Set 10: Consensus with Byzantine Failures15 Example of Resolving Values The tree when n = 4 and f = 1 : (assuming 0 is the default)

CPSC 668Set 10: Consensus with Byzantine Failures16 Resolved Values are Consistent Lemma (5.9): If p i and p j are nonfaulty, then p i 's resolved value for tree node labeled  ' j (what p j tells p i for node  ') equals what p j stores in its node  '. Proof Ideas: By induction on the height of the tree node. Uses inductive hypothesis to know that resolved values for children of the tree node corresponding to nonfaulty procs are consistent. Uses fact that n > 3f and fact that each tree node has at least n - f children to know that majority of children are nonfaulty.

CPSC 668Set 10: Consensus with Byzantine Failures17 Validity Suppose all inputs are v. Nonfaulty proc. p i decides resolve ( ), which is the majority among resolve (j), 0 ≤ j ≤ n-1, based on p i 's tree. Since resolved values are consistent, resolve(j) (at p i ) is value stored at the root of p j 's tree, which is p j 's input value if p j is nonfaulty. Since there are a majority of nonfaulty processors, p i decides v.

CPSC 668Set 10: Consensus with Byzantine Failures18 Common Nodes and Frontiers A tree node  is common if all nonfaulty procs. compute the same value of resolve (  ). A tree node  has a common frontier if every path from  to a leaf contains a common node. Lemma (5.10): If  has a common frontier, then  is common. Proof Ideas: By induction on height of . Uses fact that resolve is defined using majority.

CPSC 668Set 10: Consensus with Byzantine Failures19 Agreement The nodes on each path from a child of the root to a leaf correspond to f + 1 different processors. Since there are at most f faulty processors, at least on such node corresponds to a nonfaulty processor. This node is common (by the lemma about the consistency of resolved values). Thus the root has a common frontier. Thus the root is common (by preceding lemma).

CPSC 668Set 10: Consensus with Byzantine Failures20 Complexity Exponential tree algorithm uses n > 3f processors f + 1 rounds exponential size messages: –each msg in round r contains n(n-1)(n-2)…(n-(r-2)) values –When r = f + 1, this is exponential if f is more than constant relative to n