Koorde
In peer-to-peer networks, Koorde is a distributed hash table (DHT) system based on the Chord DHT and the De Bruijn graph (De Bruijn sequence). Inheriting the simplicity of Chord, Koorde meets O(log n)Script error: No such module "Check for unknown parameters". hops per node (where Template:Mvar is the number of nodes in the DHT), and Template:Tmath hops per lookup request with O(log n)Script error: No such module "Check for unknown parameters". neighbors per node.
The Chord concept is based on a wide range of identifiers (e.g. 2160) in a structure of a ring where an identifier can stand for both node and data. Node-successor is responsible for the whole range of IDs between itself and its predecessor.
De Bruijn's graphs
Koorde is based on Chord but also on the De Bruijn graph (De Bruijn sequence). In a Template:Mvar-dimensional de Bruijn graph, there are 2dScript error: No such module "Check for unknown parameters". nodes, each of which has a unique ID with Template:Mvar bits. The node with ID Template:Mvar is connected to nodes 2i mod 2dScript error: No such module "Check for unknown parameters". and 2i + 1 mod 2dScript error: No such module "Check for unknown parameters".. Thanks to this property, the routing algorithm can route to any destination in Template:Mvar hops by successively "shifting in" the bits of the destination ID but only if the dimensions of the distance between mod 1dScript error: No such module "Check for unknown parameters". and 3dScript error: No such module "Check for unknown parameters". are equal.
Routing a message from node Template:Mvar to node Template:Mvar is accomplished by taking the number Template:Mvar and shifting in the bits of Template:Mvar one at a time until the number has been replaced by Template:Mvar. Each shift corresponds to a routing hop to the next intermediate address; the hop is valid because each node's neighbors are the two possible outcomes of shifting a 0 or 1 onto its own address. Because of the structure of de Bruijn graphs, when the last bit of Template:Mvar has been shifted, the query will be at node Template:Mvar. Node Template:Mvar responds whether key Template:Mvar exists.
Routing example
For example, when a message needs to be routed from node 2 (which is 010) to 6 (which is 110), the steps are following:
- Node 2 routes the message to Node 5 (using its connection to 2i + 1 mod 8Script error: No such module "Check for unknown parameters".), shifts the bits left and puts
1as the youngest bit (right side). - Node 5 routes the message to Node 3 (using its connection to 2i + 1 mod 8Script error: No such module "Check for unknown parameters".), shifts the bits left and puts
1as the youngest bit (right side). - Node 3 routes the message to Node 6 (using its connection to 2i mod 8Script error: No such module "Check for unknown parameters".), shifts the bits left and puts
0as the youngest bit (right side).
Non-constant degree Koorde
The Template:Mvar-dimensional de Bruijn can be generalized to base Template:Mvar, in which case node Template:Mvar is connected to nodes k • i + j mod kdScript error: No such module "Check for unknown parameters"., 0 ≤ j < kScript error: No such module "Check for unknown parameters".. The diameter is reduced to Θ(logk n)Script error: No such module "Check for unknown parameters".. Koorde node Template:Mvar maintains pointers to Template:Mvar consecutive nodes beginning at the predecessor of k • i mod kdScript error: No such module "Check for unknown parameters".. Each de Bruijn routing step can be emulated with an expected constant number of messages, so routing uses O(logk n)Script error: No such module "Check for unknown parameters". expected hops- For k = Θ(log n)Script error: No such module "Check for unknown parameters"., we get Θ(log n)Script error: No such module "Check for unknown parameters". degree and Template:Tmath diameter.
Lookup algorithm
function n.lookup(k, shift, i)
{
if k ∈ (n, s]
return (s);
else if i ∈ (n, s]
return p.lookup(k, shift << 1, i ∘ topBit(shift));
else
return s.lookup(k, shift, i);
}
Pseudocode for the Koorde lookup algorithm at node n:
kis the keyIis the imaginary De Bruijn nodepis the reference to the predecessor of2nsis the reference to the successor ofn