Re: [Cbor] Some comments on cbor-cddl-05 and cbor-7049bis-02

John Mattsson <john.mattsson@ericsson.com> Wed, 12 September 2018 14:44 UTC

Return-Path: <john.mattsson@ericsson.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 6BACB130E27 for <cbor@ietfa.amsl.com>; Wed, 12 Sep 2018 07:44:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.309
X-Spam-Level:
X-Spam-Status: No, score=-4.309 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com header.b=KrrTqffN; dkim=pass (1024-bit key) header.d=ericsson.com header.b=bMd6fHhx
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 uxLU7ODj_IMp for <cbor@ietfa.amsl.com>; Wed, 12 Sep 2018 07:44:26 -0700 (PDT)
Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E5C57128CB7 for <cbor@ietf.org>; Wed, 12 Sep 2018 07:44:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1536763464; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=M+yaXzx2UCQWpABzadN95isFJq53CzUg9KZle8G6fpc=; b=KrrTqffNN6guT/ypNk3Etr4M5Hm1JLc4VIvjYD6/qeQF8dUayUyBaow4YzJu2WgU 8rmY2HVc83FtizDbbvfIA0EqTWkj2NFS3JGIradF8uPER9FKH61F6A9bPAr/AAYy xMVnc1u5luBGfxhP9fTt/XJMZ3ZvL7Q7Gj1hWqVtOmU=;
X-AuditID: c1b4fb2d-5ecb19c0000055ff-5d-5b9926480ade
Received: from ESESSMB501.ericsson.se (Unknown_Domain [153.88.183.119]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 75.99.22015.846299B5; Wed, 12 Sep 2018 16:44:24 +0200 (CEST)
Received: from ESESSMB504.ericsson.se (153.88.183.165) by ESESSMB501.ericsson.se (153.88.183.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 12 Sep 2018 16:43:56 +0200
Received: from EUR03-AM5-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB504.ericsson.se (153.88.183.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Wed, 12 Sep 2018 16:43:56 +0200
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M+yaXzx2UCQWpABzadN95isFJq53CzUg9KZle8G6fpc=; b=bMd6fHhxCBfKQXaBwB8FrfBLecE+exxpWnUBLdKXzrojx1L7lU6YGzN1GH8iTJkY9BbpuwdAK74K7y/RtXOSUSaz9QFgLGxsWGV6no3blFMIUHIkdZd8evJtdW6SFtvcz5h1orMqjN1gEUongGls9qAjG+6sjPFa+XGgLdUXBcs=
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com (20.176.166.22) by HE1PR07MB1372.eurprd07.prod.outlook.com (10.164.52.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.11; Wed, 12 Sep 2018 14:43:55 +0000
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::a451:7626:5a73:809]) by HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::a451:7626:5a73:809%5]) with mapi id 15.20.1143.010; Wed, 12 Sep 2018 14:43:55 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: Some comments on cbor-cddl-05 and cbor-7049bis-02
Thread-Index: AQHUSUo/j+kjrTH+rUafgOMUK+SRv6Ts3PqA
Date: Wed, 12 Sep 2018 14:43:55 +0000
Message-ID: <6691D9B4-08D0-47D1-8709-F9ED1DFCF21F@ericsson.com>
References: <D7D9E583-B019-4F96-B71E-C703887557D7@ericsson.com>
In-Reply-To: <D7D9E583-B019-4F96-B71E-C703887557D7@ericsson.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.11.0.180909
authentication-results: spf=none (sender IP is ) smtp.mailfrom=john.mattsson@ericsson.com;
x-originating-ip: [192.176.1.81]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; HE1PR07MB1372; 6:/o+H4K+VgWmiSXngjPVjvYj1AaGKds5lE6WefE4adra7WSlLWwzv86r5/8Tlj6uMIKGMKPavViEl+uUAAVm6/IG8WKZJnCbwFaL6FGO6o/FCtF7TXzd9h8VqH4jjWhpZC4SThbRoNN980fNgTVtd8BpjvA5RrQTlivsUT9jdWTnDGPfOoZjueAcY1pXHD+WHE4uiXqjXXzefsvIKoGveDi+DzPCjbJRl39Oy/ofI0kTxVVi/PSJ8eoBmB4c7ZKQ4o7urxBEHh21Qju182SS+syX7R1eaaCiTaaG6jwBxRBgF/CpV0xTqjsYOE/IeyFTcxt+qD/FUVQGMKJK2q8tMRPhYm0ZVgDISAkGDD43UO618HIYtYcvl79R4LAH1pf53ZuhQhW0S/JXic4ySqCOPoc5h/DT5lFN/TNzlEQD1ZGfexFiUwNK2QZfBR1//mGY3RSL2zpex6Zfm9pjUeCTZgQ==; 5:ybSRensHiMHy+gARLmT/hvOdKZdiQQLr/iI3B1ZeZnGMK8FIydFt5gqYiachz+B3b3gdDm3OvhAHMcP5RiNsYjIdbz8H5iB/LTczx3qAwZ5S8W3CcummlmXbJdYJB12ZcSWtezqsBgSJMe1J0G9MZRnTJcPXZ/Mff1Zz/EYuOtk=; 7:EQNSgLQPp/BkprnJ2fyasyjEoVijA6cLJsmCz+1B1PwIFz08pHwWr8XnDxah/NzErntcml6Tmrg3jNc8Vjg4xQuT3tqanIUlA16DIcwjeSDIol/h98u2mP86rZaxiVPXlzSyjUu1HESw4Vg6a2x5AOesI8yFLW7xZO9cnmTbfEvreZlnW5tflXDzMpZd6nxCJSx8WONGOUIO1YJUZRa9Gg8KBJjyEok1GQELXoCGxR4RNygXA/AvOgjwVnPmjmH5
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 20da64f3-62de-4372-0956-08d618be2a85
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:HE1PR07MB1372;
x-ms-traffictypediagnostic: HE1PR07MB1372:
x-microsoft-antispam-prvs: <HE1PR07MB1372E899C2EC583CA581177A891B0@HE1PR07MB1372.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(37575265505322)(248295561703944);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:HE1PR07MB1372; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1372;
x-forefront-prvs: 07935ACF08
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(39860400002)(376002)(366004)(51444003)(189003)(199004)(25786009)(106356001)(305945005)(36756003)(66066001)(97736004)(58126008)(1730700003)(8676002)(81166006)(81156014)(316002)(6486002)(8936002)(102836004)(5660300001)(6512007)(6306002)(6116002)(186003)(76176011)(3846002)(2906002)(7736002)(6916009)(53936002)(229853002)(26005)(5640700003)(966005)(14454004)(33656002)(478600001)(6436002)(6506007)(7520500002)(44832011)(2501003)(5250100002)(83716003)(99286004)(6246003)(68736007)(446003)(2900100001)(82746002)(486006)(105586002)(14444005)(256004)(86362001)(476003)(2616005)(2351001)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR07MB1372; H:HE1PR07MB4169.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: xZ90+KxzSUHB94yHNCr0B2/MZ0Jp4G6FN1Z5X+RuPwSUV9T5I5dm9RaFkgV1Z7VsxxGYnKVS8hvx9scZweD+IMC0REz0Lat5laR/o6XKQCOzDM5dxS4n/3P0oL8SO92qJo1NdQjwV/crWytmFb4nAk8nYf2uVZwFpy6DTYv7nCgIcEti5oUV3KLrPeXZDx2jLijnyNn7uNr0tSlVqQshAuc2h75RqHMua8RSaH2GbEKVm1LbkxxM/pwNU2XmPd8Kg+uW1g1P0PHGsjQ5jWc8JM0rZiKqmZZMVggLIvHTWJlL5TLq15bN3ZJJ3tNeJk7nNG3jrzuHsaeCdLNEwGBiHx0YYA8qqgiGffsmHw7gNPw=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <E672764D11325F4D9CA76D6B66B59D35@eurprd07.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 20da64f3-62de-4372-0956-08d618be2a85
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Sep 2018 14:43:55.4647 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1372
X-OriginatorOrg: ericsson.com
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42KZGbG9XNdDbWa0wZ6vTBYzO6azODB6LFny kymAMYrLJiU1J7MstUjfLoEr435LG1PBFdWKI7OvsTYw3lDpYuTkkBAwkVh37SFbFyMXh5DA UUaJRe0TGSGcb4wS2093QWWWMEksb93CCNLCIjCBWeJedxlEYhKTRPPCD1BVDxglHj78xwZS xSZgIDF3TwOYLSKgLDF1ymEwW1jATuLU06esEHF7ifvt21ggbCOJzw0tzBAbVCWadvwEquHg 4AWqOXpCHCQsBGTO3HyCHcTmFHCQmHb0N5jNKCAm8f3UGiYQm1lAXOLWk/lMEL8JSCzZc54Z whaVePn4H9haUQF9ifkPOlghemMlWluns0LUKEgcm7GSBcKWlbg0vxscFBIC+9glFn15CTVU V+LD1KlQQ30lepqnskIUHWeUuHz8AVS3lsTszeugGrIlTs/ewAZhe0s0Np6EapaTWNX7kGUC o9EsJIfPAvqZWUBTYv0ufYiwh8S2WytYIWxFiSndD9lBbF4BQYmTM5+wLGBkXcUoWpxaXJyb bmSsl1qUmVxcnJ+nl5dasokRmDoObvmtu4Nx9WvHQ4wCHIxKPLy7BGdGC7EmlhVX5h5ilOBg VhLhfc0OFOJNSaysSi3Kjy8qzUktPsQozcGiJM6rt2pPlJBAemJJanZqakFqEUyWiYNTqoFx 8cRga2svyS8S1wwO3qmMm3DiaDyviWuN7dXG5pB7OYqspTs8+VJPXncSFXS/+czFT7tLcvdX Wf7JUe27baYtCV97nu1+Nttl4dUX5J7K9LUs2JdTlR5n/ceVIcAwcw3jAlYrD6V0q7enGc8E xn3NVIk95xuoPHXd5qp1jl4b/ulnr9J7GKbEUpyRaKjFXFScCAAF6d5RGQMAAA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/00NtPPE5UX5rQpBINEoaAn3ikqk>
Subject: Re: [Cbor] Some comments on cbor-cddl-05 and cbor-7049bis-02
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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: Wed, 12 Sep 2018 14:44:29 -0000

