Professional Documents
Culture Documents
Chord
Chord
1500-4999
1000-1999 4500-6999
8045
9000-9500
8000-8999 7000-8500
0-999
9500-9999
Finger table:
finger[i] =
successor (n + 2i-1)
where 1 ≤ i ≤ m
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
Chord: Finger Table
Finger table:
finger[i] =
successor (n + 2i-1)
The Chord algorithm –
Scalable node localization
Chord: Search
Assume node n is searching for key k.
Node n does the following:
Find ith table entry of node n such that
k[finger[i].start, finger[i+1].start])
If no such entry exists then return the node in
the last entry of the finger table
The above two steps are repeated until the
condition in the first step is satisfied.
Chord: Join
Nodes can join (and leave) at any time.
Challenge: Preserving the ability to locate
every key in the network
Chord must preserve the following:
Each node’s successor correctly maintained
For every key k, node successor(k) is
responsible for k.
For lookups to be fast, it is desirable for
the finger tables to be correct.
Chord: Join Implementation
Each node in Chord maintains a
predecessor pointer.
This consists of the Chord ID and IP address
of the immediate predecessor of that node.
It can be used to walk counterclockwise around
the identifier circle.
The new node to be added learns the
identify of an existing Chord node by some
external mechanism
Chord: Join Initialization Steps
Assume n is the node to join.
Find any existing node, n’.
Find successor of n from n’. Label this
successor(n).
Ask successor(n) for its predecessor. This
is labelled as predecessor(successor(n)).
Chord: Join Example
•Assume N26 wants to
join; If finds N8
i=1: Does N21 precede N26 by at least 1 (2i-1); yes: N21+1 becomes N26;
i=2: Does N21 precede N26 by at least 2; yes: N21+2 becomes N26;
i=3: Does N21 precede N26 by at least 4; yes: N21+4 becomes N26;
i=4: Does N21 precede N26 by 8; no; evaluate N14;
Chord: Join Example (add N26)
N14 (new finger table) N14 (new finger table)
N14+1 N21 N14+1 N21
N14+2 N21 N14+2 N21
N14+4 N21 N14+4 N21
N14+8 N32 N14+8 N26
N14+16 N32 N14+16 N32
N14+32 N48 N14+32 N48
i=4: Does N14 precede N26 by at least 8; yes; N14+8 becomes N26
i=5; Does N15 precede N26 by at least 16; no; evaluate N8
Etc
Chord: Join (Transferring Keys)
Move responsibility for all the keys for
which node n is the successor.
Typically this involves moving data
associated with each key to the new node.
Node n can become the successor for keys
that were previously the responsibility of
the node immediately following n.
Node n only needs to contact one node to
transfer responsibility for all relevant
keys.
Chord: Join
The previous discussion on join focuses on a
single node join.
What if there are multiple node joins?
Join requires that each node’s successor is
correctly maintained
Chord: Stabilization Protocol
The successor/predecessor links are
rebuilt by periodic stabilize notification
messages
Sent by each node to its successor to inform it
of the (possibly new) identity of the
predecessor
The successor pointers are used to verify
and correct finger table entries.
Chord: Join/Stabilize Example
Chord: Join/Stabilize Example
N120
N10
N113
N102
N85 Lookup(90)
N80
OR-DSL N20
CMU
MIT
MA-Cable
Cisco
CA-T1
N40 Cornell
N41
CCI NYU
N80
Aros
Utah