Re: [Anima] DNS-SD in GRASP - draft-eckert-anima-grasp-dnssd-04

Brian E Carpenter <brian.e.carpenter@gmail.com> Wed, 23 November 2022 19:34 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: anima@ietfa.amsl.com
Delivered-To: anima@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 08C83C1522AD for <anima@ietfa.amsl.com>; Wed, 23 Nov 2022 11:34:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.097
X-Spam-Level:
X-Spam-Status: No, score=-7.097 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 k9emxNUoEXPU for <anima@ietfa.amsl.com>; Wed, 23 Nov 2022 11:34:50 -0800 (PST)
Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (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 00E23C1522AC for <anima@ietf.org>; Wed, 23 Nov 2022 11:34:49 -0800 (PST)
Received: by mail-pj1-x1032.google.com with SMTP id k5so16678962pjo.5 for <anima@ietf.org>; Wed, 23 Nov 2022 11:34:49 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=vg5q/A9W11w5aMeBPvgyu9WRpI3/EgUXr16gkaHMrY4=; b=Fbc0srtxCUqRSCe83m2A3qLS9KABJPKBnYZtkaEz76m8QShuygesLgtu3FGoyqVxGI eMKLUJ4q4L2vVAmANRyp/PzaIp51Tvb5Zv3qgm3N2+ohGoJdBltVKUpbKvclboNy9cR8 kJKd49Gl2o0dbcPXDsIv/GkSD00bifRlys8KKBvVo/Vpj2mh0Kgn6e/kgwOd0T5AGXbT 1D197XnfoyepKkbKoV4pBuZ/oQLINubmmRyMr9HdkTvSqBAgL67AeLI5mLmJKfZrutAU aKSwER2cLWxY+/7akbgAkHhmSdwGcyHmn1Jhc+7REWHQXLHNRa3VnNLPPN17E4ODAHcx +YsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vg5q/A9W11w5aMeBPvgyu9WRpI3/EgUXr16gkaHMrY4=; b=guCRRJ/1VVNJe/YUcJOQ6b8/UAqNSnC0InWJIkrCVPjsZMKb0wh9FB2p824fD21P0m p3DAlUHD8orJUCJjlUmGJVdUL7ALKiwz2vKdy7aBVH4zoFVGvCAf4IHwVDic1qMoAczO iRFXfLRnWKvHWuTflwTmt1fcApOGRZHXfdJK0wv68OZc5db7oS+CdgU9ErbdEA18Uv3M GauNOv+f22cDAt/ntqQlOpl3/OGOnlDkQx7ioXxGYvKHwVhp+BWfSVeB5IMJcOaABGfm HkbUu4wkAwWcF3/m4ouGTCP/V/RTFOWyaJe/TN29aTkEwm1ru7nMmGtGVrGjp/ZA5gMv NvGA==
X-Gm-Message-State: ANoB5pl65xyUh9SK+m3c5sb1YWQnHSE5T7Q77tyDF4SalDwHBOhqBNuO QzLFxkONmVl8j4oZO+FyLZYrT4pYUvOt6w==
X-Google-Smtp-Source: AA0mqf6xiqxYXXPWwwaddxcrgkOzUGsj6VDVX7PbvQAlEe6sXwRfVwNIoqjm3nAn2EKFMwuUUbXV9Q==
X-Received: by 2002:a17:90a:4892:b0:216:92a9:fd50 with SMTP id b18-20020a17090a489200b0021692a9fd50mr31773729pjh.126.1669232089343; Wed, 23 Nov 2022 11:34:49 -0800 (PST)
Received: from ?IPV6:2406:e003:1124:9301:672e:17ee:b374:8a9b? ([2406:e003:1124:9301:672e:17ee:b374:8a9b]) by smtp.gmail.com with ESMTPSA id u9-20020a17090a2b8900b00218e8a0d7f0sm1559120pjd.22.2022.11.23.11.34.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Nov 2022 11:34:48 -0800 (PST)
Message-ID: <930bbc65-4b66-5df4-05a3-e2d1cea2fd67@gmail.com>
Date: Thu, 24 Nov 2022 08:34:43 +1300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0
Content-Language: en-US
To: Esko Dijk <esko.dijk@iotconsultancy.nl>, "anima@ietf.org" <anima@ietf.org>
Cc: Toerless Eckert <tte@cs.fau.de>
References: <DU0P190MB1978C2564FDEEA0F276A0602FD0D9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <c3802c11-b23e-ea34-07ee-8274162e4201@gmail.com> <DU0P190MB1978188F43CF89FF3194CBECFD0C9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <DU0P190MB1978188F43CF89FF3194CBECFD0C9@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/bVRwRthgoG3d0aBbxE7YpSD2SXI>
Subject: Re: [Anima] DNS-SD in GRASP - draft-eckert-anima-grasp-dnssd-04
X-BeenThere: anima@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Autonomic Networking Integrated Model and Approach <anima.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima>, <mailto:anima-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima/>
List-Post: <mailto:anima@ietf.org>
List-Help: <mailto:anima-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima>, <mailto:anima-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 23 Nov 2022 19:34:54 -0000

On 23-Nov-22 23:09, Esko Dijk wrote:
> Hello Brian,
> 
>> GRASP is a CBOR-based protocol and the values of GRASP objectives MUST be in CBOR.
> Yes, I was also thinking about such a solution. You could define an objective 'service announcement' and include a CBOR byte string there that encodes one or more advertised services in today's DNS(-SD) format. And a pure-GRASP element such as distance/range to all these services can be additionally encoded in CBOR. Similarly an objective 'service query' is defined, with same CBOR byte string encoding the Question(s).
> 
>> ... That's a substantial reduction in complexity.
> True, for the GRASP node that doesn't have to include the DNS parser. And for the programmers of it :)   But another kind of complexity comes in return, that is, documents and format definitions in the IETF (specifically now here in the ANIMA WG). It creates a mapping of DNS onto CBOR format that is not 100% complete. And the documents hint at future extensions to include features of DNS to make it more complete, which means more documents, while the basic DNS format already has all these things. Both formats may diverge in subtle ways that will only emerge later. But I do understand the desire to 'modernize' the DNS format; a similar effort is done in CoRE to encode a URI as a CBOR structure which avoids a node having to do URI parsing. (It's 'preparsed' so to speak.) But it did lead to a lot of discussions, iterations, and unexpected semantic problems in that case.
> 
>> ... they had no choice, but do we seriously want to force that complexity onto constrained nodes?
> Some constrained nodes do include DNS-SD; e.g. in OpenThread the optional DNS client has all this and looks like ~10KB compiled on an embedded platform. It's still an impressive amount of source code though.
> So I'm trying to establish what is the constraint on an ACP-node here, probably not flash size, but rather wanting to avoid DNS code complexity which might open up opportunities for error and (therefore) potential attacks?
> 
>> What the draft does is *centralize* the lookups and the complexity. It gives the distributed clients a central place to do lookups for them.
> The draft says "Future work can also define DNS-SD <-> GRASP gateway functions.", so a centralized gateway seems not in scope? (Gateway like GetDNSSD2.py is implementing ...? )

