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).
An overlay network is a computer network that is built on top of another network. Nodes in the overlay network can be thought of as being connected by virtual or logical links, each of which corresponds to a path, perhaps through many physical links, in the underlying network. ... The Internet was originally built as an overlay upon the telephone network, while today (through the advent of VoIP), the telephone network is increasingly turning into an overlay network built on top of the Internet.
-- Wikipedia: Overlay network
Packet switching is a digital networking communications method that groups all transmitted data into suitably sized blocks, called packets, which are transmitted via a medium that may be shared by multiple simultaneous communication sessions. Packet switching increases network efficiency, robustness and enables technological convergence of many applications operating on the same network.
-- Wikipedia: Packet switching
Source routing, also called path addressing, allows a sender of a packet to partially or completely specify the route the packet takes through the network. In contrast, in non-source routing protocols, routers in the network determine the path based on the packet's destination.
-- Wikipedia: Source routing
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:
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.
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:
number => protocol name table to the crypto handshake, and all following data packets merely include this (e.g. 1-byte) number in their header.new peer-routing
libp2p ReadMsg()/WriteMsg() interface
/ipX/udp/cryptoauth/switch/some-protocol./switch/0000.4321.1234.4321/ipfs/Qmfoobar scheme (address for overlay network).It'll fit in nicely. We'll figure it out. More later. :)
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.
Apart from CryptoAuth and DTLS 1.3, we should also check out the Noise framework: http://noiseprotocol.org/ && https://github.com/titanous/noise
Work on multigram has started: https://github.com/multiformats/multigram
@izqui of aragon.one has a nice research repo: https://github.com/izqui/net
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.