Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hojx

macrumors 6502
Original poster
Jan 18, 2014
275
144
Singapore
Apple enhances IPv6 implementation in OS X El Capitan and iOS 9 DB3 and PB1

https://www.ietf.org/mail-archive/web/v6ops/current/msg22455.html said:
Hi everyone,

Today Apple released the first public seeds of iOS 9 and OS X El Capitan.
These seeds (and the third developer seeds released yesterday) include an improved version of Happy Eyeballs.

Based on our testing, this makes our Happy Eyeballs implementation go from roughly 50/50 IPv4/IPv6 in iOS 8 and Yosemite
to ~99% IPv6 in iOS 9 and El Capitan betas.

While our previous implementation from four years ago was designed to select the connection with lowest latency
no matter what, we agree that the Internet has changed since then and reports indicate that biasing towards IPv6 is now
beneficial for our customers: IPv6 is now mainstream instead of being an exception, there are less broken IPv6 tunnels,
IPv4 carrier-grade NATs are increasing in numbers, and throughput may even be better on average over IPv6.

The updated implementation performs the following:
- Query the DNS resolver for A and AAAA.
If the DNS records are not in the cache, the requests are sent back to back on the wire, AAAA first.
- If the first reply we get is AAAA, we send out the v6 SYN immediately
- If the first reply we get is A and we're expecting a AAAA, we start a 25ms timer
- If the timer fires, we send out the v4 SYN
- If we get the AAAA during that 25ms window, we move on to address selection
- When we have a list of IP addresses (either from the DNS cache or by receiving them close together with v4 before v6),
we perform our own address selection algorithm to sort them. This algorithm uses historical RTT data to prefer addresses
that have lower latency - but has a 25ms leeway: if the historical RTT of two compared address are within 25ms of each
other, we use RFC3484 to pick the best one.
- Once the list is sorted, we send out the SYN for the first address and start timers based on average and variance of the
historical TCP RTT. Roughly speaking, we start the second address around the same time we send out a SYN retransmission
for the first address.
- The first address to reply with a SYN-ACK wins the race, we then cancel the other TCP connection attempts.

If this behavior proves successful during the beta period, you should expect more IPv6 traffic from Apple products in the future.
Note however that this only describes the current beta and all these details are subject to change.

Please test this out if you have the means to, we'd love to see test results and receive feedback!

I would like to personally thank Jason Fesler and Paul Saab for their help investigating these issues and testing this.

Thanks,
David Schinazi
CoreOS Networking Engineer
 

MikhailT

macrumors 601
Nov 12, 2007
4,582
1,325
They did a lot of more than that, they've also implemented support for ECN and so on in the network stack to reduce bufferbloat. You can find more information in their WWDC session on "Your Apps and the next-gen Networks", really awesome session.

Hopefully, in the next few years, more ISP will turn on markers in their networks, Apple will release firmware updates to enable ECN and so on. This will mean better latency for everyone, which is currently the biggest problem in networking, not the speed.
 

tmiw

macrumors 68030
Jun 26, 2007
2,524
605
San Diego, CA
test-ipv6.com still seems to be occasionally giving me the "browser is preferring IPv4" warning with Safari on DP3. Sounds like it could very well be a DNS thing but I wouldn't think there would be a >25ms variance between receiving the A and AAAA records if the requests were both going to the same place.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.