mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] TCP support in the stub resolver
Date: Mon, 20 Apr 2020 08:26:45 +0200	[thread overview]
Message-ID: <87a736y8nu.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20200420012441.GW11469@brightrain.aerifal.cx> (Rich Felker's message of "Sun, 19 Apr 2020 21:24:41 -0400")

* Rich Felker:

> On Sun, Apr 19, 2020 at 10:12:56AM +0200, Florian Weimer wrote:
>> * Rich Felker:
>> 
>> >> No, you can reuse the connection for the second query (in most cases).
>> >> However, for maximum robustness, you should not send the second query
>> >> until the first response has arrived (no pipelining).  You may still
>> >> need a new connection for the second query if the TCP stream ends
>> >> without a response, though.
>> >
>> > That's why you need one per request -- so you can make them
>> > concurrently (can't assume pipelining).
>> 
>> Since the other query has likely already been cached in the recursive
>> resolver due to the UDP query (which is already in progress), the
>> second TCP query only saves one round-trip, I think.  Is that really
>> worth it?
>
> If the nameserver is not local, absolutely. A round trip can be over
> 500 ms.

Sure, but you have to put this into context. In this situation, you
already need three roundtrips (UDP query, TCP handshake, TCP query).
The other TCP handshake increases the packet count quite noticeably.

>> >> Then it might be possible that no one will notice the missing TCP
>> >> fallback.
>> >
>> > Really almost no one has noticed it so far, and the places where it
>> > was noticed were buggy (IIRC Google or Cloudflare) nameservers that
>> > were sending an empty response on truncation rather than a properly
>> > truncated response, which seems to have since been fixed. (And in this
>> > case the fallback would have been a major performance hit, so it was
>> > nice that it was caught and fixed instead).
>> 
>> SPF lookups for various domains return other TXT records, which push
>> the size of the response over the limit.  There is no way to fix this
>> on the recursive resolver side because the TXT RRset is itself larger
>> than 512 bytes.
>> 
>> TXT RRsets for DKIM can also approach, but i have not seen them cross
>> it.
>> 
>> This is just one application, receiving mail with some form of
>> authentcation, that requires TCP fallback.  I'm sure there other
>> applications.
>
> Yes. I don't claim there aren't potential cases where it's wanted,
> just that it hasn't come up aside from the buggy NS with empty TC
> response.

I don't quite understand why you keep claiming that.

For this TXT response, it's not a bug:

; <<>> DiG 9.11.5-P4-5.1-Debian <<>> +ignore +noedns ebay.com txt
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43378
;; flags: qr tc rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ebay.com.			IN	TXT

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr 20 07:57:10 CEST 2020
;; MSG SIZE  rcvd: 26

Lack of users reporting this could just mean that there are no users
running mail servers that use SPF authentication with musl.

> Anything related to mail is a case where you really really should be
> running a local DNSSEC-validating nameserver, which adds to the appeal
> of just doing TCP to begin with (activated by use-vc) or not at all.

Always using TCP for what is essentially a fringe case (but
unfortunately one that is needed for correctness) seems very wasteful.

With a local DNS server, EDNS with really large buffer size seems much
more attractive.  But for maximum compatibility, you will have to
rewrite the response to strip out the OPT record.

  reply	other threads:[~2020-04-20  6:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fce05ab0ed102dec10e4163dd4ce5d8095d2ffd7.camel@web.de>
     [not found] ` <20200412211807.GC41308@straasha.imrryr.org>
     [not found]   ` <d64b1b8801cc5350e9d27dd109dd2446e7d4b860.camel@web.de>
     [not found]     ` <20200413024746.GD41308@straasha.imrryr.org>
     [not found]       ` <b38668e94b2781003a14c6dca3d41edf33e347e2.camel@web.de>
     [not found]         ` <A2FE67B5-A9A9-4A0F-A59D-78FF2AB992B7@dukhovni.org>
     [not found]           ` <f79a9f0c369607fc38bef06fec521eaf3ab23d8c.camel@web.de>
     [not found]             ` <6E8A9D4F-18CE-4ADA-A5B4-D14DB30C99E5@dukhovni.org>
     [not found]               ` <25e70f31f0c4629f7a7d3957649d08be06144067.camel@web.de>
     [not found]                 ` <CECAFB36-DA1B-4EFB-ACD1-294E3B121B2E@dukhovni.org>
2020-04-13 18:35                   ` [musl] Re: Outgoing DANE not working Rich Felker
     [not found]                     ` <20200413190412.GF41308@straasha.imrryr.org>
     [not found]                       ` <20200413193505.GY11469@brightrain.aerifal.cx>
     [not found]                         ` <20200413214138.GG41308@straasha.imrryr.org>
     [not found]                           ` <20200414035303.GZ11469@brightrain.aerifal.cx>
     [not found]                             ` <87v9m0hdjk.fsf@mid.deneb.enyo.de>
     [not found]                               ` <20200415180149.GH11469@brightrain.aerifal.cx>
     [not found]                                 ` <87imi0haf7.fsf@mid.deneb.enyo.de>
     [not found]                                   ` <20200417034059.GF11469@brightrain.aerifal.cx>
     [not found]                                     ` <878siucvqd.fsf@mid.deneb.enyo.de>
2020-04-17 16:07                                       ` Rich Felker
2020-04-18 17:14                                         ` [musl] TCP support in the stub resolver (was: Re: Outgoing DANE not working) Florian Weimer
2020-04-19  0:03                                           ` Rich Felker
2020-04-19  8:12                                             ` [musl] TCP support in the stub resolver Florian Weimer
2020-04-20  1:24                                               ` Rich Felker
2020-04-20  6:26                                                 ` Florian Weimer [this message]
2020-04-20 17:39                                                   ` Rich Felker
2020-04-21  9:48                                                     ` Florian Weimer
2020-04-21 15:02                                                       ` Rich Felker
2020-04-21 17:26                                                         ` Florian Weimer
2020-05-01 22:02                                                           ` Rich Felker
2020-05-02 15:28                                                             ` Florian Weimer
2020-05-02 15:44                                                               ` Rich Felker
2020-05-02 22:52                                                                 ` Bartosz Brachaczek
2020-05-03  8:46                                                                   ` Florian Weimer
2020-05-03 16:51                                                                     ` Rich Felker
2020-05-03 17:19                                                                       ` Florian Weimer
2020-05-03 18:18                                                                 ` Florian Weimer
2020-05-03 19:09                                                                   ` Rich Felker
2020-05-03 19:34                                                                     ` Florian Weimer
2020-05-03 19:45                                                                       ` Rich Felker
     [not found]                             ` <20200414061620.GI41308@straasha.imrryr.org>
     [not found]                               ` <20200414160641.GC11469@brightrain.aerifal.cx>
     [not found]                                 ` <20200414215951.GJ41308@straasha.imrryr.org>
2020-05-19  1:37                                   ` [musl] Re: Outgoing DANE not working Rich Felker
     [not found]                                     ` <20200519023814.GN68966@straasha.imrryr.org>
2020-05-19  5:44                                       ` Rich Felker
     [not found]                                         ` <20200519090610.GO68966@straasha.imrryr.org>
2020-05-19 14:00                                           ` Rich Felker
2020-05-19 14:23                                             ` Wietse Venema
2020-05-19 14:28                                               ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a736y8nu.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).