[bittorrent] DHT: How to reply to get_peers when I have neither any peers nor closer nodes?

Adrian Ulrich torrent at blinkenlights.ch
Thu Nov 16 13:17:22 EST 2006

> Thanks, it's sometimes not obvious how much of the Kademlia specs apply to 
> the BT DHT implementation of it.  There's a lot that's left unsaid there.


> Well, memory isn't so much the problem, you're right, but rather that if we 
> have a peer for it, the specs say that we reply with the peer info even if 
> we'd have much better. [...]

To find peers for info-hash X you are supposed to send
'find_node' requests until you do not get any better peers
as an response. (= You've reached a dead end -> You'll know the
K-closest nodes!). Only after reaching the dead end you are supposed
to send a get_peers request. (or do an announce)

> Currently I announce every 30 minutes and expire peers that I haven't heard 
> from for 2 hours.  That seems to be similar to what most regular trackers do.

Mainline re-announces each 30 minutes. My implementation expires a peer
after 32 minutes.

            A. Top posters
            Q. What's the most annoying thing on Usenet?

More information about the BitTorrent mailing list