New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 223876 link

Starred by 5 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Jul 2013
Components:
EstimatedDays: ----
NextAction: ----
OS: All , Chrome
Pri: 2
Type: Bug

Blocking:
issue 132128



Sign in to add a comment

Built-in async DNS resolver needs a reliable equivalent to AI_ADDRCONFIG

Project Member Reported by szym@chromium.org, Mar 26 2013

Issue description

AI_ADDRCONFIG tells getaddrinfo to check the hosts interfaces to determine if it should fetch A and/or AAAA records when asked for AF_UNSPEC family.

Currently, the built-in DNS client depends on the results of the IPv6 support detection probe for that. The probe is executed on presumed network changes and the results are cached. For this to work, we must not miss any network changes. (See  Issue 132128 )

In contrast, glibc/bionic implementations of getaddrinfo execute the probe for global IPv6 addresses at the moment of the getaddrinfo call, so are more robust, albeit expensive.

In particular, glibc calls getifaddrs and looks for a global IPv6 address, similarly to our probe, but bionic executes connect(<a-hard-coded-global-IPv6-address>, UDP) and if it succeeds, checks getsockname for global IPv6 address.

The latter is an interesting alternative to getifaddrs as it should be rather quick.

 

Comment 2 by szym@chromium.org, Mar 26 2013

Labels: OS-Chrome
Tagging OS-Chrome as it is particularly relevant since the built-in resolver is enabled on stable.

Comment 3 by szym@chromium.org, Apr 8 2013

Owner: szym@chromium.org
Status: Started

Comment 4 by szym@chromium.org, Apr 9 2013

I started work on this: https://codereview.chromium.org/13812002/
As expected, in my tests the connect+UDP check takes immeasurable time.

The question is: does it ever give false positives/negatives.

I'm assuming you mean immeasurably small, as opposed to immeasurably large.

Comment 6 by szym@chromium.org, Apr 9 2013

Naturally.
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 10 2013

------------------------------------------------------------------------
r193421 | szym@chromium.org | 2013-04-10T18:10:51.052580Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/dns/host_resolver_impl.cc?r1=193421&r2=193420&pathrev=193421

[net/dns] Test IPv6 support via UDP connect (measurement)

Network interface enumeration is expensive and requires absolutely no false negatives
in network change detection. In contrast bionic (Android libc) connects a UDP socket
to an IPv6 address which confirms that the kernel can route to such address.

This CL adds the UDP connect test to measure its performance compared to the probe.

BUG= 223876 


Review URL: https://chromiumcodereview.appspot.com/13812002
------------------------------------------------------------------------
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 12 2013

------------------------------------------------------------------------
r194023 | szym@chromium.org | 2013-04-12T21:58:18.618467Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/dns/host_resolver_impl.cc?r1=194023&r2=194022&pathrev=194023

[net/dns] When testing for IPv6, discard link local and Teredo addresses (measurement)

BUG= 223876 

Review URL: https://chromiumcodereview.appspot.com/14234006
------------------------------------------------------------------------

Comment 9 by szym@chromium.org, Apr 15 2013

Results from yesterday UMA:

Windows:
Duration 98.3% < 2ms
FailureMatch FALSE: 4.6% TRUE:95.4%  (when udp-connect failed, did it match the probe result?)
SuccessMatch FALSE: 9.5% TRUE:90.5%  (when udp-connect succeeded, did it match the probe result?)

In other words, switching to the udp-connect method will disable IPv6 in ~5% more cases, and enable IPv6 in ~10% more cases than the on-change-probe.

Macintosh:
Duration 99.96% < 2ms
FailureMatch FALSE:16.7% TRUE:83.3%
SuccessMatch FALSE: 0.2% TRUE:99.8%

In this case, switching to the udp-connect method will disable IPv6 in ~17% more cases.

At this point I am considering switching canary entirely to udp-connect method.

Comment 10 by szym@chromium.org, Apr 18 2013

Here are results from last couple days on ChromeOS:
Duration 99.8% < 2ms
FailureMatch FALSE: 1.1% TRUE:98.9%
SuccessMatch FALSE:45.8% TRUE:54.2%

In this case, switching to the udp-connect method will enable IPv6 in 45% more cases!

It's also worth noting what fraction of resolutions had seen udp-connect success:
Windows:   12%
Macintosh:  9%
ChromeOS:  19%
However, bear in mind that this is from Canary which is not representative of the general population.


 

Comment 11 by lorenzo@google.com, Apr 19 2013

Do we have an idea why switching to UDP connect on Mac would disable IPv6 17% of the time compared to the current probe?

