This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
The packet switching endeavour #143
Labels
topic/libp2p
Topic libp2p
Comments
Reading List
|
This was referenced Jul 6, 2016
Apart from CryptoAuth and DTLS 1.3, we should also check out the Noise framework: http://noiseprotocol.org/ && https://github.com/titanous/noise |
ghost
mentioned this issue
Aug 23, 2016
Work on multigram has started: https://github.com/multiformats/multigram |
@izqui of aragon.one has a nice research repo: https://github.com/izqui/net |
ghost
mentioned this issue
Aug 1, 2017
How did the project go? Has this been actually implemented? |
@mohsenghajar not yet. It's still in the early planning stages. |
Is there a libp2p repo this belongs in now? |
This discussion should go in https://github.com/libp2p/notes/. Unfortunately, github doesn't allow transferring issues across organizations. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The goal of this endeavour is a source-routed, packet-switched overlay network in libp2p. The top motivations for this are:
Note: take all the following as preliminary notes to finally kickstart the endeavour and discussion. Parts of it are inspired by or directly taken from cjdns (switch and cryptoauth).
What's source routing / packet switching / overlay network?
For example TOR is an overlay network (addressed by public keys), but only exposes a SOCKS proxy. IPFS forms an overlay network too. Its existing protocol for line switching uses a relay node to open a connection to another node, via the relay node.
A telephone network analogy to the three modes of networking:
How does it work?
In the case of packet-switching itself, without a reliability protocol on top, we can't really speak of "connections". For the sake of this document's simplicity, we'll do it regardless.
Just imagine a "connection" as UDP sockets on two respective hosts, with every datagram ("packet") transparently wrapped in encryption and authentication ("crypto session"). Packet switching can use other packet-based transport like Ethernet or iodine, and with framing also stream-based ones like TCP or WebSockets.
Every connection is registered with the switch, which assigns it a slot number. Routes ("switch labels") are made up of these numbers, and represent street-routing-like instructions ("turn right, then left after 500 m") through this network of interconnected switches. Because of this numbering, the switch can operate without any memory lookups. Most other existing switching protocols use names or addressing which require processing at every hop. The downside is that we need to be careful with re-numbering when connections come and go.
To make the exposed interface of the switch as simple as possible, the local endpoint is registered with the switch too, just like connections are. That means there are UDP, Ethernet, etc. transports backed by a socket, and self/loopback connections backed by code in the same process. There could even be e.g. a unix socket transport, which allows processes on the same machine to be endpoints.
Routing
Two kinds of routing are involved here.
We can use a null switch-routing mechanism for now, which opens a connection to every endpoint, so that every switch label returned by peer-routing is only one hop. This allows us to implement packet switching without having to settle for a routing algorithm yet.
Using source routing (instead of distance-vector routing) yields a few nice benefits:
New protocols
number => protocol name
table to the crypto handshake, and all following data packets merely include this (e.g. 1-byte) number in their header.Changes to existing stack
/ipX/udp/cryptoauth/switch/some-protocol
./switch/0000.4321.1234.4321/ipfs/Qmfoobar
scheme (address for overlay network).How reliability fits in
It'll fit in nicely. We'll figure it out. More later. :)
How to continue
tl;dr bottom-up, then top-down, then spread out.
One way or the other, peer-routing should be deferred until we have a good idea what to do there.
The text was updated successfully, but these errors were encountered: