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

IPV6 Supports #1592

Closed
wants to merge 36 commits into from
Closed

IPV6 Supports #1592

wants to merge 36 commits into from

Conversation

tangdou1
Copy link
Contributor

@tangdou1 tangdou1 commented Sep 12, 2018

IPV6 Supports:
(If you donot have ipv6, these change would not change the logic of your code. If you have public ipv6, these change would let you choose ipv6 as your connection server first (can let the users to choose if needed ), not your public ipv4 address, in which you can also connect these ipv4 peers and ipv4 trackers. )

  • UDP/TCP Trackers Supports

  • Peer Exchange Supports

  • BigFile Supports

  • Bootstrapper Supports

  • Testing

This was referenced Sep 12, 2018
@danimesq
Copy link
Contributor

This pull request fixes #148

@danimesq
Copy link
Contributor

@HelloZeroNet @shortcutme

@danimesq danimesq mentioned this pull request Sep 12, 2018
@danimesq
Copy link
Contributor

@tangdou1
Does it supports IPV6 mesh networks?

@tangdou1
Copy link
Contributor Author

tangdou1 commented Sep 13, 2018

Yes, it now can support IPV6---UDP/TCP tracker connection, Peer Exchange, BigFile .

@April93
Copy link

April93 commented Sep 13, 2018

I just added the changes to my build. I don't have native ipv6 support on my ISP/internet, but instead it should be running through cjdns. I'd really love to see this working. Anyone want to help test?

@danimesq
Copy link
Contributor

@April93
I don't know how CJDNS works, and to create a node

@April93
Copy link

April93 commented Sep 14, 2018

@DaniellMesquita You need to connect to some peers. So you'll need to have some public peers to connect to. Here are some of the public nodes I have:

"185.87.193.205:18842": {
                      "publicKey": "7h898y2xdhtm9xgng7f97umx9wfjhkxfx2wkxw89mrq2y6k954d0.k", 
                      "password": "public-180613", 
                      "peerName": "h.ihc.cupivan.ru"
                    },
                    "50.31.112.231:5249": { "publicKey": "tghwsb26dvczp983358ssvyvyjnsb2jkrvl2j5u1p56066nl64f0.k", "password": "8l8hm1rzvn772bxl0d2gdrx1v6c5n4m", "peerName": "Jon Lane", }, 
                    "107.170.57.34:63472":{
                            "contact":"code@ventricle.us",
                            "gpg":"7FE895160E3314027CD3B5D37392CF088BB4345C",
                            "location":"digitalocean nyc2",
                            "login":"public-peer",
                            "password":"ppm6j89mgvss7uvtntcd9scy6166mwb",
                            "peerName":"cord.ventricle.us",
                            "publicKey":"1xkf13m9r9h502yuffsq1cg13s5648bpxrtf2c3xcq1mlj893s90.k"
                    }

So you can connect to the cjdns network. Once you can connect to http://[fc53:dcc5:e89d:9082:4097:6622:5e82:c654] you're good to go.

I've hopefully got ZN running over cjdns, so all you'll need is to enable bootstrapping and provide the cjdns ipv6 for your machine, and add me as a peer (or perhaps we may be able to exchange our ipv6 through the ipv4 trackers)

Either way, if you wanna give it a shot, this is my ipv6: fcfc:34ca:f762:779f:9600:23d3:2ef9:c571 So what you'd want to use as a tracker is zero://fcfc:34ca:f762:779f:9600:23d3:2ef9:c571

Let's give it a shot :). My laptop isn't running all day though, so if you can get a dedicated server running for it, that'd be much better.

@danimesq
Copy link
Contributor

danimesq commented Sep 14, 2018

zero://fcfc:34ca:f762:779f:9600:23d3:2ef9:c571 isn't missing the connection port?

@April93
Copy link

April93 commented Sep 14, 2018

I have no idea how bootstrapping on ZN works. From a glance it looked like that to connect to such you'd just do zero://[ipaddress] which is what I did. I didn't mess with any ports or anything, my ZN stuff is all default, and my cjdns is default.

Perhaps it'd be best if you tried to set up a boostrapper node/tracker?

@tangdou1
Copy link
Contributor Author

Here is the reason why your zero://fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 is not 100%.

ConnServer Conn#12 fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 [?] > Closing connection: fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 Connect error: error: [Errno 10061] [Error 10061] No connection could be made because the target machine actively refused it

I could not see the http://ipv6.tracker.harry.lu/announce tracker information in debug.log.

@danimesq
Copy link
Contributor

Do you have public ipv6 address?

Can I create it without it supported by ISP?

ConnServer Conn#12 fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 [?] > Closing connection: fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 Connect error: error: [Errno 10061] [Error 10061] No connection could be made because the target machine actively refused it

What could be this error?

@tangdou1
Copy link
Contributor Author

Can I create it without it supported by ISP?

No. Maybe fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 is produced by using the cjdns method (I donot understand).

ConnServer Conn#12 fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 [?] > Closing connection: fc81:4668:5a19:c29:9dfe:ed94:d745:85c9 Connect error: error: [Errno 10061] [Error 10061] No connection could be made because the target machine actively refused it

What could be this error?

Means target machine actively refused your connection (I donot know why), so your connection sometimes will disconnect. However, it can also successfully connect it sometimes.

@danimesq
Copy link
Contributor

Means target machine actively refused your connection (I donot know why), so your connection sometimes will disconnect. However, it can also successfully connect it sometimes.

It is because Multiuser plugin.
@HelloZeroNet @shortcutme

@April93
Copy link

April93 commented Sep 16, 2018