Yes. I don't think it's possible to implement what Toerless proposes *without* such a gateway, in fact.

> It also says "Also, the document allows for automatically discovering DNS-SD servers." which to me reads as the ACP-node uses GRASP to find a DNS(-SD) server and then it can use that server in the classic way. Similar to how you discover an NTP time server and then use that server in the classic way.

You could, but (IMHO) the only purpose of the proposal is to off-load the DNS-SD details from the client system. In fact I find it strange that the IOT world is not aggressively doing this (and not only for DNS-SD; for almost every protocol that was originally designed for 1980's mini-computers and mainframes).

> My strong impression of the draft is that it defines an mDNS-like lookup of services, which services can then be used in the way they're supposed to. Any node on the ACP could offer a particular service, like NTP, DNS, Radius, etc and the distributed discovery then helps to find one or more (nearby) instances of a wanted service. That doesn't look centralized to me, but maybe other authors could chime in.

Toerless needs to answer, but do remember that the original target for ANIMA was *not* IOT devices, but network elements in an enterprise or ISP network

>> Flooding is a bad idea at that scale. It's a weakness in the GRASP model and is the motivation for work like draft-ietf-anima-grasp-distribution, but we aren't done with that yet.
> Indeed this was one of the motivations for the dnssd WG "SRP" protocol, e.g. in context of constrained mesh networks with potentially 100s of nodes, to avoid the all-to-all communication model of mDNS.
> So the draft may emphasize some scalability recommendations, like only advertising a few key services needed to bootstrap the system (NTP, logging, Radius, central DNS server, ... ) and not that every ACP-node starts advertising a bunch of services. (As that wouldn't scale.)

Agreed.

     Brian

> 
> Regards
> Esko
> 
> -----Original Message-----
> From: Brian E Carpenter <brian.e.carpenter@gmail.com>
> Sent: Tuesday, November 22, 2022 21:14
> To: Esko Dijk <esko.dijk@iotconsultancy.nl>; anima@ietf.org
> Cc: Toerless Eckert <tte@cs.fau.de>
> Subject: Re: [Anima] DNS-SD in GRASP - draft-eckert-anima-grasp-dnssd-04
> 
> On 22-Nov-22 23:57, Esko Dijk wrote:
>> Hi all,
>>
>>   From a DNS/DNS-SD background and interest I started looking into draft-eckert-anima-grasp-dnssd-04.  Also saw some earlier list discussion on this topic (GRASP + DNS-SD).
>>
>> It looks like the draft mainly aims to provide a “multi-hop mDNS like functionality over an ACP by using GRASP” with unsolicited (flooded) service announcements, plus service queries. That looks quite useful to have (looking at draft-eckert-anima-services-dns-autoconfig-02 for the motivation for this.)
>>
>> First question is, why do we want to define a separate GRASP i.e. CBOR format for the DNS(-SD) information?
> 
> That's an easy one. GRASP is a CBOR-based protocol and the values of GRASP objectives
> MUST be in CBOR. Of course, exactly how the DNS information is respresented in CBOR is a matter of design choice. I'll leave Toerless to explain the choice that he proposes.
> 
> I'll just say that it wasn't too hard to implement it in Python, which is of course a very natural language for expressing JSON-like structures. If you want to see how I chose to do it, please see https://github.com/becarpenter/graspy/blob/master/ASA-examples/GetDNSSD2.py
> 
> Starting at line 203, it fetches the PTR record, then looks for SRV records. If it finds any, at line 235 it parses SRV records to extract the fields, retrieve relevant A and AAAA and TXT records, parse them, and bundle the results into a single JSON-like object.
> 
> Also see https://github.com/becarpenter/graspy/blob/master/ASA-examples/AskDNSSD2.py for the other end of a GRASP transaction. That end (the client, if you like) doesn't need to understand or parse the DNS RRs at all, just the JSON-like object. That's a substantial reduction in complexity.
> 
>> For example in CoRE WG for constrained nodes currently the draft draft-ietf-core-dns-over-coap-01 defines the re-use of the DNS format and no specific redefinition of this format as CBOR. And this intends to work for constrained nodes (like e.g. ACPna?)   So if we still want to use a CBOR based format we should have a clear motivation for this. (I understood there may be some concerns on code size of the DNS format parser?)
> 
> Exactly. I suggest that that something like Toerless's format would be ideal, with a server like my GetDNSSD2 doing the hard work for a whole crowd of constrained nodes. (I'm not of course suggesting Python for that, more likely Rust would do the job.) The transport doesn't have to be GRASP, of course (but I happen to like it :-).
> 
>> And ideally in case CoRE WG or another WG does start to define a CBOR-based DNS format (there was talk about this at IETF 115, opportunity for even more compact representations) then such format would ideally be equal to the one carried in GRASP, I think. Otherwise we will have so many different formats!
> 
> Yes.
>>
>> Re-using the existing DNS formats will save a lot of redefining things, now and in the future. If there are worries that some DNS-SD features (like e.g. ‘_sub’)  are too complex for ACP-nodes then the draft could focus on a particular constrained ‘profile’ of DNS-SD that rules out such constructs. So, a generic IETF-wide new encoding of DNS-as-CBOR is maybe useful, but doing this for GRASP specifically? I have some doubts here.
> 
> I disagree. DNS-SD in particular is a very baroque way of using multiple DNS RRs to express information that should be unified. I don't at all blame the DNS-SD team for doing this, they had no choice, but do we seriously want to force that complexity onto constrained nodes?
>    
>> Second question is, do we need to better motivate in the draft the 100% distributed nature of the service discovery mechanism?
> 
> I think that's a bit beside the point. What the draft does is *centralize* the lookups and the complexity. It gives the distributed clients a central place to do lookups for them. It's intrinsic to GRASP that the central lookup, GetDNSSD2 in my implementation) could in fact be duplicated for redundancy, but one GetDNSSD2 could support hundreds of AskDNSSD2 clients.
> 
>> Since the dnssd WG is now moving towards more centralized approaches, avoiding mDNS and avoiding multicast/flooding: using Service Registration Protocol (SRP). In this solution  there are 1 or a few SRP Registrars to which nodes can register their service(s); and DNS clients may discover those services again using (unicast) DNS queries to one of the SRP Registrars.
> 
> I wasn't aware of that. I don't think it changes the argument though; it just means that an SRP Registrar would be the ideal node to host a GetDNSSD2 instance.
> 
>> Perhaps one motivation is that in the bootstrap scenario, no SRP Registrars are defined yet so hence SRP cannot be used. And the case of multiple SRP Registrars requires automatic sync’ing between Registrars which is complex / not suitable for an ACP. And a single SRP Registrar could be possible but is then a single-point-of-failure and nothing works if this drops out.
> 
> I'm not sure. Getting the first GetDNSSD2 instance up has the same problem as getting the first SRP Registrar up, I suspect.
> 
>> Third question, what if every ACP-node starts flooding some service(s) – is that scalable to 100s or 1000s of nodes? Maybe we want to avoid this situation. It wasn’t clear to me yet if such use cases are intended. E.g. draft-eckert-anima-services-dns-autoconfig-02 mentions “SSH server” as a service which is what every ACP-node would have.
> 
> Flooding is a bad idea at that scale. It's a weakness in the GRASP model and is the motivation for work like draft-ietf-anima-grasp-distribution, but we aren't done with that yet.
> 
> Regards,
>       Brian