tonarino / innernet

A private network system that uses WireGuard under the hood.
https://blog.tonari.no/introducing-innernet
MIT License
4.96k stars 184 forks source link

feature/discussion: libp2p nat traversal, hyprspace #161

Open esovetkin opened 3 years ago

esovetkin commented 3 years ago

I want to bring to your attention the following project: hyprspace

It uses the libp2p library to encrypt traffic and to do the NAT-traversal tasks. Instead of the WireGuard network device, it creates a simple tunnel interface.

Comparing to innernet, it lacks peer info synchronisation and some basic status commands (like inn list --tree). On the other hand, innernet has some problems with NAT-traversal, which libp2p can solve. Furthermore, nodes discovery with libp2p allows eliminating the innernet-server, with information about new nodes in the network exchanged directly between nodes.

At my first glance, both projects can benefit from each other.

Hence, in this thread, I would like to discuss the way libp2p peer discovery can be added in the innernet, or perhaps to highlight the arguments, why this should not happen.

amarao commented 2 years ago

As earlier adopter of Innernet I absolutely don't want to 'get rid of innernet-server'. When network is managed by something (Ansible?) having a server to work with is a bliss. I want to add peers, block them enable/disable associations with predictable results.

pri11er commented 2 years ago

Furthermore, nodes discovery with libp2p allows eliminating the innernet-server, with information about new nodes in the network exchanged directly between nodes.

Well, not really. hyprspace uses a bootstrap node that the user does not control.

// Let's connect to the bootstrap nodes first. They will tell us about the
// other nodes in the network.
// Define Bootstrap Nodes.
    peers := []string{
        "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
        "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
        "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",

I would not want to rely upon a 3rd party "bootstrap node" for peer discovery. Or, why should the current innernet-server be rewritten to function as a "bootstrap node"?