The intention is to construct a uniform adaptive partial mesh overlay network. This approach has been chosen instead of a full mesh network because:
Once a link is broken in a full mesh network it becomes a partial mesh network anyway
The internet is not reliable enough for a full mesh network to persist on top of it, making the network in its fully connected state a rare occurrence
A partial mesh configuration is inevitable, so the added complexity of the software to handle the additional full mesh configuration is redundant
The number of links present in a full mesh network is exponential based on the number of nodes, which in any reasonably sized network will incur too much overhead and complexity
Each node in the adaptive partial mesh will have (almost) the same number of links into the network, based on the natural log of the number of nodes (this information is available since every server will know about every other server on the network). This counteracts the exponential link count that would be present in a full mesh.
Deciding on the number of persistent links to have to every node is a difficult problem. Using a fixed number of links means that some nodes cannot satisfy this requirement in some configurations or node counts.
The number of links scales at roughly n*log(n)
This all introduces a new problem - how do we get the hop counts?
Attempt connection to most distant node, traversing priority queue until a connection is achieved
n1 asks n2 for route table
n2 sends route table to n1
n1 merges the route table with its own
The hop count for every node is incremented in the received data (to account for the hop the data has just made)
Any route entries with a hop count lower than the local hop count to the same node causes an update in the local table
Hop count → new hop count
Gateway → n2
Merged route table is sent to all adjacent nodes (those connected to n1) except n2
When a route table is received by a node:
Merge with local route table as described above
If the local table was modified, rebroadcast as above
This shouldn't result in an infinite update cycle because eventually all nodes will have a full route table that needs no more updates.
Useful links: