A Distributed Polylogarithmic Time Algorithm for Self-Stabilizing Skip Graphs Christian Decker Distributed Computing Seminar Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 1 / 35
Outline Skip Graphs 1 ALG+ 2 Idea Rules How it works 3 Bottom-Up Top-Down Node join / departure Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 2 / 35
Overview Skip Graphs 1 ALG+ 2 Idea Rules How it works 3 Bottom-Up Top-Down Node join / departure Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 3 / 35
What is a DHT and what is it used for? Datastructure for storage of data. Scalable Decentralized High fault tolerance Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 4 / 35
How to create a simple DHT 0 1 9 2 9 3 3 7 4 5 6 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 5 / 35
Weaknesses of our Ring design Long search/put/get operations Single failures result in unrecoverable state Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 6 / 35
Multiple Rings? 0 1 9 3 7 4 5 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 7 / 35
The idea behind Skip Graphs We generalize the idea of having multiple lists: Each node participates in multiple rings/lists Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 8 / 35
The idea behind Skip Graphs We generalize the idea of having multiple lists: Each node participates in multiple rings/lists Each node has a random String rs , of sufficient length Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 8 / 35
The idea behind Skip Graphs We generalize the idea of having multiple lists: Each node participates in multiple rings/lists Each node has a random String rs , of sufficient length Each ring/list is identified by a prefix of length i Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 8 / 35
The idea behind Skip Graphs We generalize the idea of having multiple lists: Each node participates in multiple rings/lists Each node has a random String rs , of sufficient length Each ring/list is identified by a prefix of length i A node participates in a list if its rs matches the prefix of the list ( pre i ( u ) ) Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 8 / 35
The idea behind Skip Graphs We generalize the idea of having multiple lists: Each node participates in multiple rings/lists Each node has a random String rs , of sufficient length Each ring/list is identified by a prefix of length i A node participates in a list if its rs matches the prefix of the list ( pre i ( u ) ) Each node has a successor ( succ i ( u ) ) and predecessor ( pred i ( u ) ) in each list it is participating in Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 8 / 35
The complete picture rs=11 1 7 14 24 rs=10 9 10 22 2 i=2 rs=01 5 6 27 rs=00 3 17 rs=1 1 7 9 14 22 2 10 24 i=1 rs=0 3 5 6 17 27 rs=... i=0 1 3 2 5 6 7 9 10 14 17 22 24 27 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 9 / 35
Summary: Skip Graphs Logarithmic diameter Hypercubic-style Routing in O ( log ( n )) Not locally verifiable Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 10 / 35
Overview Skip Graphs 1 ALG+ 2 Idea Rules How it works 3 Bottom-Up Top-Down Node join / departure Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 11 / 35
Goals Start from any weakly connected graph O ( log 2 ( n )) rounds to stabilize Fast node join and departure once stabilized Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 12 / 35
Idea Divide the algorithm in two phases: Bottom-up phase: create connected ρ -components for all prefixes 1 ρ Top-Down phase: sort each list by merging the the already sorted 2 ρ 1- and ρ 0-components into a ρ -component Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 13 / 35
Idea It’s nothing more than distributed merge sort. Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 14 / 35
Tools We have to slightly extend the original Skip Graph: Extended Predecessor/Successor Instead of considering just predecessor and successor from our prefix we already look ahead at the next bit: pred ∗ i ( v , x ) = pred ( v , { w | pre i + 1 ( w ) = pre i ( v ) ◦ x } ) succ ∗ i ( v , x ) = succ ( v , { w | pre i + 1 ( w ) = pre i ( v ) ◦ x } ) Range Take the farthest away of successor and predecessor. All nodes in between will be in the range and will be the neighbors of the current node: v . range ∗ [ i ] = [ min { pred ∗ i ( v , x ) } , max { succ ∗ i ( v , x ) } ] Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 15 / 35
The final Picture rs=11 1 7 14 24 rs=10 9 22 2 10 i=1 rs=01 5 6 27 rs=00 3 17 rs=1 1 22 2 7 9 10 14 24 i=0 rs=0 3 6 27 5 17 rs=... i=0 1 2 3 5 6 7 9 14 17 22 24 27 10 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 16 / 35
The final Picture rs=11 1 7 14 24 rs=10 9 22 2 10 i=1 rs=01 5 6 27 rs=00 3 17 rs=1 1 22 2 7 9 10 14 24 i=0 rs=0 3 6 27 5 17 rs=... i=0 1 2 3 5 6 7 9 14 17 22 24 27 10 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 17 / 35
Tools Stable / Temporary edges Edges are either temporary or stable. Edges are considered stable if (from the local view of the node) it will appear in the finished Skip+ Graph. Stable edges are represented by a local flag u . F ( v ) = 1 ρ -component A subgraph of all nodes sharing the prefix ρ . ρ -Buddy Each node has a Buddy at each level | ρ | = i which differs at the last bit. These are used to pass temporary to better fitting candidates. Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 18 / 35
Basic operations insert ( u , v ) is the basic operation of the algorithm. Any node w issues an insert ( u , v ) operation to a node u telling it to add v to its neighborhood. Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 19 / 35
Rounds Preprocessing ◮ Process all insert ( u , v ) requests by adding them as temporary ( u . F ( v ) = 0) ◮ Check liveness of neighbors and remove failed ones ◮ For every i determine pred i ( u , 0 ) , pred i ( u , 1 ) , succ i ( u , 0 ) and succ i ( u , 1 ) ◮ Send state updates to neighbors Execute Rules according to local state Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 20 / 35
Rules Rule 1a: Create reverse edges For every stable edge ( u , v ) , u sets u . F ( v ) = 1 and initiates an insert ( v , u ) Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 21 / 35
Rules Rule 1a: Create reverse edges For every stable edge ( u , v ) , u sets u . F ( v ) = 1 and initiates an insert ( v , u ) Rule 1b and 1c: Introduce Stable Edges u initiates insert ( v , w ) and insert ( w , v ) for every neighbors w in the range of v ( pre i ( v ) = pre i ( w ) and w . id ∈ v . range [ i ] ) Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 21 / 35
Rules Rule 2: Forward Temporary Edges Every temporary edge ( u , v ) is forwarded to a stable neightbor of u that has the largest common prefix with v . rs Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 22 / 35
Rules Rule 3a: Introduce All Every node u that has changed its stable edge set (destabilizing or stabilizing edges) they introduce all neighbors with each other. insert ( u , v ) u , v ∈ N ( w ) Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 23 / 35
Rules Rule 3a: Introduce All Every node u that has changed its stable edge set (destabilizing or stabilizing edges) they introduce all neighbors with each other. insert ( u , v ) u , v ∈ N ( w ) Rule 3b: Linearize u identifies stable neighbors ( v 1 , . . . , v k ), with common prefix of length i , orders them by v k . id and executes insert ( v 1 , v 2 ) , insert ( v 2 , v 3 ) , . . . , insert ( v k − 1 , v k ) Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 23 / 35
Overview Skip Graphs 1 ALG+ 2 Idea Rules How it works 3 Bottom-Up Top-Down Node join / departure Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 24 / 35
How it works: Bottom-up Remember that we want to create connected components for each non-trivial prefix ρ ρ -connected graphs stay connected If a and b are ρ -connected at time t 0 , then they’ll be ρ -connected at any t > t 0 Christian Decker () Polylog Algorithm for Skip-Graphs Distributed Computing Seminar 25 / 35
Recommend
More recommend