Following on from my post about the general design of AnNet I’m now going to have a go at outlining my ideas for the distributed peer-to-peer database that it’ll use for storing the DNS entries. Please take any literal values with a pinch of salt, these will probably change dramatically based upon testing and are likely to alter dependant on the size of the network.
The system makes use of multiple redundant meshes of nodes. Each mesh has 27 nodes, 26 store data and one acts as a co-ordinator. Each node is aware of the addresses of the 27 other nodes, the 26 in it’s own mesh and one link to another mesh. Each mesh contains two complete copies of the entire database, indexed by starting letter.
This allows for missing nodes without loss of data, giving time for newly connected nodes to replace missing ones with minimal global traffic.
This structure keeps all request traffic (which makes up the majority of traffic in the network) within local meshes with direct connections between nodes.
One node acts soley to co-ordinate the mesh. All data stored by the co-ordinator can be obtained by querying all nodes in the mesh. So the co-ordinator is easily replaced and acts purely as a bandwidth saving mechanism. The co-ordinator maintains data about the state of the local mesh and assigns tasks to new nodes (i.e. what data to retrieve and serve). Nodes speak directly to each other within their mesh, communication does not go through the co-ordinator.
Where possible a node will inform the co-ordinator when it is about to go offline, if a node makes a request and finds the node that should hold it is missing it will then report this to the co-ordinator and go on to ask the other member of the mesh that holds this data. Upon having a missing node reported the co-ordinator sends out requests to other meshes asking for any spare nodes.
Communication is carried out over UDP, so no continuous connections are maintained between the nodes.
In a future post I’ll cover the initial planned rules for handling the creation of new mesh groups and the propogation of changes throughout the network.