If an application gets back both an IPv4 and IPv6 address from DNS, which one should the application use to connect? This dilemma for a “dual-stack” host is one that Dan Wing and Andrew Yourtchenko addressed in RFC 6555, “Happy Eyeballs: Success with Dual-Stack Hosts“ that can be found at:
At a high level, the premise is quite simple: open up a connection over BOTH IPv4 and IPv6 and use whichever one is fastest.
The idea being that the user will experience the best possible speed and will therefore have “happy eyeballs” if they are using something like a web browser where visual content is being viewed. RFC 6555 offers a number of suggestions and offers ideas for application developers to consider.
A variation of “happy eyeballs” is now implemented in most major web browsers, but the idea is not just for web browsers. Basically any application operating on a dual stack computer can use this idea to make the user experience as fast as possible.
The first thing to understand is the change from IPv4 to IPv6 in using POSIX getaddrinfo() as opposed to gethostbyname(). The POSIX function call gethostbyname() was replaced by getaddrinfo() when IPv6 came along. Daniel Stenberg has written a good explanation of this change and why it matters. Here is a good introduction to programming with getaddrinfo().
Certain operating systems have also made some changes under the hood to these POSIX calls, and how they implement DNS resolution. A good place to start reading is this RIPE-NCC document, entitled “Hampering Eyeballs – Observations on Two “Happy Eyeballs” Implementations”.
If you would like to get started with IPv6, please visit our IPv6 resources or begin with our “Start Here” page to help find resources most appropriate for your type of organization. If you have an IPv6 case study you think we should consider for inclusion on our site, please contact us – we are always looking for more!