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

ping before release! randomise lease ip #77

Open
hannesm opened this issue Dec 1, 2017 · 1 comment
Open

ping before release! randomise lease ip #77

hannesm opened this issue Dec 1, 2017 · 1 comment

Comments

@hannesm
Copy link
Member

hannesm commented Dec 1, 2017

while deploying charrua in africa with no persistent leases, we discovered that a restart of charrua leads to it handing out ip addresses with active lease (from the previous incarnation). -- see also https://tools.ietf.org/html/rfc5227

ways to fix this include:

  • ask via arp before handing out an ip address
  • randomise (instead of linear search) which ip to hand out

IMHO we should do both.

@haesbaert
Copy link
Member

haesbaert commented Dec 9, 2017

Pinging is not feasible, that would cause a state explosion. Would have to somehow tell the caller to ping it, check if it's ok and then install the lease. Can be done without touching the library.

The addresses are not given based on a linear search. A ridiculously naive hashing of the mac address is made, the rationale for this was to try to always give the same address to the same clients. But as we can see, that's kinda fucked up since we don't keep state.

Randomizing and, in case of collision, doing a linear search should be enough.
The client might fail one or two times but it would recover, the sad part is that clients would tend to grab different addresses every time they lose a lease and request a new one.

(sarcasm
"SEE SEE SEE YOU HIPSTERS WANT TO DO STATELESS THINGS !
THIS IS WHAT HAPPENS WHEN YOU HIPSTERIZE AN 80S PROTOCOL !")

HIPSTERIZE ALL THE THINGS !

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

No branches or pull requests

2 participants