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

Discover External IP address via PONG messages #9

Open
pipermerriam opened this issue Jul 29, 2020 · 1 comment
Open

Discover External IP address via PONG messages #9

pipermerriam opened this issue Jul 29, 2020 · 1 comment

Comments

@pipermerriam
Copy link
Member

What was wrong?

Each PONG message contains an external IP address that the sender is claiming is our external IP.

This information can be used in combination with some basic heuristics to identify our external ip address.

How can it be fixed?

We will have to use a heuristic since 1) this information is unverifiable and 2) different peers might have a different view of what our IP address might be.

We should aggregate votes for this in a simple service that listens to all the incoming PONG messages. This service will benefit from having contextual information about the peer connections such as whether they were dial-out or dial-in, whether they are trusted such as bootnode addresses.

Likely only viable once our view of the network contains a sufficiently large number of peers.

@pipermerriam
Copy link
Member Author

pipermerriam commented Oct 9, 2020

@lithp I think this might be a decent next issue to get worked on.

I think this needs to fit into a larger framework of how we decide on what external IP address to populate our ENR record with. I think we have the following sources for IP addresses.

  1. returned by UPnP during port mapping
  2. Inspecting networking devices via netifaces library (used in the upnp library)
  3. specified via CLI --listen-address
  4. Pong messages

I think the priority order for these should be:

  1. --listen-address trumps all
  2. UPnP
  3. Pong messages
  4. netifaces data (pulling IP from networking devices)

This also needs to be generic enough to work with both v5 and v5.1.

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