Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable.

Slides:



Advertisements
Similar presentations
Impossibility of Distributed Consensus with One Faulty Process
Advertisements

DISTRIBUTED SYSTEMS II FAULT-TOLERANT BROADCAST Prof Philippas Tsigas Distributed Computing and Systems Research Group.
A General Characterization of Indulgence R. Guerraoui EPFL joint work with N. Lynch (MIT)
BASIC BUILDING BLOCKS -Harit Desai. Byzantine Generals Problem If a computer fails, –it behaves in a well defined manner A component always shows a zero.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Computer Science 425 Distributed Systems CS 425 / ECE 428 Consensus
Prepared by Ilya Kolchinsky.  n generals, communicating through messengers  some of the generals (up to m) might be traitors  all loyal generals should.
Distributed Computing 8. Impossibility of consensus Shmuel Zaks ©
Data Consistency in Sensor Networks: Secure Agreement Fatemeh Borran Supervised by: Panos Papadimitratos, Marcin Poturalski Prof. Jean-Pierre Hubaux IC-29.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
1 Principles of Reliable Distributed Systems Lecture 6: Synchronous Uniform Consensus Spring 2005 Dr. Idit Keidar.
Structure of Consensus 1 The Structure of Consensus Consensus touches upon the basic “topology” of distributed computations. We will use this topological.
1 Principles of Reliable Distributed Systems Lecture 3: Synchronous Uniform Consensus Spring 2006 Dr. Idit Keidar.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 5: Synchronous (Uniform)
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 7: Failure Detectors.
Asynchronous Consensus (Some Slides borrowed from ppt on Web.(by Ken Birman) )
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 10: Consensus with Byzantine Failures1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Non-blocking Atomic Commitment Aaron Kaminsky Presenting Chapter 6 of Distributed Systems, 2nd edition, 1993, ed. Mullender.
1 Fault-Tolerant Consensus. 2 Failures in Distributed Systems Link failure: A link fails and remains inactive; the network may get partitioned Crash:
Aran Bergman Eddie Bortnikov, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 5: Synchronous Uniform.
1 Principles of Reliable Distributed Systems Lecture 5: Failure Models, Fault-Tolerant Broadcasts and State-Machine Replication Spring 2005 Dr. Idit Keidar.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 6: Impossibility.
Aran Bergman, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Recitation 5: Reliable.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 12: Impossibility.
Distributed Algorithms: Agreement Protocols. Problems of Agreement l A set of processes need to agree on a value (decision), after one or more processes.
Distributed Systems Tutorial 4 – Solving Consensus using Chandra-Toueg’s unreliable failure detector: A general Quorum-Based Approach.
On the Cost of Fault-Tolerant Consensus When There are no Faults Idit Keidar & Sergio Rajsbaum Appears in SIGACT News; MIT Tech. Report.
Systems of Distributed systems Module 2 - Distributed algorithms Teaching unit 2 – Properties of distributed algorithms Ernesto Damiani University of Bozen.
Composition Model and its code. bound:=bound+1.
Consensus and Related Problems Béat Hirsbrunner References G. Coulouris, J. Dollimore and T. Kindberg "Distributed Systems: Concepts and Design", Ed. 4,
Paxos Made Simple Jinghe Zhang. Introduction Lock is the easiest way to manage concurrency Mutex and semaphore. Read and write locks. In distributed system:
1 A Modular Approach to Fault-Tolerant Broadcasts and Related Problems Author: Vassos Hadzilacos and Sam Toueg Distributed Systems: 526 U1580 Professor:
Distributed Consensus Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit.
Distributed Consensus Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit.
1 © P. Kouznetsov A Note on Set Agreement with Omission Failures Rachid Guerraoui, Petr Kouznetsov, Bastian Pochon Distributed Programming Laboratory Swiss.
Distributed Algorithms – 2g1513 Lecture 9 – by Ali Ghodsi Fault-Tolerance in Distributed Systems.
Consensus and Its Impossibility in Asynchronous Systems.
Consensus with Partial Synchrony Kevin Schaffer Chapter 25 from “Distributed Algorithms” by Nancy A. Lynch.
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.
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 9 Consensus I Section Klara Nahrstedt.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
Sliding window protocol The sender continues the send action without receiving the acknowledgements of at most w messages (w > 0), w is called the window.
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.
SysRép / 2.5A. SchiperEté The consensus problem.
Failure Detectors n motivation n failure detector properties n failure detector classes u detector reduction u equivalence between classes n consensus.
Fault-Tolerant Broadcast Terminology: broadcast(m) a process broadcasts a message to the others deliver(m) a process delivers a message to itself 1.
Replication predicates for dependent-failure algorithms Flavio Junqueira and Keith Marzullo University of California, San Diego Euro-Par Conference, Lisbon,
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.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 9 Instructor: Haifeng YU.
1 Fault-Tolerant Consensus. 2 Communication Model Complete graph Synchronous, network.
Unreliable Failure Detectors for Reliable Distributed Systems Tushar Deepak Chandra Sam Toueg Presentation for EECS454 Lawrence Leinweber.
1 AGREEMENT PROTOCOLS. 2 Introduction Processes/Sites in distributed systems often compete as well as cooperate to achieve a common goal. Mutual Trust/agreement.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Byzantine-Resilient Colorless Computaton
Alternating Bit Protocol
Distributed Consensus
Agreement Protocols CS60002: Distributed Systems
Distributed Consensus
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Failure Detectors motivation failure detector properties
Distributed systems Consensus
Presentation transcript:

Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 4 – Consensus and reliable broadcast

Broadcast BC: If a process sends a message m, then every process eventually delivers m Can we implement this specification if processes can fail?

