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

Toerless Eckert <tte@cs.fau.de> Mon, 22 August 2022 09:09 UTC

Return-Path: <eckert@i4.informatik.uni-erlangen.de>
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 BF3BAC1526EA; Mon, 22 Aug 2022 02:09:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.661
X-Spam-Level:
X-Spam-Status: No, score=-1.661 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=no autolearn_force=no
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 GYqk5KcPV8Cz; Mon, 22 Aug 2022 02:09:25 -0700 (PDT)
Received: from faui40.informatik.uni-erlangen.de (faui40.informatik.uni-erlangen.de [131.188.34.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 A3AC1C1522AC; Mon, 22 Aug 2022 02:09:22 -0700 (PDT)
Received: from faui48e.informatik.uni-erlangen.de (faui48e.informatik.uni-erlangen.de [IPv6:2001:638:a000:4134::ffff:51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by faui40.informatik.uni-erlangen.de (Postfix) with ESMTPS id D2C1958C4AF; Mon, 22 Aug 2022 11:09:16 +0200 (CEST)
Received: by faui48e.informatik.uni-erlangen.de (Postfix, from userid 10463) id BE3234EB810; Mon, 22 Aug 2022 11:09:16 +0200 (CEST)
Date: Mon, 22 Aug 2022 11:09:16 +0200
From: Toerless Eckert <tte@cs.fau.de>
To: Brian E Carpenter <brian.e.carpenter@gmail.com>
Cc: Carsten Bormann <cabo@tzi.org>, anima@ietf.org, cbor@ietf.org
Message-ID: <YwNHvF1wzS0yaZGe@faui48e.informatik.uni-erlangen.de>
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <fa2a8d32-929d-46ec-97b3-b67ad33c23b7@gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/vSv3EnLrcoWUpMnimNNmzgTyJ0A>
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 09:09:30 -0000

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.

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.

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

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.

Cheers
    Toerless