It's possible that the mismatch is due to the probe not re-running after a global IPv6 address expired and thus incorrectly thinking that the machine has an IPv6 address when in fact it does not. Or it's possible that the machine has a global IPv6 address, but no route to 2001:4860:4860::8888 (e.g., no default route). But both of these situations are quite unlikely - I certainly wouldn't expect them to happen 17% of the time (except maybe if the canary userbase was very substantially influenced by Googlers). Do we have any breakdowns of the 17% number, perhaps by OS version?

Also, to make sure I'm reading this correctly - does the number mean: "of all the cases when the UDP connect probe indicated no IPv6 support, 17% of the time the most recent probe had found a global IPv6 address on one of the interfaces"? When is the UDP connect probe run? On every call to getaddrinfo? Or on every hostname lookup, cached or not?

Comment 12 by szym@chromium.org, Apr 19 2013

The probe is run on every hostname lookup. (This part will likely change if
we end up keeping the probe.)
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 21 2013

------------------------------------------------------------------------
r195406 | szym@chromium.org | 2013-04-21T01:26:16.230162Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/dns/host_resolver_impl.cc?r1=195406&r2=195405&pathrev=195406

[net/dns] Test IPv6 support via UDP connect

After this CL, the effective address family will be determined by
the UDP connect test rather than the last interface enumeration probe.

BUG= 223876 

Review URL: https://codereview.chromium.org/14161008
------------------------------------------------------------------------

Comment 14 by lorenzo@google.com, Apr 22 2013

Alternative explanation for the 17% number on Macs: if the system is running Back To My Mac it would get a ULA address, but not an IPv6 default route. The the system would have a "global" address (actually a ULA, not a global unicast address), which would pass the IPv6 probe, but the UDP connect would fail.

In any case, I think the new UDP connect code is correct.

Any reason why you don't want to run it on every DNS lookup? RFC 3484/6724 sorting requires that we determine the source IP address for every destination address we get back from the resolver, which requires one UDP connect() for every destination address.

Perhaps run the probe only when querying a DNS server and not when looking up from cache and hosts? After all, talking to a DNS server is going to be way more work than a plain UDP connect(), even if the DNS server is on localhost.

Comment 15 by szym@chromium.org, Apr 23 2013

It will still be run on every lookup, but the way the outcome of the check affects the actual work will change.

Right now, the check is performed when a request arrives at the HostResolver, where it is aggregated with other requests for the same hostname. Afterwards, that decision remains fixed, while the requests wait for their turn in the queue, while the DNS query is made, and even after the DNS response arrives.

I plan to change this part so that the check is performed right before the DNS query is sent.

Comment 16 by szym@chromium.org, Apr 29 2013

Blocking: chromium:132128

Comment 17 by szym@chromium.org, Jul 15 2013

Status: Fixed
The changes mentioned in #15 will be tracked by  Issue 260348 .
Project Member

Comment 18 by bugdroid1@chromium.org, Jul 22 2013

Labels: merge-merged-1500_68
------------------------------------------------------------------------
r212983 | szym@chromium.org | 2013-07-22T22:01:55.242185Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1500_68/src/net/dns/host_resolver_impl.cc?r1=212983&r2=212982&pathrev=212983

Revert 195406 "[net/dns] Test IPv6 support via UDP connect"

Breaks DirectAccess on win.

BUG= 259792 

> [net/dns] Test IPv6 support via UDP connect
> 
> After this CL, the effective address family will be determined by
> the UDP connect test rather than the last interface enumeration probe.
> 
> BUG= 223876 
> 
> Review URL: https://codereview.chromium.org/14161008

TBR=szym@chromium.org

Review URL: https://codereview.chromium.org/20004002
------------------------------------------------------------------------
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 23 2013

Labels: merge-merged-1547
------------------------------------------------------------------------
r213247 | szym@chromium.org | 2013-07-23T22:08:14.644249Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1547/src/net/dns/host_resolver_impl.cc?r1=213247&r2=213246&pathrev=213247

Revert 195406 "[net/dns] Test IPv6 support via UDP connect"

Breaks DirectAccess on win.

BUG= 259792 

> [net/dns] Test IPv6 support via UDP connect
> 
> After this CL, the effective address family will be determined by
> the UDP connect test rather than the last interface enumeration probe.
> 
> BUG= 223876 
> 
> Review URL: https://codereview.chromium.org/14161008

TBR=szym@chromium.org

Review URL: https://codereview.chromium.org/20060003
------------------------------------------------------------------------

Comment 20 by krisr@chromium.org, Aug 14 2013

Status: Verified
Project Member

Comment 21 by bugdroid1@chromium.org, Sep 23 2013

