Re: [Anima] New Version of draft-eckert-anima-grasp-dnssd

Brian E Carpenter <brian.e.carpenter@gmail.com> Wed, 02 August 2023 03:40 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 5029BC151B08 for <anima@ietfa.amsl.com>; Tue, 1 Aug 2023 20:40:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.196
X-Spam-Level:
X-Spam-Status: No, score=-7.196 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.091, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_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 D2W6f7ls8iDA for <anima@ietfa.amsl.com>; Tue, 1 Aug 2023 20:40:19 -0700 (PDT)
Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (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 31D11C151076 for <anima@ietf.org>; Tue, 1 Aug 2023 20:40:19 -0700 (PDT)
Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bba54f7eefso3176285ad.1 for <anima@ietf.org>; Tue, 01 Aug 2023 20:40:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690947618; x=1691552418; 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=ztl4ggwGeJjZ9V6li8F4ePjKvIUBXj/ax/THgJOlfEk=; b=TjaW7TfadzfM4H6FQGJEJSNTmboZZD+qjNDFZYmFqGm9TSOWVs8Ls7oWVn0IfPoe1y GN1m+o6pVIL2P74q0HqaWYwj/tPkT3d9Clb2e0BEvqobzLVQPhBx6A0XUYBpxOw00hLH CL0csECaQh1umCm1wrITZLLrn6HFTXL12ryrFlPVi5j9M6lHks5ntENFyuHvCh+lo8YW oeAPLMDkW41IpJH8B08eDeCswmXnzOHfLHCP0enpBLd9a+K0sSD6bd+WhXWgnYfjMg3d /avlo4imAh2YCZAGR/57QFm8FPViy74rr3+dneiIoxPaCNyc6dUg6Sr2sZKCiHpAtR3g IgSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690947618; x=1691552418; 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=ztl4ggwGeJjZ9V6li8F4ePjKvIUBXj/ax/THgJOlfEk=; b=Qdz0TkphbUhKjpxA8fYTwU2GQHA+xyyTs05l00qSMNZcW1uPlV8hqdLMmVO6jnZVHu SBuGq5TV3XrJsqRQO6zj/3JLhJyPHftcy9813DjDiWqjLK/s2lpFFKpXiYMypVofsvYF pKjOYKNnf4BenoJ4AL4z8cmJT9EZ1btAQuSnahbLopid3544SfTfvGCn7S8+mVmH5axK 7cIOQyhqtJ3ReperM72O60uadGcR40WIYqu40m6xBi/mtvIv2pb+3GBZmoXn2tOnhsO7 DErNlmP8/IEZV3ycY05I0pma2qmu47ue8c36WpnYFa0KhtBTsumG7WZss8onhexj9eV1 7iKg==
X-Gm-Message-State: ABy/qLaJN/ubNN2/BkxF2sFA3lj8R3GOm+vKKijqJJCPtCaGzToKeaRF G9bnfYJz6Y7oFuXfgsiF2U7GTPw4mfMz3Q==
X-Google-Smtp-Source: APBJJlFXKJTCzcR8HTbZ4kxEl3kB+sygxKyV7OIjm9RACP/jdBPQ42q1PZq+jGz/oqRGpehuJiiwjA==
X-Received: by 2002:a17:903:41d1:b0:1b0:3ab6:5140 with SMTP id u17-20020a17090341d100b001b03ab65140mr17283115ple.4.1690947618088; Tue, 01 Aug 2023 20:40:18 -0700 (PDT)
Received: from ?IPV6:2406:e003:10cc:9901:b2e1:1101:7ba7:19fd? ([2406:e003:10cc:9901:b2e1:1101:7ba7:19fd]) by smtp.gmail.com with ESMTPSA id w8-20020a170902e88800b001b53be3d956sm11188517plg.167.2023.08.01.20.40.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 20:40:17 -0700 (PDT)
Message-ID: <115a03fd-5cd7-119c-ebc0-fbe5aa554af3@gmail.com>
Date: Wed, 02 Aug 2023 15:40:13 +1200
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: Toerless Eckert <tte@cs.fau.de>
Cc: anima@ietf.org
References: <DB9PR10MB63549176EF0E405161B85649F33BA@DB9PR10MB6354.EURPRD10.PROD.OUTLOOK.COM> <1808d3ce-c03a-6871-a208-0845ad691427@gmail.com> <4024.1689630438@localhost> <DB9PR10MB63543A608EA0141A9860F65EF302A@DB9PR10MB6354.EURPRD10.PROD.OUTLOOK.COM> <6c2888e7-a2bd-b5ba-2aea-04dc26e95173@gmail.com> <2512.1690290441@localhost> <1C974DB3-2FCA-4B41-83E7-A9C095D7512B@tzi.org> <ZMEjTHl41WmjELL5@faui48e.informatik.uni-erlangen.de> <08b559ce-7903-1887-f51d-a3dcb49c0d36@gmail.com> <ZMm96pGz6pK1F58D@faui48e.informatik.uni-erlangen.de>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <ZMm96pGz6pK1F58D@faui48e.informatik.uni-erlangen.de>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/h_FGHXbWW7y0zn5dTLtWUhVynyo>
Subject: Re: [Anima] New Version of draft-eckert-anima-grasp-dnssd
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, 02 Aug 2023 03:40:20 -0000

On 02-Aug-23 14:22, Toerless Eckert wrote:
> On Sat, Jul 29, 2023 at 10:17:38AM +1200, Brian E Carpenter wrote:
>> On 27-Jul-23 01:44, Toerless Eckert wrote:
>>> DNS-SD TXT RR's are a sequenze of zero limited strings "key1=value1" ... "keyn=valuen"
>>>
>>> In my current grash/dsn-sd draft i have just proposed to encode this in
>>> CBOR with as little as possible changes, e.g.:
>>>
>>> [ "key1=value1", ...  "keyn=valuen" ]
>>
>> You have? That's not what I see in draft-eckert-anima-grasp-dnssd-05
> 
> I guess the draft is missing an example, but the definition:
> 
> *( &(kvpairs:7)      => { *(tstr: any) },
> 
> is meant to be that... and now writing it, i am again showing my ignorance of CDDL...
> 
> *( &(kvpairs:7)      => [ *(tstr: any) ],
> 
> Sigh.. what's the difference...

In CDDL, {...} is called a map, in Python and JSON it's called a dictionary.
[...] is an array (a.k.a. list).
So mainly the {...} isn't ordered and  [...] is ordered.

    Brian

> 
>>> Thinking that one needs to be able to parse this when using DNS-SD, so why
>>> parse differently. But of course that logic was flawed, only e.g.: a
>>> GRASP/DNS-SD proxy would need to be able to parse both encodings. And you
>>> obviously want to use the maximum of CBOR and minimum or none of
>>> application parsing.
>>
>> Exactly. And the way you use maps is well suited to any programming
>> language that knows how to use JSON maps, and much easier than
>> parsing the rather primitive formats in DNS records.
> 
> Right.
> 
>>> [ [ "key1", "value1" ], ...  [ "keyn", "valuen" ] ]
>>
>> (N.B. That is lists, not maps. Not that it matters much.)
> 
> Right. Btw.: In DNS-SD, valueI is optional, and if left out, the assumed value is "1",
> that need to be in our encoding.
> 
>>> And given how DNS-SD also has the shortening option "key1" implying "key1=1",
>>> this could also be
>>>
>>> [ "key1",  ...  "keyn" ]
>>>
>>> If all the keys only had values 0 or 1. Which is what Esko proposed.
>>
>> You can define that the *absence* of a key means False, 0, or "" (empty string),
>> *presence* of a key alone means True, and *presence* of [key, value] means
>> a value. I'm sure that's parsable.
> 
> I thought the alternatives for each element would be:
> 
>      [ [ "key1" ], ...
>      [ [ "key1", "value1" ], ...
>      [ [ "key1", [ "value1", ... "valueN" ], ...
> 
> The last one is kinda inofficial "," concatenated key1=value1,...,valueN
> 
>> But I still like maps.
> 
> I am lost right now about pro/cons... Need to find the 8" tape with my CBOR/CDDL braindump ;-)
> 
> Cheers
>      Toerless
> 
>>     Brian
>>>
>>> Chers
>>>       toerless
>>>
>>> On Tue, Jul 25, 2023 at 03:46:11PM +0200, Carsten Bormann wrote:
>>>> On 25. Jul 2023, at 15:07, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
>>>>>
>>>>> I have resisted suggestions that we put an array for the objective-value, and
>>>>> also that it have a string that needs to be parsed like "mode=prm,foo=1,bar=2"...
>>>>
>>>> You give a good reason not to do this at all.
>>>> But if you want to do this, do resist the urge to do a parsable string by all means.
>>>>
>>>> (I need to write that draft, CBOR anti-patterns :-) (*)
>>>>
>>>> Grüße, Carsten
>>>>
>>>> (*) Yes, anti-pattern drafts are now a thing:
>>>> https://www.ietf.org/archive/id/draft-bormann-restatement-00.html
>>>>
>>>> _______________________________________________
>>>> Anima mailing list
>>>> Anima@ietf.org
>>>> https://www.ietf.org/mailman/listinfo/anima
>>>
>> _______________________________________________
>> Anima mailing list
>> Anima@ietf.org
>> https://www.ietf.org/mailman/listinfo/anima
>