Practical Byzantine Fault Tolerance Jayesh V. Salvi

Slides:



Advertisements
Similar presentations
Byzantine Generals. Outline r Byzantine generals problem.
Advertisements

Agreement: Byzantine Generals UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau Paper: “The.
Last Class: The Problem BobAlice Eve Private Message Eavesdropping.
SSL CS772 Fall Secure Socket layer Design Goals: SSLv2) SSL should work well with the main web protocols such as HTTP. Confidentiality is the top.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Byzantine Fault Tolerance Steve Ko Computer Sciences and Engineering University at Buffalo.
The Byzantine Generals Problem Leslie Lamport, Robert Shostak, Marshall Pease Distributed Algorithms A1 Presented by: Anna Bendersky.
Prepared by Ilya Kolchinsky.  n generals, communicating through messengers  some of the generals (up to m) might be traitors  all loyal generals should.
DISTRIBUTED SYSTEMS II FAULT-TOLERANT AGREEMENT Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Byzantine Generals Problem: Solution using signed messages.
1 Principles of Reliable Distributed Systems Lecture 3: Synchronous Uniform Consensus Spring 2006 Dr. Idit Keidar.
Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 5: Synchronous (Uniform)
CS 582 / CMPE 481 Distributed Systems
Computer Science Lecture 17, page 1 CS677: Distributed OS Last Class: Fault Tolerance Basic concepts and failure models Failure masking using redundancy.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 16 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 15 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 16 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 15 Wenbing Zhao Department of Electrical and Computer Engineering.
Practical Byzantine Fault Tolerance (The Byzantine Generals Problem)
Distributed Algorithms: Agreement Protocols. Problems of Agreement l A set of processes need to agree on a value (decision), after one or more processes.
The Byzantine Generals Problem Leslie Lamport Robert Shostak Marshall Pease.
EEC 688 Secure and Dependable Computing Lecture 16 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
1 CS 194: Distributed Systems Security Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer Sciences.
Digital Signature Xiaoyan Guo/ Xiaohang Luo/
Byzantine Fault Tolerance CS 425: Distributed Systems Fall Material drived from slides by I. Gupta and N.Vaidya.
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems.
EEC 688/788 Secure and Dependable Computing Lecture 14 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
HQ Replication: Efficient Quorum Agreement for Reliable Distributed Systems James Cowling 1, Daniel Myers 1, Barbara Liskov 1 Rodrigo Rodrigues 2, Liuba.
DISTRIBUTED SYSTEMS II FAULT-TOLERANT AGREEMENT Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Practical Byzantine Fault Tolerance
Byzantine fault-tolerance COMP 413 Fall Overview Models –Synchronous vs. asynchronous systems –Byzantine failure model Secure storage with self-certifying.
From Viewstamped Replication to BFT Barbara Liskov MIT CSAIL November 2007.
1 ZYZZYVA: SPECULATIVE BYZANTINE FAULT TOLERANCE R.Kotla, L. Alvisi, M. Dahlin, A. Clement and E. Wong U. T. Austin Best Paper Award at SOSP 2007.
Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.
Byzantine fault tolerance
Practical Byzantine Fault Tolerance and Proactive Recovery
Lecture 16: Security CDK4: Chapter 7 CDK5: Chapter 11 TvS: Chapter 9.
31.1 Chapter 31 Network Security Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
14.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 14 Entity Authentication.
Byzantine Fault Tolerance CS 425: Distributed Systems Fall 2012 Lecture 26 November 29, 2012 Presented By: Imranul Hoque 1.
EECS 262a Advanced Topics in Computer Systems Lecture 25 Byzantine Agreement November 28 th, 2012 John Kubiatowicz and Anthony D. Joseph Electrical Engineering.
CSE 60641: Operating Systems Implementing Fault-Tolerant Services Using the State Machine Approach: a tutorial Fred B. Schneider, ACM Computing Surveys.
EEC 688/788 Secure and Dependable Computing Lecture 15 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department
Byzantine Fault Tolerance
Systems Research Barbara Liskov October Replication Goal: provide reliability and availability by storing information at several nodes.
Fault Tolerance
Fault Tolerance Chapter 7. Goal An important goal in distributed systems design is to construct the system in such a way that it can automatically recover.
9.2 SECURE CHANNELS JEJI RAMCHAND VEDULLAPALLI. Content Introduction Authentication Message Integrity and Confidentiality Secure Group Communications.
1 AGREEMENT PROTOCOLS. 2 Introduction Processes/Sites in distributed systems often compete as well as cooperate to achieve a common goal. Mutual Trust/agreement.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
EEC 688/788 Secure and Dependable Computing Lecture 10 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
BChain: High-Throughput BFT Protocols
Byzantine Fault Tolerance
Jacob Gardner & Chuan Guo
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
From Viewstamped Replication to BFT
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Building Dependable Distributed Systems, Copyright Wenbing Zhao
John Kubiatowicz Electrical Engineering and Computer Sciences
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
EEC 688/788 Secure and Dependable Computing
Presentation transcript:

