Term

  • Peer: On TCP, implemented BitTorrent
  • Node: On UDP, implemented DHT
    • Node ID: Globally unique
  • Distance Metric: Compare two node IDs or a node ID and an infohash for “closeness”
  • Routing Table: contains the contact info for some other nodes
    • divided into buckets

Kademlia

操作说明
(A ⊕ B) == (B ⊕ A)XOR 符合“交换律”,具备对称性。相比之下,Chord 的距离算法不对称
(A ⊕ A) == 0反身性,自身距离为零
(A ⊕ B) > 0【不同】的两个 key 之间的距离必大于零
(A ⊕ B) + (B ⊕ C) >= (A ⊕ C)三角不等式