Re: [Cbor] GRASP packet header extensions (CBOR question)

Brian E Carpenter <brian.e.carpenter@gmail.com> Mon, 22 August 2022 23:20 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 361FEC157901; Mon, 22 Aug 2022 16:20:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.11
X-Spam-Level:
X-Spam-Status: No, score=-2.11 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_NONE=-0.0001, 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=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 5MGrNcnuCx53; Mon, 22 Aug 2022 16:20:28 -0700 (PDT)
Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) (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 B4FA4C14792E; Mon, 22 Aug 2022 16:20:28 -0700 (PDT)
Received: by mail-pf1-x429.google.com with SMTP id z187so11785313pfb.12; Mon, 22 Aug 2022 16:20:28 -0700 (PDT)
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; bh=BBaEaH+YNIW7EEJdKV++oJunJ60q7zE3tgud7vEmu2U=; b=PMrkXiPnvT7A8ArXtBLWuU6x90P4XGehCUL5wh6Ul3MDED89C7jTF3CRsBSr/somT4 Gn626Fa3FCAtri+4OGxwrnp06BkNI/JoXzctN6SZYJ+oMNNCh53L69OnoLm6osmlom8B cqTTEMnI8qYMeSn+1F8pjbBexHWvSOo0+avyY0GeFb3aFwuuDJI7HXNfEdmFLVNk80LT oC6CihPVzGnDL+LdwYN0jvG03YY/GHrP7Q1ZDoR2kLoRLj6V1nKPQbyuqNFVUhEdxhuW 4bXMJDcUAZiAd4/pN7PBYLta2lpYH1AdQ4kJq/WW/iXJ/zCWGU6jPp+dV/2SEAoA9ufe ot6Q==
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; bh=BBaEaH+YNIW7EEJdKV++oJunJ60q7zE3tgud7vEmu2U=; b=gEHUSWPjbd6pm55MAmHh3mMPb7oQe9c/LrskBvwSnL3ssNIl3zdQOQkh5Mnn/NYRSC YapSu1ccvi5/NWNSMXzoXWJ/OdpQp9cB6ywv33KA2xHYgx/w7VZ7x5vTUHENVv5Yhfm2 mWf7Nw8gaqbjlZTjTsTC2DZd3isT2VhKEym/g80j91aIIrCe8PIsNgmRQAk/4RDGNuCp 86m/kHREHAOXdiLwpH8uv2xn9ItwCY8n0XNWnk+dtCPXHvQk79TNUJWQ11Uwzo/Fz4SB 5oHLGwx7soV4Sne6w0qSCF0Fqoj4t/llAoR678imkV1wzEDQutjjgHdSijNP4du8k36T mcjA==
X-Gm-Message-State: ACgBeo0fh9H4ekGFYJ+3f+q22oz4mS8o2K8D5Ddrc/te7Hi4qX/j8tQv ViQdlnjvlUU0UR97LbPoKSQ=
X-Google-Smtp-Source: AA6agR6hOUMNgd+SXkcNt7QhoQmT0iyMB0MZnNhltR3i0VqHRGYY51cvt9ohABNOTHztwpUwiwQN/Q==
X-Received: by 2002:aa7:8818:0:b0:536:6e37:633c with SMTP id c24-20020aa78818000000b005366e37633cmr10439457pfo.37.1661210427963; Mon, 22 Aug 2022 16:20:27 -0700 (PDT)
Received: from ?IPV6:2406:e003:1124:9301:80b2:5c79:2266:e431? ([2406:e003:1124:9301:80b2:5c79:2266:e431]) by smtp.gmail.com with ESMTPSA id f7-20020a170902684700b0016d93c84049sm8923479pln.54.2022.08.22.16.20.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Aug 2022 16:20:27 -0700 (PDT)
Message-ID: <e8c3cc49-c121-4343-fb14-39b863766964@gmail.com>
Date: Tue, 23 Aug 2022 11:20:23 +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: Carsten Bormann <cabo@tzi.org>, anima@ietf.org, cbor@ietf.org
References: <Yv+miC76QMc887cJ@faui48e.informatik.uni-erlangen.de> <A303E7B3-A83F-4B04-9C6F-5143E4A0B54D@tzi.org> <5fa4a9c7-bc0a-cba0-04fb-4cf5e7777c9e@gmail.com> <4E167B3F-9C68-4333-BB76-36119B8F39DF@tzi.org> <fa2a8d32-929d-46ec-97b3-b67ad33c23b7@gmail.com> <YwNHvF1wzS0yaZGe@faui48e.informatik.uni-erlangen.de>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <YwNHvF1wzS0yaZGe@faui48e.informatik.uni-erlangen.de>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/_GBPIPp5K2NcMGDiZrRGB71PjMI>
Subject: Re: [Cbor] GRASP packet header extensions (CBOR question)
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Aug 2022 23:20:29 -0000

Just a couple of comments in line:

On 22-Aug-22 21:09, Toerless Eckert wrote:
> On Sat, Aug 20, 2022 at 10:01:37AM +1200, Brian E Carpenter wrote:
>> Ditto, but referring to CDDL details. Off list, I suggested:
>>
>>     grasp-option = numeric-option / objective
>>     numeric-option = option .within option-structure
>>     option-structure = [0..255, any]
>>
>> and then
>>
>>     option /= divert-option
>>
>> etc.
> 
> I think this is a good starting point. Here is what i think is
> possible/needed beyond that:
> 
> 1) Breaks ttl
> 
> In rfc8990:
> 
>    grasp-option = any
> 
> If you constrain it to:
> 
>    grasp-option = numeric-option / objective
> 
> Then you break messages with ttl:
> 
> message-structure = [MESSAGE_TYPE, session-id, ?initiator, *grasp-option]
> flood-message = [M_FLOOD, session-id, initiator, ttl, +[objective, (locator-option / [])]]
> 
> Aka: grasp-option can not represent the purely numeric ttl anymore.
> 
> We could do a one-off fix for ttl by channging message-structure, but
> i really don't see why we would want to constrain grasp-option to be
> less than any, see below.
> 
> 2) Still want to understand .within correctly i think it does not doe
> not work as you hope above.
> 
> Carsten claimed offlist, that in your above syntax, grasp-option would
> match some option that is not yet defined, as long as it matches
> option-structure. From reading rfc8610, i think this is wrong, because
> numeric-option is an AND between option and option-structure, so only
> any currently defined options will be matched. No extensibility to
> include any future options, even if they match option-structure.
> 
> Of course, i can be wrong, but then rfc8610 text is really misleading.
> 
> 3) Here is what i propose:
> 
>    
>      grasp-option = valid-option / objective / any
>      valid-option = option .within option-structure
>      option-structure = [*any]
>      option-type = uint
> 
> 
>      flood-message = [M_FLOOD, session-id, initiator, ttl,
>                      +[objective, (locator-option / [])], *grasp-option]
> 
>      "All other"-message = [ ... existing definitions ..., *grasp-option]
> 
> 
> Explanations:
> 
> IMHO, we need to be able to introduce options that will be ignored when
> an earlier GRASP implementation receives them. To do this,
> we must append *grasp-option to all message definitions. Else a
> legacy receiver will not recognize the message as an existing message
> according to the CDDL.

