4 releases

0.1.3 Jan 31, 2024
0.1.2 Jan 24, 2024
0.1.1 Jan 9, 2024
0.1.0 Jan 9, 2024

#1465 in Network programming

Download history 65/week @ 2024-03-11 48/week @ 2024-03-18 43/week @ 2024-03-25 69/week @ 2024-04-01 21/week @ 2024-04-08 34/week @ 2024-04-15 10/week @ 2024-04-22 17/week @ 2024-05-13 32/week @ 2024-05-20 17/week @ 2024-05-27 24/week @ 2024-06-03 22/week @ 2024-06-10 15/week @ 2024-06-17 24/week @ 2024-06-24

86 downloads per month
Used in atm0s-sdn

MIT license

36KB
710 lines

atm0s-sdn Node Alias Service

This service implements a DNS-style mechanism where each node registers itself along with a number of aliases. These aliases are typically used on proxy or tunnel servers.

Functionality

The mechanism used here helps avoid the need for strong synchronization data between nodes. Any node can disconnect and rejoin at any time. The process is quite straightforward, as explained below:

  • Every time a node registers or unregisters an alias, it broadcasts this change to all other nodes.

  • When a node receives a registration, it stores the sender as the location hint.

  • When a node needs to find a location for an alias, it first checks its local storage for the location hint.

    • It pings the location hint to ensure it still holds the alias.
    • If there's no location hint, or if the ping times out or the node replies with 'NOT FOUND', the node broadcasts a 'SCAN' request to all other nodes.
    • If a node replies with 'FOUND', then the result is obtained. However, if after a timeout there's no 'FOUND' response, it means the alias was not found.

Usecase

This mechanism proves particularly useful when dealing with a large number of aliases that rarely change. This can be observed in systems like DNS, Tunnels, and Proxies. However, this service should not be used if you have aliases that frequently change and are queried often.

Dependencies

~12–23MB
~375K SLoC