SlideShare a Scribd company logo
Epidemic Algorithms
Amir H. Payberah
amir@sics.se
Amirkabir University of Technology
(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 1 / 60
What is the Problem?
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 2 / 60
What is the Problem?
Application-level broadcast/multicast
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 3 / 60
What is the Problem?
Application-level broadcast/multicast
• Database replication
• Video streaming
• RSS feeds
• ...
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 3 / 60
Possible Solutions
Flooding
• Robust, but inefficient (O(n2
))
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
Possible Solutions
Flooding
• Robust, but inefficient (O(n2
))
Tree
• Efficient (O(n)), but fragile
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
Possible Solutions
Flooding
• Robust, but inefficient (O(n2
))
Tree
• Efficient (O(n)), but fragile
Gossip
• Efficient (O(nlogn)) and robust, but has relative high latency
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
Possible Solutions
Flooding
• Robust, but inefficient (O(n2
))
Tree
• Efficient (O(n)), but fragile
Gossip
• Efficient (O(nlogn)) and robust, but has relative high latency
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
Epidemic/Gossip Algorithms
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 5 / 60
Introduction
Epidemiology studies the spread of a disease or infection in terms
of populations of infected/uninfected individuals and their rates of
change.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
Introduction
Epidemiology studies the spread of a disease or infection in terms
of populations of infected/uninfected individuals and their rates of
change.
Nodes infect each other trough messages.
Total number of messages is less than O(n2).
No node is overloaded.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
Introduction
Epidemiology studies the spread of a disease or infection in terms
of populations of infected/uninfected individuals and their rates of
change.
Nodes infect each other trough messages.
Total number of messages is less than O(n2).
No node is overloaded.
But
• No deterministic guarantee on reliability.
• Only probabilistic ones.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
History of the Epidemic/Gossip Paradigm
First defined by Alan Demers et al. (1987)
90s: gossip applied to the information dissemination problem
00s: gossip beyond dissemination
2006: Workshop on the future of gossip (Leiden, the Netherlands)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 7 / 60
History of the Epidemic/Gossip Paradigm (1987)
Database replicated at thousands of nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
History of the Epidemic/Gossip Paradigm (1987)
Database replicated at thousands of nodes.
Heterogeneous and unreliable network.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
History of the Epidemic/Gossip Paradigm (1987)
Database replicated at thousands of nodes.
Heterogeneous and unreliable network.
Independent updates to single elements of the DB are injected at
multiple nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
History of the Epidemic/Gossip Paradigm (1987)
Database replicated at thousands of nodes.
Heterogeneous and unreliable network.
Independent updates to single elements of the DB are injected at
multiple nodes.
Updates must propagate to all nodes or be supplanted by later up-
dates of the same element.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
History of the Epidemic/Gossip Paradigm (1987)
Database replicated at thousands of nodes.
Heterogeneous and unreliable network.
Independent updates to single elements of the DB are injected at
multiple nodes.
Updates must propagate to all nodes or be supplanted by later up-
dates of the same element.
Replicas become consistent after no more new updates.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
History of the Epidemic/Gossip Paradigm (Today)
Amazon uses a gossip protocol to quickly spread information
throughout the S3 system.
Amazon’s Dynamo uses a gossip-based failure detection service.
The basic information exchange in BitTorrent is based on gossip.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 9 / 60
SIR Model (1/2)
Kermack and McKendrick, 1927
An individual p can be:
• Susceptible: if p is not yet infected by the disease.
• Infective: if p is infected and capable to spread the disease.
• Removed: if p has been infected and has recovered from the disease.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 10 / 60
SIR Model (2/2)
Initially, a single individual is infective.
Individuals get in touch with each other, spreading the disease.
Susceptible individuals are turned into infective ones.
Eventually, infective individuals will become removed.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 11 / 60
From Epidemiology to Distributed Systems
The idea
• Disease spread quickly and robustly.
• Our goal is to spread an update as fast and as reliable as possible.
• Can we apply these ideas to distributed systems?
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 12 / 60
From Epidemiology to Distributed Systems
The idea
• Disease spread quickly and robustly.
• Our goal is to spread an update as fast and as reliable as possible.
• Can we apply these ideas to distributed systems?
SIR Model for database replication:
• Susceptible: if p has not yet received an update.
• Infective: if p has not yet received an update.
• Removed: if p has the update but is no longer willing to share it.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 12 / 60
Two Styles of Epidemic Protocols
Anti-entropy
Rumor mongering
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 13 / 60
Anti-Entropy
Each node p periodically contacts a random partner q selected from
the current population.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 14 / 60
Anti-Entropy
Each node p periodically contacts a random partner q selected from
the current population.
Then, p and q engage in an information exchange protocol, where
updates known to p but not to q are transferred from p to q (push),
or vice-versa (pull), or in both direction (push-pull).
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 14 / 60
Rumor Mongering
Nodes are initially ignorant.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
Rumor Mongering
Nodes are initially ignorant.
When an update is learned by a node, it becomes a hot rumor.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
Rumor Mongering
Nodes are initially ignorant.
When an update is learned by a node, it becomes a hot rumor.
While a node holds a hot rumor, it periodically chooses a random
node from the current population and sends (pushes) the rumor to
it.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
Rumor Mongering
Nodes are initially ignorant.
When an update is learned by a node, it becomes a hot rumor.
While a node holds a hot rumor, it periodically chooses a random
node from the current population and sends (pushes) the rumor to
it.
Eventually, a node will lose interest in spreading the rumor.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
Epidemic Algorithms Applications
Aggregation
Peer sampling (Cyclon)
Topology management (Tman)
...
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 16 / 60
Aggregation
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 17 / 60
Aggregation
Aggregation provides a summary of some global system property.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
Aggregation
Aggregation provides a summary of some global system property.
It allows local access to global information.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
Aggregation
Aggregation provides a summary of some global system property.
It allows local access to global information.
Examples of aggregation functions:
• The average load of nodes in a cluster.
• The sum of free space in a distributed storage.
• The total number of nodes in a P2P system.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
Aggregation Generic Framework (1/3)
Executed by all processes:
repeat evert t time units:
q = selectRandomPeer() // Select a random neighbor
send <p, pullRequest, Sp> to q
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 19 / 60
Aggregation Generic Framework (2/3)
Executed by all processes:
upon receive<p, pullRequest, Sp> do:
send <q, pullResponse, Sq> to p
Sq = update(Sp, Sq)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 20 / 60
Aggregation Generic Framework (2/3)
Executed by all processes:
upon receive<p, pullRequest, Sp> do:
send <q, pullResponse, Sq> to p
Sq = update(Sp, Sq)
update function:
• avg: return (Sp + Sq) / 2
• max: return max(Sp, Sq)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 20 / 60
Aggregation Generic Framework (3/3)
Executed by all processes:
upon receive<q, pullResponse, Sq> do:
Sp = update(Sp, Sq)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 21 / 60
Aggregation Generic Framework (3/3)
Executed by all processes:
upon receive<q, pullResponse, Sq> do:
Sp = update(Sp, Sq)
update function:
• avg: return (Sp + Sq) / 2
• max: return max(Sp, Sq)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 21 / 60
Aggregation Example (1/5)
Taking the average of the numbers in the nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 22 / 60
Aggregation Example (2/5)
Taking the average of the numbers in the nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 23 / 60
Aggregation Example (3/5)
Taking the average of the numbers in the nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 24 / 60
Aggregation Example (4/5)
Taking the average of the numbers in the nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 25 / 60
Aggregation Example (5/5)
Taking the average of the numbers in the nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 26 / 60
Network Size Estimation
Any ideas?
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
Network Size Estimation
Any ideas?
All nodes set their states to 0.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
Network Size Estimation
Any ideas?
All nodes set their states to 0.
The initiator sets its state to 1 and starts gossiping for the average.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
Network Size Estimation
Any ideas?
All nodes set their states to 0.
The initiator sets its state to 1 and starts gossiping for the average.
Eventually all nodes converge to the avg = 1
N .
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
Peer Sampling Service
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 28 / 60
Epidemic Protocols
In a epidemic (gossip) protocol, each node in the system periodically
exchanges information with a subset of nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
Epidemic Protocols
In a epidemic (gossip) protocol, each node in the system periodically
exchanges information with a subset of nodes.
The choice of this subset is crucial.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
Epidemic Protocols
In a epidemic (gossip) protocol, each node in the system periodically
exchanges information with a subset of nodes.
The choice of this subset is crucial.
Ideally, the nodes should be selected following a uniform random
sample of all nodes currently in the system.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
Achieving a Uniform Random Sample
Each node may be assumed to know every other node in the system.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 30 / 60
Achieving a Uniform Random Sample
Each node may be assumed to know every other node in the system.
Providing each node with a complete membership table is unrealistic
in a large scale dynamic system.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 30 / 60
Peer Sampling
An alternative solution.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
Peer Sampling
An alternative solution.
Every node maintains a relatively small local membership table that
provides a partial view on the complete set of nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
Peer Sampling
An alternative solution.
Every node maintains a relatively small local membership table that
provides a partial view on the complete set of nodes.
Periodically refreshes the table using a gossiping procedure.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
Peer Sampling Generic Framework (1/4)
Executed by all processes:
repeat evert t time units:
q = selectPeer()
buf = ((myAddress, 0))
view.permute()
move oldest H items to the end of view
buf.append(view.head(c/2-1))
send <p, psRequest, buf> to q
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 32 / 60
Peer Sampling Generic Framework (2/4)
Executed by all processes:
upon receive<p, psRequest, bufp> do:
buf = ((myAddress, 0))
view.permute()
move oldest H items to the end of view
buf.append(view.head(c/2-1))
send <q, psResponse, buf> to p
view.select(c, H, S, bufp)
view.increaseAge()
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 33 / 60
Peer Sampling Generic Framework (3/4)
Executed by all processes:
upon receive<q, psResponse, bufq> do:
view.select(c, H, S, bufq)
view.increaseAge()
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 34 / 60
Peer Sampling Generic Framework (4/4)
method view.select(c, H, S, bufp)
view.append(bufp)
view.removeDuplicates()
view.removeOldItems(min(H, view.size-c))
view.removeHead(min(S, view.size-c))
view.removeAtRandom(view.size-c)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 35 / 60
Gossip-based Peer Sampling (1/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 36 / 60
Gossip-based Peer Sampling (2/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 37 / 60
Gossip-based Peer Sampling (3/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 38 / 60
Gossip-based Peer Sampling (4/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 39 / 60
Gossip-based Peer Sampling (5/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 40 / 60
Gossip-based Peer Sampling (6/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 41 / 60
Gossip-based Peer Sampling (7/7)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 42 / 60
Peer Sampling Design Space
Peer Selection
• Rand: uniform random
• Tail: highest age
View Propagation
• Push
• Push-Pull
View Selection
• Blind: H = 0, S = 0
• Healer: H = c/2
• Swapper: H = 0, S = c/2
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 43 / 60
Cyclon as a Peer Sampling Service
Peer Selection
• Rand: uniform random
• Tail: highest age
View Propagation
• Push
• Push-Pull
View Selection
• Blind: H = 0, S = 0
• Healer: H = c/2
• Swapper: H = 0, S = c/2
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 44 / 60
Cyclon (1/5)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 45 / 60
Cyclon (2/5)
Pick the oldest node from my view and remove it from the view
(tail)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 46 / 60
Cyclon (3/5)
Exchange some of the nodes in neighbours (push-pull)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 47 / 60
Cyclon (4/5)
Exchange some of the nodes in neighbours (push-pull)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 48 / 60
Cyclon (5/5)
Update the views (swapper)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 49 / 60
Topology Management
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 50 / 60
T-Man
T-man is a protocol to construct and maintain any topology with
the help of a ranking function.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 51 / 60
T-Man
T-man is a protocol to construct and maintain any topology with
the help of a ranking function.
The ranking function orders any set of nodes according to their
desirability to be neighbors of a given node.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 51 / 60
T-Man Generic Framework (1/3)
Executed by all processes.
repeat evert t time units:
q = selectPeer()
myDescriptor = (myAddress, myProfile)
buf = merge(view, myDescriptor)
buf = merge(buf, view.rnd)
send <p, tmanRequest, buf> to q
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
T-Man Generic Framework (1/3)
Executed by all processes.
repeat evert t time units:
q = selectPeer()
myDescriptor = (myAddress, myProfile)
buf = merge(view, myDescriptor)
buf = merge(buf, view.rnd)
send <p, tmanRequest, buf> to q
selectPeer
• Sort all nodes in the view based on ranking.
• Pick randomly one node from the first half.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
T-Man Generic Framework (1/3)
Executed by all processes.
repeat evert t time units:
q = selectPeer()
myDescriptor = (myAddress, myProfile)
buf = merge(view, myDescriptor)
buf = merge(buf, view.rnd)
send <p, tmanRequest, buf> to q
selectPeer
• Sort all nodes in the view based on ranking.
• Pick randomly one node from the first half.
view.rnd
• Provides a random sample of the nodes from the entire network,
e.g., using cyclon.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
T-Man Generic Framework (2/3)
Executed by all processes.
upon receive<p, psRequest, bufp> do:
myDescriptor = (myAddress, myProfile)
buf = merge(view, myDescriptor)
buf = merge(buf, rnd.view)
send <q, tmanResponse, buf> to p
buf = merge(bufp, view)
view = selectView(buf)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 53 / 60
T-Man Generic Framework (2/3)
Executed by all processes.
upon receive<p, psRequest, bufp> do:
myDescriptor = (myAddress, myProfile)
buf = merge(view, myDescriptor)
buf = merge(buf, rnd.view)
send <q, tmanResponse, buf> to p
buf = merge(bufp, view)
view = selectView(buf)
selectView
• Sort all nodes in buffer (about double size of the view).
• Pick out c highest ranked nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 53 / 60
T-Man Generic Framework (3/3)
Executed by all processes.
upon receive<q, tmanResponse, bufq> do:
buf = merge(bufq, view)
view = selectView(buf)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 54 / 60
T-Man Generic Framework (3/3)
Executed by all processes.
upon receive<q, tmanResponse, bufq> do:
buf = merge(bufq, view)
view = selectView(buf)
selectView
• Sort all nodes in buffer (about double size of the view).
• Pick out c highest ranked nodes.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 54 / 60
Ranking Function
Sample ranking functions:
• Line: d(a, b) = |a − b|
• Ring: d(a, b) = min(N − |a − b|, |a − b|)
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 55 / 60
Illustration of T-Man
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 56 / 60
Summary
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 57 / 60
Summary
Epidemic/Gossip algorithms: anti-entropy and rumor mongering
Aggregation
Peer sampling service: cyclon
• Peer selection
• View propagation
• View selection
Topology management: T-man
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 58 / 60
References:
M. Jelasity, and A. Montresor, Epidemic-style proactive aggregation
in large overlay networks, ICDCS, 2004.
M. Jelasity, and O. Babaoglu, T-Man: Gossip-based overlay topol-
ogy management, Engineering Self-Organising Systems, 2006.
M. Jelasity et al., Gossip-based peer sampling, TOCS, 2007.
S. Voulgaris, D. Gavidia, and M. Van Steen, Cyclon: Inexpensive
membership management for unstructured P2P overlays, Journal of
Network and Systems Management, 2005.
A. Demers et al., Epidemic algorithms for replicated database main-
tenance, PODC, 1987.
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 59 / 60
Questions?
Acknowledgements
Some slides were derived from Alberto Montresor (Trento University).
Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 60 / 60

More Related Content

PDF
macvlan and ipvlan
PDF
Grokking Techtalk #39: Gossip protocol and applications
PPTX
Evolution of operating system
PPTX
Linux Network Stack
PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
PPTX
Peer to peer system
PDF
Inter process communication
PPT
macvlan and ipvlan
Grokking Techtalk #39: Gossip protocol and applications
Evolution of operating system
Linux Network Stack
LinuxCon 2015 Linux Kernel Networking Walkthrough
Peer to peer system
Inter process communication

What's hot (20)

PDF
Function Level Analysis of Linux NVMe Driver
PPTX
Synchronous vs Asynchronous Programming
PPTX
DNS Presentation
PPTX
Linux and DNS Server
PDF
Introduction to eBPF and XDP
PDF
Unit 5 Advanced Computer Architecture
PPTX
Communication in Distributed Systems
PPT
PPTX
Distributed shred memory architecture
PPTX
Distributed Shared Memory
PPTX
Interconnection Network
PDF
Understanding the Android System Server
PPTX
Network File System in Distributed Computing
PPTX
Sun NFS , Case study
PDF
150416 OpenStack Networking with Neutron Jieun, Kim
PPTX
Remote Method Invocation
PPTX
Introduction to gRPC
PPTX
Understanding eBPF in a Hurry!
PDF
Introduction to RCU
PPTX
Introduction aux systèmes répartis
Function Level Analysis of Linux NVMe Driver
Synchronous vs Asynchronous Programming
DNS Presentation
Linux and DNS Server
Introduction to eBPF and XDP
Unit 5 Advanced Computer Architecture
Communication in Distributed Systems
Distributed shred memory architecture
Distributed Shared Memory
Interconnection Network
Understanding the Android System Server
Network File System in Distributed Computing
Sun NFS , Case study
150416 OpenStack Networking with Neutron Jieun, Kim
Remote Method Invocation
Introduction to gRPC
Understanding eBPF in a Hurry!
Introduction to RCU
Introduction aux systèmes répartis
Ad

Viewers also liked (20)

PDF
An Adaptive Gossip-Based Dissemination Protocol for Multi-Source Message Streams
PDF
Gossip & Key Value Store
PPTX
2014 09-23 Mechanism of Gossip protocol
PDF
Cassandra background-and-architecture
PDF
Introduction to Cassandra Basics
PDF
Introduction to Apache Cassandra
PDF
Cassandra Explained
PPTX
An Overview of Apache Cassandra
PDF
Cassandra Introduction & Features
PPSX
PDF
IDMEF, the universal format for security alerts, OW2con'16, Paris.
 
DOC
Wildi 2009 Resume Addendum
PDF
Service Cloud OW2 Conference Nov10
 
PPT
Hahn Golf Academia & Club
PDF
E-Government Portal-DAWLATI, OW2con'12, Paris
 
PDF
OW2con'14 - Xlcloud, 3D rendering in the cloud
 
PDF
A new interface between smart device and web using html5 web socket and qr code
PPTX
TDC 2012 - Métricas de código na arquitetura
PDF
OW2con'14 - Weblab in the land of Big Data
 
PPT
Chapter 1 presentation
An Adaptive Gossip-Based Dissemination Protocol for Multi-Source Message Streams
Gossip & Key Value Store
2014 09-23 Mechanism of Gossip protocol
Cassandra background-and-architecture
Introduction to Cassandra Basics
Introduction to Apache Cassandra
Cassandra Explained
An Overview of Apache Cassandra
Cassandra Introduction & Features
IDMEF, the universal format for security alerts, OW2con'16, Paris.
 
Wildi 2009 Resume Addendum
Service Cloud OW2 Conference Nov10
 
Hahn Golf Academia & Club
E-Government Portal-DAWLATI, OW2con'12, Paris
 
OW2con'14 - Xlcloud, 3D rendering in the cloud
 
A new interface between smart device and web using html5 web socket and qr code
TDC 2012 - Métricas de código na arquitetura
OW2con'14 - Weblab in the land of Big Data
 
Chapter 1 presentation
Ad

Similar to Gossip-based algorithms (20)

PDF
Introduction to stream processing
PDF
PDF
Deadlocks
PDF
Process Synchronization - Part2
PDF
Time, clocks and the ordering of events
PDF
Security
PPTX
2014 Taverna Tutorial Introduction to eScience and workflows
PDF
Modeling and Threshold Sensitivity Analysis of Computer Virus Epidemic
PDF
I017134347
PDF
Updated (version 2.3 THRILLER) Easy Perspective to (Complexity)-Thriller 12 S...
DOCX
AJH CV sept2016
PDF
Applying principles of chaos engineering to serverless (ServerlessCPH)
PDF
AUDIO CRYPTOGRAPHY VIA ENHANCED GENETIC ALGORITHM
PDF
Introduction to Operating Systems - Part1
PDF
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
PDF
SIP Flooding Attack Detection Using Hybrid Detection Algorithm
PDF
PDF
Probabilistic models for anomaly detection based on usage of network traffic
PDF
Random Keying Technique for Security in Wireless Sensor Networks Based on Mem...
PDF
Graph processing - Pregel
Introduction to stream processing
Deadlocks
Process Synchronization - Part2
Time, clocks and the ordering of events
Security
2014 Taverna Tutorial Introduction to eScience and workflows
Modeling and Threshold Sensitivity Analysis of Computer Virus Epidemic
I017134347
Updated (version 2.3 THRILLER) Easy Perspective to (Complexity)-Thriller 12 S...
AJH CV sept2016
Applying principles of chaos engineering to serverless (ServerlessCPH)
AUDIO CRYPTOGRAPHY VIA ENHANCED GENETIC ALGORITHM
Introduction to Operating Systems - Part1
Introduction into Fault-tolerant Distributed Algorithms and their Modeling (P...
SIP Flooding Attack Detection Using Hybrid Detection Algorithm
Probabilistic models for anomaly detection based on usage of network traffic
Random Keying Technique for Security in Wireless Sensor Networks Based on Mem...
Graph processing - Pregel

More from Amir Payberah (20)

PDF
P2P Content Distribution Network
PDF
Cloud Computing
PDF
Data Intensive Computing Frameworks
PDF
The Stratosphere Big Data Analytics Platform
PDF
The Spark Big Data Analytics Platform
PDF
Protection
PDF
Linux Module Programming
PDF
IO Systems
PDF
File System Implementation - Part2
PDF
File System Implementation - Part1
PDF
File System Interface
PDF
Storage
PDF
Virtual Memory - Part2
PDF
Virtual Memory - Part1
PDF
Main Memory - Part2
PDF
Main Memory - Part1
PDF
CPU Scheduling - Part2
PDF
CPU Scheduling - Part1
PDF
Process Synchronization - Part1
PDF
Threads
P2P Content Distribution Network
Cloud Computing
Data Intensive Computing Frameworks
The Stratosphere Big Data Analytics Platform
The Spark Big Data Analytics Platform
Protection
Linux Module Programming
IO Systems
File System Implementation - Part2
File System Implementation - Part1
File System Interface
Storage
Virtual Memory - Part2
Virtual Memory - Part1
Main Memory - Part2
Main Memory - Part1
CPU Scheduling - Part2
CPU Scheduling - Part1
Process Synchronization - Part1
Threads

Recently uploaded (20)

PDF
AI in Product Development-omnex systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
ai tools demonstartion for schools and inter college
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
System and Network Administraation Chapter 3
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Transform Your Business with a Software ERP System
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms I-SECS-1021-03
AI in Product Development-omnex systems
VVF-Customer-Presentation2025-Ver1.9.pptx
L1 - Introduction to python Backend.pptx
How to Migrate SBCGlobal Email to Yahoo Easily
ai tools demonstartion for schools and inter college
CHAPTER 2 - PM Management and IT Context
How Creative Agencies Leverage Project Management Software.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
System and Network Administraation Chapter 3
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Wondershare Filmora 15 Crack With Activation Key [2025
Upgrade and Innovation Strategies for SAP ERP Customers
Transform Your Business with a Software ERP System
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms I-SECS-1021-03

Gossip-based algorithms

  • 1. Epidemic Algorithms Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 1 / 60
  • 2. What is the Problem? Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 2 / 60
  • 3. What is the Problem? Application-level broadcast/multicast Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 3 / 60
  • 4. What is the Problem? Application-level broadcast/multicast • Database replication • Video streaming • RSS feeds • ... Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 3 / 60
  • 5. Possible Solutions Flooding • Robust, but inefficient (O(n2 )) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
  • 6. Possible Solutions Flooding • Robust, but inefficient (O(n2 )) Tree • Efficient (O(n)), but fragile Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
  • 7. Possible Solutions Flooding • Robust, but inefficient (O(n2 )) Tree • Efficient (O(n)), but fragile Gossip • Efficient (O(nlogn)) and robust, but has relative high latency Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
  • 8. Possible Solutions Flooding • Robust, but inefficient (O(n2 )) Tree • Efficient (O(n)), but fragile Gossip • Efficient (O(nlogn)) and robust, but has relative high latency Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 4 / 60
  • 9. Epidemic/Gossip Algorithms Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 5 / 60
  • 10. Introduction Epidemiology studies the spread of a disease or infection in terms of populations of infected/uninfected individuals and their rates of change. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
  • 11. Introduction Epidemiology studies the spread of a disease or infection in terms of populations of infected/uninfected individuals and their rates of change. Nodes infect each other trough messages. Total number of messages is less than O(n2). No node is overloaded. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
  • 12. Introduction Epidemiology studies the spread of a disease or infection in terms of populations of infected/uninfected individuals and their rates of change. Nodes infect each other trough messages. Total number of messages is less than O(n2). No node is overloaded. But • No deterministic guarantee on reliability. • Only probabilistic ones. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 6 / 60
  • 13. History of the Epidemic/Gossip Paradigm First defined by Alan Demers et al. (1987) 90s: gossip applied to the information dissemination problem 00s: gossip beyond dissemination 2006: Workshop on the future of gossip (Leiden, the Netherlands) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 7 / 60
  • 14. History of the Epidemic/Gossip Paradigm (1987) Database replicated at thousands of nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
  • 15. History of the Epidemic/Gossip Paradigm (1987) Database replicated at thousands of nodes. Heterogeneous and unreliable network. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
  • 16. History of the Epidemic/Gossip Paradigm (1987) Database replicated at thousands of nodes. Heterogeneous and unreliable network. Independent updates to single elements of the DB are injected at multiple nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
  • 17. History of the Epidemic/Gossip Paradigm (1987) Database replicated at thousands of nodes. Heterogeneous and unreliable network. Independent updates to single elements of the DB are injected at multiple nodes. Updates must propagate to all nodes or be supplanted by later up- dates of the same element. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
  • 18. History of the Epidemic/Gossip Paradigm (1987) Database replicated at thousands of nodes. Heterogeneous and unreliable network. Independent updates to single elements of the DB are injected at multiple nodes. Updates must propagate to all nodes or be supplanted by later up- dates of the same element. Replicas become consistent after no more new updates. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 8 / 60
  • 19. History of the Epidemic/Gossip Paradigm (Today) Amazon uses a gossip protocol to quickly spread information throughout the S3 system. Amazon’s Dynamo uses a gossip-based failure detection service. The basic information exchange in BitTorrent is based on gossip. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 9 / 60
  • 20. SIR Model (1/2) Kermack and McKendrick, 1927 An individual p can be: • Susceptible: if p is not yet infected by the disease. • Infective: if p is infected and capable to spread the disease. • Removed: if p has been infected and has recovered from the disease. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 10 / 60
  • 21. SIR Model (2/2) Initially, a single individual is infective. Individuals get in touch with each other, spreading the disease. Susceptible individuals are turned into infective ones. Eventually, infective individuals will become removed. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 11 / 60
  • 22. From Epidemiology to Distributed Systems The idea • Disease spread quickly and robustly. • Our goal is to spread an update as fast and as reliable as possible. • Can we apply these ideas to distributed systems? Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 12 / 60
  • 23. From Epidemiology to Distributed Systems The idea • Disease spread quickly and robustly. • Our goal is to spread an update as fast and as reliable as possible. • Can we apply these ideas to distributed systems? SIR Model for database replication: • Susceptible: if p has not yet received an update. • Infective: if p has not yet received an update. • Removed: if p has the update but is no longer willing to share it. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 12 / 60
  • 24. Two Styles of Epidemic Protocols Anti-entropy Rumor mongering Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 13 / 60
  • 25. Anti-Entropy Each node p periodically contacts a random partner q selected from the current population. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 14 / 60
  • 26. Anti-Entropy Each node p periodically contacts a random partner q selected from the current population. Then, p and q engage in an information exchange protocol, where updates known to p but not to q are transferred from p to q (push), or vice-versa (pull), or in both direction (push-pull). Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 14 / 60
  • 27. Rumor Mongering Nodes are initially ignorant. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
  • 28. Rumor Mongering Nodes are initially ignorant. When an update is learned by a node, it becomes a hot rumor. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
  • 29. Rumor Mongering Nodes are initially ignorant. When an update is learned by a node, it becomes a hot rumor. While a node holds a hot rumor, it periodically chooses a random node from the current population and sends (pushes) the rumor to it. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
  • 30. Rumor Mongering Nodes are initially ignorant. When an update is learned by a node, it becomes a hot rumor. While a node holds a hot rumor, it periodically chooses a random node from the current population and sends (pushes) the rumor to it. Eventually, a node will lose interest in spreading the rumor. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 15 / 60
  • 31. Epidemic Algorithms Applications Aggregation Peer sampling (Cyclon) Topology management (Tman) ... Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 16 / 60
  • 32. Aggregation Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 17 / 60
  • 33. Aggregation Aggregation provides a summary of some global system property. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
  • 34. Aggregation Aggregation provides a summary of some global system property. It allows local access to global information. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
  • 35. Aggregation Aggregation provides a summary of some global system property. It allows local access to global information. Examples of aggregation functions: • The average load of nodes in a cluster. • The sum of free space in a distributed storage. • The total number of nodes in a P2P system. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 18 / 60
  • 36. Aggregation Generic Framework (1/3) Executed by all processes: repeat evert t time units: q = selectRandomPeer() // Select a random neighbor send <p, pullRequest, Sp> to q Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 19 / 60
  • 37. Aggregation Generic Framework (2/3) Executed by all processes: upon receive<p, pullRequest, Sp> do: send <q, pullResponse, Sq> to p Sq = update(Sp, Sq) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 20 / 60
  • 38. Aggregation Generic Framework (2/3) Executed by all processes: upon receive<p, pullRequest, Sp> do: send <q, pullResponse, Sq> to p Sq = update(Sp, Sq) update function: • avg: return (Sp + Sq) / 2 • max: return max(Sp, Sq) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 20 / 60
  • 39. Aggregation Generic Framework (3/3) Executed by all processes: upon receive<q, pullResponse, Sq> do: Sp = update(Sp, Sq) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 21 / 60
  • 40. Aggregation Generic Framework (3/3) Executed by all processes: upon receive<q, pullResponse, Sq> do: Sp = update(Sp, Sq) update function: • avg: return (Sp + Sq) / 2 • max: return max(Sp, Sq) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 21 / 60
  • 41. Aggregation Example (1/5) Taking the average of the numbers in the nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 22 / 60
  • 42. Aggregation Example (2/5) Taking the average of the numbers in the nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 23 / 60
  • 43. Aggregation Example (3/5) Taking the average of the numbers in the nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 24 / 60
  • 44. Aggregation Example (4/5) Taking the average of the numbers in the nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 25 / 60
  • 45. Aggregation Example (5/5) Taking the average of the numbers in the nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 26 / 60
  • 46. Network Size Estimation Any ideas? Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
  • 47. Network Size Estimation Any ideas? All nodes set their states to 0. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
  • 48. Network Size Estimation Any ideas? All nodes set their states to 0. The initiator sets its state to 1 and starts gossiping for the average. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
  • 49. Network Size Estimation Any ideas? All nodes set their states to 0. The initiator sets its state to 1 and starts gossiping for the average. Eventually all nodes converge to the avg = 1 N . Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 27 / 60
  • 50. Peer Sampling Service Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 28 / 60
  • 51. Epidemic Protocols In a epidemic (gossip) protocol, each node in the system periodically exchanges information with a subset of nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
  • 52. Epidemic Protocols In a epidemic (gossip) protocol, each node in the system periodically exchanges information with a subset of nodes. The choice of this subset is crucial. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
  • 53. Epidemic Protocols In a epidemic (gossip) protocol, each node in the system periodically exchanges information with a subset of nodes. The choice of this subset is crucial. Ideally, the nodes should be selected following a uniform random sample of all nodes currently in the system. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 29 / 60
  • 54. Achieving a Uniform Random Sample Each node may be assumed to know every other node in the system. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 30 / 60
  • 55. Achieving a Uniform Random Sample Each node may be assumed to know every other node in the system. Providing each node with a complete membership table is unrealistic in a large scale dynamic system. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 30 / 60
  • 56. Peer Sampling An alternative solution. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
  • 57. Peer Sampling An alternative solution. Every node maintains a relatively small local membership table that provides a partial view on the complete set of nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
  • 58. Peer Sampling An alternative solution. Every node maintains a relatively small local membership table that provides a partial view on the complete set of nodes. Periodically refreshes the table using a gossiping procedure. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 31 / 60
  • 59. Peer Sampling Generic Framework (1/4) Executed by all processes: repeat evert t time units: q = selectPeer() buf = ((myAddress, 0)) view.permute() move oldest H items to the end of view buf.append(view.head(c/2-1)) send <p, psRequest, buf> to q Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 32 / 60
  • 60. Peer Sampling Generic Framework (2/4) Executed by all processes: upon receive<p, psRequest, bufp> do: buf = ((myAddress, 0)) view.permute() move oldest H items to the end of view buf.append(view.head(c/2-1)) send <q, psResponse, buf> to p view.select(c, H, S, bufp) view.increaseAge() Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 33 / 60
  • 61. Peer Sampling Generic Framework (3/4) Executed by all processes: upon receive<q, psResponse, bufq> do: view.select(c, H, S, bufq) view.increaseAge() Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 34 / 60
  • 62. Peer Sampling Generic Framework (4/4) method view.select(c, H, S, bufp) view.append(bufp) view.removeDuplicates() view.removeOldItems(min(H, view.size-c)) view.removeHead(min(S, view.size-c)) view.removeAtRandom(view.size-c) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 35 / 60
  • 63. Gossip-based Peer Sampling (1/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 36 / 60
  • 64. Gossip-based Peer Sampling (2/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 37 / 60
  • 65. Gossip-based Peer Sampling (3/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 38 / 60
  • 66. Gossip-based Peer Sampling (4/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 39 / 60
  • 67. Gossip-based Peer Sampling (5/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 40 / 60
  • 68. Gossip-based Peer Sampling (6/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 41 / 60
  • 69. Gossip-based Peer Sampling (7/7) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 42 / 60
  • 70. Peer Sampling Design Space Peer Selection • Rand: uniform random • Tail: highest age View Propagation • Push • Push-Pull View Selection • Blind: H = 0, S = 0 • Healer: H = c/2 • Swapper: H = 0, S = c/2 Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 43 / 60
  • 71. Cyclon as a Peer Sampling Service Peer Selection • Rand: uniform random • Tail: highest age View Propagation • Push • Push-Pull View Selection • Blind: H = 0, S = 0 • Healer: H = c/2 • Swapper: H = 0, S = c/2 Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 44 / 60
  • 72. Cyclon (1/5) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 45 / 60
  • 73. Cyclon (2/5) Pick the oldest node from my view and remove it from the view (tail) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 46 / 60
  • 74. Cyclon (3/5) Exchange some of the nodes in neighbours (push-pull) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 47 / 60
  • 75. Cyclon (4/5) Exchange some of the nodes in neighbours (push-pull) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 48 / 60
  • 76. Cyclon (5/5) Update the views (swapper) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 49 / 60
  • 77. Topology Management Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 50 / 60
  • 78. T-Man T-man is a protocol to construct and maintain any topology with the help of a ranking function. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 51 / 60
  • 79. T-Man T-man is a protocol to construct and maintain any topology with the help of a ranking function. The ranking function orders any set of nodes according to their desirability to be neighbors of a given node. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 51 / 60
  • 80. T-Man Generic Framework (1/3) Executed by all processes. repeat evert t time units: q = selectPeer() myDescriptor = (myAddress, myProfile) buf = merge(view, myDescriptor) buf = merge(buf, view.rnd) send <p, tmanRequest, buf> to q Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
  • 81. T-Man Generic Framework (1/3) Executed by all processes. repeat evert t time units: q = selectPeer() myDescriptor = (myAddress, myProfile) buf = merge(view, myDescriptor) buf = merge(buf, view.rnd) send <p, tmanRequest, buf> to q selectPeer • Sort all nodes in the view based on ranking. • Pick randomly one node from the first half. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
  • 82. T-Man Generic Framework (1/3) Executed by all processes. repeat evert t time units: q = selectPeer() myDescriptor = (myAddress, myProfile) buf = merge(view, myDescriptor) buf = merge(buf, view.rnd) send <p, tmanRequest, buf> to q selectPeer • Sort all nodes in the view based on ranking. • Pick randomly one node from the first half. view.rnd • Provides a random sample of the nodes from the entire network, e.g., using cyclon. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 52 / 60
  • 83. T-Man Generic Framework (2/3) Executed by all processes. upon receive<p, psRequest, bufp> do: myDescriptor = (myAddress, myProfile) buf = merge(view, myDescriptor) buf = merge(buf, rnd.view) send <q, tmanResponse, buf> to p buf = merge(bufp, view) view = selectView(buf) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 53 / 60
  • 84. T-Man Generic Framework (2/3) Executed by all processes. upon receive<p, psRequest, bufp> do: myDescriptor = (myAddress, myProfile) buf = merge(view, myDescriptor) buf = merge(buf, rnd.view) send <q, tmanResponse, buf> to p buf = merge(bufp, view) view = selectView(buf) selectView • Sort all nodes in buffer (about double size of the view). • Pick out c highest ranked nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 53 / 60
  • 85. T-Man Generic Framework (3/3) Executed by all processes. upon receive<q, tmanResponse, bufq> do: buf = merge(bufq, view) view = selectView(buf) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 54 / 60
  • 86. T-Man Generic Framework (3/3) Executed by all processes. upon receive<q, tmanResponse, bufq> do: buf = merge(bufq, view) view = selectView(buf) selectView • Sort all nodes in buffer (about double size of the view). • Pick out c highest ranked nodes. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 54 / 60
  • 87. Ranking Function Sample ranking functions: • Line: d(a, b) = |a − b| • Ring: d(a, b) = min(N − |a − b|, |a − b|) Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 55 / 60
  • 88. Illustration of T-Man Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 56 / 60
  • 89. Summary Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 57 / 60
  • 90. Summary Epidemic/Gossip algorithms: anti-entropy and rumor mongering Aggregation Peer sampling service: cyclon • Peer selection • View propagation • View selection Topology management: T-man Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 58 / 60
  • 91. References: M. Jelasity, and A. Montresor, Epidemic-style proactive aggregation in large overlay networks, ICDCS, 2004. M. Jelasity, and O. Babaoglu, T-Man: Gossip-based overlay topol- ogy management, Engineering Self-Organising Systems, 2006. M. Jelasity et al., Gossip-based peer sampling, TOCS, 2007. S. Voulgaris, D. Gavidia, and M. Van Steen, Cyclon: Inexpensive membership management for unstructured P2P overlays, Journal of Network and Systems Management, 2005. A. Demers et al., Epidemic algorithms for replicated database main- tenance, PODC, 1987. Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 59 / 60
  • 92. Questions? Acknowledgements Some slides were derived from Alberto Montresor (Trento University). Amir H. Payberah (Tehran Polytechnic) Epidemic Algorithms 1393/7/7 60 / 60