-
Notifications
You must be signed in to change notification settings - Fork 238
IPIP-342: Ambient Discovery of Content Routers #342
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
25abd6d
2585578
1202cdf
92cf422
07710d5
8ac57d9
e558e66
d79bb40
d99131a
b033bee
b05960a
b6a3611
8174cea
6c837cc
88dd4de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,14 @@ these alernative content routing systems automatically. This IPIP proposes | |
| a mechanism by which IPFS nodes can discover and make use of content routing | ||
| systems. | ||
|
|
||
| The mechanism proposed by this IPIP, where nodes gossip preferred routers | ||
| to their connected peers, can also have broader applications. The same | ||
| mechnism could be used for external IPNS, peer routers, relays, or DNS | ||
| resolvers. We point out the label allowing re-use of this mechanism for | ||
| other systems in the (protocol design)[#1-content-routing-as-a-libp2p-protocol], | ||
| but otherwise leave the concerete design for other systems to subsequent | ||
willscott marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| IPIPs. | ||
|
|
||
| ## Motivation | ||
|
|
||
| There is currently not a process by which IPFS nodes can discover alernative | ||
|
|
@@ -34,10 +42,10 @@ is also insufficient long term because: | |
|
|
||
| This spec is designed for the ability of IPFS nodes to automatically discover | ||
| and make use of 'content routers'. Content routers are services which are able | ||
| to fulfill libp2p's [ContentRouting](https://github.com/libp2p/go-libp2p/blob/master/core/routing/routing.go#L26) | ||
| to fulfill IPFS's [ContentRouting](https://github.com/libp2p/go-libp2p/blob/master/core/routing/routing.go#L26) | ||
| API. These routers currently are considered to directly support queries using | ||
| the protocols specified by | ||
| [IPIP-337](https://github.com/ipfs/specs/pulls) | ||
| [IPIP-337](https://github.com/ipfs/specs/pulls/337) | ||
| and/or | ||
| [IPIP-327](https://github.com/ipfs/specs/pull/327). | ||
|
|
||
|
|
@@ -77,15 +85,15 @@ nodes with high connectivity in the network. | |
| ### 1. content-routing as a libp2p protocol | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the expected plan for this to work with browser-based nodes? Are they supposed to fallback to one of your rejected alternatives (e.g. hardcoded nodes, hardcoded bootstrap nodes, advertising in the DHT, advertising in the Indexers, ...)?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect the idea is for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what prevents them from participating in this protocol as described?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
CORS. If the only type of router this protocol returns is HTTP URL, then by default JS-IPFS running on a website won't be able to read data via cross-origin requests to the discovered router due to CORS limitations. We have two ways of solving the problem:
|
||
|
|
||
| IPFS nodes will advertise and coordinate discover of content routers using a | ||
| new libp2p protocol advertised as "/ipfs/content-router-discovery/1.0.0". | ||
| new libp2p protocol advertised as "/ipfs/router-discovery/1.0.0". | ||
|
|
||
| The protocol will follow a request-response model. | ||
| A node will open a stream on the protocol when it wants to discover new | ||
| content routers it does not already know. | ||
| The node wants to request the best set of known content routers from it's peer | ||
| that it does not already know. The query will make use of a bloom filter to | ||
| support this prioritization without leaking the exact list of known content | ||
| routers that the client already knows. | ||
| The node will request routers from the peer that it does not already know. | ||
| To express what it does know, it will query with a bloom filter. The | ||
| statistical data structure provides a minimal amount of deniability around | ||
| the routers that the client already knows. | ||
|
|
||
| * The size of the bloom filter is chosen by the client. It is sized such | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately GitHub doesn't allow threads not tied to a line, but wanted to add some thoughts to this discussion #342 (comment) in a way that responses would be easy to trace.
|
||
| that it has a greater than 99% certainly that it will receive a useful | ||
|
|
@@ -99,12 +107,50 @@ to content discovery queries. By default this will be 10. (This default is | |
| picked as the result of modeling router propagation). It will iterate through | ||
| it's list of known content routers, hashing them against the bloom filter and | ||
| selecting the top routers that are not already known to the client. It will | ||
| return this list, along with it's reliability score for each. This response | ||
| is structured as a list, conceptually: | ||
| return this list, along with it's reliability score for each. | ||
|
|
||
| #### protocol messages | ||
|
|
||
| Protocol messages are encoded using *cbor*. The following protocol examples demonstrate | ||
| the schemas of requests and responses if they were to be encoded with JSON. | ||
|
|
||
| A query on the "/ipfs/router-discovery/1.0.0" protocol will look like: | ||
| ```json | ||
| { | ||
| "router": "string", | ||
| "filter": "bytes of the bloom filter" | ||
| } | ||
| ``` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this protocol for discovering routers could be useful for some libp2p users (we could have a separate type for discovering routers that support peer routing). Indexers already have the peer data (mapping from peerid to multiaddrs), could be useful for reducing peer routing on light clients (use DHT as fallback / only when necessary). @mxinden @marten-seemann thoughts on the use case and the wire format here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thus they would serve the same use-case as a rendezvous server?
I can not think of a project outside of the IPFS realm that is in need for this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It extends the rendezvous protocol in two ways:
|
||
|
|
||
| A concrete example would be: | ||
| ```json | ||
| { | ||
| "router": "content-routing", | ||
| "filter": {"/": {"Bytes": "xhCakxnfIHbzeOjqlbZjawUKf7uvCXAkp0L5z9jF3actECFyCzriAuS1xiyhBCailtsYEwoy/hanhiIHqTZgnA=="}} | ||
| } | ||
| ``` | ||
|
|
||
| A response is a list of entries, which looks like: | ||
| ```json | ||
| [ | ||
| { | ||
| "peer": "multiaddr.MultiAddr", | ||
| "score": float | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| A concrete example would be: | ||
| ```json | ||
| [ | ||
| ["https://cid.contact/", 0.95], | ||
| ["https://dev.cid.contact/", 0.90], | ||
| { | ||
| "peer": "/dns4/cid.contact/tcp/443/https", | ||
| "score": 0.95 | ||
| }, | ||
| { | ||
| "peer": "/dns4/dev.cid.contact/tcp/443/https", | ||
| "score": 0.90 | ||
| }, | ||
| ] | ||
| ``` | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.