P2P Systems and Gossip Protocols in Distributed Computing

 
P2P Systems: Gossip Protocols
 
CS 6410
By Alane Suhr & Danny Adams
 
1
 
 
Outline
 
2
 
Timeline
CAP Theorem
Epidemic algorithms for replicated database maintenance
Managing update conflicts in Bayou, a weakly connected
replicated storage system
Conclusion
 
A
 
Timeline
 
3
 
A
 
CAP
 
Consistency -- all nodes contain the same state
Availability -- requests are responded to 
promptly
Partition
part of a system completely independent from the rest of
the system
ideally should maintain itself autonomously
Partition tolerance -- system can stay online and functional
even when message passing fails
 
4
 
A
 
CAP Theorem
 
Paxos
&
Gossip
 
Paxos: prioritize consistency
given a network partition
Gossip: prioritize availability
given a network partition
 
5
 
A
 
Gossip
 
6
 
D
 
Gossip Overview
 
7
 
Authors
Motivations
Epidemic Models
Direct Mail
Anti-Entropy
Rumor mongering
Evaluation
DC’s
Spatial Distribution
 
D
 
8
 
Alan Demers
Cornell
University
 
Dan Greene
PARC
Research
 
Scott Shenker
EECS
Berkeley
 
Doug Terry
Amazon Web
Services
 
Carl Hauser
PhD Cornell
Washington
State University
 
A
u
t
h
o
r
s
 
D
Motivations
9
Unreliable network
Unreliable nodes
CAP:  *AP*
always be able to respond to a
(read/write) request
eventual consistency
D
 
Epidemic
Models
 
10
 
A
 
Proposers and Acceptors
 
Proposer
In Paxos: clients 
propose
 an update to the database
Epidemic model: a node 
infects
 its neighbors
Acceptor
In Paxos: acceptor 
accepts
 an update based on one or
more proposals
Epidemic model: a node is 
infected
 by a neighbor
 
11
 
A
 
Types of
Epidemics
 
Direct Mail
Anti-Entropy
Rumor Mongering
 
12
 
A
 
Advantages
 
13
 
Simple algorithms
High Availability
Fault Tolerant
Tunable
Scalable
Works in Partition
 
A
 
Direct Mail
 
14
 
Notify all neighbors of
an update
Timely and reasonably
efficient
n
 messages per update
 
 
D
Direct Mail
15
D
 
Direct Mail
 
16
 
D
 
Direct Mail
 
Messages sent: O(n) where n is
number of neighbors
Not fault tolerant -- doesn’t
guarantee eventual consistency
High volume of traffic with site
at the epicenter
 
17
 
D
 
Anti-Entropy
 
18
 
Site chooses random
partner to share data
Number of rounds til
consistency: O(log n)
Sites use custom
protocols to resolve
conflicts
Fault tolerant
 
A
 
Anti-Entropy
 
19
 
A
 
Anti-Entropy
 
20
 
A
 
Anti-Entropy
 
21
 
A
 
Anti-Entropy
 
22
 
A
 
Anti-Entropy
 
23
 
A
 
Anti-Entropy
 
24
 
A
 
Anti-Entropy
 
25
 
A
 
Anti-Entropy
 
26
 
A
Anti-Entropy
27
What
happens
next?
A
 
28
 
Mechanism: Push & Pull
 
D
Push vs. Pull
Push
Pull
29
{A, B}                           {A, C}
{A, B}                            {A, C}
{A, B}                           {A,B,C}
{A, B, C}                          {A, C}
D
What is Push-Pull?
30
{A, B}                           {A, C}
 {A, B, C}                        {A,B,C}
D
Propagation times of Push vs. Pull
P
u
s
h
:
 
P
i
+
1
 
=
 
P
i
e
-
1
P= Probability node hasn’t received
update after the i
th
 round
P
u
l
l
:
 
P
i
+
1
=
 
P
i
2
31
Pull is faster!!
D
 
Rumor Mongering
 
Sites choose a random neighbor to
share information with
Transmission rate is tuneable
1.
How long new updates are
interesting is also tuneable
2.
Can use push or pull mechanisms
 
 
32
 
A
 
Rumor Mongering Complexity
 
O(ln n) rounds leads to consistency 
with
high probability
Push requires O(n ln n) transmissions
until consistency
Further proved lower bound for all push-
pull transmissions: 0(n ln ln n)
 
33
 
Karp et al 2000. Randomized rumor spreading. In 
FOCS.
 
A
 
Analogy to epidemiology
 
Susceptible:
 site does not know an update yet
Infective: 
actively sharing an update
Removed:
 updated and no longer sharing
 
Rumor mongering: nodes go from 
susceptible
 to 
infective
 and
eventually (probabilistically) to 
removed
 
34
 
A
 
Rumor mongering
 
35
 
A
 
Rumor mongering
 
36
 
A
 
Rumor mongering
 
37
 
A
 
Rumor mongering
 
