Clarification on Apple Prioritizing IPv6 over IP4

I’m seeking clarification on why iOS prioritizes IPv6 when both IPv4 and IPv6 are available. Does iOS always default to using IPv6 in such scenarios? Is this happening by design as Apple developer docs never explicitly state the prioritization rules. This might explain us why the issue doesn’t occur as frequently in IPv4-only environments

Answered by DTS Engineer in 808352022
Does iOS always default to using IPv6 in such scenarios?

No. If you use our recommended APIs, like URLSession and Network framework, you benefit from our connect-by-name infrastructure, which uses the latest Happy Eyeballs algorithm. That races connections to all the addresses to see which one is fastest. TN3151 Choosing the right networking API has more background to this, including a link to the RFC.

If you use BSD Sockets then it’s up to you to do this yourself.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Does iOS always default to using IPv6 in such scenarios?

No. If you use our recommended APIs, like URLSession and Network framework, you benefit from our connect-by-name infrastructure, which uses the latest Happy Eyeballs algorithm. That races connections to all the addresses to see which one is fastest. TN3151 Choosing the right networking API has more background to this, including a link to the RFC.

If you use BSD Sockets then it’s up to you to do this yourself.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Clarification on Apple Prioritizing IPv6 over IP4
 
 
Q