Giter Club home page Giter Club logo

Comments (15)

makew0rld avatar makew0rld commented on August 26, 2024 6

@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.

from hyperdht.

kravietz avatar kravietz commented on August 26, 2024 4

@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?

from hyperdht.

kravietz avatar kravietz commented on August 26, 2024 2

@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.

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024 1

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.

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024 1

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

from hyperdht.

pfrazee avatar pfrazee commented on August 26, 2024 1

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.

from hyperdht.

mafintosh avatar mafintosh commented on August 26, 2024 1

Upcoming v5 has primitives to connect peers over ipv6

from hyperdht.

perguth avatar perguth commented on August 26, 2024 1

Close?

const ipv6 = {

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024

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

Would a PR that adds support be welcome?

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024

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.

from hyperdht.

makew0rld avatar makew0rld commented on August 26, 2024

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.

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024

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

from hyperdht.

martinheidegger avatar martinheidegger commented on August 26, 2024

Just to share here: https://dat.discourse.group/t/where-is-dat-on-ipv6-support/32/4

from hyperdht.

urbien avatar urbien commented on August 26, 2024

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?

from hyperdht.

RangerMauve avatar RangerMauve commented on August 26, 2024

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

from hyperdht.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.