Re: [dtn] BPv7 CDDL and CBOR tagging

Carsten Bormann <cabo@tzi.org> Sat, 06 April 2019 12:51 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: dtn@ietfa.amsl.com
Delivered-To: dtn@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5D5E81200B1 for <dtn@ietfa.amsl.com>; Sat, 6 Apr 2019 05:51:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dfzkl5p23wXL for <dtn@ietfa.amsl.com>; Sat, 6 Apr 2019 05:51:44 -0700 (PDT)
Received: from smtp.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 69FCF120026 for <dtn@ietf.org>; Sat, 6 Apr 2019 05:51:44 -0700 (PDT)
Received: from client-0108.vpn.uni-bremen.de (client-0108.vpn.uni-bremen.de [134.102.107.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 44bxQQ4Rw7zyd7; Sat, 6 Apr 2019 14:51:42 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CY4PR1301MB20399B0DD6B59D2D566257379F570@CY4PR1301MB2039.namprd13.prod.outlook.com>
Date: Sat, 06 Apr 2019 14:51:41 +0200
Cc: "dtn@ietf.org" <dtn@ietf.org>, Scott Burleigh <scott.c.burleigh@jpl.nasa.gov>
X-Mao-Original-Outgoing-Id: 576247900.131725-8e6879eafd9a0e21483911c33238793c
Content-Transfer-Encoding: quoted-printable
Message-Id: <B8DF4499-2EEC-4680-B1AD-9FEF00A907D7@tzi.org>
References: <CY4PR1301MB20399B0DD6B59D2D566257379F570@CY4PR1301MB2039.namprd13.prod.outlook.com>
To: Brian Sipos <BSipos@rkf-eng.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dtn/zcBOPnRTnCs2N-pukQVEXrz9tDk>
Subject: Re: [dtn] BPv7 CDDL and CBOR tagging
X-BeenThere: dtn@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Delay Tolerant Networking \(DTN\) discussion list at the IETF." <dtn.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dtn>, <mailto:dtn-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dtn/>
List-Post: <mailto:dtn@ietf.org>
List-Help: <mailto:dtn-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dtn>, <mailto:dtn-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Apr 2019 12:51:46 -0000

On Apr 3, 2019, at 21:14, Brian Sipos <BSipos@rkf-eng.com> wrote:
> 
> 		• A disconnect between the “canonical-block" definition and the "extension-block" and "payload-block" uses (which are just canonical-block type with value restrictions, probably using ".within").

Right, it would help to define payload-block and extension-block, and .within could be used to reference canonical-block (which is currently unused).

The text of 4.2.1 in -12 starts with a paragraph that ends in:

   The last item of
   the array SHALL be a CBOR “break" stop code.

A break stop code is not a data item, but is the part of an indefinite-length array encoding that ends it (the same change needs to be made in the second paragraph of the start of section 4).  So the text seems to be trying to say

   bundle = [primary-block, *canonical-block]

The CDDL in Appendix B is more specific:

   bundle = [primary-block, *extension-block, payload-block]

So there must be a payload-block as the last data item, and zero or more extension-blocks preceding it, which according to the text in 4.2.1 all need to be of canonical-block structure.

Is there something from the text about extension-block and payload-block that could be encoded in a CDDL definition of these two?

So far, I have found text that makes be believe

payload-block = ([block-type-code: 1, canonical-block-common, ?crc]) .within canonical-block

and

extension-block = ([block-type-code: (uint .ne 1), canonical-block-common, ?crc]) .within canonical-block

BTW, the CDDL for primary block ends in three optional components, two of which are of the same type, so it is not clear whether you have a primary-block with a fragment-offset but without a total-application-data-length or a primary block with a total-application-data-length but no fragment-offset.

Grüße, Carsten