Skip to content
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

Support IPv6 #1

Open
hackergrrl opened this issue Oct 8, 2018 · 15 comments
Open

Support IPv6 #1

hackergrrl opened this issue Oct 8, 2018 · 15 comments

Comments

@hackergrrl
Copy link

related: webtorrent/bittorrent-dht#88

@RangerMauve
Copy link

This would be super useful for a project I'm working on.

Would a PR that adds support be welcome?

@makew0rld
Copy link

@mafintosh @aral @pfrazee Is supporting IPv6 here and across hyperswam a possibility? It would be really helpful for IPv6 networks such as meshnets, and as the Internet evolves.

@RangerMauve
Copy link

Sadly I haven't had time for this.

From talking to @mafintosh in the past it seems the first step would be to make an equivalent of ipv4-peers for ipv6 peers.

If someone could implement this it could be the first step for getting ipv6 to work.

After that it'd be good to set up an ipv6 DHT bootstrap node and make an example of initializing the DHT with the ipv6-peers encoding / figuring out how to do that at the hyperswarm level.

@kravietz
Copy link

kravietz commented Apr 5, 2020

@mafintosh @RangerMauve The main driver for having IPv6 is user experience and network performance. Getting any P2P network to operate behind NAT is a pain and if you ever ran tcpdump on most P2P nodes (like IPFS or SSB) you surely have seen how many connections attempts are being made towards RFC 1918 networks which other NATed nodes announce, and effectively wasted. I run BitTorrent and IPFS over IPv6 for a few years now and it just works like a breeze. For DAT to even work I need to create awkward port forwards or run an additional proxy node on my router to be able to talk both to NAT and other nodes on the Internet.

If this is purely matter of resources, maybe we can do some crowdsourcing on Bountysource, Gitcoin or something like that?

@RangerMauve
Copy link

Part of the issue is that the tech leads for hyperswarm don't use IPv6 in their day to day so it's a bit harder for them to integrate it. I think also with regards to all the other things on the TODO list this just isn't a high priority item.

I don't think I have time to implement stuff at the moment but I'm willing to donate some time to mentor somebody else that wants to start putting it together and submitting a PR.

@RangerMauve
Copy link

It might be useful to talk about this more at the next dat comm comm dat-ecosystem/comm-comm#136

@pfrazee
Copy link
Contributor

pfrazee commented Apr 5, 2020

Maf can give a better explanation, but my understanding is that we started with IPv4 because it has the largest adoption so it's wise to make that work first. Hyperswarm's DHT includes hole-punching specifically to handle NATs and success rates have been very high so far.

IPv6 is on the roadmap but it's not trivial to implement because it introduces duplicate addresses for each peer, and so the network has to include logic to avoid creating duplicate connections. The decision was to prioritize IPv4's success-rate before putting resources into implementing IPv6.

@makew0rld
Copy link

An alternate way of approaching this would be through webtorrent/bittorrent-dht#88, where there are already PRs to add IPv6 to the whole dat ecosystem.

@RangerMauve
Copy link

@makeworld-the-better-one I don't think hyperswarm is using the bittorrent DHT anymore so it probably won't be enough. 😅

@martinheidegger
Copy link
Contributor

@urbien
Copy link

urbien commented Oct 12, 2020

I run BitTorrent and IPFS over IPv6 for a few years now and it just works like a breeze.

@kravietz can you elaborate on that? Do you mean that by using IPv6 you bypass NAT? I understand that NAT was introduced initially as a way to multiplex local addresses onto the limited IPv4 address space. But now everyone is sitting behind NAT. How does IPv6 helps? Is there any way to configure NAT to pass-through the IPv6 traffic, or are you saying this is what NAT does by default?

@kravietz
Copy link

kravietz commented Oct 13, 2020

@urbien

When you're on IPv4 a typical set up will be like this:

  • Gateway is 123.5.5.5 on public routable IPv4, client is 10.10.10.10. To open BitTorrent on port 12345 you need:
  • allow 10.10.10.10:12345 on gateway firewall
  • maintain a static DHCP lease for 10.10.10.10
  • create a NAT mapping to forward traffic to 123.5.5.5:12345 to 10.10.10.10:12345 (or use UPnP which does the same dynamically)
  • BitTorrent client needs to discover its own public IPv4 address to be able to announce it to peers

On IPv6 large part of this complexity is gone:

  • Gateway is 2a02:123::1, client uses auto-generated SLAAC address like 2a02:123:7::ccbe:c2a3:1a9c:fedd/64
  • BitTorrent client announces itself as [2a02:123:7::ccbe:c2a3:1a9c:fedd]:12345 which is a public routable IP and you just need to allow port 12345 on firewall to the whole world's peers to be able to talk to it

In other words, with IPv4 your gateway is a NAT translation box that needs to be configured to pass-through specific traffic. With IPv6 your gateway is simply a router that has a simple job of routing traffic between public subnets without any additional configuration.

@mafintosh
Copy link
Contributor

Upcoming v5 has primitives to connect peers over ipv6

@RangerMauve
Copy link

@mafintosh Is there some code I could look at to check it out? :O

@perguth
Copy link

perguth commented Feb 17, 2024

Close?

const ipv6 = {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants