Slide 46
Slide 46 text
Kademlia (Pseudo Geography)
• Randomly assign yourself a node ID ☺
• Measure distance using XOR: 1
, 2
= 1
⊕ 2
(Interesting…)
• Unlike arithmetic difference (A – B) no two nodes can have the same distance
to any key.
• XOR has the same properties as Euclidian distance, but cheaper:
• Identity: 1
, 1
= 1
⊕ 1
= 0
• Symmetry: 1
, 2
= 2
, 1
= 1
⊕ 2
= 2
⊕ 1
• Triangle Inequality: 1
, 2
≤ 1
, 3
+ 2
, 3
1
⊕ 2
≤ 1
⊕ 3
+ 2
⊕ 3
… Confounding, but true.
• Once again, we store keys near similar IDs.
• This time, we minimize the distance:
• Store key at any node that minimizes ,