I think that correct use of .within covers that point, if a protocol
decoder is adhering to CDDL in some strict fashion. If it isn't
CDDL-driven, which is the norm, the text in RFC8990 already tells
it to ignore unknowns.

> 
> We already discussed that we want to be more flexible with option-structure,
> hence the *any there.
> 
> The .within ONLY gives us a checker that all the options that
> we define are matching option-structure. If we for example define
> 
>      option /= [ -1, "bla" ]
> 
> The name valid-option matches only those option that match option-structure,
> but it does not match any structure that matches option-structure. So it
> is IMHO not the solution for our extensibility problem.
> 
> Also: in any RFC valid-option must really be the same as option, because
> otherwise we would have defined an option that doesn't match option-structure
> (so it is an option, but not a valid-option), and of course we wouldn't want
> to publish that as an RFC. But in any case, using valid-option in grasp-option
> simply enforcesthat.
> 
> grasp-option must have any to allow extensibility with future options
> as described above.

It turns out that we need any in the .within structure anyway,
to make the CDDL consistent with all the existing messages.

> 
> If someone wants to make the argument that we should not allow any,
> then any needs to be replaced with option-structure, but not
> removed. But i strongly suggest any. For example, we may want to add
> maps later on as permitted structures. so why exclude them.
> 
> According to carsten, the "/" is match-first, so grap-option will
> reliably match against any defined option and objective before it
> goes to match any.
> 
> 4) Breaking forward compatibility.
> 
> option-type should be defined by ranges. We can define that in CDDL
> as well, just too lazy now:
> 
> standards-action, experimental

I'm against that. IMHO we should limit complexity and change in the core
part of GRASP, and use the infinite flexibility already allowed
in objective definitions.
  
> We may also want to carve out ranges to indicate that an option received
> with such a numbe,if not known to the receiver must not be ignored but
> needs to result in an error condition.
> 
> 5) M_FLOOD
> 
> M_FLOOD still has the added issue, that it can have multiple objectives,
> and we do not have a way to express per-objective options. Which bugs me.

It doesn't bug me, because I see all the expressivity we need
in objective-value = any.

    Brian
> 
> Cheers
>      Toerless