[Cbor] CDDL use in DTN WG

Brian Sipos <brian.sipos+ietf@gmail.com> Fri, 29 July 2022 00:40 UTC

Return-Path: <brian.sipos@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 1C53BC14F73A for <cbor@ietfa.amsl.com>; Thu, 28 Jul 2022 17:40:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=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 zyc-JS7YjB_7 for <cbor@ietfa.amsl.com>; Thu, 28 Jul 2022 17:40:09 -0700 (PDT)
Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 DD3D3C14F718 for <cbor@ietf.org>; Thu, 28 Jul 2022 17:40:09 -0700 (PDT)
Received: by mail-io1-xd2a.google.com with SMTP id q14so2647496iod.3 for <cbor@ietf.org>; Thu, 28 Jul 2022 17:40:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc; bh=QEOSxfvYop3EXsrG7WM9e72GxBoh9eXbCfBb1+JQtgE=; b=iyWQFZADAMCCP9JRdfmw/DKI5L4vyO0VciPd+Ol772oby17axvJ+oyIQDnGF5dB7N6 i+s6o+kB00gkpDjv2rdoYrMA/JrqrdlIXctXLL3J7kDzk0luj3+1qaYU0EsDQT86HVNg rGIoUxz5MDYb4TmttnpI4f4jkAW2/S7duNyEGzzffAZd3TWvUQ1D1MPPQsu2OYesfYUY xN7YpG3aySZyc7FujxtBnF4/sopPcVsQfhEqBXz5rRJntLb1ZX/0aBJsAmaYLMtd7JAD Mqqr5WDE+/VG2egnH4i+C2RNrtgrVYATean5o8Hv0l5vc5L99Zec94vkmi5jGV+3tGdZ RgCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc; bh=QEOSxfvYop3EXsrG7WM9e72GxBoh9eXbCfBb1+JQtgE=; b=qXfmTF8v+Y0Npm1nro/JTWLC3o1OSKr3son1QVvy2vkajjyAFo7jg5NHCFlFZATKK5 E3V4Yp1EOBsQrKR/aE3PtYyJVpHTKAIy26cqB1BEr1h4bVGaFGVNZMpPO5OklPfIOaoo za8yuTaDz0m11gDBAMuemSltctblwipay0NYLGNeB/OkQPq4EyIhBM1YofKyN/CJTFPE 8RNkkoDV1uQHtoL8hI8+LOgSLvKAiLjoMJ3E+2Ouvy/MH1jhvkD+Ge277ynJBLa+0ed/ 4NI8O71FDzNZOncbcDtVWNRO6GcKcXPt/jO3G+2M99nBX8APhiDtfmwFIQk4ZaFxWvS7 +HHw==
X-Gm-Message-State: AJIora9JJTuSAQYqMwolbhiFitLqMA5IrUjTLTsZy3MVufOyDE8cxZxe Q2a7lhirKhewqtAFT3EAqx1ua63XsSGbXZN/avUlUKpl
X-Google-Smtp-Source: AGRyM1uhVOeoQbB7xvBL3qhQYosTcEh2D2UbW4Rj+x5JSoDaFCzVOCpusZ6950ipe0IHtjIdUGPCnVQ0NtkcxPuhPN8=
X-Received: by 2002:a05:6602:2e07:b0:67c:9d61:4b50 with SMTP id o7-20020a0566022e0700b0067c9d614b50mr333396iow.121.1659055208879; Thu, 28 Jul 2022 17:40:08 -0700 (PDT)
MIME-Version: 1.0
From: Brian Sipos <brian.sipos+ietf@gmail.com>
Date: Thu, 28 Jul 2022 20:39:56 -0400
Message-ID: <CAM1+-gjbprRzBoK4STLW7U1EHxpv9qZEBEAhk4Fc6LW39wQ4nQ@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org
Content-Type: multipart/alternative; boundary="000000000000635ee905e4e6e4e9"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/gXspwNgBAp9Jo5fwRkp98aMAvTw>
Subject: [Cbor] CDDL use in DTN WG
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: Fri, 29 Jul 2022 00:40:14 -0000

Carsten,
Although there has been a good and consistent use of CBOR in the DTN WG,
the uptake of CDDL for documentation and implementation has been less
consistent. This may be due to its (perceived) complexity and maybe lack of
or maturity of tooling in the past. I was a heavy user of XML Schema and
all of the tooling that went along with it. I appreciate the current CDDL
and see how composition will help how existing definitions are able to be
used and how new ones can be steered to making their use easier.

For example, the definition Appendix B of RFC 9171 [1] makes use of both
sockets and generics to fully specify a protocol with many structural rules
and several extension points. The authors of RFC 9172 chose not to make an
explicit CDDL definition, but I constructed one [2] from the prose
explanations for my own validation needs and then extended that in a draft
[3] which also references rules from COSE RFC 8152 (which had to be
extracted from the source).

Besides a mechanism for composition, it would be useful to allow validation
tools to target a specific rule name as the required top-level item. I know
that this can currently be done by adding a new "first rule" in the
definition file but this is tedious and error prone when validating many
items against many possible top-level rules.

Let me know if any concepts or prototypes would be helpful to get feedback
on.
Brian S.

[1] https://www.rfc-editor.org/rfc/rfc9171.html#appendix-B
[2] https://github.com/BrianSipos/dtn-bpsec-cose/blob/main/bpsec.cddl
[3] https://www.ietf.org/archive/id/draft-bsipos-dtn-bpsec-cose-06.html