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

Sane method to manage IP address included in local ENR #10

Open
pipermerriam opened this issue Jul 29, 2020 · 0 comments
Open

Sane method to manage IP address included in local ENR #10

pipermerriam opened this issue Jul 29, 2020 · 0 comments

Comments

@pipermerriam
Copy link
Member

pipermerriam commented Jul 29, 2020

What was wrong?

  1. Local ENR does not get generated with an IP address
  2. Need way to determine IP address to be included in ENR
  3. Need way to update ENR with IP address while the service is running based on learning new information such as:
    • UPnP UPnP #7
    • Address reported to us by peers in ping messages

How can it be fixed?

I think we should do roughly this:

  • on app initialization:
    1. If an explicit --listen-address was provided: prefer that one
    2. If the ENR we have on-record in our database contains an IP address, use this value (assume whatever value we previously were using is correct)
    3. If UPnP is enabled use the external ip address reported by that service.
      • Care should be taken here to not flip/flop between a local ip address and the external one each time we start the application.
    4. Maybe use the inetfaces library to dig up a local IP address if all else fails
  • while running
    1. Pong messages: Discover External IP address via PONG messages #9
    2. UPnP service can discover external address

Care should be taken to ensure that we don't flip-flop back and forth between two different IP address in the event that UPnP and PONG approach continually return different values.

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

1 participant