The Reliable Broadcast problem Validity –If the sender is correct and broadcasts a message m, then all correct processes eventually deliver m Agreement –If a correct process delivers a message m, then all correct processes eventually deliver m Integrity –Every correct process delivers at most one message, and if it delivers m, then some process must have broadcast m

The Terminating Reliable Broadcast problem Termination –Every correct process eventually delivers some message Validity –If a correct process broadcasts a message m, then all correct processes eventually deliver m Agreement –Hosts If a correct process delivers a message m, then all correct processes eventually deliver m Integrity –Every correct process delivers at most one message, and, if it delivers m  SF, then some process must have broadcast m

The Consensus problem Termination –Every correct process eventually decides some value Validity –If all processes that propose a value propose v, then all correct processes eventually decide v Agreement –If a correct process decides v, then all correct processes eventually decide v Integrity –Every correct process decides at most one value, and if it decides v, then some process must have proposed v

Properties of send (m) and receive (m) For benign failures Validity – If p sends m to q, and both p and q and the link between them are correct, then q eventually receives m Uniform Integrity – For any message m, q receives m at most once from p, and only if p sent m to q For benign failures Integrity – For any message m, if p and q are correct then q receives m at most once from p, and only if p sent m to q

Questions, Questions… Are these problems solvable at all? Can they be solved independent of the failure model? Does solvability depend on the ratio between faulty and correct processes? Does solvability depend on assumptions about the reliability of the network? Are the problems solvable in both synchronous and asynchronous systems? If a solution exists, how expensive is it?

Plan Synchronous Systems –Consensus for synchronous systems with crash failures –Lower bound on the number of rounds –Early stopping protocols for Reliable Broadcast –Reliable Broadcast for arbitrary failures with message authentication –Lower bound on the ratio of faulty processes for Consensus with arbitrary failures –Reliable Broadcast for arbitrary failures Asynchronous Systems –Impossibility of Consensus for crash failures

Model Synchronous Message Passing –Execution is a sequence of rounds –In each round every process takes a step  Sends messages to neighbors  Receives messages sent in that round  Changes its state Network is fully connected (an n-clique) No communication failures

A simple algorithm for Consensus Code for process p i : Initially V={v i } To execute propose(v i ) 1:send {v i } to all decide(x) occurs as follows: 2: for all j, 0  j  n-1, j  i do 3:receive S j from p j 4:V:= V U S j 5:decide min(V)

An execution

Idea A process that receives a proposed message in round 1, relays it to others during the next round Suppose p 3 hasn’t heard from p 2 at the end of round 2. Can it decide?

In general… Suppose a correct process p* has not received all proposals by the end of round i. Can p* decide? If not, why not? Another process may have received the missing proposal at the end of round i and be ready to relay it in round i + 1

Dangerous chains How many rounds can a dangerous chain span? –f faulty processes –at most f + 1 nodes in the chain –spans at most f rounds It is safe to decide after round f + 1

The Algorithm Initially V={v i } To execute propose(v i ) round k, 1  k  f+1 1:send {v in V : p i has not already sent v} to all 2:for all j, 0  j  n-1, j  i do 3:receive S j from p j 4:V:= V U S j decide(x) occurs as follows: 5:if k = f+1 then 6:decide min(V) Code for process p i :

Termination –Every correct process reaches round f + 1 –Decides on min(V) --- which is well defined

Integrity At most one value: –one decide, and min(V) is unique Only if it was proposed: –to be decided upon, must be in V at round f + 1 –if value = v i, then it is proposed in round 1 –else suppose received in round k, and do induction on k  The k = 1:  by Uniform Integrity of underlying send and receive, it must have been sent in round 1  by the protocol and because only crash failures, it must have been proposed  Induction Hypothesis: all values received up to round k = j have been proposed  k = j+1  sent in round j+1 (Uniform Integrity of send and synchronous model)  must have been part of V of sender at end of round j  by protocol, must have been received by end of round j  by induction hypothesis, must have been proposed

Validity (1) Initially V={v i } To execute propose(v i ) round k, 1  k  f+1 1:send {v in V : p i has not already sent v} to all 2:for all j, 0  j  n-1, j  i do 3:receive S j from p j 4:V:= V U S j decide(x) occurs as follows: 5:if k = f+1 then 6:decide min(V)

Validity (2) Suppose every process proposes v * Since only crash model, only v * can be sent By Uniform Integrity of send and receive, only v * can be received By protocol, V={v * } min(V) = v * decide(v * )

Agreement (1) Initially V={v i } To execute propose(v i ) round k, 1  k  f+1 1:send {v in V : p i has not already sent v} to all 2:for all j, 0  j  n-1, j  i do 3:receive S j from p j 4:V:= V U S j decide(x) occurs as follows: 5:if k = f+1 then 6:decide min(V)

Agreement (2) Lemma 1: –For any r  1, if a process p receives a value v in round r, then there exists a sequence of processes p 0, p 1, …, p r such that p 0 = v’s proponent, p r = p, and in each round k, 1  k  r, p k-1 sends v and p k receives it. Furthermore, all processes in the sequence are distinct. Lemma 2: –In every execution, at the end of round f + 1, V i = V j for every correct processes p i and p j

Agreement (3) Proof: –Show that if a correct process has x in its V at the end of round f + 1, then every correct process has x in its V at the end of round f + 1 –Let r be earliest round x is added to the V of a correct process. Let that process be p –If r  f, then p sends x in round r + 1  f + 1; every correct process receives x and adds x to its V in round r + 1 –What if r = f + 1?

Agreement (4) –By Lemma 1, there exists a sequence p 0, …, p f+1 = p of distinct processes –Consider processes p 0, …, p f –f + 1 processes; only f faulty –one of p 0, …, p f is correct, and adds x to its V before p does it in round r CONTRADICTION Agreement: Lemma 2 and min a deterministic function FINE