Scratchpad: Mesh
From the makers of InspIRCd.
| Historical Material - Information posted here may be inaccurate as a result of being obsolete. This information is kept for historical reference purposes. |
This is just a place I'm (FrostyCoolSlug) chucking random ideas to aid any possible implementation of mesh linking, i'm aiming for Technical documentation in an easy to understand language.. So Here we go.
My Basic Proposal is the implementation of 'Routing' around the mesh, sending messages via the fastest calculated route using periodic pings of all servers, lets elaborate:
We start off with 5 servers:
- Server A
- Server B
- Server C
- Server D
- Server E
Every 5 minutes, each server will send some sorta message to every server connection, then broadcast the time it takes to reply (divided by 2) to the network:
Server A -> Server B
:server.a YOU THERE
Server B once recieved -> Server A
:server.b IM HERE
Server a -> All Servers
:server.a ServerB REPLIED IN 0.3 SECONDS
All Servers will then calculate the fastest possible route to send messages to server b, it's more than likely that this will be a direct route, in the event that Server B doesn't respond in 5seconds(??), Server A assumes the connection is lost and sends the result as -1
:server.a ServerB Replied in -1 Seconds (Assumed Dead)
In the event that a server realises there is no way to route to that server, assume it's split off:
:server.c ServerB Has NetSplit! No Useful Route found.
at which point, the other servers will (if they havn't already) split it and broadcast the same message until the server is no longer on the network, and Server Bs ping results then become discarded while everything is recalculated.
The Routing calculation may possibly involve sending messages via 3 or 4 routes, however, if that long route is faster than the direct connection, i can't see anything madly wrong with that.
Services: This will be simple. The Ping Routing calculation will determine that it's only possible to get to services via Server D, meaning reliance on the Server D ping result. If Server D broadcasts a -1 ping, assume it's split, otherwise use your fastest route to server D.
What if server D splits?! i hear you all scream. Simple. As soon as server Ds ping results become discarded, Servers will realise that there is no longer a way to access the services server, thus causing a 'Split Server' broadcast.
NetSyncs:
Something i spent a little time thinking about, seems to make sense to do it this way:
Server E connects to Server A, authentication takes place. Afterwards, Server E bursts to Server A, which then (using it's fastest routes) burts to the rest of the network. Once burst is complete, Send the Authentication cookie along, and request all other servers join up with it. Basically, it's the two servers initilising the connections job to make sure all relevant information is passed around to it's respective servers before the final linking phase comes into play.
Feel Free to contact me if this confuses anyone, it makes sense to me, and should resolve any 'Race' conditions, as well as sync issues as well. I win. (If you wanna edit this page or add notes, please do so at the BOTTOM of this page. Thanks)

















