IPv6 node support #1021

pull sipa wants to merge 8 commits into bitcoin:master from sipa:ipv6 changing 14 files +347 −119
  1. sipa commented at 1:01 am on April 1, 2012: member
    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.
  2. 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?

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

  4. Diapolo commented at 10:09 am on April 2, 2012: none
    Thanks for the infos @sipa. How would I query or list all interfaces that are used for connections, is this possible with a single GetLocal() call somehow?
  5. sipa commented at 10:27 am on April 2, 2012: member
    GetLocal() 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”).
  6. 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.

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

  8. luke-jr commented at 1:48 pm on April 10, 2012: member
    Needs rebasing. Sipa broke everything using locks. >_<
  9. sipa commented at 2:02 pm on April 10, 2012: member
    Yeah, I’m a lock breaker. Rebased.
  10. 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.
  11. 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:
    done
  12. Diapolo commented at 5:50 pm on April 10, 2012: none
    I’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!
  13. luke-jr commented at 5:54 pm on April 10, 2012: member
    IPv6 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.
  14. sipa commented at 6:32 pm on April 10, 2012: member

    Ok, 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
  15. sipa commented at 6:38 pm on April 10, 2012: member
    as 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.
  16. jgarzik commented at 6:38 pm on April 10, 2012: contributor
    ACK
  17. sipa commented at 6:50 pm on April 10, 2012: member
    Socks version is now selectable using -socks=.
  18. jgarzik commented at 6:28 pm on April 23, 2012: contributor
    I 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.
  19. sipa commented at 6:31 pm on April 23, 2012: member
    I just split off the SOCKS-related changes to another pullreq.
  20. rebroad commented at 2:22 pm on April 28, 2012: contributor
    is the -externalip=blahblah.onion working yet?
  21. sipa commented at 2:25 pm on April 28, 2012: member
    No, that requires onioncat-style IPv6 addresses support.
  22. 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.
    23aa78c405
  23. 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.
    d32148567f
  24. 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.
    090e5b40f1
  25. Add -noproxy to circumvent proxy for some network 623b987813
  26. Use NET_ identifiers in CNetAddr::GetGroup() c5b3ffd8d5
  27. Add -blocknet to prevent connections to a given network 457754d2c2
  28. Keep port information for local addresses 7fa4443f77
  29. Separate listening sockets, -bind=<addr> 8f10a28890
  30. sipa commented at 1:34 pm on May 11, 2012: member
    Added -bind=[addr].
  31. luke-jr commented at 1:47 pm on May 11, 2012: member
    FWIW, I don’t seem to be getting any IPv6 connections with this
  32. sipa commented at 1:53 pm on May 11, 2012: member
    @luke-jr how do you mean?
  33. luke-jr commented at 3:35 pm on May 11, 2012: member
    I mean, I expect running with this should get me at least a few IPv6 connections..?
  34. jgarzik commented at 4:06 pm on May 11, 2012: contributor
    You’re probably the only one besides sipa running an IPv6 node, so connection success seems doubtful
  35. rebroad commented at 4:47 pm on May 11, 2012: contributor
    I’m running this also, and I think I have IPv6 enabled.
  36. sipa referenced this in commit a3878873f3 on May 12, 2012
  37. sipa merged this on May 12, 2012
  38. sipa closed this on May 12, 2012

  39. coblee referenced this in commit e7d5d8484f on Jul 17, 2012
  40. sipa deleted the branch on Jun 23, 2017
  41. suprnurd referenced this in commit 9bf1e00f09 on Dec 5, 2017
  42. ptschip referenced this in commit 5179f16e59 on Apr 5, 2018
  43. lateminer referenced this in commit 899b4bd6a9 on Oct 30, 2019
  44. ajtowns referenced this in commit 7a9246e978 on Oct 21, 2020
  45. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

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-07-03 19:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me