Hi there!
As this came up in a Github Issue
which pretty much ended in "we should discuss this", I wanted to get some more input about whether Rust should strictly default to IPv6 as the protocol used for talking about everything IP.
The idea is that, as a sizeable community with recent developer interest, Rust could make a meaningful impact towards better software support for IPv6 by both making it easy to use it (which pretty much already is the case, given as e.g. the standard library's functionality is entirely agnostic about IP protocols for everything), and more importantly examples and documentation should, in my opinion, default to IPv6 to increase visibility and help developers considering it the "default".
I consider the Rust community culture to be usually very proactive with encouraging good and discouraging bad habits with other things, e.g. making it very hard or impossible to disable verification in TLS libraries, or choosing the stricter parsing logic to get some rigor into the ecosystem, and I think that culture could make a meaningful impact on IPv6 transition too.
This is not entirely about documentation and examples then, but also about taking this issue into the usual modernization and security culture Rust (in my opinion) already has, and making the internet transition something people stay aware of.
Some in the github issue discussion already disagreed with this, and I fear there will be quite a lot of pushback here too given the general aversion to the topic (at least in my eyes, and I see a lot of it because I am quite passionate about v6), but I think it's worth discussing and hearing some points about.
I agree with the people opposing your proposed changes to the docs in the issue you linked. IPv6 is now almost 30 years old. Adoption won't suddenly increase due to some Rust docs using [::1] instead of 127.0.0.1. Plus, young developers who still learn networking with IPv4 at school / uni, probably, might get unnecessarily confused. It's not worth it IMO.
i don't think anyone expects the doc change to have a huge impact, but the fact that it isn't a big deal doesn't mean we shouldn't use the better default
that would be a problem with the course, not rust. if there is a networking course that doesn't teach ipv6, the curriculum should have gone in the trash 10 years ago.
no one is talking about removing ipv4 or even making it harder to use in any way.
having documentation for both certainly is fine.
but ipv6 must be the default if there has to be one
edit : i would add that having both side by side in some example might in fact be helpful to indicate the similarity to users which are only familiar with one
This is most of the reason why I even started this topic. I'm sometimes a bit baffled how every programming community, programming example, network equipment etc. does not at least to this.
Feels like after almost 30 years after coming up with the standard that could be the bare minimum.
I don't think anyone wants to make things harder for the sake of the transition, that's why we haven't completed it after all, but at least going v6 first should be "normal", and I don't think that's too much to ask for by anyone who cares about the topic.
And I don't want to argue that it makes a large difference, I just think it's the right default, and considering good defaults is something this community objectively cares about, I think this could be one of them
Note that there's a significant asymmetry here. If your software supports IPv4, that's all it supports. If your software supports IPv6, then in many cases[1], you get IPv4 support "for free" via IPv4-mapped IPv6 addresses.
Thus, unless you genuinely care about whether traffic is IPv4 or IPv6 (e.g. because you serialize addresses into a protocol), you're best off using IPv6 sockets, and supporting IPv4 by not disabling support for IPv4-mapped IPv6 addresses.
If you set the IPV6_V6ONLY flag (e.g. via socket2's set_v6_only), then you only get IPv6 on an IPv6 socket, not IPv4 and IPv6. ↩︎
+1 vote on "against the grain" feeling of proposed change. imho the IPv6 default would be worse choice, due to overload of training materials, devices, examples etc. all over internet that view IPv4 as "the thing", and v6 as modern, more complicated extension...
Yep, but we still have so many IPv4 networks all over the world. Those, who do not speak IPv4, might have hard times trying to figure out how things work.
I am for IPv6: it has static size header, better multicast support, and of course NAT is a crime!
But I have a VPS on a small hosting provider, and they only gave me IPv4 and their (very limited) UI for DNS doesn't have "AAAA" record. And I am not alone here.
Others have said this in different ways by now, but to put it as directly as possible, the 30yrs of inadoption you keep mentioning, has been overwhelmingly bottlenecked by hardwares beyond developers' control.
For IPv6 to be adopted en masse, it has to be offered at no extra charge, because non-techies of the world, who have nothing to gain from it, will not pay a dime for it.
Meanwhile, the minority of people who stand to benefit from IPv6 doesn't have much leverage toward their ISPs, as those are even more dependent of having some internet right now.
There was a time when Minecraft was the next big thing, and I was secretly hoping it and gaming at large would drive IPv6 ahead. That didn't work; I suppose parents of the world did not understand how much pain NAT is.
For what it's worth, I don't disagree with your reasons for the lack of adoption either, they're true, but hardware isn't required for what i'm talking about here!
One problem is that attitudes toward IPv4 and IPv6 vary greatly from region to region:
There are regions where IPv6 has been the standard for many years and IPv4 is seen as an annoying relic of the past, and there are regions where people still view IPv6 as a technology of the future that will eventually become a reality.
It does mean that our choices are between documentation, examples, etc. that works for everyone vs. that works only for some people. If there's a good way to present both v4 and v6 without causing TL;DR, great, and by all means do it. But wherever we have to pick just one, we're likely to be choosing IPv4, because whenever different people have to do different things, there's a teaching/learning nightmare, as informations become exponentially more complicated to organize and we keep reading/pointing at the wrong thing. To some extent this is unavoidable when working close to the metal, but still, we'd like to keep as much stuff shared as possible.