Practical Byzantine Fault Tolerance Jayesh V. Salvi

Contents Introduction State Machine Working of state machine with Public Key Cryptography Alternative to PK - MAC Modification of algorithm to use with MACs Optimizations Conclusion 2

Introduction What is Byzantine Generals Problem? If n number of Byzantine generals are attacking an enemy city, then what is the maximum number of traitors that can be tolerated and the battle be won? Yes, it has a mathematical proof… 3

Byzantine Generals Problem G1 G4G3 G2G5 4

Solution for Byzantine Generals Traitors send wrong messages, so that the loyal generals cannot reach a valid consensus Loyal generals try to reach consensus, despite of the wrong messages sent by traitors It can be mathematically proved that, the army of n generals can reach consensus in the presence of (n-1)/3 or less traitors [ Ref: The Byzantine Generals Problem, Leslie Lamport, Robert Shostak, Marshall Pease, ACM Transactions on Programming Languages and systems, Vol. 4,No. 3, July 1982 ] 5

Our Battlefield – State Machine A state machine is a collection of multiple, identical, deterministic servers, providing a service Clients send requests to this machine and collect replies from multiple servers Principal tasks of state machine Request sequencing Execution of requests and result delivery Garbage collection (cleaning logs) View - change 6

Message Passing in State Machine C 0(P) 1(B) 2(B) 3(B) RequestPre-PreparePrepareCommitResult t σc σp, m> σi 7

Typical states of a backup PRE-PREPARE from Primary Prepared (m,v,n,i) 2f PREPAREs that match PRE-PREPARE Committed-local (m,v,n,i) 2f+1 COMMITS that match PRE-PREPARE Sending COMMIT messages Sending PREPARE messages Result To Client 8

Garbage collection The logs are cleaned periodically Before cleaning the logs a backup must be sure that all requests whose messages it is going to clean have been successfully executed After fixed number of requests replicas send check- point signals σi When a replica receives f+1 check-point messages, it clears all messages for requests up to n. 9

View - change When backups suspect Primary they call for a View change When backups suspect Primary they call for a View change A backup starts timer when it is waiting for executing a request and stops it when it is waiting no longer If timer times out something is wrong with Primary So change view so that Primary gets changed A backup sends σi C is a proof of last stable check-point P is a proof of due requests after the check-point 10

View - change When a primary of new view gets 2f VIEW-CHANGE messages, it declares new view The new Primary sends σi V is a proof containing valid VIEW-CHANGE messages O is a set containing PRE-PREPARE messages needed to carry the incomplete messages from previous view into new view 11

Is this algorithm optimum? Calculation of digital signatures is very time-consuming Is there any alternative – MACs ? + MACs are 3 orders of magnitude faster to compute than digital signatures – But, receiver of MAC cannot prove the authenticity of sender to third party 12

PK and MAC The MAC is a function of the message and the shared secret key HMAC K (M) = H( K 1 || H(K 2 || M) ) In Public Key Cryptography, it has been assumed that there are means for the sender of a message to obtain an authentic copy of the intended receiver’s public key Sender signs the message with his Private key and sends the message to receiver. The receiver verifies the authenticity by using sender’s public key 13

