Hacker News new | past | comments | ask | show | jobs | submit login

If someone wanted to deploy a DHT today what protocol and/or library would they use?



Kademlia. Certainly the most used (it's the default for Bittorrent) and, from a quick reading of other protocols, also the simplest. Moreover it has the advantage of naturally not depending on other peers behaving correctly (some other rely on peers forwarding search and coming back eventually when they have a result)

There's a working implementation over here [0] in Go, and there will most certainly be something for other language. Search for "DHT Kademlia Mainline" (mainline is the name of the network used by bittorrent peers as described here: [1])

[0] https://github.com/nictuku/dht

[1] http://www.bittorrent.org/beps/bep_0005.html


While I'm inclined to agree that Kademlia is the frontrunner for DHTs, I'd like to comment on:

> it has the advantage of naturally not depending on other peers behaving correctly

This is, depending on the variety of pedantic hat you put on, not true. While Kademlia is resistant to some simple malfunctions, it can be attacked by an adversary. Or, to put it formally, Kademlia is not Byzantine Fault Tolerant [2].

It can be strengthened, but at the cost of greater complexity. See [3] for an example. Further, it's arguable that zero-trust systems where anyone is allowed to join can never be BFT because of Sybil attacks [4]. The paper in [3] elaborates on how to mitigate this variety of attack, but it's unlikely that Sybil attacks can ever be "solved".

1. "Attacking the kad network" http://www.p2p.tu-darmstadt.de/fileadmin/user_upload/Group_P...

2. http://en.wikipedia.org/wiki/Byzantine_fault_tolerance

3. "S/Kademlia: A Practicable Approach Towards Secure Key-Based Routing" http://doc.tm.uka.de/SKademlia_2007.pdf

4. http://en.wikipedia.org/wiki/Sybil_attack


Of course, a global attacker can always muck with the system. I was talking about single independent peers behaving badly on their little scale, such as returning wrong or no information, which I believe is more likely to happen.

Also, the guys at Bittorrent are pushing for a limitation on how you can form your own ID based on your external IP [0], which should make it much more costly to perform a large-scale attack.

Thank you for being pedantic :)

[0] http://blog.libtorrent.org/2012/12/dht-security/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: