jech / dht

BitTorrent DHT library

Home Page:https://www.irif.fr/~jch/software/bittorrent/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhance bootstrapping mechanism

fonic opened this issue · comments

commented

From other implementations (libbtdht, KTorrent), I understand bootstrapping is usually done like this:

  • add bootstrap nodes with fake ids as far away as possible from one's own id
  • send find_node for slightly modified own id to bootstrap nodes
  • bootstrap is considered complete when a certain routing table depth (*) is reached

Here's how libbtdht does it:
https://github.com/bittorrent/libbtdht/blob/200b8adf83edeb84f1c81fb82de7e5b8624a5fa4/src/DhtImpl.cpp#L2673
https://github.com/bittorrent/libbtdht/blob/200b8adf83edeb84f1c81fb82de7e5b8624a5fa4/src/DhtImpl.cpp#L1263

(*) libbtdht refers to this as 'span', but I currently fail to understand how it is being calculated.

Would you care to add a similar mechanism?

commented

In case you are interested, I'm testing bootstrapping and other stuff here:
https://github.com/fonic/dht/tree/testing

Please note that this is just testing and not meant to be used/integrated as is.

commented

Closing, will create pull request for this soon.