Can HTTP be configured to prefer IPv4 over IPv6?

2,364 views
Skip to first unread message

Adam Rice

unread,
May 18, 2017, 9:28:41 PM5/18/17
to net-dev
Issue 721119 says that Windows has a setting to prefer IPv4 over IPv6 and HTTP(S) connections in Chrome will respect that setting.

My understanding is that HTTP(S) connections always use Happy Eyeballs regardless of any OS setting, but I want to double-check.

Matt Menke

unread,
May 18, 2017, 11:07:53 PM5/18/17
to Adam Rice, net-dev
We use a probe to determine if you have remote IPv6 connectivity.  If not, we just use IPv4.

On Thu, May 18, 2017 at 9:28 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Issue 721119 says that Windows has a setting to prefer IPv4 over IPv6 and HTTP(S) connections in Chrome will respect that setting.

My understanding is that HTTP(S) connections always use Happy Eyeballs regardless of any OS setting, but I want to double-check.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.
To post to this group, send email to net...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/CAHixhFoHumwJ04ZP7iA_t8rcgQ9_qgDiTBqXEOkt3QSxTHA2aA%40mail.gmail.com.

Adam Rice

unread,
May 18, 2017, 11:18:59 PM5/18/17
to Matt Menke, net-dev
Thanks for the response. That aligns with my understanding.

I assume the probe you're referring to is HostResolverImpl::IsIPv6Reachable? In that case WebSockets also use the same code path. I think the issue is when IPv6 connectivity is available, but the user prefers to use IPv4 when possible.

Can net::AddressSorter put IPv4 addresses first? Will Happy Eyeballs be disabled if that happens?

Matt Menke

unread,
May 18, 2017, 11:25:00 PM5/18/17
to Adam Rice, net-dev
On Thu, May 18, 2017 at 11:18 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Thanks for the response. That aligns with my understanding.

I assume the probe you're referring to is HostResolverImpl::IsIPv6Reachable? In that case WebSockets also use the same code path. I think the issue is when IPv6 connectivity is available, but the user prefers to use IPv4 when possible.

Correct, that's where the probe is done.
 
Can net::AddressSorter put IPv4 addresses first? Will Happy Eyeballs be disabled if that happens?

I don't think there's any case where it puts IPv4 addresses first (Well, it follows RFC 3484 - there may be some cases where IPv4 are given priority, if all IPv6 addresses are in certain regions, I honestly can't remember, but seems unlikely to be the issue here).

Note that we only use AddressSorter on platforms where we use the built-in stub resovler.  If we're using GetAddrInfo, we just use the OS's order.  Happy Eyeballs, though, may do its own ordering?  I can't remember - we race two connections, one with the addresses in the default order (Where IPv6 is first, not sure if we sort them that way, or just assume that's the case), and another with the order reversed, and the latter is started 200 milliseconds later, I believe.
 

On 19 May 2017 at 12:07, Matt Menke <mme...@chromium.org> wrote:
We use a probe to determine if you have remote IPv6 connectivity.  If not, we just use IPv4.

On Thu, May 18, 2017 at 9:28 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Issue 721119 says that Windows has a setting to prefer IPv4 over IPv6 and HTTP(S) connections in Chrome will respect that setting.

My understanding is that HTTP(S) connections always use Happy Eyeballs regardless of any OS setting, but I want to double-check.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.
To post to this group, send email to net...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/CAHixhFoHumwJ04ZP7iA_t8rcgQ9_qgDiTBqXEOkt3QSxTHA2aA%40mail.gmail.com.


--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.
To post to this group, send email to net...@chromium.org.

Chris Bentzel

unread,
May 19, 2017, 8:20:27 AM5/19/17
to Matt Menke, Adam Rice, net-dev
We've also seen some cases on some Android devices to implement "sad eyeballs": https://bugs.chromium.org/p/chromium/issues/detail?id=697568

On Thu, May 18, 2017 at 11:25 PM Matt Menke <mme...@chromium.org> wrote:
On Thu, May 18, 2017 at 11:18 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Thanks for the response. That aligns with my understanding.

