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

mc714 sistemas distribu dos
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

MC714: Sistemas Distribu´ ıdos

  • Prof. Lucas Wanner

Instituto de Computac ¸ ˜ ao, Unicamp

Aula 22: Sistemas Peer-to-Peer Estruturados: DHT/Chord

slide-2
SLIDE 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

slide-3
SLIDE 3

DHTs: Finger tables

Principle Each node p maintains a finger table FTp[] with at most m entries: FTp[i] = succ((p +2i−1) mod 2m) Note: FTp[i] points to the first node succeeding p by at least 2i−1. To look up a key k, node p forwards the request to node with index j satisfying q = FTp[j] ≤ k < FTp[j +1] If p < k < FTp[1], the request is also forwarded to FTp[1]

Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 3 / 7

slide-4
SLIDE 4

DHTs: Finger tables

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

1 4 2 4 3 9 4 9 5 18 1 9 2 9 3 9 4 14 5 20 1 11 2 11 3 14 4 18 5 28 1 14 2 14 3 18 4 20 5 28 1 18 2 18 3 18 4 28 5 1 1 20 2 20 3 28 4 28 5 4 1 21 2 28 3 28 4 28 5 4 1 28 2 28 3 28 4 1 5 9 1 1 2 1 3 1 4 4 5 14

Resolve k = 26 from node 1 Resolve k = 12 from node 28

i s u c c ( p + 2 )

i-1

Finger table Actual node Source: Maarten van Steen, Distributed Systems: Principles and Paradigms 4 / 7

slide-5
SLIDE 5

Maintaining Finger Tables

Invariants Keep the following invariants when a node joins:

1

Each node’s successor points to its immediate successor correctly.

2

Each key is stored in succ(k).

3

Each node’s finger table should be correct. Solution Maintain a predecessor field for each node. When a new node n joins, take the following actions:

1

Initialize node n (the predecessor and the finger table).

2

Notify other nodes to update their predecessors and finger tables.

3

n takes over its responsible keys from its successor.

5 / 7

slide-6
SLIDE 6

Stabilization Procedure

New node n joins with ID between np and ns

1

predecessor = nil

2

n finds ns as its successor via any node n′ (need a known entry point)

3

n notifies ns being the new predecessor

4

ns acquires n as its predecessor (hand over keys) np runs stabilization

1

np asks ns for its predecessor (now n)

2

np acquires n as its successor

3

np notifies n

4

n will acquire np as its predecessor All predecessor and successor pointers are now correct. Finger tables still need to be fixed, but old tables still work.

6 / 7

slide-7
SLIDE 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 FTp[i] points to first node in INT = [p +2i−1,p +2i −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