This Bridge is the Root

View Original

How RFC 8503 is making IPv6 a little happier

Early in the life of IPv6 deployments, a problem started cropping up that put a damper on the deployment of dual-stack IPv6 deployments. That problem was that if a machine had both a v4 and v6 address, which should it prefer and how long should it wait for a connection on one protocol before moving on and trying the other. The early answer and one that frustrated many early adopters was to prefer IPv6 and the timeout was frustratingly long (over 10 seconds in some cases).

Unfortunately, to solve this problem, many people in the early days of IPv6 deployments decided to disable the IPv6 stack on their machines as a work around instead of actually fixing the issues.

Happily though, RFC 8503 "Happy Eyeballs" was written to fix this issue and help endpoints quickly connect to both IPv4 and IPv6 resources. Happy Eyeballs is also referred to as Fast Fallback.

  1. The algorithm starts out with an endpoint making a DNS request for both an A record and a AAAA record simultaneously.

    1. If the client receives only a AAAA record back it moves onto step 2.1.

    2. If the client receives only an A record back, it waits a preconfigured amount of time (between 50 and 300ms) for a AAAA record to arrive before moving onto step 2.2.

    3. If the client receives both an A record and AAAA record in the allotted time, it moves onto step 2.3.

  2. The client attempts to make a connection to the service

    1. The client will then attempt to make a connection to the IPv6 address that it received from DNS.

    2. The client will attempt to establish an IPv4 connection. If, before the IPv4 connection can be established, it then receives a AAAA response, it will then attempt to establish an IPv6 connection. As soon as one connection is established, all others are canceled.

    3. The client will attempt to make an IPv6 connection, waiting a predetermined amount of time based on either the implementation or historical RTT data before attempting to establish an IPv4 connection. As soon as a connection is established, all other attempts are canceled.

Not only can Happy Eyeballs help prevent waiting for a long timeout to expire on every connection in the case that there are broken or no DNS records for a host but it can also help keep a network functioning in the event of a partial network failure with either IPv4 or IPv6.

It should also be noted that if you haven't deployed IPv6 to your publicly facing websites yet, you might be unintentionally slowing down a portion of your users and in todays internet, milliseconds can feel like an eternity to some users.