Sequential Computation The Consensus Problem Roger Wattenhofer thread a lot of kudos to memory Maurice Herlihy and Costas Busch Distributed for some of Computing their slides Group object object Distributed Computing Group Roger Wattenhofer 2 Concurrent Computation Asynchrony s d a e r h t • Sudden unpredictable delays memory – Cache misses ( short ) – Page faults ( long ) – Scheduling quantum used up ( really long ) object object Distributed Computing Group Roger Wattenhofer 3 Distributed Computing Group Roger Wattenhofer 4
Model Summary Road Map • Multiple threads • We are going to focus on principles – Sometimes called processes – Start with idealized models – Look at a simplistic problem • Single shared memory – Emphasize correctness over pragmatism • Objects live in memory – “Correctness may be theoretical, but • Unpredictable asynchronous delays incorrectness has practical impact” Distributed Computing Group Roger Wattenhofer 5 Distributed Computing Group Roger Wattenhofer 6 You may ask yourself … Fundamentalism • Distributed & concurrent systems are I’m no theory weenie - why all hard the theorems and proofs? – Failures – Concurrency • Easier to go from theory to practice than vice-versa Distributed Computing Group Roger Wattenhofer 7 Distributed Computing Group Roger Wattenhofer 8
The Two Generals Communications Red army wins Red armies send If both sides messengers across valley attack together Distributed Computing Group Roger Wattenhofer 9 Distributed Computing Group Roger Wattenhofer 10 Communications Your Mission Design a protocol to ensure that red armies attack simultaneously Messengers don’t always make it Distributed Computing Group Roger Wattenhofer 11 Distributed Computing Group Roger Wattenhofer 12
Real World Generals Real World Generals Date: Mi 11.12.2002 12:34 Date: Wed, 11 Dec 2002 12:33:58 +0100 From: Roger Wattenhofer <wattenhofer@inf.ethz.ch> From: Friedemann Mattern <mattern@inf.ethz.ch> To: Friedemann Mattern <mattern@inf.ethz.ch> To: Roger Wattenhofer <wattenhofer@inf.ethz.ch> Subject: Re: Vorlesung Subject: Vorlesung OK. Aber ich gehe nur, wenn sie diese Email nochmals Sie machen jetzt am Freitag, 08:15 die Vorlesung bestaetigen... :-) Verteilte Systeme, wie vereinbart. OK? (Ich bin jedenfalls am Freitag auch gar nicht da.) Ich Gruesse -- Roger Wattenhofer uebernehme das dann wieder nach den Weihnachtsferien. Distributed Computing Group Roger Wattenhofer 13 Distributed Computing Group Roger Wattenhofer 14 Real World Generals Real World Generals Date: Wed, 11 Dec 2002 12:53:37 +0100 Date: Mi 11.12.2002 13:01 From: Friedemann Mattern <mattern@inf.ethz.ch> From: Roger Wattenhofer <wattenhofer@inf.ethz.ch> To: Roger Wattenhofer <wattenhofer@inf.ethz.ch> To: Friedemann Mattern <mattern@inf.ethz.ch> Subject: Naechste Runde: Re: Vorlesung ... Subject: Re: Naechste Runde: Re: Vorlesung ... Das dachte ich mir fast. Ich bin Praktiker und mache Ich glaube, jetzt sind wir so weit, dass ich diese es schlauer: Ich gehe nicht, unabhaengig davon, ob Sie Emails in der Vorlesung auflegen werde... diese email bestaetigen (beziehungsweise rechtzeitig erhalten). (:-) Distributed Computing Group Roger Wattenhofer 15 Distributed Computing Group Roger Wattenhofer 16
Real World Generals Theorem There is no non-trivial Date: Wed, 11 Dec 2002 18:55:08 +0100 From: Friedemann Mattern <mattern@inf.ethz.ch> To: Roger Wattenhofer <wattenhofer@inf.ethz.ch> protocol that ensures the red Subject: Re: Naechste Runde: Re: Vorlesung ... armies attacks simultaneously Kein Problem. (Hauptsache es kommt raus, dass der Prakiker am Ende der schlauere ist... Und der Theoretiker entweder heute noch auf das allerletzte Ack wartet oder wissend das das ja gar nicht gehen kann alles gleich von vornherein bleiben laesst... (:-)) Distributed Computing Group Roger Wattenhofer 17 Distributed Computing Group Roger Wattenhofer 18 Proof Strategy Proof • Assume a protocol exists 1. Consider the protocol that sends fewest messages • Reason about its properties 2. It still works if last message lost • Derive a contradiction 3. So just don’t send it – Messengers’ union happy 4. But now we have a shorter protocol! 5. Contradicting #1 Distributed Computing Group Roger Wattenhofer 19 Distributed Computing Group Roger Wattenhofer 20
Fundamental Limitation You May Find Yourself … • Need an unbounded number of I want a real-time YAFA I want a real-time YAFA messages compliant Two Generals compliant Two Generals • Or possible that no attack takes protocol using UDP datagrams protocol using UDP datagrams place running on our enterprise-level running on our enterprise-level fiber tachyion network ... fiber tachyion network ... Distributed Computing Group Roger Wattenhofer 21 Distributed Computing Group Roger Wattenhofer 22 You might say You might say Advantage: Advantage: I want a real-time YAFA I want a real-time dot-net •Buys time to find another job •Buys time to find another job compliant Two Generals compliant Two Generals •No one expects software to work •No one expects software to work Yes, Ma’am, right away! Yes, Ma’am, right away! Yes, Ma’am, right away! protocol using UDP datagrams protocol using UDP datagrams anyway anyway running on our enterprise-level running on our enterprise-level fiber tachyion network ... fiber tachyion network ... Distributed Computing Group Roger Wattenhofer 23 Distributed Computing Group Roger Wattenhofer 24
You might say You might say Advantage: I want a real-time dot-net I want a real-time YAFA •Buys time to find another job I can’t find a fault-tolerant compliant Two Generals compliant Two Generals I can’t find a fault-tolerant Disadvantage: Disadvantage: •No one expects software to work Yes, Ma’am, right away! algorithm, I guess I’m just a protocol using UDP datagrams protocol using UDP datagrams algorithm, I guess I’m just a •You’re doomed •You’re doomed anyway pathetic loser. running on our enterprise-level running on our enterprise-level pathetic loser. •Without this course, you may •Without this course, you may fiber tachyion network ... fiber tachyion network ... not even know you’re doomed not even know you’re doomed Distributed Computing Group Roger Wattenhofer 25 Distributed Computing Group Roger Wattenhofer 26 You might say You might say Advantage: Advantage: Advantage: Advantage: I want a real-time YAFA I want a real-time YAFA •No need to take course •No need to take course •No need to take course •No need to take course I can’t find a fault-tolerant I can’t find a fault-tolerant compliant Two Generals compliant Two Generals I can’t find a fault-tolerant I can’t find a fault-tolerant Disadvantage: Disadvantage: algorithm, I guess I’m just a algorithm, I guess I’m just a protocol using UDP datagrams protocol using UDP datagrams algorithm, I guess I’m just a algorithm, I guess I’m just a •Boss fires you, hires •Boss fires you, hires pathetic loser pathetic loser running on our enterprise-level running on our enterprise-level pathetic loser pathetic loser University St. Gallen graduate University St. Gallen graduate fiber tachyion network ... fiber tachyion network ... Distributed Computing Group Roger Wattenhofer 27 Distributed Computing Group Roger Wattenhofer 28
Consensus: Each Thread has a You might say Private Input I want a real-time YAFA 19 32 compliant Two Generals Using skills honed in course, I Using skills honed in course, I 21 protocol using UDP datagrams can avert certain disaster! can avert certain disaster! running on our enterprise-level •Rethink problem spec, or •Rethink problem spec, or fiber tachyion network ... •Weaken requirements, or •Weaken requirements, or •Build on different platform •Build on different platform Distributed Computing Group Roger Wattenhofer 29 Distributed Computing Group Roger Wattenhofer 30 They Agree on Some Thread’s They Communicate Input 19 19 19 Distributed Computing Group Roger Wattenhofer 31 Distributed Computing Group Roger Wattenhofer 32
Recommend
More recommend