Skip to content

Seed Agent Cluster Auto-Configuration #403

@CMCDragonkai

Description

@CMCDragonkai

Specification

The seed node cluster is what is behind mainnet.polykey.io and testnet.polykey.io requires some auto-configuration to gain knowledge of each other so that they can share their DHT workload which include signalling and relaying.

Currently seed nodes are launched without knowledge of any seed nodes. This makes sense, since they are the first seed nodes. However as we scale the number of seed nodes, it would make sense that seed nodes can automatically discover each other and establish connections. This would make easier to launch clusters of seed nodes.

There are several challenges here and questions we must work out:

  • Does it mean it is possible to run multiple seed nodes with the same NodeID?
  • If we need to have multiple seed nodes, we must then pregenerate their root keys and preserve their recovery codes Testnet securely maintain a pool of recovery codes #285
  • If multiple seed nodes have different NodeIDs, are their root keys connected to each other in a trust relationship (either hierarchically via PKI, or a loose-mesh via the gestalt graph + root chain)
    • How does this impact how this trust information is propagated eventually-consistently across the network?
    • How does this deal with attacks/impersonation/DHT poisoning/sybil...?
    • How does this deal with revocation?
    • What does this mean for our default seed node list that is configured in the PK software distribution
  • If seed nodes are scaled up and down, how do they acquire their recovery keys securely and without conflict?
  • When seed nodes need to discover each other automatically, we have to use one of the auto-configuration networking technologies.
  • If the seed cluster are all behind 1 IP address/hostname (like our NLB) this means:
    • Multiple node ids - multiple host names - multiple IP addresses
    • Multiple node ids to 1 IP address
    • Multiple node ids to 1 host name
    • 1 hostname can resolve to multiple IP addresses (randomly too)
    • The same node id on multiple IP addresses and multiple host names
    • Testnet Deployment via CI/CD #396 (comment) - discussion on the multi-level complexity of AWS
  • Using a network load balancer means we need to preserve stickiness for "flows", we must ensure that this doesn't break down our network connections mid-flight and mid-conversation.
    • AWS sets this to 120s timeout for a UDP flow, this is not configurable.
    • AWS load balances according to origin IP address, and maintains the stickiness for the lifetime of a flow
    • The stickiness must be preserved between NLB to multiple listeners, from listener to multiple target groups, from target group to multiple targets.
    • Testnet Deployment via CI/CD #396 (comment) - discussion about how stickiness works on NLB
    • image
  • Load balancing introduces network proxies. These network proxies must preserve the client IP address, otherwise NAT-busting signalling will not work.

Additional context

Tasks

  1. Research DNS load balancing as an alternative
  2. Work out how distributed PK with multiple nodes sharing the same IP address will work
  3. Answer every question above

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions