-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Prefer IPv6 over IPv4 #1469
Comments
@FliesLikeABrick see #864 for a previous discussion on this topic.
Can you give some examples? On my system (macOS) both I also tried
I have to add
In practice, why is this an issue given the default can be changed to |
One option here may be to support a "whatever comes back first" mode, i.e. something like For the default The other resolvers (namely One issue that occurs to me is that, as this mode would be racy, it could lead to confusing user experience where you may get either IPv4 or IPv6 each time you run And of course, it would still be a significant breaking change to adjust the default value for Edit: WIP impl of Testing it locally, I do indeed see the "flip/flop" between IPv4/IPv6 issue mentioned above. Edit 2: The name Therefore, a better name may be something like "any" or "unspecified" or "ipv4-or-ipv6" as we are telling Trippy "I don't care if I get IPv4 or IPv6, just return the first addr the OS gives us or the first thing that works if we're not using the OS DNS resolver". PR updated to be Edit 3: Another issue with this approach I just experienced is that, if your system DNS resolver support both IPv4 and IPv6, but you do not have IPv6 connectivity, you will get BSOD errors when IPv6 is chosen but there is no IPv6 routing. For example, on my system with IPv6 routing disabled I get:
|
I don't have access to IPv6 so have no personal stake but I don't think I'd like the race option in a diagnostic tool. |
@fujiapple852 ping and traceroute have the appearance of preferring IPv4 first, however on MacOS and Linux (up until recently in some distros), ping6 and traceroute6 are separate utilities. mtr prefers IPv6 over IPv4, and so do the newer dual-stack versions of ping being distributed in some Linux distros (instead of the separate ping vs ping6 utilities). fping also has converged fping and fping6 into one utility or wrapper, which prefers IPv6. Browsers and all other userland applications prefer IPv6 first when using default source address selection strategies, on all OSes. This is why trippy implementing a different default strategy is misleading for users, administrators, and others who are troubleshooting on dual-stack systems. The diagnostic tools should mirror the default system and application behaviors. I completely agree with @c-git that non-deterministic behavior should be avoided in this tool, as it is in others. |
BackgroundTrippy will typically be given a IPv4 or IPv6 address as input and so no decision is required. As a convenience Trippy supports taking a hostname as input and attempts to resolve this to a IPv4 or IPv6, which is where, in the absence of any user supplied preference, a decision is required. Trippy should, in general, be unopinionated on such matters. The correct thing to do in such cases is defer the decision to the OS and therefore avoid having a default value in Trippy. Current Default BehaviourThe current default behaviour for Trippy is:
Proposed New Default BehaviourThe proposed new default behaviour for Trippy is:
This introduces a new Edge CaseIt does leave one problem however, namely how to deal with the case where The options here are, for the non-system resolvers:
I think we can rule out the first option, due to the non-determinism. The second option is better but not very user friendly, as it forces you to configure both That leaves the 3rd option, where Trippy does express an opinion to favour IPv6 over IPv4, but only when the user has opted into using a non-default resolver. This is a breaking change but seems acceptable. Note on System tools vs ApplicationsThis still leaves the matter of the behaviour of Trippy differing for some other applications, such as web browsers, which are opinionated about IPv4 vs IPv6 and choose to override the OS resolver behaviour. Unlike regular applications such as web browsers, where the choice of IP protocol is a low level detail that the user should not be aware of, for system tools such as Trippy the choice matters. For example, the UDP/dublin algorithms for IPv4 and IPv6 are very different. Therefore I think trying to match the behaviour of application such as web browser is a non-goal for Trippy. RolloutI propose the following rollout timetable:
|
I agree with this being the best of the options given |
follow up breaking change in |
I also think the third options is the best of the 3. But... Is there an advantage to IPv6 over IPv4? Why not just leave it as IPv4 then IPv6 if they leave it on system and choose an non-system resolver? PS. But I am ok with going with the third option. |
@c-git it's a good thought; it would mean the breaking change (to use the With your suggestion, it only impacts those who use the default Those who currently configure a non-system resolver but do not configure a address family will not be impacted as they'll continue to default to |
Yeah, I think it strikes a nice balance and is a "reasonable" default in as much as it will do what the system it is on does by default. I'd actually argue that IPv4 is still the default in most places in terms of most tools. Seems many tools added a new version with a 6 so the "default" with no number is still 4. |
I am not 100% sure what you are referring to and would love examples of tools that have v4+v6 support but default to IPv6 -- that has not been my experience I am not sure your background or experience, but I would encourage you to educate yourself further on how IPv6 is deployed and adopted in "dual stack" environments - as this is the way that IPv6 is rolled out to all kinds of content/datacenter, commercial/enterprise, and residential environments. Approximately 50% of US users have IPv6 available for example - and those are pretty much all dual-stack (having IPv4 and IPv6). IPv6 is used by default on all hosts/systems that have both IPv4 and IPv6 available (with different timeouts or fallbacks to IPv4 based on multiple layers of considerations that may be application and OS-specific) |
I have very little experience with IPv6, none of my ISPs have ever offered it. The opinion was based on the default versions being the IPv4 versions and having alternate versions suffixed with a 6. I re-read the messages and based on this comment
It does suggest a trend of moving from only IPv4 support with a separate binary for IPv6 towards changing the default as you said. If the long term trend is indeed IPv6 as the default maybe since we are already making a breaking change we should change now. However, it does mean that we break people who currently don't use the system resolver and don't need to be broken. While people who don't change the default will get the same as the system (and thus default to IPv6 in dual stack based on the above referenced comment). |
Thinking about it some more, there is one scenario I did not consider; after the breaking change to make the default address family Therefore I think it is better that the |
That is true and breaking less often is better I think. Even if it means we have to break a bit more. |
I have built and run this from master after the PR was merged and the default behavior still appears to use IPv4 -- @fujiapple852 did you or someone else test this branch out? |
@FliesLikeABrick to recap on the rollout plan: 0.13.0 (~Q1 2025): add a 0.14.0 (~Q2 2025): change the default address family to be |
@fujiapple852 understood and agreed it's a solid plan -- however I ran |
@FliesLikeABrick use Aside: the |
@fujiapple852 perfect thank you -- I see now that I was indeed confusing the resolver vs family options, both of which have If we wanted to deploy this internally via a fork until 0.14 is released, I presume there's a one-line change we just need to make somewhere to change the default -- possibly line 116 in src/config.rs ? |
@FliesLikeABrick I’m not near a laptop to check, however I believe this is where you would want to change the default:
|
Thanks @fujiapple852 confirmed changing that line to instead use AddressFamilyConfig::System changed the default behavior for us to deploy internally until 0.14.0 is released. Thanks everyone for the quick and productive engagement on this suggestion |
And thank you for raising this. |
Describe the feature you'd like
We would like trippy to implement a more typical AF/source address selection policy. Currently the default is "IPv4 then IPv6", however this is the opposite of every other typical system and application default behavior. This leads to users or administrators who use trippy capturing data that does not show the same path/transport their application or system is using, leading to confusing diagnostics and communication.
Change the default AF/source address selection from Ipv4thenIpv6 to ipv6-then-ipv4
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: