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

Brian E Carpenter <brian.e.carpenter@gmail.com> Tue, 22 November 2022 20:14 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 9BF3EC1526F0 for <anima@ietfa.amsl.com>; Tue, 22 Nov 2022 12:14:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.099
X-Spam-Level:
X-Spam-Status: No, score=-7.099 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] 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 r2xHok7ezTLe for <anima@ietfa.amsl.com>; Tue, 22 Nov 2022 12:14:18 -0800 (PST)
Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 ED4E3C14CF14 for <anima@ietf.org>; Tue, 22 Nov 2022 12:14:18 -0800 (PST)
Received: by mail-pg1-x52c.google.com with SMTP id 130so14995114pgc.5 for <anima@ietf.org>; Tue, 22 Nov 2022 12:14:18 -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=hZ2icBmod9piOfjwJLcWNguqwixg6j/BgaEOY6knQZo=; b=pygYIFUsxiA9YeN4hwmIYmk6txt85hcqEm5uevjAR8hMf1yBhY7utuBuTGYUzNhd30 tYEw1w7tNgPE7aq8OTh/nrhYyMpHPSymuLTT08vjEsqePF1/XHeVKjGEflBufxuS/t9S 7TG9GN1inOcwHiGUV2C2cdOkptVdfrTsjrMS3SxXsNJysQW5A105jK4b4kEOhSxf1VWF siOEGp1PbKvcTI6cl9SWsyJHGK62tPs0DoA3f3BtJpjUqPNoYcMuAfYlk6Sk+4dJQJPp Mly/xneZ0Vl+4dYzSRZJsWBB9uW0JVjEyWMxVtgyGmtre8lgUXrctr0Ys2pa2xAmQVD+ N9mg==
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=hZ2icBmod9piOfjwJLcWNguqwixg6j/BgaEOY6knQZo=; b=tboAqxRs9QkCRF/KWKsSbpWitQ18/kQFAPT1bLsR1tSEqjRpIQ6DWUuaiH46Hvr9G9 fBbO+/SiuUECFjMNotO4FinH5kqI1ge7QIbXbW9wPRkqu67ODIQZbQ4PhgQ+eCqfTmdO ezUwIIPCqOlfsXUQn8apqrM2XINpYgKQliHWqwmbabPkMBbHrLqgcQ4LDhdrbrRc/lvf 9zieQotivMjo+fmEtnb0Mbx7/7rBESDbGD7mI+oZbQjnkT23I7zhvZ46l9VuZHdvMS35 588HMlsV9rd/KShoDxq2wsIPhzSNd2LOH0acwlwXXql/+RizSqRIj3hwFdQjKEcMORSh PD6A==
X-Gm-Message-State: ANoB5plc55UQMv5Ti87XLocb8fn07GCHiqiIqWXZdbDnoGRy951USDsc BhguNANPlicjPDCbx7trv64VxkTUN53dzg==
X-Google-Smtp-Source: AA0mqf7y51GnNgrvqAbGJBFpGTVXP8XUR/2ANg5aJNV7G8PWWc1eNQp/hnDcWfG0iECRVIN6cBjs/g==
X-Received: by 2002:a63:dc45:0:b0:44e:46f9:7eeb with SMTP id f5-20020a63dc45000000b0044e46f97eebmr5520695pgj.3.1669148057913; Tue, 22 Nov 2022 12:14:17 -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 d8-20020a631d08000000b0046f7b0f504esm9558493pgd.58.2022.11.22.12.14.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Nov 2022 12:14:17 -0800 (PST)
Message-ID: <c3802c11-b23e-ea34-07ee-8274162e4201@gmail.com>
Date: Wed, 23 Nov 2022 09:14:12 +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>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <DU0P190MB1978C2564FDEEA0F276A0602FD0D9@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/y1ihQzOGIZKoHRzkbfBS7MXDdZY>
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: Tue, 22 Nov 2022 20:14:19 -0000

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