DAGSTUHL SEMINAR 342 EPIDEMIC ALGORITHMS AND PROCESSES: FROM THEORY TO APPLICATIONS A Sysems Perspecive Pascal Felber Pascal.Felber@unine.ch hp://iiun.unine.ch/! Gossip proocols Inroducion! Decenralized communicaion proocols inspired by gossip (or rumor spreading) as observed in social neworks! Also called epidemic proocol, as i spreads like a disease! Widely used for:! Informaion disseminaion! Ani-enropy (e.g., compare/reconcile replicas)! Compue aggregaes Informaion Disseminaion! Uniform gossiping is a well-sudied proocol for spreading informaion! I know a secre, I ell wo friends, who ell wo friends,! Formally, each round, everyone who knows he daa sends i o one paricipan a random! Afer O(log n) rounds, all n paricipans know he informaion (wih high probabiliy) [Piel 87] Ani-Enropy! Inroduced for replicaed daabase mainenance [Demers e al. 87]! Every sie regularly chooses anoher sie a random and, by exchanging daabase conens wih i, resolves any differences beween he wo! Updaes evenually (bu slowly) reach he whole populaion! Used for insance in evenually consisen sorage sysems! Replicas updaed lazily
Aggregae Gossiping! Push-Sum proocol [Kempe e al. 3]! Seing: all n paricipans have a value, wan o compue average! In round, node i receives (sum j -, coun j - ) pairs! Compue sum i = Σ j sum j -, coun i = Σ j coun j! Pick node k uniformly from oher nodes! Send (½ sum i, ½ coun i ) o k and o i (self)! Round zero: send (value, ) o self! Conservaion of mass : Σ i sum i says same! Esimae avg = sum i /coun i x (x+y)/2 i y (x+y)/2, 2, ½,3/2 7½,3/4 Push-Sum Convergence 2, 7½, ½,3/4 6, 6,/2 8½,9/8 7½,7/8 9,,3/2 7½,7/8 8½,9/8 Afer O(log n + log /ε + log /δ) rounds, he proocol converges wihin ε# n = number of nodes ε = (relaive) error δ = failure probabiliy Peer Sampling Service Wha s Good wih Gossip?! Provide each node wih a view of live nodes (= small random subse of he sysem)! Iniially, a node has random view! Periodically, conac a node from view and exchange enries (gossip)! Unresponsive nodes removed afer bounded ime! Resul: coninuous flow of random live nodes for use by upper layers! E.g., random node for epidemic disseminaion [Theory]! Algorihmic simpliciy! Easy o model, prove correc, find bounds [Sysems]! Robusness (failures of nodes and links)! Adaped o large-scale dynamic neworks! I jus works in real sysems!! Build o run on unreliable sysem (e.g., UDP)! E.g., Amazon dynamo uses gossip-based membership proocol and failure deecion
Wha s No-so-good wih Gossip? [Theory]! Someimes no so simple! E.g., uniformiy assumpion (Inerne no random)! Simplisic vs. realisic models [Sysems]! Bandwidh overuilizaion (redundancy)! High laency (sabilizaion/convergence)! More srucured gossip is faser, bu impac of failure is higher! Some challenges: NAT raversal, securiy Approximae vs. Exac! Gossip-based proocols ofen provide approximae (or evenual ) resuls! This is ofen sufficien in pracice! Nework size esimaion! Approximae! View membership! Migh be oudaed! Evenual consisency (see CAP heorem)! Will converge if here are no failures for long enough! Random peer sampling (periodic view shuffling)! Someimes no so random Epidemic Proocols: Push vs. Pull Push-based Disseminaion! Push! A s recepion, every node forwards message o f oher nodes, a mos TTL imes! Low laency, high redundancy! Pull! Periodically, every node conacs anoher node and asks for missing messages! High laency, low redundancy! Boh approaches rely on a sampling service o obain random nodes 8 6 4 2 2 Coverage 8 6 4 2 2 FANOUT TTL 2 2 FANOUT TTL Complee disseminaions 2 2 2 2 FANOUT TTL Avg. redundan pushes received, per peer nodes
Noified nodes (percenage) Push vs. Pull: Laency & Redundancy 8 6 4 2 8 6 4 2 8 6 4 2 Useful Useless Noified Push-based, FANOUT = 2 2 2 2 3 4 6 7 8 9 Push-based, FANOUT = 4 98.9% 2 3 4 6 7 8 9 Pull-based 2 2 2 2 2 4 6 8 2 4 6 8 2 Cycles % nodes Messages (useful/useless) A Two-Phase Proocol! Two-phase hybrid approach [Karp e al. ]. Exponenial growh phase (push)! Inform sufficienly many nodes w/ou redundancy 2. Quadraic shrinking phase (pull)! Pull frequency driven by message aciviy! Adap o exploi sequences of messages! Push messages carry informaion for pull phase! Limis useless pulls! Suppors complee disseminaions wih low cos and low laency s Phase! Objecive: inform sufficienly many nodes wih negligible redundancy! 4-% of he nework (based on observaions)! Size of nework N esimaed by sampling service TTL! Choose TTL and f: c = N f i 4.%! Subses of nodes reached by differen messages are no correlaed (random neighbor selecion)! Forwarded messages embed informaion abou previously received messages (drive 2 nd phase) i= 2 nd Phase! Objecive: limi useless pulls! The proocol uses informaion abou missing messages (received during s phase)! Pull frequency adaps according o:! Missing messages! Raio of useful o useless pulls in las period! Pull frequency increases when more messages are being disseminaed! When here is lile aciviy, pull frequency depends on how useful previous pulls have been
Daa Srucures! Every node mainains a sored lis of received messages! H p : Recen hisory (las messages)! T p H p : Trading window (available for ohers)! T p is embedded in messages sen by p o q! If m T p \ H q hen q can reques m from p old messages Hp: recen hisory Tp: rading window B3 A7 C3 B C6 B2 C A A6 C7 C8 B A9 C4 Evaluaion! nodes in a cluser! Reproducing real churn (OverNe race)! 3 nodes from PlaneLab! Heavily loaded machines! Messages sen from random nodes! Communicaion over UDP (i.e., unreliable)! Merics: number of recepions (coverage), laency, evoluion of pull frequency Cluser Coverage vs. Laency ( s Phase, TTL=2) Number of recepions Delays (seconds) Pull replies (/peer, /sec.) 8 6 4 2 2 3 4 8 6 4 2.2.8.6.4.2 9h perc. 7h perc. h perc. 2 3 4 Useful 2h perc. h perc. Useless 2 3 4 Time (sec.) nodes 2 messages ( / 2s) Bandwidh coss: ~3 UDP messages / node / minue Delays (seconds) Push duplicaes (%) 3 2 4 3 2 9h perc. 4. (6).97 (4).7 (2) 6.94 (8) 7h perc. h perc.,4 () 4.4 (2) Push coverage (%) (Fanou) 2h perc. h perc. 8.8 (4) 23. (6)
PlaneLab Adapaion of Pull Frequency 3 Number of recepions Time of recepion (seconds) 2 2 8 6 4 2 2 7 2 7 2 2 9h perc. 7h perc. h perc. 3 nodes 2 messages ( / 3.7s) Bandwidh coss: ~2 UDP messages / node / minue 2h perc. h perc. Only pull: Recepion Delays Disribuion 8 7 6 4 3 2 2 3 4 6 7 2 3 4 6 Time of publicaion (seconds) Only push (Fanou=, TTL=4): Recepion Delays Disribuion 2 7 2 7 2 2 3 4 6 6 4 3 PULP (Fanou=3, TTL=3): Recepion Delays Disribuion 9 h perc. 7 h perc. h perc. 2 h perc. h perc. 2 3 4 6 Messages frequency Pulling period disribuion (seconds) Pull replies (/peer, /second) 2.. 2 4 6 8 2 4 3 2 9h perc. 7h perc. h perc. 2h perc. 2 4 6 8 2 4.. Useful Time (seconds) h perc. Useless 2 4 6 8 2 4 8 6 6 Comparison 4 wih Pull-/Push-only 6 4 3 2 PULP (Fanou=3, TTL=3): Recepion Delays Disribuion 9 h perc. Raio 7 h perc. h perc. 2 h perc. h perc. 2 3 4 6 Only pull: Recepion Delays Disribuion 8 7 6 4 3 2 2 3 4 6 7 h perc. 2 h perc. 2 Hi Raio 4 9 h perc. Dup Raio h perc. h perc. 3 2 3 2 4 6 Message sending rae 2 3 4 6 msg /2s msg /2s Only push (Fanou=, TTL=4): Hi and Duplicae raios 8 7 6 4 2 3 3 4 6 Raio 2 PULP (Fanou=3, TTL=3): Recepion Delays Disribuion Only pull: Recepion Delays Disribuion 2 3 4 6 Only push (Fanou=, TTL=4): Recepion Delays Disribuion 2 7 2 7 2 2 3 4 6 8 6 4 2 Only push (Fanou=, TTL=4): Hi and Duplicae raios Hi Raio Dup Raio 2 3 4 6 Conclusion! Gossip-based proocols are widely used o build large-scale sysems! Decenralized, robus, designed o cope wih node/communicaion failures! Approximae/evenual sufficien in pracice! Can be used o solve wide range of problems! Based on informaion spreading, random sampling, agreemen! From a heoreical perspecive! Simple ye ~realisic models, provable bounds! Resuls are (ofen) direcly applicable Gossip-Based Proocols msg P. Felber /2s Message sending rae msg /2s 2 3 4 6
References [Piel 87] B. Piel. On Spreading a Rumor. In SIAM Journal of Applied Mahemaics, 47() 23-223, 987. [Demers e al. 87] A. Demers, D. Greene, C. Hauser, W. Irish, J. Larson, S. Shenker, H. Surgis, D. Swinehar, D. Terry. Epidemic Algorihms for Replicaed Daabase Mainenance. In ACM Symposium on Principles of Disribued Compuing, 987. [Karp e al. ] R. Karp, C. Schindelhauer, S. Shenker, B. Vocking. Randomized rumour spreading. In IEEE Symposium on Foundaions of Compuer Science, 2. [Kempe e al. 3] D. Kempe, A. Dobra, and J. Gehrke. Compuing aggregaes using gossip. In IEEE Symposium on Foundaions of Compuer Science, 23.