wiki:RoutingTable

The current implementation of teh routing table (source:neuropil/include/np_route.h) uses two different structures:

  • to lookup neighbour nodes or
  • to lookup routing nodes

A neighbour node list contains the sixteen closest logical neighbours to the current node. "closest" means: sorted by the hash difference.

The routing table uses the common prefix length of the hash values. For each common prefix length 16 different keys are stored, for each key there can be three different alternative routings. The result is a table that has closer neighbours with increasing common prefix length. For the last entries in the routing table it is faster to use the logical neighbour list mentioned above.

The routing table explained by example:

  • the node has a hash value of ab92
  • another node with hash value eb92 would have a common prefix length of 0
  • another node with hash value 7a82 would have a common prefix length of 0
  • another node with hash value 5a12 would have a common prefix length of 0
  • another node with hash value 5b23 would have a common prefix length of 0
  • another node with hash value ab24 would have a common prefix length of 2
  • another node with hash value a124 would have a common prefix length of 1

Last modified 3 years ago Last modified on 04/20/17 16:44:56