Hi,

Two additional comments

/John

--------------------------------------------------

Should't [], {}, and () be in Table 1?

--------------------------------------------------

Would it be possible to allow the << >> notation also in CCDL? The CDDL notation for wrapping things in byte strings are very different from the diagnostic notation. Realising which diagnostic notation expressions matches bstr .cbor type1 and bstr .cborseq type2 are not obvious. I think that allowing the << >> notation in CDDL would make it easier for users of CDDL (e.g. writers of internet-drafts and developers). 

def1 = << int >>

def2 = <<
   x: float,
   y: float,
>>

--------------------------------------------------

On 2018-09-10, 22:45, "John Mattsson" <john.mattsson@ericsson.com> wrote:

Hi,

Hi, took some time to read these two documents in detail during my last trip. Both documents are very well written and quite easy to read and understand. Some comments:


Comments on cbor-cddl-05
---------------------------------

- I think cbor-cddl-05 should formally update RFC7049 or RFC7049bis as it extends the diagnostic notation.

- Section 2.2.1 seem to define value notation for integers, floats, and text strings, but not byte strings (which in my use cases are often used very much). Maybe the cddl tool already implements something that is just missings from the documents, otherwise all or some of the diagnostic notation for byte string would fit. e.g. h'0102030405'

- If I understand correctly, Section 3.8.5. uses the $ notation which is not defined until Section 3.9.

