Page 1 of 2

DHT implementation

Posted: Wed May 13, 2009 2:49 pm
by jch
I've just hacked together a patch to add DHT support to transmission. Here's a screenshot:

http://www.pps.jussieu.fr/~jch/software ... on-dht.png

Build instructions and a pointer to the sources are on

http://www.pps.jussieu.fr/~jch/software ... dht.README

I'll be grateful for help with the transmission side of things (I'll take care of the DHT side).

--Juliusz

Re: DHT implementation

Posted: Sun May 17, 2009 6:35 am
by jch
A new version of the DHT code is available. Again, please see

http://www.pps.jussieu.fr/~jch/software ... dht.README

--Juliusz

Re: DHT implementation

Posted: Sun May 17, 2009 9:20 am
by bollywood
youre a legend, cant wait to see this in an official release!

Re: DHT implementation

Posted: Tue May 19, 2009 8:21 pm
by jch
Just to let you know that my code has been merged into what will become transmission 1.70. So unless something goes catastrophically wrong, 1.70 should have DHT support.

Re: DHT implementation

Posted: Wed May 20, 2009 2:43 am
by Exp
That's a big one for the team jch! KUDOS!!!

Re: DHT implementation

Posted: Wed May 20, 2009 6:31 am
by Yada
That's very good news. This will please a lot of people. Nice work!

Re: DHT implementation

Posted: Wed May 20, 2009 11:20 am
by jh
DHT is working fine on 8450. I have tested it on two different DHT only torrents (tracker is dead and gone).
Nice work.

Re: DHT implementation

Posted: Wed May 20, 2009 7:11 pm
by jch
Thanks for the kind words, to all of you. Here's some comments and news.

One user has reported an unexplained crash in the DHT code. It only happened in the morning, after a whole night of seeding.

What I've implemented is a pretty nice citizen of the DHT: it plays by all the rules, and tries not to hammer the DHT too hard. In particular, if any of you are worried about the FUD about DHT and private trackers: I am quite positive that my code will not get you banned, as we obey the ``private'' flag, and don't use DHT peers in private torrents. (The downside of being nice is that we're slow: my code takes between 1 and 3 minutes to perform a trackerless announce, which is somewhat slower than some more aggressive implementations. Of course, you can have as many simultaneous announces as you have torrents.)

What is missing is the user-interface code: there's no easy way to disable the DHT, which may be useful for people behind broken routers, and there's also no easy way to monitor the DHT.

We're working on all of that, and I'm fairly confident we'll have a complete implementation within a couple of weeks.

--Juliusz

Re: DHT implementation

Posted: Thu May 21, 2009 2:07 am
by Jordan
Enabling / disabling DHT is supported in the gtk, qt, and transmission-remote clients now.

I'm really not sure what DHT monitoring is needed / possible other than the per-torrent node count and the TR_DHT_{STOPPED,BROKEN,POOR,FIREWALLED,GOOD} status...

Re: DHT implementation

Posted: Thu May 21, 2009 2:29 pm
by Exp
I was using the latest svn build this morning. I had to revert back to an earlier build because Transmission was maxing out one of my cpu's.
Back to 1.60 and is good again.

Re: DHT implementation

Posted: Fri May 22, 2009 9:57 am
by Yada
Exp wrote:I was using the latest svn build this morning. I had to revert back to an earlier build because Transmission was maxing out one of my cpu's.
Back to 1.60 and is good again.
Did you try disabling DHT to see if the problem lies in that code?

Re: DHT implementation

Posted: Fri May 22, 2009 12:10 pm
by Exp
Yada wrote:
Exp wrote:I was using the latest svn build this morning. I had to revert back to an earlier build because Transmission was maxing out one of my cpu's.
Back to 1.60 and is good again.
Did you try disabling DHT to see if the problem lies in that code?
Yes I did and it did not fix the cpu problem.
I just updated to svn 1.61+ (8478) and the problem with my cpu appears to be fixed.

UPDATE : Transmission has been stable for 3 hours.

Jordan wrote this : "(trunk) dht seems to be crashing in bcmp() on the mac, so I suspect the homegrown implementation of memmem() is buggy... test this out by replacing memmem()'s implementation"

Re: DHT implementation

Posted: Fri May 22, 2009 3:54 pm
by jch
Jordan wrote:I'm really not sure what DHT monitoring is needed / possible other than the per-torrent node count and the TR_DHT_{STOPPED,BROKEN,POOR,FIREWALLED,GOOD} status...
Information in the trackers details window on whether a DHT announce is in progress for this particular torrent right now, and the time since the last announce. A button to allow manually triggerring a DHT announce for this particular torrent.

We also need to check whether the libtransmission code or any GUI code assumes that the number of tracker URLs in a .torrent is at least 1 -- with the DHT, torrents with 0 such URLs have become perfectly legitimate.

The possibility in the torrent creation code to add a ``nodes'' field. It should default to empty, at least until we set up a ``router.transmissionbt.com''

--Juliusz

Re: DHT implementation

Posted: Sun May 24, 2009 7:06 pm
by Weaselboy
Nice works guys. Thanks to Jordan and JCH!

Re: DHT implementation

Posted: Sun May 31, 2009 2:41 pm
by jah
I have a few questions about the DHT? (most of them aimed at the Mac version of T)
1. how do I know if I have successfully 'connected' to the DHT?
2. Does each torrent have its own DHT, or is there just one DHT for all torrents?
3. Do DHT peers show up as coming from the DHT in the 'peers' tab of the inspector?

I have been downloading a couple of public torrents with a nightly, and I haven't been connecting to any DHT peers. I suppose this could either mean a) T doesn't specify DHT peers, b) i just coincidentally haven't connected to any, c) i am having problems connecting to the DHT itself.

The problem is I don't know which of these 3 options it is...