Skip to content

Divulge non-local addresses #246

Closed
Closed

Description

@jbenet

Right now we can end up connecting to ourselves (which rightly triggers a panic currently) because we currently advertise our own listening address (e.g. /ip4/0.0.0.0/tcp/4001). This is the reverse of the previous dht-addr-listing problem (listing addrs we've dialed from). What we need is to generate a list of possible addresses, both by inspecting our machine's interfaces, and by asking other peers what our external address seems to be (ICE-style).

I propose:

  • in the handshake we inform each other what address we see them coming from.
  • use this to populate list of "potential" local addresses
  • transmit those when asked (node id / handshake)
  • transmit those to our directly connected peers.

i'm not sure we want to store everyone's addresses along with provider records. While this does certainly speed up lookups (avoiding additional lookup for the node), it will be pretty space inefficient to include it as part of the record. We should relax this constraint, making provider-records (in the dht) merely store identities (node.IDs) of providers. Nodes who store a particular provider record should also store the providers' addresses and return those when sending provider info. (sounds the same, but note that since it's not stored in the record, there's space savings when a node has the same node in multiple provider records)


https://gist.github.com/jbenet/9b6c1ca8bb2c76443dea

03:57 <jbenet> ah!!! found the problem
03:57 <jbenet> we don't _mean_ to connect to ourselves.
03:57 <jbenet> we're just at the same addr: [Peer Qmcrp1uV8Na1] dialing [Peer Qmb1PXdLf9fc] /ip4/0.0.0.0/tcp/4001 dial.go:35
03:57 <jbenet> we need to figure out our real ip addrs before listing them.
03:57 <jbenet> ah the reverse of the other address problem in the dht.
03:58 <jbenet> we need a "what's my IP" / stun type of thing

Activity

  1. jbenet commented on Nov 3, 2014

    @jbenet
    MemberAuthor

    This will be improved in #253

  2. jbenet commented on Nov 3, 2014

    @jbenet
    MemberAuthor
  3. added this to the α milestone on Nov 5, 2014
  4. whyrusleeping commented on Nov 9, 2014

    @whyrusleeping
    Member

    Is this resolved? 253 has been merged

  5. whyrusleeping commented on Jan 11, 2015

    @whyrusleeping
    Member

    @jbenet i think this one can be closed, we do this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions