Comments (15)
@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.
@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.
When you're on IPv4 a typical set up will be like this:
- Gateway is
123.5.5.5
on public routable IPv4, client is10.10.10.10
. To open BitTorrent on port12345
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
to10.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 like2a02: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 port12345
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.
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.
It might be useful to talk about this more at the next dat comm comm dat-ecosystem/comm-comm#136
from hyperdht.
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.
Upcoming v5 has primitives to connect peers over ipv6
from hyperdht.
Close?
Line 17 in 2e9c6b6
from hyperdht.
This would be super useful for a project I'm working on.
Would a PR that adds support be welcome?
from hyperdht.
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.
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.
@makeworld-the-better-one I don't think hyperswarm is using the bittorrent DHT anymore so it probably won't be enough. 😅
from hyperdht.
Just to share here: https://dat.discourse.group/t/where-is-dat-on-ipv6-support/32/4
from hyperdht.
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.
@mafintosh Is there some code I could look at to check it out? :O
from hyperdht.
Related Issues (20)
- Use in browser HOT 3
- Unable to holepunch from the local network to a Docker container HOT 6
- Add userData to dht.announce()
- Strange error. HOT 2
- Privacy Preserving in @hyperswarm/dht HOT 2
- Sending HTTP traffic over Hyperswarm. Should we consider supporting multiplexing in the protocol? HOT 25
- Cache handshake information for quick-connect of additional sockets HOT 5
- Add userData to handshake HOT 2
- Same code works except in DigitalOcean servers HOT 20
- server (socket-pairer) throws if client write() without noise HOT 13
- multiple mutablePut failure (maybe my misunderstanding?) HOT 2
- remove node net module HOT 2
- README.md encryptedConnection.on('open'), is this a mistake? HOT 3
- Node can be connected to by its defaultKeyPair.publicKey, even if `node.listening` is empty. HOT 2
- stream from node.lookup() doesn't match the documented interface HOT 8
- Cannot read property length of null when using flushed() in Hyperswarm HOT 1
- Connection metadata HOT 1
- Output Public key to file and read into another file HOT 4
- destroy() hangs HOT 2
- [Feature] discovery on lan wihtout access to internet HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperdht.