[dnssd] Re: SRP + Advertising Proxy: TTL related questions
Michael Sweet <msweet@msweet.org> Thu, 03 July 2025 14:33 UTC
Return-Path: <msweet@msweet.org>
X-Original-To: dnssd@mail2.ietf.org
Delivered-To: dnssd@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 221023D86300 for <dnssd@mail2.ietf.org>; Thu, 3 Jul 2025 07:33:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -1.867
X-Spam-Level:
X-Spam-Status: No, score=-1.867 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.232, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (1024-bit key) header.d=msweet.org
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 36sh3fgVKU02 for <dnssd@mail2.ietf.org>; Thu, 3 Jul 2025 07:33:25 -0700 (PDT)
Received: from mail.msweet.org (mail.msweet.org [173.255.209.91]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 441233D862FB for <dnssd@ietf.org>; Thu, 3 Jul 2025 07:33:25 -0700 (PDT)
Received: from smtpclient.apple (cbl-66-186-76-47.vianet.ca [66.186.76.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.msweet.org (Postfix) with ESMTPSA id 2368880445; Thu, 3 Jul 2025 14:33:24 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.msweet.org 2368880445
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=msweet.org; s=default; t=1751553204; bh=wP8cTcWeZoPVFpqOKTQZ42/UuTrRDINHatk8N1fYmk0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=M7JLYnSHmJiBbqf5llhgJnuHmzNz68Czp14KL0q4BhKxHT0rTMYHdlS/Sr37W3PJg DYj6vABwK1AQ5pOC7y0cEHLNGVeIyPs75VYQUNqD9GfSlRVMv9/KyZk9Sd3/c+8MoQ JoOMd5268iXH2+0liEcIQ7Cy4JeNMLfqGaeQKfKI=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\))
From: Michael Sweet <msweet@msweet.org>
In-Reply-To: <DU0P190MB19786C7CF7E590EBF9673F2FFD43A@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
Date: Thu, 03 Jul 2025 10:33:13 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <5A1BC025-A5E8-47AE-BDC2-B905407ED3FC@msweet.org>
References: <DU0P190MB19785B005106B4C21D7D726BFDAD2@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <9eda7373-8937-43dd-9e46-7d09316fdfe8@app.fastmail.com> <DU0P190MB1978FE249E33B5D0F5295B9EFDAD2@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <594c513c-361a-4d50-ae72-509a8d8c8113@app.fastmail.com> <CACce4dT5dUU7gz6gjaOECpnqq08VjgBq3uH7g6VtcDO2n0JALA@mail.gmail.com> <DU0P190MB1978A8C67105148B91E80C9BFD41A@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <834FF6FC-2389-4EAF-BD99-42361130ABCD@fugue.com> <DU0P190MB1978B0ADE0B9D51099E56032FD41A@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <CAGwZUDtRX=-afSB5X+UBAH-_8yOe7T_c4JPwLZEc3V7sKpzRkg@mail.gmail.com> <DU0P190MB19786C7CF7E590EBF9673F2FFD43A@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
To: Esko Dijk <esko.dijk@iotconsultancy.nl>
X-Mailer: Apple Mail (2.3826.600.51.1.1)
Message-ID-Hash: XB5Y5MFLNIYP2YVVCJVGYENF6XB4KXMB
X-Message-ID-Hash: XB5Y5MFLNIYP2YVVCJVGYENF6XB4KXMB
X-MailFrom: msweet@msweet.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-dnssd.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Jonathan Hui <jonhui@google.com>, Ted Lemon <mellon@fugue.com>, Abtin Keshavarzian <abtink@google.com>, dnssd <dnssd@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [dnssd] Re: SRP + Advertising Proxy: TTL related questions
List-Id: "Discussion of extensions to DNS-based service discovery for routed networks." <dnssd.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnssd/OUNM7rDkzU0f4XVMcw5kpN766b4>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnssd>
List-Help: <mailto:dnssd-request@ietf.org?subject=help>
List-Owner: <mailto:dnssd-owner@ietf.org>
List-Post: <mailto:dnssd@ietf.org>
List-Subscribe: <mailto:dnssd-join@ietf.org>
List-Unsubscribe: <mailto:dnssd-leave@ietf.org>
Esko, I think a factory reset that didn't actually reset the device to its original "from the factory" state/configuration and destroy any saved data isn't workable - it might not have network access after the reset and the whole purpose of a factory reset is to start over safely/securely/privately to re-provision, retire/recycle/dispose of, or resell the device. > On Jul 3, 2025, at 3:26 AM, Esko Dijk <esko.dijk@iotconsultancy.nl> wrote: > > In this case of a planned factory reset that is a standard or expected step in the process: > > • the device could store the info about the "old" SRP key persistently such that it survives this planned factory reset; > • and then after the planned factory reset retrieve the "old" key and send an SRP update signed with the "old" key to remove the "commissionable" service. > But if the factory reset is a true factory reset, no information like this would survive. > Then, if there's no opportunity to remove the service just before doing the factory reset , then I agree using a shorter-than-usual lease time seems the best solution. > In this case we rely on cleanup by timing out of the lease (which may take long if the SRP Registrar decided to make the lease much longer than the requested time by the client). > Not sure if this leads to any problems? (If it does, maybe TSR can help to distinguish active "commissionable" services vs stale ones.) > Esko > From: Jonathan Hui <jonhui@google.com> > Sent: woensdag 2 juli 2025 22:59 > To: Esko Dijk <esko.dijk@iotconsultancy.nl> > Cc: Ted Lemon <mellon@fugue.com>; Abtin Keshavarzian <abtink@google.com>; dnssd <dnssd@ietf.org> > Subject: Re: [dnssd] Re: SRP + Advertising Proxy: TTL related questions > I agree that explicitly removing the service is ideal. In the case of Matter, I believe the challenge was that a device in commissioning mode is often factory reset and not afforded the opportunity to remove its commissionable service before doing so. > -- > Jonathan Hui > On Tue, Jul 1, 2025 at 6:23 AM Esko Dijk <esko.dijk@iotconsultancy.nl> wrote: > Ok. I believe the correct way for such a situation is to send an update to remove a DNS-SD service again, using an SRP Update, if the service is no longer available. > If the client doesn't know in advance when the service is to be removed again, it should base its lease time on other considerations. (Whatever these are: maybe do the same like for its other DNS-SD services if it has any.) > The described approach is also brittle: the SRP registrar MAY opt to change the lease time to 4 hours, for example. > Esko > From: Ted Lemon <mellon@fugue.com> > Sent: dinsdag 1 juli 2025 15:07 > To: Esko Dijk <esko.dijk@iotconsultancy.nl> > Cc: Abtin Keshavarzian <abtink@google.com>; dnssd <dnssd@ietf.org> > Subject: Re: SRP + Advertising Proxy: TTL related questions > We have noted a use pattern where a device that has not yet been paired advertises its availability for pairing using SRP with a short lease interval, with the hope that the pairing will happen quickly and the short lease will result in that service being removed quickly. We should probably think about whether that makes sense, or whether it's better for the device to simply remove the advertisement when pairing is complete. > On 1 Jul 2025, at 14:52, Esko Dijk <esko.dijk@iotconsultancy.nl> wrote: > Hi Abtin, > thanks for clarifying the OpenThread configurations and algorithm. > Based on RFC 9665 I see quite some implementation freedom on handling TTLs: > > • TTL value for RR in SRP Update is an advisory to the SRP registration (Section 4) > • TTL value SHOULD NOT exceed the lease time (within the SRP Update scope) > • function of Lease times and the function of TTLs are completely different (Section 5.1) > • TTL value for RR when served in a DNS response (e.g. by Advertising Proxy) MAY exceed the remaining lease time (Section 5.1) > • although it's not forbidden to e.g. set the TTL based on remaining lease time, if the implementation sees some benefit in that. > So an SRP registrar can modify lease times to regulate the amount of SRP Updates per time unit. (Basically ignoring the SRP client's requested lease time.) > And it can choose TTL values to regulate the amount of DNS/mDNS queries being sent to its host per time unit. (Ignoring the SRP client's suggested TTL.) > The SRP registrar going along with an SRP client's suggested TTL, within certain preconfigured min/max limits, also sounds like a feasible default strategy. > Now that the SRP registrar has determined TTL in some way, I'd assume that the Advertising Proxy uses exactly these TTL values in its mDNS advertisements. > The Advertising Proxy draft can maybe list some sensible defaults for TTL? > For this I created: https://github.com/dnssd-wg/draft-ietf-dnssd-advertising-proxy/issues/6 > regards, > Esko > From: Abtin Keshavarzian <abtink@google.com> > Sent: dinsdag 1 april 2025 22:50 > To: Ted Lemon <mellon@fugue.com> > Cc: Esko Dijk <esko.dijk@iotconsultancy.nl>; dnssd <dnssd@ietf.org> > Subject: Re: SRP + Advertising Proxy: TTL related questions > Let me clarify the statement about OpenThread behavior. > > OpenThread is a network stack designed to run on a variety of platforms and device categories, offering flexibility in configuration and integration into projects and products. > > Regarding the SRP Server and Advertisement Proxy, OpenThread provides several integration options: > > A) Platform/Project Managed: The platform or project handles all SRP Server and Adv Proxy functionalities, making them fully project/product-specific. > B) OpenThread SRP Server, Platform Adv Proxy: The SRP Server function is implemented within the OpenThread core, while the Advertisement Proxy is delegated to the platform. > C) OpenThread Native SRP Server and Adv Proxy: Both the SRP Server and the Advertisement Proxy are provided by the OpenThread core. > > The OpenThread SRP server implementation tracks a TTL for each registered service and host: > > - The TTL is set to the minimum of the granted lease time and the TTL from the records in the SRP message. Note that SRP requires TTL consistency, so all RRs within an SRP message must use the same TTL. > - OpenThread also provides `otSrpServerTtlConfig`, which can be configured via APIs to specify a minimum and maximum TTL range. The granted TTL is then clamped to fall within this defined range. > - The OpenThread SRP client also offers APIs to explicitly set the desired TTL value if needed. If not explicitly set, the client will use the lease time as the TTL (default value 2 hours). > > Regarding the Advertisement Proxy: > > - For options (A) and (B), the Adv Proxy behavior, including TTL handling, is entirely dependent on the platform implementation. This, I believe, is what Esko's setup is using and what he observed. > - In option (C), where the OpenThread native Adv Proxy is used, it utilizes the TTL managed by the SRP server as described above. > - For the Advertisement Proxy, it makes sense to honor the TTL included in the SRP message while adhering to some min/max limits. > - The default/common behavior would be for the SRP client to set the TTL the same as the lease time (typically 2 hours). If, however, the TTL value is explicitly set to a different value by the SRP client, then it makes sense for this request to be honored by the Advertising proxy. > Abtin. > On Mon, Mar 31, 2025 at 5:15 AM Ted Lemon <mellon@fugue.com> wrote: > Actually we’ve learned (because of thread!) that the 120s ttl is way too short, and mDNSResponder now uses a 75 minute ttl for address records. > If the goodbye packet doesn’t come, then the next step is to probe. See for example the DNSServiceReconfirmRecord API. > On Mon, Mar 31, 2025, at 11:19 AM, Esko Dijk wrote: > > and rely on the goodbye packet to remove the record if the lease expires > This works well as long as the SRP Registrar stays online. If it is unexpectedly disconnected, there’s no opportunity to send goodbyes for all its proxied services/host-names. > I’m guessing that’s why mDNS chose the 120 seconds limit, which feels fairly short but somewhat addresses the issue of a device suddenly being disconnected/powered-off. > If we go for “long” TTLs, then we need to define a recommendation for this time. E.g. in the order of 30 minutes? > Maybe a range can be defined. Then, if there’s a record registered via SRP with a longer lease time (e.g. 8 hours, or 24 hours) then the mDNS advertised TTL can also be initially advertised as longer, up to the high end of this range. > Say, 2 hours (if that’s the end of the range). > Esko > From: Ted Lemon <mellon@fugue.com> > Sent: maandag 31 maart 2025 11:01 > To: Esko Dijk <esko.dijk@iotconsultancy.nl>; dnssd <dnssd@ietf.org> > Cc: abtink@google.com > Subject: Re: SRP + Advertising Proxy: TTL related questions > There is a significant cost to short ttls for mdns: if there is an active query on a record, we will see mdns exchanges towards the end of the ttl to keep the query going. > Given that mdns also has maintenance packets, it’s better to use a long ttl and rely on the goodbye packet to remove the record if the lease expires. > Letting the client choose the mdns ttl could enable a dos attack. > On Mon, Mar 31, 2025, at 10:19 AM, Esko Dijk wrote: > Hi all, > The Advertising Proxy can advertise DNS records using mDNS, where the records were received in an SRP Update. This brings up questions related to the TTL of the mDNS-advertised records. > mDNS has some standard guidance for TTL (e.g. 2 minutes for host-related records and SRV, 75 minutes for others like TXT). So an implementer could use this guidance. This is what I see in the OpenThread implementation. > However, in the SRP + Advertising Proxy case, the registered records each come with their own TTL value that maybe should be respected. So then the mDNS component could use those (received) TTLs and do a countdown on the time. > For example, if the SRP lease time is 10 minutes, and 4 minutes passed since the last SRP Update, then mDNS will advertise the service (PTR + SRV+ TXT) with a TTL of 6 minutes. > Would this be the intention for Advertising Proxy? Or can the defaults be used? > Alternatively there could also be some kind of cap on the mDNS-advertised TTL (like 2 minutes?) to avoid the TTLs on mDNS getting very large. (RFC 6762 kept these fairly small, for a good reason probably). > In that case the TTLs can be smaller but not larger than the cap. > Regards > Esko > _______________________________________________ > dnssd mailing list -- dnssd@ietf.org > To unsubscribe send an email to dnssd-leave@ietf.org > _______________________________________________ > dnssd mailing list -- dnssd@ietf.org > To unsubscribe send an email to dnssd-leave@ietf.org ________________________ Michael Sweet
- [dnssd] SRP + Advertising Proxy: TTL related ques… Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Ted Lemon
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Ted Lemon
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Abtin Keshavarzian
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Ted Lemon
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Jonathan Hui
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Ted Lemon
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Michael Sweet
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Esko Dijk
- [dnssd] Re: SRP + Advertising Proxy: TTL related … Ted Lemon