38
 
A
 
Rumor mongering
 
39
 
A
 
Rumor mongering
 
40
 
A
 
Rumor mongering
 
41
 
A
 
A
 
Rumor mongering
 
Pros:
Fast
Low call on resources
Fault-Tolerant
Less traffic
 
42
 
Cons:
A site can potentially miss an
update
 
A
 
Backups
 
Anti-entropy can be used to
“update” the network
regularly after direct mail or
rumor mongering
If inconsistency found in anti-
entropy, run the original
algorithm again
 
43
 
D
Death Certificates
 
How are items deleted
using epidemic models?
44
D
45
I like Bread
I DON’T like
Bread!
I like orange
juice
D
Death Certificates
How to remove items
from epidemic model?
46
D
 
Drawbacks
Space
Increases traffic
DC Can be lost
Dormant death
certificates & retention
 
Evaluating Epidemic Models
 
Residue:
 remaining susceptibles
when epidemic finishes
Traffic:
 
Delay:
T
avg
:
 Average time between
start of outbreak and arrival
of update @ given site
T
last
:
 Delay until last update
 
47
 
 
D
 
Spatial
Distribution
 
Helping
Or
Hurting
 
48
 
A
Convergence Times and Traffic
Linear network: anti entropy
Nearest-neighbors
 O(n) convergence
 O(1) traffic
Random connections
O(log(n)) convergence
 O(n) traffic
49
A
 
Optimizations for realistic network distributions
 
Select connections from
list of neighbors sorted
by distance
Treat network as linear
Compute probabilities
based on position in list
 
50
 
A
 
Rumor Mongering Non-Standard Distribution
 
Increase 
k
 --
number of rounds
a rumor is
“interesting”
Use push-pull
 
51
 
A
 
Takeaways
 
Availability >> consistency
Updates can be expensive
Distribution protocols should be
robust
Network design can hurt overall
performance
Byzantine Behavior not addressed
Questions?
 
52
 
A
 
Managing update conflicts in
Bayou, a weakly connected
replicated storage system
1995
 
Additional Reading
 
53
 
D
 
Weak consistency makes
unstable network applications
possible
Developing good interfaces
allows for complex functions
like merging to be
interchangeable via the
application
 
54
 
D
 
Timeline
 
55
 
D
 
What is Bayou?
 
Storage system designed for
mobile computing
Network is not stable
Parts of the network may
not be connected all the time
Goal: high availability
Guarantees 
weak
consistency
 
56
 
D
 
Bayou System Diagram
 
57
Server
Client
Client
 
Write
(unique ID)
Server
 
Anti-Entropy
 
Read Request
 
Data
 
D
 
Consistent Replicas
 
Writes are first 
tentative
Eventually they are
committed
, ordered by time
Clients can tell whether
writes are 
stable
(
committed
)
Primary
 servers deal with
committing updates
 
58
 
A
 
Detecting and Resolving Conflicts
 
Dependency checks
Merge procedures
Described by the clients,
application-dependent
 
59
 
A
 
Conclusions
 
Distributed systems need a
form of consensus
Effectively choosing the
correct consensus model for a
system has to be weighed
carefully with the attributes
of the system
 
60
 
A
 
Acknowledgements
 
Content Inspired by:
Ki Suh Lee: 
“Epidemic Techniques”[2009]
Eugene Bagdasaryan: 
“P2P Gossip Protocols” [2016]
Photos
www.pixabay.com
www.unsplash.com
www.1001freedownloads.com/free-cliparts
 
61
 
A
Slide Note
Embed
Share

Delve into the world of P2P systems and gossip protocols through a comprehensive exploration of CAP Theorem, epidemic algorithms, managing update conflicts, and key events in distributed systems history. Learn about the prioritization of consistency versus availability, the roles of Paxos and Gossip protocols, and the motivations driving research in this field.

  • Distributed Computing
  • Gossip Protocols
  • P2P Systems
  • CAP Theorem
  • Consistency

