News

Testing Happy Eyeballs with your dual stack application

 

 “I spent last week in Phoenix, Arizona. My eyeballs are very happy – one week of blue skies and a lot of good network labs in my SIP training class. In the beginning of the week I had a discussion about Happy Eyeballs”. An extract of a blogger writing when it comes to test happy eyeballs issue. The article that has been posted on discover Ipv6 of the site IPv6friday.

The writer had a discussion about Happy Eyeballs – the way modern web browsers running in dual stack connects to the web server without bad affects on the user experience. The problem was solved – this affects all application protocols – from SIP to Email, chat and applications. Let’s discuss Happy Eyeballs and how to test it!

Happy Eyeballs – a quick introduction.

When both a client and a server runs dual IP stacks, both IPv4 and IPv6, the client needs to find the best possible – and working – connection between the two computers. In the early days of IPv6, client computers set up automatically configured tunnels of various types, that usually was blocked in the firewall. The client tried with IPv6 first. After failure, some clients failed and some retried with IPv4. The big problem was that the failure took time – between 15 and 30 seconds, depending on the protocol used. The user actually had a working connection path – over IPv4 – but running dual stacks caused delays and broken connection attempts. In total, not a good solution..
The Happy Eyeballs RFC from IETF suggests a change in procedure. The client now sets up connections over all possible network paths at the same time. The connection that succeeds first is the one used. No priority over any specific type of IP protocol, just get connectedant make the user happy.


Making all protocols happier – testing, testing, testing.

While this is was initially applied to HTTP, it affects all applications. We’re going to take a look at wget and curl in this example, to show you the problem and how you can set up a test.

Start with setting up records in DNS.

A requirement for testing happy eyeballs are that both client and server are dual stack. You need to set up one DNS name with two address, one for each family. The writer has set up two DNS names - badipv6.test.ipv6friday.org and badipv4.test.ipv6friday.org.

So what’s the trick with these? Well, the IPv6 address for the badipv6 entry is a documentation address, not routable anywhere. It simply does not work. The IPv4 address is the address for this site. For badipv4, the IPv6 address is the address for this site. The IPv4 address however, is an RFC1918 private IPv4 address, again an address that is  not routable on the Internet. A perfect setup for Happy Eyeballs!

Testing with wget.

The rule used to be that dual stack clients should try IPv6 first. In this case, an HTTP client that has no support for Happy Eyeballs will fail. Let’s test with wget, a popular Linux/Unix command line tool to fetch files with HTTP. Wget clearly has a happy eyeballs problem. You do not see the time it took for it to time out on the IPv6 address before it failed over to IPv4. Running wget to badipv4 was no fun, sincewget starts with IPv6 and succeeds directly. Let’s try another similar tool, curl  v7.24 by Daniel Stenberg. Curl still has the issue. It tries IPv6 and waits forever, then times out and fails over to IPv4.

The good thing coming out of this test is that while both clients show the issue, both of them actually fail over to IPv4. Curl is also a library, used in many applications. For example, in Asterisk, CURL is frequently used indial plan processing. A timeout on over ten seconds is not acceptable while setting up a call.

Test your own applications.

The same problem applies to all TCP based protocols (and possibly UDP too). With a DNS setup like the previous one, you can run your own tests. Do not forget to report back and tell others about your findings. Your favorite SSH client is affected, your FTP client as well as your e-mail software. The web browsers have worked with this issue for a long time, and have shared their implementation experience. How we can proceed in fixing this – where are you going to start? Happy eyeballs could be the answer in this case.

Have a great IPv6 week!

 Theo IPv6friday.