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

#1488 in Network programming

Download history 93/week @ 2024-01-08 1/week @ 2024-01-15 289/week @ 2024-01-22 247/week @ 2024-01-29 135/week @ 2024-02-05 275/week @ 2024-02-12 242/week @ 2024-02-19 146/week @ 2024-02-26 68/week @ 2024-03-04 65/week @ 2024-03-11 48/week @ 2024-03-18 43/week @ 2024-03-25 72/week @ 2024-04-01

231 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

~11–23MB
~351K SLoC