1.15k likes | 1.2k Views
Learn about graph theory, continuous-discrete approaches, and various overlay network designs for peer-to-peer systems. Explore methods for maintaining robustness and scalability in overlay networks.
E N D
Peer-to-Peer Networks 0 1 Christian Scheideler Institut für Informatik Technische Universität München
Motivation • Every distributed system must be based on a network interconnecting its sites • Network: of physical or logical nature
Physical Network Supercomputers, multicore systems,…
Logical Network Internet
Overlay Network Internet
Overlay Network Basic question: how to organize sites in a scalable and robust overlay network???
Overview • Graph Theory • Supervised and Peer-to-Peer Overlay Networks • Continuous-Discrete Approach • Maintaining a robust Cycle • Skip Graphs • Locality-aware Overlay Networks • Networks for non-uniform Peers
Graph theory Graph G=(V,E): • V: set of nodes / vertices • E ½ { (v,w) | v,w 2 V}: set of edges / arcs v knows w v can send info to w valid path D B C A
D B C A Graph theory • (v,w): distance (length of shortest path) of w to v in G • D=maxv,w(v,w): diameter of G D=4
Graph theory • (U): set of neighbors of node set U • (U)=|(U)| / |U| • (G) = minU,|U|<|V|/2(U): expansion of G D B C A |U|=2 U |(U)|=1
Graph theory NetworkG=(V,E,c): • V: set of nodes, E: set of edges • c:E ! IR+: edge capacities 2 D B C A
Graph Theory Unless mentioned otherwise: • All edges have capacity 1 • {v,w} represents {(v,w), (w,v)} D B C A
Network topologies Ideally, complete network: Problem: does not scale well! (~n2 edges)
Line Network • degree 2 (optimal), BUT • diameter bad (n-1 for n nodes) • expansion bad ( (line) = 2/n ) How to get a low diameter?
Binary Tree • n=2k+1-1 nodes, degree 3 • diameter is k = 2 log2 n, BUT • expansion is still bad ( (tree)=2/n ) 0 depth k k
2-dimensional Grid • n = k2 nodes, maximum degree 4 • diameter is 2(k-1) < 2 n • expansion is ~2/ n • Not too bad, but can we get better values? 1 side length k k
Hypercube • Nodes: (x1,…,xd) 2 {0,1}d • Edges: 8 i: (x1,…,xd) ! (x1,..,1-xi,..,xd) d=1 d=2 d=3 Degree d, diameter d, expansion 1/ d Routing: (x1,x2,…,xd) ! (y1,x2,…,xd) ! (y1,y2,x3,…,xd) ! … ! (y1,y2,…,yd)
Butterfly • Nodes: (k,(xd,…,x1)) 2 {0,..,d} £ {0,1}d • Edges: (k-1,(xd,…,x1)) ! (k,(xd,..,xk,..,x1)) (k,(xd,..,1-xk,..,x1)) Degree 4, diameter 2d, expansion ~1/d 00 01 10 11 0 1 0 0 1 1 2 Routing: (0,(x1,x2,…,xd)) ! (1,(y1,x2,…,xd)) ! (2,(y1,y2,x3,…,xd)) ! … ! (d,(y1,y2,…,yd))
Cube-Connected-Cycles • Nodes: (k,(x1,…,xd)) 2 {0,..,d-1} £ {0,1}d • Edges: (k,(x1,…,xd)) ! (k-1,(x1,...,xd)) (k+1,(x1,..,xd)) (k,(x1,..,1-xk+1,..,xd)
De Bruijn Graph • Nodes: (x1,…,xd) 2 {0,1}d • Edges: (x1,…,xd) ! (0,x1,…,xd-1) (1,x1,…,xd-1) 01 001 011 010 101 00 11 000 111 10 100 110 (x1,…xd) ! (yd,x1,…xd-1) ! (yd-1,yd,x1,…,xd-2) ! …
The Diameter Theorem: Every graph of maximum degree d>2 and size n must have a diameter of at least (log n)/(log(d-1))-1. Theorem: For every even d>2 there is a family of graphs of maximum degree d and size n with diameter (log n)/(log d -1). tree of all reachable nodes at dist. k
The Expansion Theorem: For every graph G the expansion (G) is at most 1. Theorem: There are families of constant degree graphs with constant expansion. Example: Gabber-Galil Graph • Node set: (x,y) 2{0,…,n-1}2 • (x,y) ! (x,x+y),(x,x+y+1), (x+y,y), (x+y+1,y) (mod n)
Overview • Graph Theory • Supervised and Peer-to-Peer Overlay Networks • Continuous-Discrete Approach • Maintaining a robust Cycle • Skip Graphs • Locality-aware Overlay Networks • Networks for non-uniform Peers
Overlay Network Basic question: how to organize sites in a scalable and robust overlay network??? Robustness: can handle faults and malicious behavior Scalability: works efficiently for large number of sites
Server-based approach Internet server Does not scale well! sites
Alternatives Supervised overlay network Peer-to-peer overlay network Supervisor assists in maintaining network Peers maintain network themselves
Overlay Network Problem: How to maintain an overlay network as peers join and leave?
Supervised Overlay Network • Supervisor assigns peers to points in [0,1) so that peers evenly distributed • Neighboring peers connect to form cycle 1 0 0 7/8 1/8 1/4 3/4 3/8 5/8 1/2
Supervised Overlay Network • Node v wants to join (n nodes in system):give it (n+1)th position • Node w wants to leave:move last node v to w‘s position 1 0 v w
Supervised Overlay Network • v: node at nth position • supervisor: stores pred(v), v, succ(v), succ(succ(v)) • join and graceful leave operation: 1 0 v
Pure Peer-to-Peer Network We also focus on [0,1). Every peer mapped to random point in [0,1). Peers form cycle based on points. • Chord: cryptographic hash function • CAN: random number 0 1 v
Continuous-Discrete Approach Problem: cycle not a good routing topology! 1 0 long paths!
Overview • Graph Theory • Supervised and Peer-to-Peer Overlay Networks • Continuous-Discrete Approach • Maintaining a robust Cycle • Skip Graphs • Locality-aware Overlay Networks • Networks for non-uniform Peers
Continuous-discrete Approach • V: set of peers, U: virtual space • Each v 2 V mapped to regionR(v) ½ U • Family F of functionsf:U ! U • {v,w} edge ,[F(R(v)) Å R(w)] [ [F(R(w)) Å R(v)] = ;
Continuous-discrete Approach Basic questions: • How to map peers to regions? • What family F to choose?
Continuous-discrete Approach • Take a classical family of networks(Hypercube, de Bruijn graph,…) • Convert it into continuous form by interpreting node labels as points in U,edges as a family of functions F • Mapping peers to regions will then convert continuous form back into discrete graph.
Hypercube Classical hypercube: • V: nodes with labels (x1,…,xd) 2 {0,1}d • For all i: (x1,…,xd) ! (x1,..,1-xi,..,xd) Continuous version of hypercube: • Interpret (x1,…,xd) as z=i xi/2i • d !1: U=[0,1) • F: fi+(x) = x+1/2i, fi-(x) = x-1/2i8 i>0
De Bruijn Graph Classical de Bruijn graph: • V: nodes with labels (x1,…,xd) 2 {0,1}d • E: (x1,…,xd) ! (0,x1,…,xd-1), (1,x1,…,xd-1) Continuous de Bruijn graph: • Interpret (x1,…,xd) as z=i xi/2i • d !1: U=[0,1) • F: f0(x) = x/2, f1(x) = (1+x)/2
Gabber-Galil Graph Classical Gabber-Galil graph: • Node set: (x,y) 2{0,…,n-1}2 • (x,y) ! (x,x+y),(x,x+y+1), (x+y,y), (x+y+1,y) (mod n) Continuous Gabber-Galil graph: • n !1: U=[0,1)2 • F: f1(x,y)=(x,x+y), f2(x,y)=(x+y,y)
Continuous-discrete Approach • Take a classical family of networks(Hypercube, de Bruijn graph,…) • Convert it into continuous form by interpreting node labels as points in U,edges as a family of functions F • Mapping peers to regions will then convert continuous form back into discrete graph.
Supervised Overlay Network • How to map peers to regions? • Consider any space U=[0,1)d • Hierarchical decomposi-tion tree:
Supervised Overlay Network 0 1 000 001 01 10 11
Supervised Overlay Network Fact: • Volumes of subcubes assigned to nodes differ by factor of at most 2. • Subcubes pairwise disjoint. • Union of subcubes gives U. Combine this with family F of functions.
Join Operation w v 0 1 000 001 010 01 011 10 11
Join Operation 000 001 10 f R(v) R(v) R(w) 11 f’ {u,v} edge ,[F(R(u)) Å R(v)] [ [F(R(u)) Å R(v)] = ;
Join Operation w inherits connections from v w v 0 1 000 001 010 01 011 10 11
Leave Operation v inherits connections from w v w 0 1 000 00 001 01 10 11
Supervised Overlay Network For any supervised network based on continuous-discrete approach with[0,1)d: • Sufficient if supervisor introduces new peer to cycle neighbors. From these, new peer can get allF-connections • Join/leave can be performed with constant time and work for supervisor. High robustness: • Sufficient to secure base cycle!
Peer-to-Peer Overlay Network We focus on U=[0,1). Every peer mapped to random point in [0,1). 1 0 v v owns region [v,succ(v))