Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use correct DHT routing table data structure, per spec #11

Closed
feross opened this issue Nov 10, 2013 · 12 comments
Closed

Should use correct DHT routing table data structure, per spec #11

feross opened this issue Nov 10, 2013 · 12 comments
Labels

Comments

@feross
Copy link
Member

@feross feross commented Nov 10, 2013

@ghost ghost assigned jhiesey Nov 10, 2013
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Dec 8, 2013

https://github.com/jech/dht is a legit implementation used by Transmission, but it's 3000 lines of C and doesn't look easy to port.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Dec 9, 2013

Also useful:

@dzlab

This comment has been minimized.

Copy link

@dzlab dzlab commented Jan 25, 2014

here is a ready to use node module https://github.com/indutny/dht.js

@feross feross added the bug label Mar 6, 2014
@ivantodorovich

This comment has been minimized.

@ivantodorovich

This comment has been minimized.

Copy link

@ivantodorovich ivantodorovich commented Apr 25, 2014

Can't we just use one of them? Maybe extend kademlia?

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented May 1, 2014

Yeah, will consider dht.js. Seems legit.

@ivantodorovich

This comment has been minimized.

Copy link

@ivantodorovich ivantodorovich commented May 1, 2014

👍

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Jun 12, 2014

I just updated bittorrent-dht to 1.0.0. It now follows the spec, contains a proper routing table, answers find_node requests from other nodes, and more efficiently crawls the DHT.

Previously, to find peers we would do a very aggressive crawl where we stuck every new node into a big queue and queried them all, not paying any attention to how close they were to the target info hash. So we had lots of pointless traffic to far away nodes that weren't helping us at all. Now, we only recurse on the K closest nodes, so we find the correct nodes with a lot less UDP traffic.

I'm really happy with the new API. Check it out: https://github.com/feross/bittorrent-dht

@feross feross closed this Jun 12, 2014
@jure

This comment has been minimized.

Copy link

@jure jure commented Jun 12, 2014

Nice! Is the idea for bittorrent-dht to one day work over WebRTC as well, i.e. have an exchangeable networking module, or will that be a different project?

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Jun 12, 2014

@jure I would definitely prefer to utilize the work that's already gone into bittorrent-dht when writing the WebRTC version. bittorrent-dht is quite fast, reliable, and well-tested. And also used by the peerflix/torrent-stream projects. So it's going to keep getting better over time.

Perhaps the parts of the module that use dgram can be abstracted out so the majority of the code could be re-used?

@jure

This comment has been minimized.

Copy link

@jure jure commented Jun 12, 2014

I see, bittorrent-dht is made specifically to work in Node and with the existing bittorrent network. Just a bit of background: what I'm looking for is not a protocol specific (i.e. bittorrent) DHT implementation, but a general DHT implementation (Chord/Kademlia) in the browser, backed by WebRTC (not UDP). There are a few attempts out there but for some reason all of them are somewhere in the alpha-stage zone.

I know this is very off topic, but if you were to start writing a WebRTC DHT framework, where would you begin?

@piranna

This comment has been minimized.

Copy link

@piranna piranna commented Jun 12, 2014

I know this is very off topic, but if you were to start writing a WebRTC DHT framework, where would you begin?

Write it transport agnostic, in Node.js, but only with APIs available
on the browser (in Node.js would be acceptable to use modules that
implement this APIs).

As a personal side-note, I'm thinking about to fork Chord.js and
remove the dependency of PeerJS, this would be a good starting point.

"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
– Linus Tordvals, creador del sistema operativo Linux

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.