Re: [dnssd] Strategy of advertising proxy for hostname conflicts during key lease period? (draft-ietf-dnssd-advertising-proxy-00)

Ted Lemon <mellon@fugue.com> Sun, 19 June 2022 13:28 UTC

Return-Path: <mellon@fugue.com>
X-Original-To: dnssd@ietfa.amsl.com
Delivered-To: dnssd@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2497CC15AAEA for <dnssd@ietfa.amsl.com>; Sun, 19 Jun 2022 06:28:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fugue-com.20210112.gappssmtp.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fkKhI3TobnR4 for <dnssd@ietfa.amsl.com>; Sun, 19 Jun 2022 06:28:48 -0700 (PDT)
Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 88044C14EB1E for <dnssd@ietf.org>; Sun, 19 Jun 2022 06:28:48 -0700 (PDT)
Received: by mail-oi1-x22a.google.com with SMTP id v4so10813849oiv.1 for <dnssd@ietf.org>; Sun, 19 Jun 2022 06:28:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fugue-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0M3sQByYiVdnTIxX80bEUH2VKxlV2ckPtgenFbH8SUA=; b=vE5lfegdkww71iHLa1SWyUvoy6LZHsPY2dlJtOvn2nO3P+lbmEiWKBRYiVhTXy3hGv 1OFmsSzm1NgmwgHEtuwnvWN5rpo6fITUGzQTjd//V7HdOPWyIzthf1GgQWmCOkVa9FsH fmJkzHkoWkvcpqWk+n6CucxxNKvs6/WOC2QzLJJYVYpR7KiNK43kRrRp1ScOcHaH/s4j hG62IlmV8XCLTX0DHgulLORW2f6UPXhuppNgh1A1vKx0I0+5wb1OWH4nbqW3cyYuNay1 n2sFTQgJPgvFusRi57UkuQMXcpbCg4BnnAa5lO+wCh/jRRAOUofOwl73dtPkapvHBKd9 1qtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0M3sQByYiVdnTIxX80bEUH2VKxlV2ckPtgenFbH8SUA=; b=TawxfASKgL2QPIJVOLjjKD5YMcz5aVD9THEqZNrVwBEViE1NFtqEyC1Zz+jQYAohwH 1CaSK9zeSS7AGsTFNW0dA6UZg5eG4lqhzCkpJwQuvVUT2DonCihVBNd5epgQw9xH3/0M nJe6IP0Dpu9xxHqNcQVG68muaoD8he6es5oJBqcF4pvdLWzS2WIyQGOxth7BhtSilJ1X 1gjtjqdd3q1almB2Ooe9hv4B7ekpN+81EVTPYgEU6eHC3Lydgw4pcpp2LJbAo4e6CP/G qf0uG4QRb4H3LZIkifxxqLhWdvT4oQ4VWmkWYudxocSHZPqcs/CE9eAz2tnuwSs/JSHt L3aQ==
X-Gm-Message-State: AJIora+IMh3RTBoY+D4H1MYdiwIoYJNfvifdah59wBqZBnSYn+6Z47nh LazmOu/0AWVc0iohc6iqnEfKZZ2ChxaLfo2BjeAGgRtvO6+JFw==
X-Google-Smtp-Source: AGRyM1uOcFR8z1IiCtVrVPDUhvg30nAt7i3oX4qR+CHbtX2MZjvL9Eb5x4ff4uVAgSk0kbfQO/xWTXkHVDccTlL1+qo=
X-Received: by 2002:a05:6808:1794:b0:32f:c68:c3db with SMTP id bg20-20020a056808179400b0032f0c68c3dbmr9019021oib.209.1655645327616; Sun, 19 Jun 2022 06:28:47 -0700 (PDT)
MIME-Version: 1.0
References: <DU0P190MB1978D4C3F784B67C8AF39A7DFDA49@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <CAPt1N1nFYVMYiEuhSM4Kuickvb2VBgyanEV=VgGtX996oZW5EA@mail.gmail.com> <DU0P190MB197866CA95A9ABBB013ED9D9FDA79@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <DU0P190MB1978B2BF4465D735DF2FC24BFDAC9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <CAPt1N1n-cmg4bydwM56Z9EZF_si19Ve1YNbBg=4H2YksWDd++A@mail.gmail.com> <CAPt1N1kD7VT0OKoEbH6LHZh4v0goNj1jV1aTSrE4kY9pLF3pQA@mail.gmail.com> <DU0P190MB1978AE5CAB7C8A54AE5FA457FDB19@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
In-Reply-To: <DU0P190MB1978AE5CAB7C8A54AE5FA457FDB19@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
From: Ted Lemon <mellon@fugue.com>
Date: Sun, 19 Jun 2022 09:28:11 -0400
Message-ID: <CAPt1N1=KNUFi9Db4+a9edYsjmuCvoYZVupNRMnznQhPs62NFUQ@mail.gmail.com>
To: Esko Dijk <esko.dijk@iotconsultancy.nl>
Cc: "dnssd@ietf.org" <dnssd@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000a0854b05e1ccf7b7"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnssd/rD69LrIW1I6934Ahcq1TUAZ0XHA>
Subject: Re: [dnssd] Strategy of advertising proxy for hostname conflicts during key lease period? (draft-ietf-dnssd-advertising-proxy-00)
X-BeenThere: dnssd@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Discussion of extensions to DNS-based service discovery for routed networks." <dnssd.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnssd>, <mailto:dnssd-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnssd/>
List-Post: <mailto:dnssd@ietf.org>
List-Help: <mailto:dnssd-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnssd>, <mailto:dnssd-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 19 Jun 2022 13:28:51 -0000

