6. server
index table
data client a
client b
client c
client ddata
data
data
query
data transferring
History: peer-to-peer model (Napster)
7. query
data transferring
index table
data client a
client b
client c
client d
index table
data
index table
data
index table
data
History: peer-to-peer model (DHT systems)
34. Chord protocol
• The Chord protocol supports just one
operation: given a key, it maps the key onto
a node.
• Depending on the application using Chord,
that node might be responsible for storing a
value associated with the key.
• Chord uses a variant of consistent hashing
to assign keys to Chord nodes.
35. Chord protocol
• Each Chord node needs “routing” information
about only a few other nodes.
• Because the routing table is distributed, a node
resolves the hash function by communicating
with a few other nodes.
• Chord maintains its routing information as nodes
join and leave the system.
36. How to look up a key quickly ?
• We need finger table
37. How to look up a key quickly ?(cont.)
finger table for node 1
40. How to look up a key quickly ?(cont.)
Node 3: Am I predecessor(1) ?
Predecessor(1) successor(1)
Node 3: Try entry 3, and find node
0
Node 3: Send lookup to node 0
Node 0: Am I predecessor(1) ?
Node 0: successor(1) is node 1
return to node 3 (RPC)
Value
of key 1
?
41. Node joins
Two challenges
Each node’s finger table is correctly filled
Each key k is stored at node successor(k)
Three operations
Initialize the predecessor and fingers of the new node n
Update the fingers and predecessors of existing nodes
Copy to n all keys for which node n has became their
successor
42. Initialize the predecessor and fingers
of node n
• Idea: Ask an existing node for information needed
Join
in
43. Update the fingers and predecessors of
existing nodes
• Observation: when node n joins the network, n will become
the ith finger of a node p when the following two conditions
meet:
P proceeds n by at least 2i-1
The ith finger of node p succeeds n
Solution: Try to find predecessor(n- 2i-1) for all 1<=i<=m; and
check whether n is their ith finger, and whether n is their
predecessor’s ith finger.
44. Update the fingers and predecessors
of existing nodes (cont.)
Predecessor(6-21-1) =3, update
6
Predecessor(3) =1, no update
Predecessor(6-22-1) =3, update
6
Predecessor(6-23-1) =1, update
6
Predecessor(1) =0, update
Predecessor(3) =1, no update
6
Predecessor(0) =3, no update
Join
in
45. Copy to n all keys for which node n has
became their successor
• Idea: Node n can become the successor only for keys
stored by the node immediately following n
Join
in