Uploaded on Sep 30, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. P2P Systems: Gossip Protocols CS 6410 By Alane Suhr & Danny Adams 1

  2. Outline Timeline CAP Theorem Epidemic algorithms for replicated database maintenance Managing update conflicts in Bayou, a weakly connected replicated storage system Conclusion 2 A

  3. Timeline 1978 1982 1985 1987 1990 1995 1998 Lamport Lamport FLP Demers Schneider Terry Lamport Implementing fault-tolerant services using the state machine approach: A tutorial The part-time parliament Time, Clocks, and the Ordering of Events in a Distributed System The Byzantine Generals Problem Impossibility of Distributed Consensus with One Faulty Process Epidemic algorithms for replicated database maintenance Managing update conflicts in Bayou, a weakly connected replicated storage system 3 A

  4. CAP Consistency -- all nodes contain the same state Availability -- requests are responded to promptly Partition part of a system completely independent from the rest of the system ideally should maintain itself autonomously Partition tolerance -- system can stay online and functional even when message passing fails 4 A

  5. CAP Theorem Paxos: prioritize consistency given a network partition Gossip: prioritize availability given a network partition Paxos & Gossip 5 A

  6. Gossip 6 6 D

  7. Gossip Overview Authors Motivations Epidemic Models Direct Mail Anti-Entropy Rumor mongering Evaluation DC s Spatial Distribution 7 D

  8. A u t h o r s Carl Hauser PhD Cornell Washington State University Alan Demers Cornell University Dan Greene PARC Research Scott Shenker EECS Berkeley Doug Terry Amazon Web Services 8 D

  9. Motivations Unreliable network Unreliable nodes CAP: *AP* always be able to respond to a (read/write) request eventual consistency 9 D

  10. Epidemic Models 10 A

  11. Proposers and Acceptors Proposer In Paxos: clients propose an update to the database Epidemic model: a node infects its neighbors Acceptor In Paxos: acceptor accepts an update based on one or more proposals Epidemic model: a node is infected by a neighbor 11 A

  12. Types of Epidemics Direct Mail Anti-Entropy Rumor Mongering A 12

  13. Advantages Simple algorithms High Availability Fault Tolerant Tunable Scalable Works in Partition 13 A

  14. Notify all neighbors of an update Timely and reasonably efficient n messages per update Direct Mail 14 D

  15. Direct Mail 15 D

  16. Direct Mail 16 D

  17. Direct Mail Messages sent: O(n) where n is number of neighbors Not fault tolerant -- doesn t guarantee eventual consistency High volume of traffic with site at the epicenter 17 D

  18. Anti-Entropy Site chooses random partner to share data Number of rounds til consistency: O(log n) Sites use custom protocols to resolve conflicts Fault tolerant 18 A

  19. Anti-Entropy 19 A

  20. Anti-Entropy 20 A

  21. Anti-Entropy 21 A

  22. Anti-Entropy 22 A

  23. Anti-Entropy 23 A

  24. Anti-Entropy 24 A

  25. Anti-Entropy 25 A

  26. Anti-Entropy 26 A

  27. Anti-Entropy What happens next? 27 A

  28. Mechanism: Push & Pull 28 D

  29. Push vs. Pull Push Pull {A, B} {A, C} {A, B} {A, C} H(A), H(B) H(A), H(B) H(B C B {A, B} {A,B,C} {A, B, C} {A, C} 29 D

  30. {A, B} {A, C} What is Push-Pull? H(A), H(B) C, H(B) B 30 {A, B, C} {A,B,C} D

  31. Propagation times of Push vs. Pull Push: Pi+1 = Pie-1 Pull: Pi+1= Pi2 Pull is faster!! P= Probability node hasn t received update after the ithround 31 D

  32. Rumor Mongering Sites choose a random neighbor to share information with Transmission rate is tuneable 1. How long new updates are interesting is also tuneable 2. Can use push or pull mechanisms 32 A

  33. Rumor Mongering Complexity O(ln n) rounds leads to consistency with high probability Push requires O(n ln n) transmissions until consistency Further proved lower bound for all push- pull transmissions: 0(n ln ln n) 33 Karp et al 2000. Randomized rumor spreading. In FOCS. A

  34. Analogy to epidemiology Susceptible: site does not know an update yet Infective: actively sharing an update Removed: updated and no longer sharing Rumor mongering: nodes go from susceptible to infective and eventually (probabilistically) to removed 34 A

  35. Rumor mongering 35 A

  36. Rumor mongering 36 A

  37. Rumor mongering 37 A

  38. Rumor mongering 38 A

  39. Rumor mongering 39 A

  40. Rumor mongering 40 A

  41. Rumor mongering A 41 A

  42. Rumor mongering Pros: Cons: Fast Low call on resources Fault-Tolerant Less traffic A site can potentially miss an update 42 A

  43. Backups Anti-entropy can be used to update the network regularly after direct mail or rumor mongering If inconsistency found in anti- entropy, run the original algorithm again 43 D

  44. Death Certificates How are items deleted using epidemic models? 44 D

  45. I DONT like Bread! I like Bread System Update I like orange juice 45 D

  46. Death Certificates How to remove items from epidemic model? Drawbacks Space Increases traffic DC Can be lost 46 Dormant death D

  47. Evaluating Epidemic Models Residue: remaining susceptibles when epidemic finishes Traffic: Delay: Tavg: Average time between start of outbreak and arrival of update @ given site Tlast: Delay until last update 47 D

  48. Spatial Distribution Helping Or Hurting 48 A

  49. Convergence Times and Traffic Linear network: anti entropy Nearest-neighbors O(n) convergence O(1) traffic Random connections O(log(n)) convergence O(n) traffic 49 A

  50. Optimizations for realistic network distributions Select connections from list of neighbors sorted by distance Treat network as linear Compute probabilities based on position in list 50 A

Related


More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#