ROBUST & SPECULATIVE BYZANTINE RANDOMIZED CONSENSUS WITH CONSTANT TIME COMPLEXITY IN NORMAL CONDITIONS Nuno Neves Bruno Vavala University of Lisbon, Portugal University of Lisbon, Portugal Carnegie Mellon University, U.S. IEEE Symposium on Reliable and Distributed Systems 2012
CONSENSUS • Fundamental problem in distributed computing • Examples: SM Replication, Leader Election, Coordination, Group Membership, etc. • Impossible to attain deterministically with crash-faults (partial correctness) • Termination achievable with: • weaker models (ev. synchrony assumption) • randomization (almost-surely) Bruno Vavala, CMU-FCUL, Oct 2012 2 IEEE Symposium on Reliable and Distributed Systems 2012
RANDOMIZED CONSENSUS • Properties • Validity: if all correct processes propose v, then v is the only possible decision • Agreement: no two correct processes decide differently • Probabilistic Termination: all correct processes eventually decide with probability 1 • Assumptions • Reliable channels • Source-authenticated channels Bruno Vavala, CMU-FCUL, Oct 2012 3 IEEE Symposium on Reliable and Distributed Systems 2012
BRACHA’S ALGORITHM (PODC 1984) • Seminal algorithm • Asynchronous • Byzantine resistant • Resilient-optimal (3f+1) • Correct under the Strong Adversary model Bruno Vavala, CMU-FCUL, Oct 2012 4 IEEE Symposium on Reliable and Distributed Systems 2012
BRACHA’S ALGORITHM (PODC 1984) 1)RBcast value 2)Set majority value 1st phase • Seminal algorithm (set majority) • Asynchronous • Byzantine resistant • Resilient-optimal (3f+1) • Correct under the Strong Adversary model Bruno Vavala, CMU-FCUL, Oct 2012 5 IEEE Symposium on Reliable and Distributed Systems 2012
BRACHA’S ALGORITHM (PODC 1984) 1)RBcast value 2)Set majority value 1st phase • Seminal algorithm (set majority) 4)RBcast value • Asynchronous 5)Set quorum value 2nd phase (if any, or default v) • Byzantine resistant (try-lock) • Resilient-optimal (3f+1) • Correct under the Strong Adversary model Bruno Vavala, CMU-FCUL, Oct 2012 6 IEEE Symposium on Reliable and Distributed Systems 2012
BRACHA’S ALGORITHM (PODC 1984) 1)RBcast value 2)Set majority value 1st phase • Seminal algorithm (set majority) 4)RBcast value • Asynchronous 5)Set quorum value 2nd phase (if any, or default v) • Byzantine resistant (try-lock) 3rd phase 7)RBcast value • Resilient-optimal (3f+1) 8)Set decision value (try-decide) (if any, or majority) • Correct under the (if any, or flip coin ) Strong Adversary model 10)start new round Bruno Vavala, CMU-FCUL, Oct 2012 7 IEEE Symposium on Reliable and Distributed Systems 2012
IN THEORY 1000000000000000000000000000000 1000000000000000000000000000 1000000000000000000000000 1000000000000000000000 1000000000000000000 Rounds 1000000000000000 1000000000000 1000000000 1000000 1000 1 4 28 52 76 100 Processes Potential problem: expected exponential time execution under adverse conditions Bruno Vavala, CMU-FCUL, Oct 2012 8 IEEE Symposium on Reliable and Distributed Systems 2012
IN PRACTICE 10 Rounds 6 2 4 28 52 76 100 Processes In reality: it terminates in a constant number of rounds under normal conditions Bruno Vavala, CMU-FCUL, Oct 2012 9 IEEE Symposium on Reliable and Distributed Systems 2012
RELIABILITY VS. PERFORMANCE WHAT’S THE MODEL? Bruno Vavala, CMU-FCUL, Oct 2012 IEEE Symposium on Reliable and Distributed Systems 2012
WHAT IS NORMAL? • Asynchrony? • Crash failures? • Byzantine failures? • Content-independent message scheduler? • Full information adversary? • Adversary message scheduler? Bruno Vavala, CMU-FCUL, Oct 2012 11 IEEE Symposium on Reliable and Distributed Systems 2012
AN EXPERIMENT Bruno Vavala, CMU-FCUL, Oct 2012 IEEE Symposium on Reliable and Distributed Systems 2012
FIRST ROUND first phase > < second phase third phase > toss a coin Bruno Vavala, CMU-FCUL, Oct 2012 13 IEEE Symposium on Reliable and Distributed Systems 2012
SECOND ROUND first phase > < second phase third phase > toss a coin Bruno Vavala, CMU-FCUL, Oct 2012 14 IEEE Symposium on Reliable and Distributed Systems 2012
THIRD ROUND first phase > < second phase third phase > decision Bruno Vavala, CMU-FCUL, Oct 2012 15 IEEE Symposium on Reliable and Distributed Systems 2012
PROBABILISTIC ANALYSIS Bruno Vavala, CMU-FCUL, Oct 2012 IEEE Symposium on Reliable and Distributed Systems 2012
INGREDIENTS • Hypergeometric distribution H H ( n, k, n − f ) B • Binomial distribution B ( n, p ) • Normal distribution N ( np, np (1 − p )) • Some approximations ✓ ◆ i − np P ( B ( n, p ) ≤ i ) ≈ Φ √ np (1 − p ) Bruno Vavala, CMU-FCUL, Oct 2012 17 IEEE Symposium on Reliable and Distributed Systems 2012
KEY • Threshold of half plus 1/4 of procs proposing v at the end of 2nd phase 1 ! 0.75 ! Proability ! All procs set v ( k>1/4 ) ! 0.5 ! A proc sets default ( k<1/4 ) ! 0.25 ! k < 1/4 k > 1/4 0 ! 1 ! 4 ! 7 ! 10 ! 13 ! 16 ! 19 ! Processes ! Bruno Vavala, CMU-FCUL, Oct 2012 18 IEEE Symposium on Reliable and Distributed Systems 2012
GOING BACKWARDS • decision on v message exchange 3rd Phase • Linear bias of constant 1/4 of procs proposing v message exchange 2nd Phase • Procs have constant probability of setting v • Linear bias of (just) positive constant beyond the average message exchange 1st Phase • Square root bias beyond the average of procs proposing v • Back to coin tossing, this is a . . . Basic property of the Normal Distribution: p=2/5 (or 2.5 rounds ) Bruno Vavala, CMU-FCUL, Oct 2012 19 IEEE Symposium on Reliable and Distributed Systems 2012
EVALUATION Bruno Vavala, CMU-FCUL, Oct 2012 IEEE Symposium on Reliable and Distributed Systems 2012
PERFORMANCE 3.5 ! 3 ! ? 2.5 rounds 2.5 ! Rounds ! 2 ! 1.5 ! 1 ! 0.5 ! 0 ! 4 ! 16 ! 28 ! 40 ! 52 ! 64 ! 76 ! 88 ! 100 ! Processes ! • Cluster of 6 nodes • n = 3f + 1 • Up to 100 processes • Divergent initial configuration Bruno Vavala, CMU-FCUL, Oct 2012 21 IEEE Symposium on Reliable and Distributed Systems 2012
PERFORMANCE 3.5 ! 3 ! 2.5 rounds 2.5 ! Rounds ! 2 ! 1.5 ! baseline 1 ! 0.5 ! 0 ! 4 ! 16 ! 28 ! 40 ! 52 ! 64 ! 76 ! 88 ! 100 ! Processes ! • Analysis says 2.5 rounds after coin flipping • Baseline at 1 round • Theoretically satisfactory, but practically not precise, constant complexity Bruno Vavala, CMU-FCUL, Oct 2012 22 IEEE Symposium on Reliable and Distributed Systems 2012
LOOK AT THE CONSTANTS • Approximations are theoretically good • Loss of precision when computing constant values ours ⇣ ⌘ i µ B P ( H ( n, k, n − f ) ≤ i ) ≤ Φ − σ B • A better approximation is available Feller ⇣ ⌘ i µ H P ( H ( n, k, n − f ) ≤ i ) Φ ≈ − σ H • A multiplicative constant impacts noticeably just on constants ⇣ ⌘ ⇣ ⌘ i µ H i µ B √ Φ = Φ − − 3 σ H σ B Bruno Vavala, CMU-FCUL, Oct 2012 23 IEEE Symposium on Reliable and Distributed Systems 2012
PERFORMANCE 3.5 ! 3 ! 2.5 ! Rounds ! 2 ! 1.59 rounds 1.5 ! baseline 1 ! 0.5 ! 0 ! 4 ! 16 ! 28 ! 40 ! 52 ! 64 ! 76 ! 88 ! 100 ! Processes ! • Analysis says 1.59 rounds after coin flipping • Baseline at 1 round • Theoretically satisfactory and practically rather precise constant complexity Bruno Vavala, CMU-FCUL, Oct 2012 24 IEEE Symposium on Reliable and Distributed Systems 2012
HIGH LEVEL VIEW Model Complexity SA O(2 n ) WA O(1) SMO 1 round Bruno Vavala, CMU-FCUL, Oct 2012 25 IEEE Symposium on Reliable and Distributed Systems 2012
HIGH LEVEL VIEW strong adversary Model Complexity SA O(2 n ) WA O(1) SMO 1 round Bruno Vavala, CMU-FCUL, Oct 2012 26 IEEE Symposium on Reliable and Distributed Systems 2012
HIGH LEVEL VIEW strong adversary Model Complexity SA O(2 n ) s y n c h r o n o u s m s g o r d e r WA O(1) SMO 1 round Bruno Vavala, CMU-FCUL, Oct 2012 27 IEEE Symposium on Reliable and Distributed Systems 2012
HIGH LEVEL VIEW strong adversary Model Complexity y r a s r e v d a s u o i v i l b o SA O(2 n ) s y n c h r o n o u s m s g o r d e r OA O(1) SMO 1 round Complexity values are all relative to the Bracha’s algorithm Bruno Vavala, CMU-FCUL, Oct 2012 28 IEEE Symposium on Reliable and Distributed Systems 2012
LET’S GO BEYOND Bruno Vavala, CMU-FCUL, Oct 2012 IEEE Symposium on Reliable and Distributed Systems 2012
{ OVERVIEW 1-2 rounds (good) Termination in 3-6 phases (bad) Objective: can we improve phase complexity in normal conditions while maintaining reliability? • (oblivious) crash-failures may happen • Decision in 1 phase possible in a weaker model • Focus on the set of ( n-f ) received messages Bruno Vavala, CMU-FCUL, Oct 2012 30 IEEE Symposium on Reliable and Distributed Systems 2012
SPECULATION broadcast and decision 1st Phase set majority quorum reached speculate broadcast and 2nd Phase try lock value v is locked no decision broadcast and broadcast (3s) 3rd Phase try decide v try decide v Bruno Vavala, CMU-FCUL, Oct 2012 31 IEEE Symposium on Reliable and Distributed Systems 2012
Recommend
More recommend