Skip to content

tailscale exit node breaks Happy Eyeballs on MacOS and iOS (rfc6555) #2299

Closed

Description

@psaab

When using a dual stacked exit node, tailscale breaks Happy Eyeballs (at least on the mac). A test that was used to fix iOS and MacOS's Happy Eyeballs implementation years ago is located here:

http://he.test-ipv6.com/

As you can see with my results from test-ipv6.com, I have IPv6 connectivity but MacOS isn't using it. It seems something you're doing with Magic DNS is causing the AAAA records to be delayed and the OS preferring IPv4.

Test your IPv6_.pdf
Test your Happy Eyeballs_.pdf

Activity

  1. bradfitz commented on Jul 1, 2021

    @bradfitz
    Member

    You using Chrome?

    This is very similar to #1486, in which includes this comment (#1486 (comment)):

    @DentonGentry proposed a hypothesis that I like, which is that Chrome may be treating IPv6 ULAs (such as our Tailscale IPs and routes) as "less good" connectivity than native IPv6, and so is preferring IPv4 because it thinks the v6 connectivity is bad. Chrome apparently does this already with 6RD addresses, among others, so it's a plausible suggestion. I'm currently struggling to clone the Chromium source repository so that I can explore how exactly it's implementing Happy Eyeballs, to confirm or disprove.

  2. bradfitz commented on Jul 1, 2021

    @bradfitz
    Member

    (If this turns out to be the case, I suppose getting some proper IPv6 space probably isn't too hard.)

    /cc @danderson

  3. added
    connectivity
    on Jul 1, 2021
  4. psaab commented on Jul 1, 2021

    @psaab
    Author

    Chrome is the worst offender, but it also happens with safari. Just in safari it will sometimes use IPv6 when using exit node, but if I turn exit node off it uses IPv6 100% of the time in safari and chrome. IMO real IPv6 space is a better idea. We did this at FB when doing internal IPv6-only vs doing ULA.

  5. psaab commented on Jul 1, 2021

    @psaab
    Author

    This may be more nuanced and related to address selection and ordering with DNS etc. Maybe the ULA addresses de-prioritize IPv6 in ordering for getaddrinfo. You can also show this problem with a simple net.Dial to a dual stacked host and it will connect over IPv4 almost every time.

    $ cat getaddrinfo.py
    import socket
    print(socket.getaddrinfo("www.facebook.com", "80"))

    without exit node:
    $ python3 getaddrinfo.py
    [(<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2a03:2880:f10d:83:face:b00c:0:25de', 80, 0, 0)), (<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2a03:2880:f10d:83:face:b00c:0:25de', 80, 0, 0)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('157.240.11.35', 80)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('157.240.11.35', 80))]

    with exit node:
    $ python3 getaddrinfo.py
    [(<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('31.13.88.35', 80)), (<AddressFamily.AF_INET: 2>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('31.13.88.35', 80)), (<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_DGRAM: 2>, 17, '', ('2a03:2880:f10d:183:face:b00c:0:25de', 80, 0, 0)), (<AddressFamily.AF_INET6: 30>, <SocketKind.SOCK_STREAM: 1>, 6, '', ('2a03:2880:f10d:183:face:b00c:0:25de', 80, 0, 0))]

  6. bradfitz commented on Jul 1, 2021

    @bradfitz
    Member

    Is that with 100.100.100.100? (that is, using MagicDNS or otherwise have a DNS config that enables the 100.100.100.100 resolver?)

  7. psaab commented on Jul 1, 2021

    @psaab
    Author

    DNS configuration (for scoped queries)

    resolver #1
    search domain[0] : lan
    nameserver[0] : 2603:800c:2b43:d9f0:449b:adff:fe74:13da
    nameserver[1] : 192.168.86.1
    if_index : 6 (en0)
    flags : Scoped, Request A records, Request AAAA records
    reach : 0x00000002 (Reachable)

    resolver #2
    search domain[0] : paul-m-saab.gmail.com.beta.tailscale.net
    nameserver[0] : 100.100.100.100
    if_index : 22 (utun6)
    flags : Scoped, Request A records, Request AAAA records
    reach : 0x00000003 (Reachable,Transient Connection)

    if I turn off DNS in tailscale perferences, all dns stops working.

  8. DentonGentry commented on Oct 30, 2022

    @DentonGentry
    Contributor

    This might be related to #5425, if macOS was being used as the exit node. Though the worst of the symptoms happen with Chrome 104 and later, the underlying problem impacted IPv6 until 1.30.1 and could easily have broken Happy Eyeballs.

    Barring further comment or additional reports of the issue with 1.30.1 or later, we'll expect to close this during the next regular bug scrub.

  9. DentonGentry commented on Jan 7, 2023

    @DentonGentry
    Contributor

    Believed to be a symptom of #5425.
    Closing as a dup of #5425

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

    L5 All usersP1 NuisanceT3 Performance/Debuggingconnectivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions