Re: [core] Comments on draft-ietf-core-yang-cbor-06

Carsten Bormann <cabo@tzi.org> Mon, 09 July 2018 16:17 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0796D131025; Mon, 9 Jul 2018 09:17:32 -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 um0OOVIoUEnD; Mon, 9 Jul 2018 09:17:29 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (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 AB47613101E; Mon, 9 Jul 2018 09:17:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [134.102.201.11]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id w69GHHsg026406; Mon, 9 Jul 2018 18:17:17 +0200 (CEST)
Received: from [192.168.217.114] (p5DC7F1FB.dip0.t-ipconnect.de [93.199.241.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 41PVpj3lNPzDXhL; Mon, 9 Jul 2018 18:17:17 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <DM5PR06MB27772BC8B389ED32841725A19A440@DM5PR06MB2777.namprd06.prod.outlook.com>
Date: Mon, 09 Jul 2018 18:17:16 +0200
Cc: Robert Wilton <rwilton@cisco.com>, "draft-ietf-core-yang-cbor@ietf.org" <draft-ietf-core-yang-cbor@ietf.org>, "core@ietf.org" <core@ietf.org>
X-Mao-Original-Outgoing-Id: 552845833.5686359-fd2b97ed761ad00344a1e34a288942e5
Content-Transfer-Encoding: quoted-printable
Message-Id: <F3F051B4-A1EB-4B78-923B-A9E3F88759C1@tzi.org>
References: <6ff65b2e-ab4f-5d92-8fff-68c08584682e@cisco.com> <DM5PR06MB2777C2ABB330D1054D2E1D8D9A440@DM5PR06MB2777.namprd06.prod.outlook.com> <E765AC20-41BE-4235-B858-6904C9BA63EF@tzi.org> <DM5PR06MB27772BC8B389ED32841725A19A440@DM5PR06MB2777.namprd06.prod.outlook.com>
To: Michel Veillette <Michel.Veillette@trilliant.com>
X-Mailer: Apple Mail (2.3445.8.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/umznda5_7lXHMuPtO4aZoAtmppw>
Subject: Re: [core] Comments on draft-ietf-core-yang-cbor-06
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Jul 2018 16:17:33 -0000

Hi Michel,

> https://tools.ietf.org/html/draft-ietf-core-comi-03#section-5.2.3.1
> 
>   REQ: GET example.com/c/a5
> 
>   RES: 2.05 Content (Content-Format: application/yang-value+cbor)
>   {
>     +2 : "2014-10-26T12:16:51Z",   / current-datetime SID 1723 /
>     +1 : "2014-10-21T03:00:00Z"    / boot-datetime SID 1722 /
>   }

I actually didn’t want to exclude this example (just wanted to make sure all those places in the tree are deltas), but the comments from Robert and Andy make me think again.

The idea of depending on the request path for decoding the response is akin to all the issues we have with base URIs and charsets in HTML files saved from the browser.

Turning this into

> RES: 2.05 Content (Content-Format: application/yang-value+cbor)
>   {
>     +1723 : “2014-10-26T12:16:51Z”,   / current-datetime SID 1723 /
>     +1722 : “2014-10-21T03:00:00Z"    / boot-datetime SID 1722 /
>   }

by not using the context makes little difference in this specific example, but if the data items are not the heavyweight strings from this example but some numbers, it can make a difference.

If we had a way to put the context SID into the response, we would still waste a few bytes for that, but at least not for every single map key below that.

An alternative would be to keep it as is for the exchange but nail down a format for *saved* yang-cbor that includes the context SID.  Tools would then know to never save a naked body but instead wrap it into something like:

[“application/yang-value+cbor”,   
 1721,
 { +2 :…

I put in the media type there (we probably would really use the content-format number) as well to make it easier to understand stored yang-cbor.  (We could also spend a number of tags for the media types as in RFC 8152; long ones to turn them into a magic number as we did with 55799 in RFC 7049.)

Grüße, Carsten



> On Jul 9, 2018, at 17:39, Michel Veillette <Michel.Veillette@trilliant.com> wrote:
> 
> Hi Carsten
> 
> CoMI for example, uses delta for the first root data node based on the requested SID.
> In the following example, the +2 is relative to SID 1721 which is part of the requested URI (i.e. a5).
> This requested SID need to be maintained in the client state in order to process the response.
> 
> https://tools.ietf.org/html/draft-ietf-core-comi-03#section-5.2.3.1
> 
>   REQ: GET example.com/c/a5
> 
>   RES: 2.05 Content (Content-Format: application/yang-value+cbor)
>   {
>     +2 : "2014-10-26T12:16:51Z",   / current-datetime SID 1723 /
>     +1 : "2014-10-21T03:00:00Z"    / boot-datetime SID 1722 /
>   }
> 
> Regards,
> Michel
> 
> -----Original Message-----
> From: Carsten Bormann [mailto:cabo@tzi.org] 
> Sent: Monday, July 9, 2018 11:23 AM
> To: Michel Veillette <Michel.Veillette@trilliant.com>
> Cc: Robert Wilton <rwilton@cisco.com>; draft-ietf-core-yang-cbor@ietf.org; core@ietf.org
> Subject: Re: [core] Comments on draft-ietf-core-yang-cbor-06
> 
> It is much less confusing to always talk of deltas in the structure.
> 
> Just say that the context SID value (the one that the delta is computed from) is 0 at the root of a tree.
> 
> Grüße, Carsten
> 
> 
>> On Jul 9, 2018, at 17:18, Michel Veillette <Michel.Veillette@trilliant.com> wrote:
>> 
>> Hi Robert
>> 
>> Andy also asked for a clarification about the encoding of the root data node identifier (absolute vs. delta).
>> Section 4.4.1. have a sentence addressing this topic.
>>   It is important to note that the protocol or method
>>   using this mapping may carry a parent SID or may have the knowledge
>>   of this parent SID based on its context.  In these cases, delta
>>   encoding can be performed based on this parent SID which minimizes
>>   the size of the encoded data.
>> 
>> A similar sentence need to be added to section 4.2.1.
>> We also need to clarify that the protocol or method using this encoding must mandate which approach is implemented, the data serialized don’t carry this information.
>> 
>> Regards,
>> Michel
>> 
>> From: Robert Wilton [mailto:rwilton@cisco.com] 
>> Sent: Monday, July 9, 2018 11:00 AM
>> To: draft-ietf-core-yang-cbor@ietf.org; core@ietf.org
>> Subject: Comments on draft-ietf-core-yang-cbor-06
>> 
>> Hi,
>> 
>> I've read this draft, and think that it is well written.
>> 
>> There is one area of the draft that is somewhat unclear to me when using SID encodings:  Is the root node(s) of a request or a response always an absolute SID value, or could it still be a delta?
>> 
>> In particular:
>> 
>> Sec 2.1 indicates that the translation to/from SID deltas is stateless, which implies to me that the root node(s) of a request/response would always be an absolute SID value.
>> 
>> Sec 4.2.1 gives an example using a absolute SID for the top node.  It then has this text: "
>> 
>>   On the other hand, if the serializer is aware of the parent SID, 1716
>>   in the case 'system-state' container, root data nodes are encoded
>>   using deltas.
>> "
>> I think that it is quite plausible that the serializer may know the SIDs for all nodes in the data tree, which the text implies it could then use a relative SID for the top node.  Particularly, if the top level node was explicit from the request.
>> 
>> Hence, I think that this draft could probably benefit in being more explicit on exactly when a top level node uses an absolute SID, and in what scenarios it may end up using a a relative SID.  If this distinction is down to the protocol being used, then perhaps that could be stated?
>> 
>> One other nit:
>> 
>> Section 4.4.1 says "delta encoding can be performed", but I think that this should probably be "delta encoding MUST be performed".
>> 
>> Thanks,
>> Rob
>> 
>> 
>> 
>> 
>> _______________________________________________
>> core mailing list
>> core@ietf.org
>> https://www.ietf.org/mailman/listinfo/core
> 
> 
>