libp2p / libp2p/specs

Multihop Relay mode - fold left or right

Open
#21 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1.8k
Forks
320
Avg merge
11d 15h
Merged PRs (30d)
1

Description

When building multi-hop relayed connections, there can be multiple modes for how exactly to dial. There are two obvious modes, but both of them are currently blind spots in the circuit relay spec.

(All kinds of other modes are also possible -- these two are just the most obvious ones.)

Hop-by-hop dialing
  • How it dials, given A->R1->R2->B
    1. A connects to R1
    2. A builds A->R2 connection, via R1
    3. A builds A->B connection, via R2
  • Formula
    • Relay(Relay(Relay(A, R1), R2), B)
  • Properties
    • A only sends the very next hop's multiaddr as the header
    • A is in full control of the circuit
    • A doesn't rely on /hop support on R1 or R2
    • More resource-intensive the more hops there are, light clients will probably rather use deferred dialing
    • Slight overhead per hop due to multiple crypto channels and stream muxers.
  • Naming
    • previously dubbed "onion", which we shouldn't use anymore due to confusion with Tor.
    • proposal: matreshka (russian doll)
    • proposal: shallot (small onion, pic)
Deferred dialing
  • How it dials, given A->R1->R2->B
    1. A connects to R1
    2. R1 connects to R2
    3. R2 connects to B
    4. R1 builds R1->B connection, via R2
    5. R1 builds A->B connection, via R1->B
  • Formula, Header
    • Relay(A, Relay(R1, Relay(R2, B)))
  • Properties
    • Depends on R1 and R2 allowing passing /p2p-circuit addresses as headers
    • Resource-saving on A, good for light clients
    • Slightly less overhead from multiple crypto channels and stream muxers
  • Naming
    • previously dubbed "telescope", which is a good name. I2P's relay construction is called the same and operates similarly, but with I2P the name isn't part of the branding (as with Tor), so it's fine to use it too.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the circuit relay spec and compare the documented hop-by-hop and deferred-dialing formulas for the A→R1→R2→B example. Review the stated properties, headers, and naming proposals, then clarify which specification change is expected; the issue does not define a final decision or concrete acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.