mc714 sistemas distribu dos
play

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de - PowerPoint PPT Presentation

MC714: Sistemas Distribu dos Prof. Lucas Wanner Instituto de Computac ao, Unicamp Aula 22: Sistemas Peer-to-Peer Estruturados: DHT/Chord Distributed Hash Tables (DHT) Chord Consider the organization of many nodes into a logical


  1. MC714: Sistemas Distribu´ ıdos Prof. Lucas Wanner Instituto de Computac ¸ ˜ ao, Unicamp Aula 22: Sistemas Peer-to-Peer Estruturados: DHT/Chord

  2. Distributed Hash Tables (DHT) Chord Consider the organization of many nodes into a logical ring Each node is assigned a random m -bit identifier. Every entity is assigned a unique m -bit key. Entity with key k falls under jurisdiction of node with smallest id ≥ k (called its successor). Nonsolution Let node id keep track of succ ( id ) and start linear search along the ring. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 2 / 7

  3. DHTs: Finger tables Principle Each node p maintains a finger table FT p [] with at most m entries: FT p [ i ] = succ (( p + 2 i − 1 ) mod 2 m ) Note: FT p [ i ] points to the first node succeeding p by at least 2 i − 1 . To look up a key k , node p forwards the request to node with index j satisfying q = FT p [ j ] ≤ k < FT p [ j + 1 ] If p < k < FT p [ 1 ] , the request is also forwarded to FT p [ 1 ] Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 3 / 7

  4. DHTs: Finger tables 1 4 Finger table 2 4 3 9 i-1 ) 4 9 2 + 5 18 p ( c c Actual node 0 u i s 31 1 30 2 1 9 29 3 2 9 1 1 3 9 2 1 28 4 4 14 3 1 5 20 4 4 27 5 5 14 Resolve k = 12� from node 28 26 6 25 7 24 8 1 11 2 11 3 14 23 9 Resolve k = 26� 4 18 from node 1 5 28 22 10 1 28 2 28 21 11 1 14 3 28 2 14 4 1 20 12 3 18 5 9 4 20 13 19 5 28 1 21 18 14 2 28 15 17 16 3 28 1 18 4 28 2 18 5 4 1 20 3 18 2 20 4 28 3 28 5 1 4 28 5 4 Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 4 / 7

  5. Maintaining Finger Tables Invariants Keep the following invariants when a node joins: Each node’s successor points to its immediate successor correctly. 1 Each key is stored in succ ( k ) . 2 Each node’s finger table should be correct. 3 Solution Maintain a predecessor field for each node. When a new node n joins, take the following actions: Initialize node n (the predecessor and the finger table). 1 Notify other nodes to update their predecessors and finger tables. 2 n takes over its responsible keys from its successor. 3 5 / 7

  6. Stabilization Procedure New node n joins with ID between n p and n s predecessor = nil 1 n finds n s as its successor via any node n ′ (need a known entry point) 2 n notifies n s being the new predecessor 3 n s acquires n as its predecessor (hand over keys) 4 n p runs stabilization n p asks n s for its predecessor (now n ) 1 n p acquires n as its successor 2 n p notifies n 3 n will acquire n p as its predecessor 4 All predecessor and successor pointers are now correct. Finger tables still need to be fixed, but old tables still work. 6 / 7

  7. Exploiting network proximity Problem The logical organization of nodes in the overlay may lead to erratic message transfers in the underlying Internet: node k and node succ ( k + 1 ) may be very far apart. Topology-aware node assignment: When assigning an ID to a node, make sure that nodes close in the ID space are also close in the network. Can be very difficult. Proximity routing: Maintain more than one possible successor, and forward to the closest. Example: in Chord FT p [ i ] points to first node in INT = [ p + 2 i − 1 , p + 2 i − 1 ] . Node p can also store pointers to other nodes in INT . Proximity neighbor selection: When there is a choice of selecting who your neighbor will be (not in Chord), pick the closest one. Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 7 / 7

Recommend


More recommend