How Kademlia tree of nodes relates to the infohash of a torrent file?

后端 未结 1 556
滥情空心
滥情空心 2020-12-06 21:27

I\'m trying to understand how Kademlia works in regards to finding a resource. There is pretty good description of now to build a node tree which is closest to the self node

相关标签:
1条回答
  • 2020-12-06 22:26

    I recommend that you don't just read the bittorrent DHT specification but also the original kademlia paper, since the former is fairly concise and only mentions some things in passing.

    Bittorrent's get_peers lookup is equivalent to the find_value operation described in the paper.

    In short: just like you can do an iterative lookup to find the K-closest-node-set - closest based on xor-distance relative to the target key - for your own node's ID you can do so for any other ID.

    For get_peers you simply use the infohash as target key.

    The K-closest-node-set for a particular infohash is the set of nodes considered responsible to store the data for said infohash. Although due to inaccuracies of implementations and node churn more than K nodes around the target key may be storing data of interest.

    0 讨论(0)
提交回复
热议问题