Skip to content

Koorde - beyond Kademlia #20

Open
Open
@Kubuxu

Description

@Kubuxu

Koorde is a DHT based on Chord, and the driving principle is a bit different than Kademlia.
Instead of using XOR metric Chord (and Koorde) interprets keyspace as a circle.

Connecting nodes to the next node in the circle (successor) create the basis of the network. As long as there exists this connection forward, the DHT is fully functional (albeit slow). By maintaining additional connections across the circle, Koorde achieves logarithmic lookup we expect from the DHT.

This is where Koorde and Chord diverge and where the improvement of Koorde comes in. The important benefit of Koorde is its ability to use multiple connections across the network efficiently.

By using (for example) 16 connections, instead of 2, Koorde can reduce the number of required messages (and new connections) by a factor of more than 4 (from 26 to 6.3 on average).

It is important to point out significant differences of Koorde from Kademlia:

  • Koorde is a bit more fragile than Kad, mostly because it keeps such a small state. Instead of remembering 100s of nodes in k-buckets, number of connections is configuration and optimization factor of Koorde
    • The resilience of Koorde is a fully tuneable parameter by selecting nodes in succession we want to maintain. After one immediate successor fails we take over its role, and we already have a connection to the new successor.
    • While increasing the resilience of Koorde, above also increases its performance but allowing quicker correction of lookup attempts.
  • Each key, in Koorde, has precisely one correct node assigned to it. It is also a major difference between Koorde and Kad; there are multiple ways to increase resilience for values. These are few ways of dealing with it:
    • Storing keys also in nodes nearby in keyspace (a bit problematic)
    • Generating multiple keys k' from k with use of hashing: k'(i) = SHA256(k || i)
  • Nodes in Koorde can cooperate if one of them has to leave the network. Leaving node then transfers its key-value store to its predecessor and allows it to take over. This cooperation can also be done ahead of time to reduce key loss for unexpected failures.
  • Koorde can perform with O(log(n)/log(m)) lookup complexity where n is the number of nodes in the network and m is the number of nodes across the circle we maintain connection (degree).

In my opinion, and in comparison with Kademlia, Koorde can function as a highly cooperative network but can resist possible failures and attacks. While it might not be a perfect fit for organized chaos type network (what we do currently with our Kademlia), I firmly believe that it can function extremely well in case of delegated routing schemes with dedicated routing network with multiple independent parties cooperating.

With metrics as low as 5.6 messages per lookup I think sub-1 second record lookup time should be possible which would be a major improvement over our current DHT.


I have created a toy implementation of Koorde in Go (https://github.com/Kubuxu/go-toy-koorde-dht). It currently implements the lookup algorithm, but I plan to implement the rest of the protocol there to scope out possible issues. It also provides a way to benchmark the implementation and parameters. These are the results:
https://docs.google.com/spreadsheets/d/1PgkvrYWYynu-lS-B8kjjGCuqJqol4nqnleNJzV8brcE/edit?usp=sharing


Koorde paper: https://www.comp.nus.edu.sg/~bleong/hydra/related/kaashoek03koorde.pdf
Chord paper: https://pdos.csail.mit.edu/papers/chord:sigcomm01/chord_sigcomm.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions