Post by Doug BartonI'm trying to help advise someone working on an open source project
who would like to know a reliable way to determine if a client system
has a valid IPv6 connection (not necessarily by asking the OS, which
as we all know may lie). Essentially a happy eyeballs lite. Can anyone
recommend a good reference for that? The project runs on Linux, BSD,
OS X, and Windows, but even a general reference that discusses the
concepts would be a good start.
I suspect this isn't really about IPv6, and the same issue would arise
in systems where all real work was done over v6 and v4 in theory should
work but sometimes doesn't.
"valid IPv6 connection" is a complicated notion. I think what is really
meant is "if I send IPv6 packets to some arbitrary public address that
is in good working order, will it work", which is about not just my
local behavior but about routing. Plus, it has the difficulty of
presuming the other end is in good shape. It's only when the world is
99% working that one can talk about a node working or not working.
Otherwise there's a more complicated notion of what fraction of the
other nodes can be reached.
Another problem is that ping results do not always predict the use of
other ports/protocols in the presence of firewalls. I have specifically
seen the mac happy eyeballs code choose IPv4 for ssh (ping was slightly
faster on v4 than v6) but lose because v4 and not v6 was firewalled.
Definitely something to avoid is sending a probe to some well-known
place, as your program then has a phones-home bug.
I think what's needed is a library to scoreboard results from trying to
connect to various places (that the user of the program has asked to
connect to, otherwise it's a privacy leak) over various protocols, that
can then suggest which to try first. So it really is the happy eyeballs
approach.
It would probably help if you explain the reason the OP is asking.