mafintosh / discovery-swarm

A network swarm that uses discovery-channel to find peers
MIT License
375 stars 57 forks source link

No IPv6 support in uTP/DHT #45

Open vuori opened 6 years ago

vuori commented 6 years ago

I was trying out Dat and noticed that IPv6 is not used to reach peers. This pretty seriously limits its usefulness for me, so I looked around the internals a bit. On a high level, I think the following changes would be needed in discovery-swarm to fix this:

On the lower levels, looks like this needs:

I may have some time to work on this in the near future. Does the approach sound reasonable?

RangerMauve commented 6 years ago

Beaker doesn't make use of the bittorrent-dht and there are plans of migrating to a new implementation.

DNS-discovery is actually the more important discovery-related module to modify since it's being used more heavily. I think there's not too much to be changed there, instead of only using A records, you'll need to add support for AAAA records for IPv6.

vuori commented 6 years ago

If I understand the workings of the DNS discovery system correctly, it relies on the server recording the transmitting IP of the host that 's announcing a service. That would require communicating with the datprotocol.com DNS servers over IPv6, but none of them have AAAA records. So it looks like the infrastructure would need to be fixed first before client-side changes can go anywhere?

pfrazee commented 6 years ago

@vuori that's correct, but less daunting than it sounds. We'd just need to update the dns-discovery module to support ipv6. @mafintosh can deploy the new server relatively quickly

danimesq commented 5 years ago

@vuori , how Dat could support i2p?

vuori commented 5 years ago

I'm not familiar with i2p. If you mean IPv6, it turned out that the rabbit hole went a bit too deep for a weekend project, so the issue has been on the shelf.

RangerMauve commented 5 years ago

@vuori I'm going to be doing some stability work on hyperswarm, I'll see if I can put in IPv6 support in my spare time.

danimesq commented 5 years ago

@RangerMauve how Dat could support Tor or i2p?

RangerMauve commented 5 years ago

@DaniellMesquita Dat can work across any transport. What you'd need to do is find some sort of peer discovery mechanism for Tor or i2p (Maybe a DHT exists for this?), open a connection to a peer, and use hyperdrive.replicate() to create a replication stream and pipe it into the peer.