Format of Authenticated messages Using MAC to authenticate point to point messages –, μ i,j (m) Using MACs in multicast messages – αi This denotes that, it is an authenticator generated by i for a message m having an entry for every replica j other than i. 14

Session Key establishment εj, t > σi i chooses a new key K j,i to be used by j, to compute MACs for messages sent by j to i. t - time stamp (to avoid replay attack) εj - encryption with j ’s public key 15

How is the algorithm modified? Request αc, μ c,p (r) > Possible attacks from Client in Request phase: Attack on safety Degrading the performance 16

Attacks Attack on Safety: C 0(P) 1(B) 2(B) 3(B) RequestPre-Prepare 2 will assign a sequence number for m in its log 0 will assign a sequence number for m in its log 3 will assign a sequence number for m in its log 1 will not assign a sequence number for m in its log 17

Solution Even if the authenticity of a request cannot be verified at a backup, assign a sequence number to it Don’t transmit PREPARE message for it either But, if it is found that this sequence number request is committed at 2f+1 other backups, go ahead and execute the request 18

Degrading the Performance Performance can be degraded by forcing unnecessary view-changes, i.e. creating distrust between backups and primary Correct MAC to primary and Incorrect MACs to backups Incorrect MAC to primary and Correct MACs to backups 19

Correct MAC to primary & Incorrect MAC to backups C 0(P) 1(B) 2(B) 3(B) RequestPre-Prepare 20

Solution Primary aborts such requests The view changes are performed but with Primary unchanged Subsequently Primary accepts requests from the Client only if they are signed with its private key 21

Incorrect MAC to primary & Correct MAC to backups C 0(P) 1(B) 2(B) 3(B) RequestPre-Prepare 22

Solution Backups only accept retransmitted requests with digital signatures 23

Pre-Prepares, Prepares, Commits They work same as in previous algorithm In normal cases replicas only need to authenticate the sender of message and need not prove that to others MACs are sufficient for this But you need proof sometime… 24

When do you need proof? Garbage Collection View - change 25

Garbage Collection To reach a stable check-point you need f+1 CHECKPOINT messages You have to prove this in your VIEWCHANGE message The backup lazily builds the proof Proof is nothing but the same messages resent by the non-faulty backups, with the signature A backups ask for proof by sending αi When they receive f+1 signed check-point messages they are ready with a proof 26

Garbage Collection But what if not all of f+1 backups resend check-point messages Those might have come from disguised faulty replicas So wait for 2f+1 messages in the first place, so that at least f+1 of them will reply at the time of building proof 27

View Changes View change message is same σi C is built as discussed in Garbage Collection P is built by transmitting αi for each m, such that prepared(m,v,n’,i) is true for some v and n’ > n 28

View Changes The receiving non-faulty replica responds in following two ways: If it has stable checkpoint >= n’, then it responds as if the message was CHECK-SIGN message Else it sends signed copy of PRE-PREPARE and PREPARES for m, which it has in its log 29

Optimizations The C component and P component can be formed by digests of messages to reduce the size of these messages Don’t make all replicas to send same big result to the client. Send one original result and other digests of that result 30

Conclusion This algorithm can tolerate independent software errors occurring at different replicas It is the first to work correctly in an asynchronous system like the Internet Use of MAC vectors instead of Public Keys improves performance. 31

References Miguel Castro, Barbara Liskov, Practical Byzantine Fault Tolerance, Proceedings of the Third Symposium on Operating Systems Design and Implementation,New Orleans, LA, February 1999 Miquel Castro, Barbara Liskov, Authenticated Byzantine Fault Tolerance, Without Public-Key Cryptography, Technical Memo MIT/LCS/TM-589,MIT Laboratory for Computer Science, June 1999 Miguel Castro, Practical Byzantine Fault Tolerance, MIT-LCS- TR-817, (Thesis) Leslie Lamport, Robert Shostak, and Marshall Pease, The Byzantine Generals Problem, ACM Transactions on Programming Languages and Systems, Vol. 4, No.3, July

33 Thank You !