[bittorrent] Questions related to mainline DHT specs...

NewMedia42 newmedia42 at excite.com
Mon Aug 14 20:25:10 EDT 2006

 --- On Mon 08/14, Patrick Moor < pmoor at student.ethz.ch > wrote:
>I'm not an expert at all, but here's what I assumed for my

Thanks for the help, I appreciate it!  :)  The more I read the docs, the more I want to pull my hair out!  Running ethereal is far more enlightening...

>I do find_node queries when I want to refresh my neighbourhood,
>i.e. searching for new peers I could include in my routing

So who do you send the find_node against - the central server (ie; router.bittorrent.com)?  It seems somewhat redundant to do it against itself, ping would seem to be more appropriate.

>From my interpretation of the docs, this returns it returns a list of the nodes close to the node you're interested in - it seems like this would just fill up your routing table with irrelevant entries.  What am I missing here?

>Again, I'm using random 4-byte values, which seems to work
>fine. If I remember the mainline code right, there aren't any
>assumptions about the content of this byte-string

This is one of the examples of something that should be simple, but because the docs are inconsistent and confusing it isn't.  It says in the docs "single character string value", somewhat vague, which let to my first question.  After hearing your implementation, I looked more closely at the docs; in the example for ping, it's encoded as:


no problem, it's a 1 character string value, that supports the concept that it's really just a character blob... But wait, there's more, check out the find_node example:


Ok, so now it's encoded as an integer?  All the other queries encode it as an integer also, so is it a bug in the docs or spec?  The problem now is that when I check out what uTorrent sends, it does a 4 byte binary blob, probably much like you're doing, but if this is supposed to be an integer, then it's obviously not correct.


Which central routers do you work against (such as router.bittorrent.com:6881)?  Right now it doesn't seem to be responding, so I'm testing against utorrent's, but any others that are consistently up would be helpful...

Join Excite! - http://www.excite.com
The most personalized portal on the Web!

More information about the BitTorrent mailing list