Labels: merge-merged-1599
------------------------------------------------------------------------
r224617 | szym@chromium.org | 2013-09-22T02:01:09.807166Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1599/src/net/dns/host_resolver_impl.cc?r1=224617&r2=224616&pathrev=224617

Revert 195406 "[net/dns] Test IPv6 support via UDP connect"

Breaks DirectAccess on win. Fixed in 223595.

BUG= 259792 

> [net/dns] Test IPv6 support via UDP connect
> 
> After this CL, the effective address family will be determined by
> the UDP connect test rather than the last interface enumeration probe.
> 
> BUG= 223876 
> 
> Review URL: https://codereview.chromium.org/14161008

TBR=szym@chromium.org

Review URL: https://codereview.chromium.org/23478045
------------------------------------------------------------------------
Project Member

Comment 22 by bugdroid1@chromium.org, Sep 23 2013

------------------------------------------------------------------------
r224663 | laforge@chromium.org | 2013-09-23T04:44:35.793660Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1599/src/net/dns/host_resolver_impl.cc?r1=224663&r2=224662&pathrev=224663

Revert 224617 "Revert 195406 "[net/dns] Test IPv6 support via UD..."

> Revert 195406 "[net/dns] Test IPv6 support via UDP connect"
> 
> Breaks DirectAccess on win. Fixed in 223595.
> 
> BUG= 259792 
> 
> > [net/dns] Test IPv6 support via UDP connect
> > 
> > After this CL, the effective address family will be determined by
> > the UDP connect test rather than the last interface enumeration probe.
> > 
> > BUG= 223876 
> > 
> > Review URL: https://codereview.chromium.org/14161008
> 
> TBR=szym@chromium.org
> 
> Review URL: https://codereview.chromium.org/23478045

TBR=szym@chromium.org

Review URL: https://codereview.chromium.org/24350003
------------------------------------------------------------------------
Project Member

Comment 23 by bugdroid1@chromium.org, Sep 23 2013

------------------------------------------------------------------------
r224681 | szym@chromium.org | 2013-09-23T06:15:12.913348Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1599/src/net/dns/host_resolver_impl.cc?r1=224681&r2=224680&pathrev=224681

Revert 195406 "[net/dns] Test IPv6 support via UDP connect"

Breaks DirectAccess on win.

Second attempt at revert.

> [net/dns] Test IPv6 support via UDP connect
> 
> After this CL, the effective address family will be determined by
> the UDP connect test rather than the last interface enumeration probe.
> 
> BUG= 223876 
> 
> Review URL: https://codereview.chromium.org/14161008

TBR=szym@chromium.org
BUG= 259792 

Review URL: https://codereview.chromium.org/23517010
------------------------------------------------------------------------
Project Member

Comment 24 by bugdroid1@chromium.org, Sep 23 2013

------------------------------------------------------------------------
r224748 | karen@chromium.org | 2013-09-23T18:02:09.653539Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1599/src/net/dns/host_resolver_impl.cc?r1=224748&r2=224747&pathrev=224748

Revert 224681 "Revert 195406 "[net/dns] Test IPv6 support via UD..."

> Revert 195406 "[net/dns] Test IPv6 support via UDP connect"
> 
> Breaks DirectAccess on win.
> 
> Second attempt at revert.
> 
> > [net/dns] Test IPv6 support via UDP connect
> > 
> > After this CL, the effective address family will be determined by
> > the UDP connect test rather than the last interface enumeration probe.
> > 
> > BUG= 223876 
> > 
> > Review URL: https://codereview.chromium.org/14161008
> 
> TBR=szym@chromium.org
> BUG= 259792 
> 
> Review URL: https://codereview.chromium.org/23517010

TBR=szym@chromium.org

Review URL: https://codereview.chromium.org/23785015
------------------------------------------------------------------------
Project Member

Comment 25 by bugdroid1@chromium.org, Sep 23 2013

------------------------------------------------------------------------
r224786 | szym@chromium.org | 2013-09-23T20:46:11.001050Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/branches/1599/src/net/dns/host_resolver_impl.cc?r1=224786&r2=224785&pathrev=224786

Revert 195406 "[net/dns] Test IPv6 support via UDP connect"

Breaks DirectAccess on win.

Third attempt at revert.

> [net/dns] Test IPv6 support via UDP connect
> 
> After this CL, the effective address family will be determined by
> the UDP connect test rather than the last interface enumeration probe.
> 
> BUG= 223876 
> 
> Review URL: https://codereview.chromium.org/14161008

TBR=szym@chromium.org
BUG= 259792 

Review URL: https://codereview.chromium.org/24365006
------------------------------------------------------------------------

Sign in to add a comment