Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views29 pages

Lecture-6 - Consensus

This document discusses distributed systems and achieving consensus in distributed systems. It provides examples of situations that require consensus like committing transactions to a database. It describes different fault modes like fail-stop and Byzantine faults. It discusses the FLP impossibility proof that consensus is impossible in asynchronous systems with even one faulty process. It also discusses the Byzantine General's Problem and how Byzantine fault tolerance can provide resilience against Byzantine faults. Finally, it summarizes consensus protocols like 2 phase commit, 3 phase commit, Paxos, and the consensus algorithm used in Bitcoin.

Uploaded by

Shahzaib Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views29 pages

Lecture-6 - Consensus

This document discusses distributed systems and achieving consensus in distributed systems. It provides examples of situations that require consensus like committing transactions to a database. It describes different fault modes like fail-stop and Byzantine faults. It discusses the FLP impossibility proof that consensus is impossible in asynchronous systems with even one faulty process. It also discusses the Byzantine General's Problem and how Byzantine fault tolerance can provide resilience against Byzantine faults. Finally, it summarizes consensus protocols like 2 phase commit, 3 phase commit, Paxos, and the consensus algorithm used in Bitcoin.

Uploaded by

Shahzaib Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

DISTRIBUTED SYSTEMS

Dr. Shahid Naseem


Assistant Professor (IT)
Division of Science & Technology
University of Education, Township Campus, Lahore
[email protected]

Superior University, Gold Campus


Consensus

Superior University, Gold Campus


Consensus
Achieving Consensus: distributed system acting as
one entity.
Consensus Problem: getting nodes in a distributed
system to agree or something (value, operation,
etc.)

Examples
 Commit transactions to a database
 Synchronising clocks
 Replicating logs

Superior University, Gold Campus


Fault Modes
 Fail-Stop: a node dies

 Fail-recover: a node dies and comes back later

 Byzantine: a node misbehaves

The scary (chiling) part? The symptoms are the


same.

Superior University, Gold Campus


FLP Impossible Proof
Michael J. Fisher Nancy A. Lynch and Michael S.
Patterson, 1985 & Dijkstra Award, 2001

 Impossibility of Distributed Consensus with One


Faulty Process.
 In synchronous settings, it is possible to reach
consensus at the cost of time.
 Consensus is impossible in an asynchronous
setting even when only 1 node will crash.
 It is important because math> your arguments!

Superior University, Gold Campus


BYZANTINE General’s Problem
Originated from the Two General’s Problem (1975).
Explored in detail in Leslie Lamport Robert Shostak
Marshal Pease Paper: The Byzantine General
Problem (1982).

Superior University, Gold Campus


BYZANTINE General’s Problem

Superior University, Gold Campus


BYZANTINE Fault Tolerance
 Byzantine Fault: Any fault that presents different
symptoms to different observers (some general
attacks, some general retreat).

 Byzantine Failure: The loss of a system service


reliant on consensus due to Byzantine fault.

 Byzantine Fault Tolerance: A system that is


resilient/tolerant of a Byzantine Fault.

Superior University, Gold Campus


Solving the Consensus Problem
Strong consensus follows these properties:
 Termination: all nodes eventually decide on a
value.
 Agree: All nodes decide on a value
 Integrity: all nodes must decide on at most 1
value, and this value must be a value that’s been
proposed.
 Validity: If all correct nodes propose the same
value, then all nodes decide on the same value.

Superior University, Gold Campus


Consensus Protocols
 2 Phase Commit

 3 Phase Commit

 Basic Paxos

 Bitcoin Consensus

Superior University, Gold Campus


2 Phase Commit
 Simplest consensus protocol
 Phase 1-Proposal.

 A node (called coordinator) proposes a value


to all other nodes, then gathers votes.

 Phase 2-Commit or abort

 The coordinator sends:


 Commit if all nodes votes yes. All nodes
commit the new value.
Superior University, Gold Campus
2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


2 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus


3 Phase Commit

Superior University, Gold Campus

You might also like