Skip to content

Switch to IPv6 #859

Open
Open

Description

@IntegratedQuantum

It appears that holepunching doesn't work on carrier grade NATs which are used by some mobile network companies.
IPv6 could fix this.

Since I don't know how to detect carrier grade NATs, I'd need to use IPv6 for everything which reduces the bandwidth (IPv6 headers are bigger).

Activity

  1. added
    bug
    on Dec 29, 2024
  2. IntegratedQuantum commented on Dec 29, 2024

    @IntegratedQuantum
    MemberAuthor

    Actually it doesn't seem like a good idea to switch to IPv6.
    Support for IPv6 is still relatively poor, for example my internet provider does not appear support it natively, it only supports it via 6to4 tunneling. And there are still many devices that do not support IPv6 at all.

    Supporting IPv6 alongside IPv4 is also not an option, since it would make the user interface even more confusing than it already is.

  3. added
    undecided
    on Dec 29, 2024
  4. added
    network
    on Feb 25, 2025
  5. TudbuT commented on Jan 5, 2026

    @TudbuT

    Hi, the current errors when entering an ipv6 address or ipv6-only domain (my setup is near-exclusively ipv6 nowadays, except for my websites) are quite cryptic. It would be nice if this could be improved, perhaps with a link to this issue.

    Of course, supporting ipv6 would also indeed be extremely good™ and very appreciated. The user interface for joining wouldnt really need to be more complicated either, it is standard practice to put ipv6 addresses in square brackets in address fields, without any need for a toggle or whatever. For now, we can leave ipv6 out of the address display, i guess, due to the possible confusion.

    And there are still many devices that do not support IPv6 at all.

    this is not true, all devices manufactured in the last 20 years will do just fine with an ipv6 connection (even an ipv6-only connection), and any OS updated in the last 20 years will do so too (even windows 7 has IPv6 enabled by default). the only bottleneck are ISPs that think theyre too fancy to deploy it (and a few routers that have it disabled by default for some reason), of which there are fewer and fewer. see https://www.google.com/ipv6/statistics.html#tab=ipv6-adoption for stats on that, and these are a pretty pessimistic estimate that doesnt quite match my experience - most people i talk to have ipv6.

    here is a thinkpad from 2005 with 32-bit windows 7 passing an ipv6 test with 10/10 points:

    Image
    Image

    Since I don't know how to detect carrier grade NATs, I'd need to use IPv6 for everything which reduces the bandwidth (IPv6 headers are bigger).

    you can also default to ipv6 and switch to ipv4 if that doesnt work, or the other way around. one way to accomplish this is outputting both ipv6 and ipv4 in a single base32 value, which the other side can enter. cubyz can then find whatever works. symmetric NAT / NAT4 (what CGNAT often is - this is the actual issue with it, not that its carrier grade) can also be detected by having two STUN servers, and checking whether using the same egress port on the client will result in the same egress port being shown in both STUN results (if not, NAT is symmetric and thus ipv4 traversal impossible).

  6. IntegratedQuantum commented on Jan 5, 2026

    @IntegratedQuantum
    MemberAuthor

    see https://www.google.com/ipv6/statistics.html#tab=ipv6-adoption for stats on that

    less than 50% supported devices seems pretty bad, even if we assume that it's using a pessimistic metric.
    And I think when I posted this issue there was also at least one person in the community for whom it didn't work.

    For now, we can leave ipv6 out of the address display, i guess, due to the possible confusion.

    So what do you propose then? Two separate sockets on the server? Seems like it would be rather annoying to implement and maintain (and thanks to Windows, the network code needs a lot of maintainance).

    symmetric NAT / NAT4 (what CGNAT often is - this is the actual issue with it, not that its carrier grade) can also be detected by having two STUN servers

    We already do that, the reason for creating this issue was that there was a cgnat (somewhere in the UK) where it didn't detect symmetric NAT but connecting was still not possible. I couldn't find a reason for it and I just blindly hoped that IPv6 could fix it.

  7. TudbuT commented on Jan 6, 2026

    @TudbuT

    less than 50% supported devices seems pretty bad

    this statistic is the number of devices that Actively Prefer ipv6 over ipv4 for requests. this is part of why i consider the stat so pessimistic.

    We already do that

    nice

    I couldn't find a reason for it and I just blindly hoped that IPv6 could fix it.

    well, it can, if both sides have it.

    So what do you propose then? Two separate sockets on the server?

    a socket listening on [::0]:47649 will automatically also receive ipv4 connections, at least to my knowledge. as a result, thats what i usually use. im not sure if you consider this adequate of course, as you expressed concern over MTU, which is 24 bytes less in udp6 than in udp4 as far as i can tell

  8. tillpp commented on Jan 6, 2026

    @tillpp
    Contributor

    So what do you propose then? Two separate sockets on the server? Seems like it would be rather annoying to implement and maintain (and thanks to Windows, the network code needs a lot of maintainance).

    If i remember correctly you could connect to an IPv6 server with an IPv4 client,
    Looking at one of my old (c++) projects, i got this line, that might help you:

     int no = 0;
     setsockopt(handle,IPPROTO_IPV6,IPV6_V6ONLY,(const char*)&no,sizeof(no));

    (same code for windows and for linux)

    I tested it with an IPv4 client: netcat 127.0.0.1 <port> , connecting to my IPv6 server and the server interpreted the client's ipv4 as ::ffff:127.0.0.1 , but haven't tested it with two different machines yet (i.e. not localhost).

    Image
  9. TudbuT commented on Jan 6, 2026

    @TudbuT

    correct. ipv6 sockets can handle incoming v4 always - all my networking apps listen on v6 only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugnetworkui/uxundecided

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions