P2P Systems: Gossip Protocols
CS 6410 By Alane Suhr & Danny Adams
1
P2P Systems: Gossip Protocols CS 6410 By Alane Suhr & Danny - - PowerPoint PPT Presentation
P2P Systems: Gossip Protocols CS 6410 By Alane Suhr & Danny Adams 1 Outline Timeline CAP Theorem Epidemic algorithms for replicated database maintenance Managing update conflicts in Bayou, a weakly connected replicated
CS 6410 By Alane Suhr & Danny Adams
1
2
❖ Timeline ❖ CAP Theorem ❖ Epidemic algorithms for replicated database maintenance ❖ Managing update conflicts in Bayou, a weakly connected replicated storage system ❖ Conclusion
A
3
Lamport Time, Clocks, and the Ordering of Events in a Distributed System
1978
Lamport The Byzantine Generals Problem
1982
FLP Impossibility of Distributed Consensus with One Faulty Process
1985
Demers Epidemic algorithms for replicated database maintenance
1987
Schneider Implementing fault-tolerant services using the state machine approach: A tutorial
1990
Terry Managing update conflicts in Bayou, a weakly connected replicated storage system
1995
Lamport The part-time parliament
1998
A
○ part of a system completely independent from the rest of the system ○ ideally should maintain itself autonomously
even when message passing fails
4
A
given a network partition
given a network partition
5
A
6
D
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
D
9
D
10
A
○ In Paxos: clients propose an update to the database ○ Epidemic model: a node infects its neighbors
○ In Paxos: acceptor accepts an update based on one or more proposals ○ Epidemic model: a node is infected by a neighbor
11
A
❖ Direct Mail ❖ Anti-Entropy ❖ Rumor Mongering
12
A
13
➢ Simple algorithms ➢ High Availability ➢ Fault Tolerant ➢ Tunable ➢ Scalable ➢ Works in Partition
A
14
an update
efficient
D
15
D
16
D
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
❏ 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
19
A
20
A
21
A
22
A
23
A
24
A
25
A
26
A
27
A
28
Mechanism: Push & Pull
D
Push Pull
29
{A, B} {A, C} {A, B} {A, C} {A, B} {A,B,C} {A, B, C} {A, C} D
30
{A, B} {A, C} {A, B, C} {A,B,C} D
Push: Pi+1 = Pie-1 P= Probability node hasn’t received update after the ith round Pull: Pi+1= Pi
2 31
Pull is faster!!
D
1. Sites choose a random neighbor to share information with 2. Transmission rate is tuneable 3. How long new updates are interesting is also tuneable 4. Can use push or pull mechanisms
32
A
high probability
until consistency
push-pull transmissions: 0(n ln ln n)
33
Karp et al 2000. Randomized rumor spreading. In FOCS.
A
Rumor mongering: nodes go from susceptible to infective and eventually (probabilistically) to removed
34
A
35
A
36
A
37
A
38
A
39
A
40
A
41
A A
Pros:
42
Cons:
update
A
“update” the network regularly after direct mail or rumor mongering
anti-entropy, run the original algorithm again
43
D
❖ How are items deleted using epidemic models?
44
D
45
I like Bread I DON’T like Bread! I like orange juice D
❖ How to remove items from epidemic model?
46
D
❖ Drawbacks ➢ Space ➢ Increases traffic ➢ DC Can be lost ❖ Dormant death certificates & retention
➢ Residue: remaining susceptibles when epidemic finishes
➢
Traffic: ➢ Delay: ○ Tavg: Average time between start of outbreak and arrival
○ Tlast: Delay until last update
47
D
Helping Or Hurting
48
A
○ Nearest-neighbors ■ O(n) convergence ■ O(1) traffic ○ Random connections ■ O(log(n)) convergence ■ O(n) traffic
49
A
list of neighbors sorted by distance
based on position in list
50
A
number of rounds a rumor is “interesting”
51
A
robust
performance
Questions?
52
A
Managing update conflicts in Bayou, a weakly connected replicated storage system 1995
53
D
unstable network applications possible
allows for complex functions like merging to be interchangeable via the application
54
D
55
Lamport Time, Clocks, and the Ordering of Events in a Distributed System
1978
Lamport The Byzantine Generals Problem
1982
FLP Impossibility of Distributed Consensus with One Faulty Process
1985
Demers Epidemic algorithms for replicated database maintenance
1987
Schneider Implementing fault-tolerant services using the state machine approach: A tutorial
1990
Terry Managing update conflicts in Bayou, a weakly connected replicated storage system
1995
Lamport The part-time parliament
1998
D
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
committed, ordered by time
writes are stable (committed)
committing updates
58
A
application-dependent
59
A
form of consensus
correct consensus model for a system has to be weighed carefully with the attributes
60
A
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