k nowledge and c ommon k nowledge in a d istributed
play

K NOWLEDGE AND C OMMON K NOWLEDGE IN A D ISTRIBUTED E NVIRONMENT - PowerPoint PPT Presentation

K NOWLEDGE AND C OMMON K NOWLEDGE IN A D ISTRIBUTED E NVIRONMENT Ellis Michael A DMINISTRIVIA Everyone should have a GitLab repo. If not, email me. Everyone should have signed up for Piazza. Lab 1 due in 1 week. M UDDY F OREHEADS


  1. K NOWLEDGE AND C OMMON K NOWLEDGE IN A D ISTRIBUTED E NVIRONMENT Ellis Michael

  2. A DMINISTRIVIA • Everyone should have a GitLab repo. If not, email me. • Everyone should have signed up for Piazza. • Lab 1 due in 1 week.

  3. M UDDY F OREHEADS • 𝑜 children, 𝑙 get mud on their foreheads • Children sit in circle. • Teacher announces, "Someone has mud on their forehead." • Teacher repeatedly asks, "Raise your hand if you know you have mud on your forehead." • What happens?

  4. M UDDY F OREHEADS • 𝑜 children, 𝑙 get mud on their foreheads • Children sit in circle. • Teacher announces, "Someone has mud on their forehead." • Teacher repeatedly asks, "Raise your hand if you know you have mud on your forehead." • What happens?

  5. M UDDY F OREHEADS Answer: On the 𝑙 th round, all of the muddy children know they have mud on their forehead, raise their hands. "Proof" by induction on 𝒍 . When 𝑙 =1, the muddy child knows no other child is muddy, must be muddy themself. 
 When k=2, on the fi rst round, both muddy children see each other, cannot conclude they themselves are muddy. But after neither raises their hand, they realize there must be two muddy children, raise their hand. 
 In general, when 𝑙 >1, after round 𝑙 -1, if there were 𝑙 -1 muddy foreheads, all of those children would have raised their hands (by induction). Therefore, each muddy child knows they're muddy and raises their hand on the 𝑙 th round.

  6. T HE M UDDY F OREHEAD "P ARADOX " If 𝑙 >1, the teacher didn't say anything anyone didn't already know!

  7. K NOWLEDGE AND C OMMON K NOWLEDGE 𝜒 — a fact (e.g. "someone has mud on • 𝐹 𝐻 𝜒 = 𝐹 𝐻 1 𝜒 — everyone knows 𝜒 • their forehead") 𝐹 𝐻 k+1 𝜒 — everyone knows 𝐹 𝐻 k 𝜒 • 𝐿 𝑗 𝜒 — agent 𝑗 knows 𝜒 
 • 𝐷 𝐻 𝜒 — 𝜒 is common knowledge in 𝐻 • 𝐿 𝑗 𝜒 ⊃ 𝜒 (knowledge of 𝜒 implies 𝜒 ) (everyone knows everyone knows 𝐸 𝐻 𝜒 — group 𝐻 has distributed • everyone knows everyone knows... 𝜒 ) 
 knowledge of 𝜒 𝐷 𝐻 𝜒 ⊃ ... ⊃ 𝐹 𝐻 k+1 𝜒 ⊃ ... ⊃ 𝐹 𝐻 𝜒 ⊃ 𝑇 𝐻 𝜒 ⊃ 𝑇 𝐻 𝜒 — someone in group 𝐻 
 • 𝐸 𝐻 𝜒 ⊃ 𝜒 knows 𝜒

  8. A N E XAMPLE You and your friends want to decide where to eat lunch. 𝜒 = "we will go to Chipotle" • ∀ 𝑞 ∈ 𝐻 : 𝑞 wants to go to Chipotle ⊃ 𝐸 𝐻 𝜒 • You all tell your preferences to Alice privately. Then 𝐿 Alice 𝜒 holds • (implies 𝑇 𝐻 𝜒 ) Alice then tells everyone the result privately. 𝐹 𝐻 𝜒 holds. • Alice then tells everyone that she told everyone, 𝐹 𝐻 2 𝜒 . etc. • Alice announces the result publicly in front of the group, 𝐷 𝐻 𝜒 . •

  9. M UDDY F OREHEADS AND C OMMON K NOWLEDGE The muddy foreheads argument implicitly requires 𝐹 k 𝜒 , where 𝜒 is "someone has mud on their forehead" and 𝑙 is the number of muddy foreheads. At the beginning, children only have 𝐹 k-1 𝜒 . When the teacher spoke in plain sight, imparted common knowledge (i.e., 𝐷𝜒 ⊃ 𝐹 k 𝜒 ).

  10. A T WIST What if, instead of announcing "someone has mud on their forehead," the teacher pulled each student aside and told them privately?

  11. T WIST 2: E LECTRIC B OOGALOO Teacher pulls each student aside. Each student, unbeknownst to the others, planted listening devices on all other students, heard the teacher tell the other students "someone has mud on their forehead"?

  12. W HAT D O T HEY R EALLY N EED TO K NOW ? Fun problems: • What is the weakest level of knowledge needed by the children such that one or all of the muddy ones will eventually raise their hand? • Is it possible for one muddy child to raise their hand and another to never realize their forehead is muddy? Come to o ffi ce hours!

  13. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks without the other, they will both be defeated. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  14. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks Attack at without the other, they will both dawn! be defeated. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  15. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks Attack at without the other, they will both dawn! be defeated. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  16. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks Attack at without the other, they will both dawn! be defeated. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  17. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks Attack at without the other, they will both dawn! be defeated. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  18. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they CARTHAGE will be victorious. If one attacks without the other, they will be repelled, routed. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  19. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they Roger! CARTHAGE will be victorious. If one attacks Attack at without the other, they will be dawn! repelled, routed. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  20. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they Roger! CARTHAGE will be victorious. If one attacks Attack at without the other, they will be dawn! repelled, routed. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  21. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they Roger! CARTHAGE will be victorious. If one attacks Attack at without the other, they will be dawn! repelled, routed. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  22. C OORDINATED A TTACK • Two generals, on opposite sides of a city on a hill. • If they attack simultaneously, they Roger! CARTHAGE will be victorious. If one attacks Attack at without the other, they will be dawn! repelled, routed. • Can communicate by messenger. Messengers can get lost or be captured. • How do they ensure they can take the city?

  23. C OORDINATED A TTACK Answer: There does not exist a protocol to decide when and whether to attack. Proof by contradiction. Assume a protocol exists. Let the minimum number of messages received in any terminating execution be 𝑜 . Consider the last message received in one such execution. The sender's decision to attack does not depend on whether or not the message is received; sender must attack. Since the sender attacks, the receiver must also attack when the message is not received. Therefore, the last message is irrelevant, and there exists an execution with 𝑜 -1 message deliveries. 𝑜 was the minimum! Contradiction.

  24. C OORDINATED A TTACK The coordinated attack problem requires common knowledge! CARTHAGE Each message only moves one step up in the hierarchy (i.e., 𝑇𝜒 → 𝐹 1 𝜒 → 𝐹 2 𝜒 → 𝐹 3 𝜒 → ...), never reaches 𝐷𝜒 .

  25. L AB 1: R EMOTE P ROCEDURE C ALLS Goal: Execute function call on remote machine as if both the callee (server) and caller (client) were on the same machine. function, arguments result h/t for RPC slides: Tom Anderson

  26. D ISTRIBUTED C OMPUTING M ODEL • Processes (also called nodes/machines/servers) communicate by passing messages over a network • Failure assumptions: ✦ No failures ✦ Fail-stop ✦ Crashes ✦ Byzantine ✦ etc. • Network assumptions: ✦ Synchronous ✦ Asynchronous ✦ etc.

  27. A SYNCHRONOUS M ODEL • Messages can be: ✦ delayed inde fi nitely ✦ dropped (indistinguishable from delayed) ✦ duplicated ✦ re-ordered • No bound on clock skew across processes. Weak assumptions ⇒ robust results

  28. RPC S EMANTICS • At least once (lab 1b) = when the call returns successfully on the client side, was executed at least once (maybe multiple times) on the server. Continuously retries until successful. • At most once = if the call returns successfully, was executed once. Never executed more than once. • Exactly once (lab 1c) = at most once + continuous retries

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend