0

Writing another DHT-ready torrent client I run into a question regarding announcing on DHT. It is clear that I have to sent get_peers to the nodes closer and closer to the searched info hash until at least one node respond with a list of peers having that info hash.

As I understand I can find multiple nodes responding with overlapped list of peers knowing the info hash. Now the question is, should I announce my presence to all nodes which returned list of peers or pick just one. What are the recommendations on this account?

Maybe I'm mistaken and it works somewhat different and my assumption is wrong and it is not possible to have multiple nodes with list of peers for the same info hash?

Alex
  • 655
  • 1
  • 8
  • 16

1 Answers1

1

It is clear that I have to sent get_peers to the nodes closer and closer to the searched info hash until at least one node respond with a list of peers having that info hash.

You actually perform an iterative lookup until responses do not return any new node contact information that is closer to the target key than the K closest entries that have responded and included a write token.

Now the question is, should I announce my presence to all nodes which returned list

Only to the K-closest-node-set. In case an announce fails (error message or no response) you can also backtrack to ensure you get at least K store requests acknowledged.

the8472
  • 40,999
  • 5
  • 70
  • 122