IPv6 node support #1021
pull sipa wants to merge 8 commits into bitcoin:master from sipa:ipv6 changing 14 files +347 −119-
sipa commented at 1:01 am on April 1, 2012: memberThis will make bitcoin relay valid routable IPv6 addresses, and when USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections to IPv6 addresses.
-
Diapolo commented at 9:23 am on April 2, 2012: none
I can’t really comment on your code changes, but I’m interested in some of the changes. You removed / changed how the global var addrLocalHost worked. There is now a list / an array which holds all local addresses, which can be used for bitcoin network connections. That one can be queried via GetLocal(), right? I understand this is needed for IPv6, but could that be used if a client had more than 1 NIC with internet connection, too?
Is IPv6 external address detection possible like with IPv4 or is there a new mechanism in the protocol?
-
sipa commented at 9:31 am on April 2, 2012: member
@Diapolo: yes you can use it with multiple NICs; it’s even in a separate commit named “Support for multiple local addresses”.
IPv6 external address detection works the same way as IPv4, though IRC and whatismyip.com will obviously only tell you about IPv4 addresses.
-
sipa commented at 10:27 am on April 2, 2012: memberGetLocal() queries the mapLocalAddress database; this contains the routable addresses detected on local interfaces, but also addresses discovered through UPnP, IRC, website lookups, or manually specified. There’s not really a way to link them back to interfaces anymore (though you can find those in debug.log, lines of the form “ipv4 eth0: 192.168.1.1”).
-
Diapolo commented at 11:16 am on April 2, 2012: none
I’m asking, because I have a small commit in the pipe, which displays the external IP as a tooltip when you hover the connection symbol in the Qt client. This would get broken by your commit and I wanted to know if I could make it work again (if it ever get’s accepted - but it would be an added value to the GUI).
To query all used IPs via a foreach or sth. like that would be nice.
-
sipa commented at 12:19 pm on April 2, 2012: member
You can query which potentially local addresses bitcoin knows about (just check the mapLocalAddress), but that is not the same as the addresses it’s reachable on (no way to know that for sure) or the address of local interfaces.
Edit: you could just use GetLocal(addrBest, NULL), which will return the most likely publicly reachable address.
-
luke-jr commented at 1:48 pm on April 10, 2012: memberNeeds rebasing. Sipa broke everything using locks. >_<
-
sipa commented at 2:02 pm on April 10, 2012: memberYeah, I’m a lock breaker. Rebased.
-
in bitcoin-qt.pro: in adcd6f2f8d outdated
61@@ -62,6 +62,12 @@ contains(USE_DBUS, 1) { 62 QT += dbus 63 } 64 65+# use: qmake "USE_IPV6=1"
luke-jr commented at 3:57 pm on April 10, 2012:Why should IPv6 be disabled by default for Bitcoin-Qt? :/
luke-jr commented at 3:59 pm on April 10, 2012:Also, note that USE_* flags currently represent optional dependencies. I’m not sure IPv6 is a dependency, just a feature?
sipa commented at 4:20 pm on April 10, 2012:I intended it to be disabled by default everywhere, but at least it should be consistent.in src/net.cpp: in adcd6f2f8d outdated
1711- } 1712+ CNetAddr addr(s4->sin_addr); 1713+ if (AddLocal(addr, LOCAL_IF)) 1714+ printf("ipv4 %s: %s\n", ifa->ifa_name, addr.ToString().c_str()); 1715 } 1716 else if (ifa->ifa_addr->sa_family == AF_INET6)
luke-jr commented at 4:03 pm on April 10, 2012:This needs to be inside an #ifdef USE_IPV6
sipa commented at 4:21 pm on April 10, 2012:doneDiapolo commented at 5:50 pm on April 10, 2012: noneI’m sure IPv6 support is one of the biggest infrastructure things in the “Internet” … would it perhaps be a good idea to offer an IPv6 enabled beta instead of merging directly into master? That’s no NACK btw!luke-jr commented at 5:54 pm on April 10, 2012: memberIPv6 is basically deployed by now. Even in the rare cases of ISPs behind the times or ancient routers, Windows will still setup a Teredo tunnel and Linux users can trivially configure 6to4.sipa commented at 6:32 pm on April 10, 2012: memberOk, updated.
- Foreign addresses (ipv6 when you are ipv4-only, for example) are now not stored in addrman, and only relayed to one node instead of 2.
- USE_IPV6 is enabled by default by all makefiles
sipa commented at 6:38 pm on April 10, 2012: memberas soon as support for tor/i2p hidden services is added, you’ll probably need -externalip=something.onion to make your node advertize that address as well. It seems a bit strange to limit the function to IPv4 when the semantics are exactly the same for every network.jgarzik commented at 6:38 pm on April 10, 2012: contributorACKsipa commented at 6:50 pm on April 10, 2012: memberSocks version is now selectable using -socks=.jgarzik commented at 6:28 pm on April 23, 2012: contributorI would like to merge this sooner rather than later… we can always merge this with !USE_IPV6 for 0.6.1, for example, and then turn on USE_IPV6 on 0.7.sipa commented at 6:31 pm on April 23, 2012: memberI just split off the SOCKS-related changes to another pullreq.rebroad commented at 2:22 pm on April 28, 2012: contributoris the -externalip=blahblah.onion working yet?sipa commented at 2:25 pm on April 28, 2012: memberNo, that requires onioncat-style IPv6 addresses support.IPv6 node support
This will make bitcoin relay valid routable IPv6 addresses, and when USE_IPV6 is enabled, listen on IPv6 interfaces and attempt connections to IPv6 addresses.
Preliminary support for Tor/I2P hidden services
There are plans to let Bitcoin function as Tor/I2P hidden service. To do so, we could use the established encoding provided by OnionCat and GarliCat (without actually using those tools) to embed Tor/I2P addresses in IPv6. This patch makes these addresses considered routable, so they can travel over the Bitcoin network in 'addr' messages. This will hopefully make it easier to deploy real hidden service support later.
Limited relaying/storing of foreign addresses
Introduce a boolean variable for each "network" (ipv4, ipv6, tor, i2p), and track whether we are likely to able to connect to it. Addresses in "addr" messages outside of our network get limited relaying and are not stored in addrman.
Add -noproxy to circumvent proxy for some network 623b987813Use NET_ identifiers in CNetAddr::GetGroup() c5b3ffd8d5Add -blocknet to prevent connections to a given network 457754d2c2Keep port information for local addresses 7fa4443f77Separate listening sockets, -bind=<addr> 8f10a28890sipa commented at 1:34 pm on May 11, 2012: memberAdded -bind=[addr].luke-jr commented at 1:47 pm on May 11, 2012: memberFWIW, I don’t seem to be getting any IPv6 connections with thisluke-jr commented at 3:35 pm on May 11, 2012: memberI mean, I expect running with this should get me at least a few IPv6 connections..?jgarzik commented at 4:06 pm on May 11, 2012: contributorYou’re probably the only one besides sipa running an IPv6 node, so connection success seems doubtfulrebroad commented at 4:47 pm on May 11, 2012: contributorI’m running this also, and I think I have IPv6 enabled.sipa referenced this in commit a3878873f3 on May 12, 2012sipa merged this on May 12, 2012sipa closed this on May 12, 2012
coblee referenced this in commit e7d5d8484f on Jul 17, 2012sipa deleted the branch on Jun 23, 2017suprnurd referenced this in commit 9bf1e00f09 on Dec 5, 2017ptschip referenced this in commit 5179f16e59 on Apr 5, 2018lateminer referenced this in commit 899b4bd6a9 on Oct 30, 2019ajtowns referenced this in commit 7a9246e978 on Oct 21, 2020DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC
More mirrored repositories can be found on mirror.b10c.me