I assume the probe you're referring to is HostResolverImpl::IsIPv6Reachable? In that case WebSockets also use the same code path. I think the issue is when IPv6 connectivity is available, but the user prefers to use IPv4 when possible.

Correct, that's where the probe is done.
 
Can net::AddressSorter put IPv4 addresses first? Will Happy Eyeballs be disabled if that happens?

I don't think there's any case where it puts IPv4 addresses first (Well, it follows RFC 3484 - there may be some cases where IPv4 are given priority, if all IPv6 addresses are in certain regions, I honestly can't remember, but seems unlikely to be the issue here).

Note that we only use AddressSorter on platforms where we use the built-in stub resovler.  If we're using GetAddrInfo, we just use the OS's order.  Happy Eyeballs, though, may do its own ordering?  I can't remember - we race two connections, one with the addresses in the default order (Where IPv6 is first, not sure if we sort them that way, or just assume that's the case), and another with the order reversed, and the latter is started 200 milliseconds later, I believe.
On 19 May 2017 at 12:07, Matt Menke <mme...@chromium.org> wrote:
We use a probe to determine if you have remote IPv6 connectivity.  If not, we just use IPv4.
On Thu, May 18, 2017 at 9:28 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Issue 721119 says that Windows has a setting to prefer IPv4 over IPv6 and HTTP(S) connections in Chrome will respect that setting.

My understanding is that HTTP(S) connections always use Happy Eyeballs regardless of any OS setting, but I want to double-check.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.

To post to this group, send email to net...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.

To post to this group, send email to net...@chromium.org.

Miriam Gershenson

unread,
May 19, 2017, 10:30:28 AM5/19/17
to Chris Bentzel, Matt Menke, Adam Rice, net-dev
Happy eyeballs is only used if the first address in the list is IPv6. If we get a list from getaddrinfo that has IPv4 before IPv6, we'll just try the IPv4 address first.

On Fri, May 19, 2017 at 8:20 AM, Chris Bentzel <cben...@chromium.org> wrote:
We've also seen some cases on some Android devices to implement "sad eyeballs": https://bugs.chromium.org/p/chromium/issues/detail?id=697568
On Thu, May 18, 2017 at 11:25 PM Matt Menke <mme...@chromium.org> wrote:
On Thu, May 18, 2017 at 11:18 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Thanks for the response. That aligns with my understanding.

I assume the probe you're referring to is HostResolverImpl::IsIPv6Reachable? In that case WebSockets also use the same code path. I think the issue is when IPv6 connectivity is available, but the user prefers to use IPv4 when possible.

Correct, that's where the probe is done.
 
Can net::AddressSorter put IPv4 addresses first? Will Happy Eyeballs be disabled if that happens?

I don't think there's any case where it puts IPv4 addresses first (Well, it follows RFC 3484 - there may be some cases where IPv4 are given priority, if all IPv6 addresses are in certain regions, I honestly can't remember, but seems unlikely to be the issue here).

Note that we only use AddressSorter on platforms where we use the built-in stub resovler.  If we're using GetAddrInfo, we just use the OS's order.  Happy Eyeballs, though, may do its own ordering?  I can't remember - we race two connections, one with the addresses in the default order (Where IPv6 is first, not sure if we sort them that way, or just assume that's the case), and another with the order reversed, and the latter is started 200 milliseconds later, I believe.
On 19 May 2017 at 12:07, Matt Menke <mme...@chromium.org> wrote:
We use a probe to determine if you have remote IPv6 connectivity.  If not, we just use IPv4.
On Thu, May 18, 2017 at 9:28 PM, 'Adam Rice' via net-dev <net...@chromium.org> wrote:
Issue 721119 says that Windows has a setting to prefer IPv4 over IPv6 and HTTP(S) connections in Chrome will respect that setting.

My understanding is that HTTP(S) connections always use Happy Eyeballs regardless of any OS setting, but I want to double-check.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.

To post to this group, send email to net...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+unsubscribe@chromium.org.

To post to this group, send email to net...@chromium.org.
Reply all
Reply to author
Forward
0 new messages