On Sun, Jun 19, 2022 at 6:04 AM Esko Dijk <esko.dijk@iotconsultancy.nl>
wrote:

> Thanks , I updated my lists based on your response – shown below.  There’s
> separate Options 1/2 now for the case that the Advertising Proxy (AP) does
> propagate KEY records for services, and for the case the AP doesn’t do this
> for services but only for Hosts. (Which you indicated would be sufficient
> and simpler to implement.)
>
> Option 1) Incoming mDNS query , assuming that KEY records are also
> propagated via the Advertising Proxy:
>
>    - QTYPE = PTR , QNAME=<service type name> : No response
>    - QTYPE = SRV, QNAME=<service instance name> : Response with success
>    (NoError) status and 0 answer records
>    - QTYPE = ANY, QNAME=<service instance name> : Respond with KEY record
>    for <service instance name>
>    - QTYPE = KEY, QNAME=<service instance name> : Respond with KEY record
>    for <service instance name>
>    - QTYPE = AAAA, QNAME=<host name>.local : Response with success
>    (NoError) status and 0 answer records
>    - QTYPE = ANY, QNAME=<host name>.local : Respond with KEY record for
>    <host name>.local
>    - QTYPE = KEY, QNAME=<host name>.local : Respond with KEY record for
>    <host name>.local
>
> Option 2) Incoming mDNS query , assuming that KEY records for services are
> NOT propagated via the Advertising Proxy:
>
>    - QTYPE = PTR , QNAME=<service type name> : No response
>    - QTYPE = SRV, QNAME=<service instance name> : No response
>    - QTYPE = ANY, QNAME=<service instance name> : No response
>    - QTYPE = KEY, QNAME=<service instance name> : No response
>    - QTYPE = AAAA, QNAME=<host name>.local : Response with success
>    (NoError) status and 0 answer records
>    - QTYPE = ANY, QNAME=<host name>.local : Respond with KEY record for
>    <host name>.local
>    - QTYPE = KEY, QNAME=<host name>.local : Respond with KEY record for
>    <host name>.local
>
> Right.

> Incoming unicast DNS query:


>    - QTYPE = PTR , QNAME=<service type name> : Respond NXDOMAIN  (since
>    the pointers for the expired-lease services are removed)
>    - QTYPE = SRV, QNAME=<service instance name> : Response with success
>    (NoError) status and 0 answer records
>    - QTYPE = ANY, QNAME=<service instance name> : Respond with KEY record
>    for <service instance name>
>    - QTYPE = KEY, QNAME=<service instance name> : Respond with KEY record
>    for <service instance name>
>    - QTYPE = AAAA, QNAME=<host name>.default.service.arpa : Response with
>    success (NoError) status and 0 answer records
>    - QTYPE = ANY, QNAME=<host name>.default.service.arpa : Respond with
>    KEY record for <host name>.default.service.arpa
>    - QTYPE = KEY, QNAME=<host name>.default.service.arpa : Respond with
>    KEY record for <host name>.default.service.arpa
>
>
>

Also right.


> > the instance name is nearly always going to be the same as the hostname
> plus the service type and transport type labels.
>
>
>
> This part was unclear to me; do you have an example? I thought a mDNS
> device would typically register something like “My
> Service._exampletype._udp.local” without including any hostname within the
> service instance name.
>
> And with Option 2 above this service instance name would not be “defended”
> for the duration of the key lease which looks like a problem for service
> consistency within a home. (E.g. a client may have initially selected a
> particular instance and wants to keep using that specific one even though
> the service may be ‘absent’ some of the time.)
>
> <https://www.ietf.org/mailman/listinfo/dnssd>
>
> This might be a bit puzzling because we do see certain IoT frameworks
using a different label for the service instance name than for the
hostname. But this is not the usual behavior, and TBH I think it's a
mistake. Not sure there's anything to be done about it. But normally this
is what you'd expect to see:

libretto._ssh._tcp.local.     SRV    IN     0 0 22 libretto.local.

Note that service instance name is libretto._ssh._tcp.local, and the
hostname is libretto.local, so the initial label in both cases is the same.
This is the behavior that most DNS-SD services exhibit. I'm slightly
glossing over one difference, which this HomeKit accessory shows off:

Eve\032Energy\032A02E._hap._udp.local. SRV    IN     0 0 5683
Eve-Energy-A02E.local.

So here the service instance name label and the hostname label are
different in that the hostname label has dashes instead of spaces. This is
because the service instance name label is not a hostname, and we care more
about how it looks to the user in a UI than that the labels are identical.
But still the two names clearly map to one another: if the hostname were to
change, we'd expect the service instance name to change as well. My
laptop's name doesn't exhibit this behavior because there are no spaces in
the name. If it were e.g. "Ted Lemon's Laptop" then we would see the same
service instance name difference that we see for the HomeKit accessory.

In the case of the IoT frameworks that use a different label for the
service instance name, we're pretty much relying on collisions being very
unlikely. I think this is a safe bet—the service instance name has
something like 64 or 128 bits of randomness (I'm not sure off the top of my
head) and is required to be unique on generation, so the chances that the
same label would show up on the same network in mDNS for a different
service are vanishingly small.

If we really think that's too big a risk to take, I can look into how hard
it is to use the KEY record to defend the name, but bearing in mind that I
think we ultimately (and hopefully fairly soon!) want to move in the
direction of using mostly unicast discovery, it's worth considering how
much effort would be worthwhile in pursuit of this goal.