Professional Documents
Culture Documents
Chord: A Scalable Peer-To-Peer Lookup Protocol For Internet Applications
Chord: A Scalable Peer-To-Peer Lookup Protocol For Internet Applications
Lookup Protocol
for Internet Applications
I. Introduction
V. Summary
2
I. Introduction
Problem:
Decentralized network with several peers (clients)
How to find specific peer that hosts desired data within this network?
N7
N3 N6
N4 N2
has matching data Network
N1
N8
N5 Looks for data
N9
3
I. Introduction
Solution:
Routing queries along the network via known peers.
(Example: quite inefficient!)
Network
N6
N3 2
N7
N4
3
N2 2
N9 1
N5 1
4
Overview
I. Introduction
V. Summary
5
II. The Chord Protocol and how it works
What is Chord?
Efficient
Simple
Provable Performant
Provable Correct
Scalable
Supporting only one operation: mapping a given key onto a node
lookup protocol
6
II. The Chord Protocol and how it works
Consistent Hashing:
Using SHA1 (secure hash standard) Chord assigns each node and key a
m-bit identifier
Node (-> hashing IP Address) N63
N60 N2
Keys(->hashing key itself)
k7
k58
N50 k16
7
II. The Chord Protocol and how it works
Protocol Improvements
9
II. The Chord Protocol and how it works
Finger Table for scalable node localisation: not enough information to find node
directly but nodes in direct neighbourhood
10
II. The Chord Protocol and how it works
//ask node n to find the successor //search the local table for
//of id the //highest predecessor of id
n.find_successor(id) n.closest_preceding_node(id)
if (id in (n,successor]) for i=m downto 1 do
return successor if (finger[i] in (n,id))
else return finger[i];
n‘ = closest_preceding_node(id); return n;
return n‘.find_successor(id);
11
II. The Chord Protocol and how it works
Fig. 2.4
#messages = log(#nodes) !!
12
II. The Chord Protocol and how it works
13
II. The Chord Protocol and how it works
Stabilize()
if n is not its successor´s
predecessor it changes its successor
successor …
predecessor Ny
Nz
Ny
Am I your predecessor?
-> No it´s Ny
successor Nyz
Nx
predecessor …
14
II. The Chord Protocol and how it works
Notify()
Nz changes predecessor to Nx because predecessor = nil
Nz changes predecessor to Ny because Ny between Nx and Nz.
Fix_fingers() successor …
updates finger tables
predecessor N
NIL
y
x
Nz
Ny
Might be my predecessor!
Nx
15
II. The Chord Protocol and how it works
a)
b) c)
a) Initial state
b) node 26 enters the system & finds its successor
c) Stabilize procedure updates successor of n21 to n26
16
II. The Chord Protocol and how it works
Node failures
It is provable that even if half of the nodes in the network fail, lookups
are executed correctly!
17
Overview
I. Introduction
V. Summary
18
III. Disadvantages and Improvements
19
III. Disadvantages and Improvements
Chord´s disadvantages
asymmetric lookup => lookup from node n to node p could take
a different number of hops than vice versa
=> In huge Chord Rings lookup to one of near preceding nodes
routed clockwise over almost complete ring.
20
Overview
I. Introduction
V. Summary
21
IV. Applications using Chord
Cooperative mirroring
22
Overview
I. Introduction
V. Summary
23
V. Summary
24
Thank you
25