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

*: Address security-protocol-in-multiaddr and relay conflict #359

Commits on Aug 5, 2021

  1. *: Address security-protocol-in-multiaddr and relay conflict

    This patch addresses the problems below by detailing the solution below in the
    corresponding specifications.
    
    > Taxonomy:
    >
    > * `A`: The destination node.
    >
    > * `B`: The source node.
    >
    > * `R`: The relay node.
    >
    > * outer connection: The connection from `R` to `A`.
    >
    > * relayed (inner) connection: The relayed (inner) connection from `B` to
    >   `A`.
    >
    >
    > Problems we need to solve:
    >
    > 1. `B` and `A` need to know which security protocol to use to upgrade the
    >    relayed (inner) connection.
    >
    > 2. In the case of active relaying, `R` needs to know which security
    >    protocol to use to upgrade the outer connection to the destination.
    >
    > 3. `A` should be able to offer different security protocols for the
    >    relayed (inner) connection. `A` can use different layer 4 ports to
    >    demultiplex security protocols for the outer connection. `A` has no
    >    demultiplexing mechanism for the security protocols used for the
    >    relayed (inner) connection. Thus if `A` advertises different
    >    multiaddresses with different security protocols for the relayed
    >    (inner) connection, it has no way to determine which one to use on
    >    incoming relayed (inner) connections.
    >
    >
    > We propose two mechanisms to solve the issues above:
    >
    > 1. We have to somehow embed both outer and inner security protocol in the
    >    multiaddr. What we could do is introduce another separator, e.g.
    >    `p2p-circuit-inner` (name yet to be determined).
    >
    >    * **Solving (1)**: A multiaddr for a passive relayed connection could
    >      then look like:
    >      `/ip4/../tcp/../tls/p2p/QmRelay/p2p-circuit/p2p/QmA/p2p-circuit-inner/noise`,
    >      with `noise` being used to secure the relayed (inner) connection. *
    >    * **Solving (2)**: A multiaddr for an active relayed connection could
    >      then look like:
    >      `/ip4/../tcp/../tls/p2p/QmRelay/p2p-circuit/ip6/::1/tls/p2p/QmA/p2p-circuit-inner/noise`,
    >      with `tls` being used to secure the outer connection and `noise`
    >      being used to secure the relayed (inner) connection.
    >
    > 2. **Solving (3)**: In order for `A` to be able to advertise different
    >    multiaddresses with different security protocols for the relayed
    >    (inner) connection, while still being able to choose the right security
    >    protocol on incoming relayed (inner) connections, we need to include
    >    the security protocol for the relayed (inner) connection in the circuit
    >    relay v2 CONNECT message from `B` to `A`.
    
    See libp2p#349 (comment) for details.
    mxinden committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    2d96129 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. Configuration menu
    Copy the full SHA
    7844421 View commit details
    Browse the repository at this point in the history