CJDNS generates a localhost ipv6 for your machine, and then routes ipv6 traffic through cjdns. This is why it's different from a native/regular ipv6 connection (which would use the full spectrum of IPs). And to answer @DaniellMesquita, the only way to have a normal ipv6 (rather than going through cjdns) is to set up your router and contact your ISP properly so that you may be assigned one. That's part of the reason why cjdns is such a big deal, as it allows people to have an ipv6 address without needing to go through an authority.

@andrewheadricke
Copy link

This is great, thanks @tangdou1, I'm playing around with it now to see if I can get it working on CJDNS.

One suggestion, usually ipv6 addresses are enclosed with [] to handle the : between address and port. Rather than taking a reverse split(':',1) it would be great to support [0123:4567:8901]:80 for example.

@andrewheadricke
Copy link

andrewheadricke commented Sep 17, 2018

Ok, so a few findings..

There does not appear to be a simple way in ZeroNet to add individual peers, it primarily relies on "trackers". Becoming a tracker looks fairly straight forward as its just a matter of enabling the Bootstrapper plugin. However, there is lots of ip4/onion statements in that plugin, so i'm guessing its not going to work with an ipv6 node (without modification).

Edit: Does anyone know how the Bootstrapper works? Does it listen on 15441 or does it listen on a new port?

Next i tried to forcefully add the peer listed above by @April93 directly into the Zeronet sqlite db. Zeronet is trying to connect which is good, I can't ping the node so maybe its offline. But I took a guess that the node is listening on 15441, but going by other public nodes, that port is only used 50% of the time so I may be using the wrong port too.

@April93
Copy link

April93 commented Sep 17, 2018

@andrewheadricke If you're referring to the one I explicitly said was my laptop's ipv6, the reason you failed to connect was because my laptop was off all day since I was doing a movie marathon with my family. The other ipv6 I provided isn't a zeronet node whatsoever, but instead just a random site on cjdns/hyperboria so you can ensure you're connected to the network. I should be online now for a few hours maybe, so feel free to try.

As for the ip4/onion thing in the bootstrapper plugin, I already asked about that, read the earlier conversation. What I've been doing is enabling the bootstrapper plugin, using --external_ip and set it to my ipv6. And then adding the relevant zero://[ipv6] info to the /Config page.

I haven't changed any of my ports or whatever, so it should indeed be 15441 for mine.

@tangdou1
Copy link
Contributor Author

tangdou1 commented Sep 17, 2018

There does not appear to be a simple way in ZeroNet to add individual peers, it primarily relies on "trackers"

No, you can connect others peers if you know their ip and port by
http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D/?zeronet_peers=ip:port

It can also be used in the condition that two users in different gateway but in one big local network which means they can ping each other. Now, the automatic local peers discover can only be used in the same gateway. However, this method can expand its scope.

@andrewheadricke
Copy link

No, you can connect others peers if you know their ip and port by
http://127.0.0.1:43110/1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D/?zeronet_peers=ip:port

I wasn't aware of that, thanks. Only issue is my ZeroNet instance does not have 1HeLLo... downloaded.. I cant get it to connect to my other ipv6 node and download the content.

@danimesq
Copy link
Contributor

There does not appear to be a simple way in ZeroNet to add individual peers, it primarily relies on "trackers".

DTH can support it?

@danimesq
Copy link
Contributor

@tangdou1

@danimesq
Copy link
Contributor

Reference: #1636

@ghost
Copy link

ghost commented Oct 4, 2018

The types of IPv6 addresses that CJDNS creates are not routable via the IPv6 internet, they are only routable via the CJDNS network.

Let's provide support for CJDNS connected hosts by all means, just as with i2p, etc.

But CJDNS is not going to connect an IPv4 only host to the IPv6 internet without leveraging a dual-stacked clearnet gateway on the CJDNS network, where CJDNS is essentially acting as a tunnel; and that could be built directly into ZN without creating a dependency on the CJDNS network.

Feel like I'm laboring the point but there's been a lot of talk recently about how CJDNS 'enables ZN to connect over IPv6' and its a false equivalency. You can make a v4 host communicate with v6 without CJDNS, and CJDNS is its own pseudo-v6 overlay network which may happen to have gateway nodes to the v6 clearnet, in the same way you could write a ZN gateway which happens to be dual-stacked.

It's not necessary to integrate with CJDNS if you just want v4 hosts to communicate with v6.

@April93
Copy link

April93 commented Oct 4, 2018

You can't connect to meshes that cjdns if you don't use cjdns. You also can't route traffic properly without it. Regular ipv6 will not work, and cannot replicate the features of cjdns we're after. It's not about accessing ipv6 peers. It's about going through the cjdns overlay network. Replicating cjdns features in zn would be very difficult and way out of scope. Similar to why zn doesn't replicate tor features and instead routes through tor.

@danimesq
Copy link
Contributor

danimesq commented Oct 4, 2018

@April93

A user like you that uses Linux inside Windows and isn't moving from Discord, simply surprised me now -

@ghost
Copy link

ghost commented Oct 6, 2018

I have publicly retracted my statements about CJDNS not using IPv6 on the ZN article; so I'll reflect it here for completeness, CJDNS does use IPv6 ULA to formulate its internal node addresses.

And whilst I fully support integration support for ZN with CJDNS for those that wish to use the two networks, in the same way and for the same reason as I support tor integration. I do not recognise any of the claimed benefits of the CJDNS overlay network above those already achieved with either/or/both tor and native IPv6 functionality.

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

Successfully merging this pull request may close these issues.

None yet

4 participants