Download presentation
Presentation is loading. Please wait.
1
SKIP GRAPHS James Aspnes Gauri Shah SODA 2003
2
P2P system Bunch of peers. Store resources identified by keys.
Peers subject to crash failures. Goal: locate resources efficiently.
3
Properties of ideal network
Data availability Decentralization Fault-tolerance Scalability Load balancing Maintaining the network Dynamic node addition/deletion Self-stabilization Efficient searching Incorporating geography Incorporating locality [temporal, spatial]
4
Distributed Hash Tables
Virtual Route v4 Nodes Keys v2 v1 HASH Physical Link v3 v1 v2 v3 v4 Virtual Link Actual Route PHYSICAL NETWORK VIRTUAL OVERLAY NETWORK
5
Advantages Disadvantages SKIP GRAPHS Load balancing. Decentralization.
O(log n) space and search time. O(log2n) insert and delete time [search for (log n) neighbors]. Tolerance of random faults. No locality properties. No tolerance to adversarial faults. No self-stabilization. No optimization wrt. geography. SKIP GRAPHS
6
Skip List [Pugh ’90] Data structure based on a linked list. J A J M A
HEAD TAIL J Level 2 A J M Level 1 Level 0 A G J M R W Each node linked at higher level with probability 1/2.
7
Searching in a skip list
Search for key ‘R’ HEAD success TAIL failure J Level 2 A J M Level 1 Level 0 A G J M R W - + Time for search: O(log n) on average. On average, constant number of pointers per node.
8
Skip lists for P2P? Advantages O(log n) expected search time.
Retains locality. Dynamic node additions/deletions. Disadvantages Heavily loaded top-level nodes. Easily susceptible to random failures. Lacks redundancy.
9
A Skip Graph G W A J M R G R W A J M A G J M R W
Level 2 A J M R 101 100 000 001 011 110 100 G R W Level 1 A J M 110 101 001 001 011 Membership vectors Level 0 A G J M R W 001 100 001 011 110 101 Link at level i to nodes with matching prefix of length i. Think of a tree of skip lists that share lower layers.
10
Properties of skip graphs
Searching. Node insertions. Independence from system size. Locality and range queries.
11
Searching: avg. O (log n)
Restricting to the lists containing the starting element of the search, we get a skip list. Level 2 G W A J M R G R W Level 1 A J M Level 0 A G J M R W Same performance as DHTs.
12
Node Insertion – 1 buddy new node J 001 G W Level 2 A M R 100 101 000 011 110 G R W Level 1 A M 110 101 100 001 011 Level 0 A G M R W 001 100 011 110 101 Starting at buddy node, find nearest key at level 0. Basically a range query looking for key closest to new key. Takes O(log n) on average.
13
Node Insertion - 2 Total time for insertion: O(log n)
At each level i, find nearest node with matching prefix of membership vector of length i+1. G W Level 2 A J 001 M R 100 101 000 011 110 G R W Level 1 A J 001 M 110 101 100 001 011 A Level 0 G J 001 M R W 001 100 011 110 101 Total time for insertion: O(log n) DHTs take: O(log2n)
14
Independent of system size
No need to know size of keyspace or number of nodes. E Z 1 J 00 01 Level 0 Level 1 Level 2 J insert E Z Level 1 E Z Level 0 1 Old nodes extend membership vector as required with arrivals. DHTs require knowledge of keyspace size initially.
15
Locality and range queries
Find key < F, > F. Find largest key < x. Find least key > x. Find all keys in interval [D..O]. Initial node insertion at level 0. A D F I A D F I L O S
16
Applications of locality
Version Control e.g. find latest news from yesterday. find largest key < news:10/29. Level 0 news:10/25 news:10/26 news:10/27 news:10/28 news:10/29 Data Replication e.g. find any copy of some Britney Spears song. Level 0 britney01 britney02 britney03 britney04 britney05 DHTs cannot do this easily as hashing destroys locality.
17
So far... Coming up... Self-stabilization. Decentralization.
Load balancing. Tolerance to faults. Self-stabilization. Random faults. Adversarial faults. Decentralization. Locality properties. O(log n) space per node. O(log n) search, insert, and delete time. Independent of system size.
18
Load balancing Interested in average load on a node u. i.e. the number of searches from source s to destination t that use node u. Theorem: Let dist (u, t) = d. Then the probability that a search from s to t passes through u is < 2/(d+1). where V = {nodes v: u <= v <= t} and |V| = d+1.
19
Skip list restriction s
Level 2 Nodes u Level 1 Level 0 Node u is on the search path from s to t only if it is in the skip list formed from the lists of s at each level.
20
Tallest nodes s t u s u is not on path. u is on path. u u t Node u is on the search path from s to t only if it is in T = the set of k tallest nodes in [u..t]. Pr [u T] = Pr[|T|=k] • k/(d+1) = E[|T|]/(d+1). k=1 d+1 Heights independent of position, so distances are symmetric.
21
Load on node u Average load on a node is inversely proportional
Start with n nodes. Each node goes to next set with prob. 1/2. We want expected size of T = last non-empty set. We show that: E[|T|] < 2. = T Asymptotically: E[|T|] = 1/(ln 2) 2x10-5 … [Trie analysis] Average load on a node is inversely proportional to the distance from the destination. We also show that the distribution of average load declines exponentially beyond this point.
22
Experimental result Load on node Node location Expected load
Actual load Destination = 76542 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 0.0 Load on node Node location
23
Fault tolerance How do node failures affect skip graph performance?
Random failures: Randomly chosen nodes fail. Experimental results. Adversarial failures: Adversary carefully chooses nodes that fail. Bound on expansion ratio.
24
Random faults nodes
25
Searches with random failures
nodes 10000 messages
26
Adversarial faults Theorem: A skip graph with n nodes has
dA = nodes adjacent to A but not in A. Expansion ratio = min |dA|/|A|, 1 <= |A| <= n/2. A dA Theorem: A skip graph with n nodes has expansion ratio = (1/log n). f failures can isolate only O(f•log n ) nodes.
27
Proof intuition Consider neighbors of set A at level 0.
1. Clumpy sets Level 0 Low probability of clumpy sets. dA A A 2. Non-clumpy sets Level 0 Non-clumpy sets have many neighbors at level 0. Gives high expansion ratio.
28
This gives expansion ratio = (1/log n).
All sets have low probability of few neighbors at level h. And there are not too many clumpy sets. Low probability that any set A has few neighbors at level 0 or h. This gives expansion ratio = (1/log n). Same analysis applicable to DHTs?
29
Need for repair mechanism
G W Level 2 A J M R G R W Level 1 A J M Level 0 A G J M R W Node failures can leave skip graph in inconsistent state.
30
Let xRi (xLi) be the right (left) neighbor of x
Ideal skip graph Let xRi (xLi) be the right (left) neighbor of x at level i. If xLi, xRi exist: k xRi = xRi-1. xLi = xLi-1. Successor constraints x Level i Level i-1 i xR i-1 1 2 ..00.. ..01.. xLi < x < xRi. xLiRi = xRiLi = x. Invariant
31
Basic repair If a node detects a missing neighbor, it tries to patch the link using other levels. 1 5 1 3 5 6 1 2 3 4 5 6 Also relink at other lower levels. Successor constraints may be violated by node arrivals or failures.
32
Constraint violation Neighbor at level i not present at level (i-1). x
..00.. ..01.. x Level i x x Level i-1 ..00.. ..01.. ..01.. ..01.. ..00.. ..01.. ..01.. ..01.. zipper Level i-1 Level i x
33
Self-stabilization zOp(B) zOp(E) zOp(I) A C D F J zipperOp message Level i B E G H I zOp(A) zOp(D) zOp(F) Eventually want each connected component of the skip graph to reorganize itself into an ideal skip graph.
34
Conclusions Similarities with DHTs Decentralization.
O(log n) space at each node. O(log n) search time. Load balancing properties. Tolerant of random faults.
35
Differences Property DHTs Skip Graphs Insert/Delete time O(log2n)
Locality No Yes Repair mechanism ? Partial Tolerance of adversarial faults Keyspace size Reqd. Not reqd.
36
Open Problems Design efficient repair mechanism.
Incorporate geographical proximity. Study multi-dimensional skip graphs. Evaluate performance in practice. Study effect of byzantine failures. ?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.