- That ".ctrl" in Table 1 means all CDDL control operators should be explained.

- Section 2.1.2 states that "comma is actually optional (not just in the final entry), but it is considered good style to set it."

Reading the doc it feels like the good style is to set all commas in definitions with a line break after each entry, but to leave out the last comma in definitions that do not use line breaks after each entry

orderedpair = [
   a: int,
   b: int,
]

orderedpair = [ a: int, b: int ]

I think the sentence should be updated to reflect this.

- More guidelines or at least links on how to include CDDL in RFCs would be helpful, i.e.

   <artwork type="CDDL"> in xml
   
   ~~~~~~~~~~~ CDDL in kramdown

- SenML is now published as RFC 8428

- The document refers to the cddl tool, it could also refer to tools for diagnostic notation in the extended diagnostic notation section, e.g. cbor.me


Comments on cbor-7049bis-02
---------------------------------

- 7049bis should obsolete RFC7049, I think.

- The terminology section should refer to RFC 8174

- JSON should refer to RFC 8259 instead of RFC 7159

- RFC 5226 should be replaced by RFC 8126

- ANS.1 should refer to the 2015 version
  https://www.itu.int/itu-t/recommendations/rec.aspx?rec=x.690

- ECMA/262 should refer to the 9th edition, 2018

- [TIME_T] should refer to the 2017 edition

- Could refer to tools for diagnostic notation in the extended diagnostic notation section, e.g. cbor.me


Comments on cbor-7049bis-02 or cbor-cddl-05
---------------------------------

I think it's a large benefit if the CDDL and the CBOR diagnostic notation is as similar as possible. The diagnostic notation should allow comma after the final entry. The specification is not clear here, but at least cbor.me dislikes all the following

[ 1, ]
{ 1, }
<< 1, >>

Cheers,
John