Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor remotes and handshaking to give every address a fair shot #437

Merged
merged 9 commits into from
Apr 14, 2021

Conversation

nbrownus
Copy link
Collaborator

@nbrownus nbrownus commented Apr 6, 2021

This change unifies the idea of the lighthouse cache and the hostinfo remotes address list. The motivation is:

  • To enable a quicker handshake by attempting to transmit the handshake packet to all known remotes on each attempt
  • Give every lighthouse an equal opportunity to provide answers, in the event of a buggy or compromised lighthouse, other lighthouses should have their shot at getting the right answer to the client.

Limits are 10 ipv4 and 10 ipv6 per lighthouse (clients) or per client (lighthouse).

Learned addresses changed to only store 1 of each v4 and v6 address. This should benefit hosts that get new public facing ports through a NAT frequently.

This also adds a check to ensure the responder is who we expected at stage 2. There is an open question on whether we keep the result of the work there (less disruptive in the event a lie disrupted a tunnel to a host you were communicating with) or discard the work. There is another PR nearly ready that speaks to this specific problem in a more elegant way.

Given the scope of the change, a few other items were included:

  • Dont hold locks in ssh commands #244 is folded in since hostinfo marshaling needed rework.
  • Lighthouses will not attempt to roam clients, this keeps a lighthouse on the ip proto the client was configured with.
  • Listen address calculation is fixed on linux, sometimes nil:4242 would be reported

@nbrownus nbrownus force-pushed the e2e-lies branch 5 times, most recently from 8e6e5e3 to e4c7a73 Compare April 9, 2021 17:49
@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
All committers have signed the CLA.

@nbrownus nbrownus force-pushed the e2e-lies branch 2 times, most recently from 90775dd to 1cbb15d Compare April 9, 2021 17:55
@nbrownus nbrownus force-pushed the e2e-lies branch 2 times, most recently from 6f0960e to e1e2c6d Compare April 13, 2021 04:23
examples/config.yml Outdated Show resolved Hide resolved
handshake_ix.go Outdated Show resolved Hide resolved
handshake_manager.go Outdated Show resolved Hide resolved
handshake_manager.go Show resolved Hide resolved
handshake_manager.go Show resolved Hide resolved
hostmap.go Outdated Show resolved Hide resolved
hostmap.go Show resolved Hide resolved
lighthouse.go Show resolved Hide resolved
lighthouse.go Show resolved Hide resolved
lighthouse.go Show resolved Hide resolved
@nbrownus nbrownus changed the title WIP: Refactor remotes and handshaking to give every address a fair shot Refactor remotes and handshaking to give every address a fair shot Apr 13, 2021
wadey
wadey previously approved these changes Apr 14, 2021
Copy link
Member

@wadey wadey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of my issues have been resolved, this is a big change but I think it looks good (and probably safer than what we have now) 👍

@nbrownus nbrownus merged commit 710df6a into master Apr 14, 2021
@nbrownus nbrownus deleted the e2e-lies branch April 14, 2021 18:50
@wadey wadey added this to the v1.4.0 milestone Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants