Re: [apps-discuss] ??: New round of comments on draft-greevenbosch-appsawg-cbor-cddl-04

"Jim Schaad" <ietf@augustcellars.com> Wed, 21 January 2015 18:52 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E34DB1A6F3C for <apps-discuss@ietfa.amsl.com>; Wed, 21 Jan 2015 10:52:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 2.967
X-Spam-Level: **
X-Spam-Status: No, score=2.967 tagged_above=-999 required=5 tests=[BAYES_50=0.8, FF_IHOPE_YOU_SINK=2.166, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=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 etcUAZ2yp8NS for <apps-discuss@ietfa.amsl.com>; Wed, 21 Jan 2015 10:52:37 -0800 (PST)
Received: from smtp3.pacifier.net (smtp3.pacifier.net [64.255.237.177]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A63A21A6F28 for <apps-discuss@ietf.org>; Wed, 21 Jan 2015 10:52:36 -0800 (PST)
Received: from Philemon (173-164-94-161-Oregon.hfc.comcastbusiness.net [173.164.94.161]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jimsch@nwlink.com) by smtp3.pacifier.net (Postfix) with ESMTPSA id 0B28E38F31; Wed, 21 Jan 2015 10:52:34 -0800 (PST)
From: Jim Schaad <ietf@augustcellars.com>
To: 'Bert Greevenbosch' <ietf@bertgreevenbosch.nl>
References: <042b01d031fe$0c7edfc0$257c9f40$@augustcellars.com> <D0C6C869A85CC246A93F3F5823FB45385428B60B@SZXEMA509-MBX.china.huawei.com> <54BDFBF3.9010101@bertgreevenbosch.nl>
In-Reply-To: <54BDFBF3.9010101@bertgreevenbosch.nl>
Date: Wed, 21 Jan 2015 10:51:48 -0800
Message-ID: <031201d035ab$5077e9a0$f167bce0$@augustcellars.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0313_01D03568.425A00D0"
X-Mailer: Microsoft Outlook 14.0
Content-Language: en-us
Thread-Index: AQIkoVtF/wxHHQfQmcTr3uIMbS3ufgHaP14+AafTl2KcBQwjIA==
Archived-At: <http://mailarchive.ietf.org/arch/msg/apps-discuss/pO7j58UYE0YFJ-rogyivQCcjnQo>
X-Mailman-Approved-At: Thu, 22 Jan 2015 10:11:37 -0800
Cc: apps-discuss@ietf.org, draft-greevenbosch-appsawg-cbor-cddl@tools.ietf.org
Subject: Re: [apps-discuss] ??: New round of comments on draft-greevenbosch-appsawg-cbor-cddl-04
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss/>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Jan 2015 18:52:40 -0000

 

 

From: Bert Greevenbosch [mailto:ietf@bertgreevenbosch.nl] 
Sent: Monday, January 19, 2015 10:56 PM
To: Jim Schaad
Cc: draft-greevenbosch-appsawg-cbor-cddl@tools.ietf.org
Subject: Re: ??: New round of comments on draft-greevenbosch-appsawg-cbor-cddl-04

 

Hi Jim,

Thank you for your comments. They are very helpful. Please find my answers below.

B.T.W.,would you mind including the apps-discuss mailing list in this discussion? It may be good for the chairs and others to see activity on this draft.

1. You have a length restriction on float, do you see a need for begin able to do length restrictions on int, tstr and bstr? I don't know if a restriction based on number of bytes or based on a value range would be better. It make sense to use the () syntax to specify a length restriction since you are already using it for float. 

I started out with such notation, e.g. "int(16)" for a 16-bit integer. However, there is a difference between ints and floats: for any integer number, it is easy to find out how much bits are needed. Hence we could allow some freedom in choosing the number of bits on a per-number basis on the encoder side. This was a comment from Carsten, and we subsequently removed the "int(16)" notation.

For floats, this is harder, as the number of bits does not depend on the value of the variable, but on the precision with which we want to represent that variable. For example, the value 1/3 can be represented using both a float(16) and a float(32), but the latter representation would be closer to the real value than the former.

[JLS] What I was looking for was a size limitation which might be helpful.  That is the integer that goes here is limited to 16 bits.

3. I will reiterate the request for some type of alternate syntax for types - i.e. TypeA or TypeB

I like your earlier proposed notation:

price: uint | float(16)

and think we can implement this in the next version of the draft.

2. You have removed the union/choice structure from the document. I highly recommend that this be added back in some form. 

I think we can use the same solution for (3) as well, as follows:

*smallStructure1 {
   dish: tstr;
   recipe: tstr;
}

*smallStructure2 {
   drink: tstr;
   price: int;
}

*BigStructure : {
   subStructure: smallStructure1 | smallStructure2; 
}

Interesting would be how to distinguish between smallStructure1 and smallStructure2. Especially in the following case:

*smallStructure1 {
   dish: tstr;
   recipe: tstr;
}

*smallStructure2 {
   drink: tstr;
   ingredients: tstr;
}

*BigStructure : {
   subStructure: smallStructure1 | smallStructure2; 
}

The last may need some more consideration.

[JLS] while one could use tags – is there a reason not to go back to the world of using an int field to discriminate?



4. A structure can be folded at the top level into a structure by not using the '*' operator on a type. Do you want to be able to do the same type of thing for a map?

Not sure about this. Do you have an example?

CDDL maps need a CBOR map encoding. A structure, however, does not necessarily require what I call an "encompassing array". Thus the encompassing array is signalled by the asterisk, because there is a choice.

[JLS]  If one looks at the COSE document that I am working on.  One can define three maps, one each for an EC key, for an RSA key and for a secret key.  One can then define a base key with common fields that are not algorithm specific.  One could then define  single map that included each of the other items into it by reference rather than as sub items.

 

COSE_KEY : map { base_key; rsa_key; ec_key; secret_key }



5. I don't understand the last example in section 4.5.1 - You are combining a structure and a map together into a single item. Would the syntax "ToString: map(., tstr)" be a better example? This is a map in this case and that is what you are talking about 

Yes, indeed this would be better:

toString: map( ., tstr );

(Notice the lower case "t" at the beginning, this is a convention I use for variable names, although it is not mandatory.)

Best regards,
Bert



On 19-01-15 01:59, Sunruinan wrote:

Hi Bert, I received such email from Jim. Since I can't find it in appsawg email list, I think this is a system automatic email, is it right? Can I find some web pages about these comments? As the title of this email, it means New round of comments. Are these comments has some relationship with the previous round comments? Thank you in advance for your reply! Best Regards! Ruinan -----邮件原件----- 发件人: Jim Schaad [mailto:ietf@augustcellars.com] 发送时间: 2015年1月17日 10:34 收件人: draft-greevenbosch-appsawg-cbor-cddl@tools.ietf.org 主题: New round of comments on draft-greevenbosch-appsawg-cbor-cddl-04 Here comes a new round of comments on the draft. I have tried not hit the same points again. 1. You have a length restriction on float, do you see a need for begin able to do length restrictions on int, tstr and bstr? I don't know if a restriction based on number of bytes or based on a value range would be better. It make sense to use the () syntax to specify a length restriction since you are already using it for float. 2. You have removed the union/choice structure from the document. I highly recommend that this be added back in some form. 3. I will reiterate the request for some type of alternate syntax for types - i.e. TypeA or TypeB 4. A structure can be folded at the top level into a structure by not using the '*' operator on a type. Do you want to be able to do the same type of thing for a map? 5. I don't understand the last example in section 4.5.1 - You are combining a structure and a map together into a single item. Would the syntax "ToString: map(., tstr)" be a better example? This is a map in this case and that is what you are talking about Jim . 


-- Bert Greevenbosch ietf@bertgreevenbosch.nl 



Best regards,
Bert



On 20-01-15 07:09, Sunruinan wrote:

Hi Jim,
Thank you for your comments!
Since Bert is original editor of this draft and more familiar with previous discussion, I forward your comments to his new email address.
He can give some answers.
 
Best Regards!
Ruinan Sun
Huawei
 
-----邮件原件-----
发件人: Jim Schaad [mailto:ietf@augustcellars.com] 
发送时间: 2015年1月17日 10:34
收件人: draft-greevenbosch-appsawg-cbor-cddl@tools.ietf.org
主题: New round of comments on draft-greevenbosch-appsawg-cbor-cddl-04
 
Here comes a new round of comments on the draft.  I have tried not hit the same points again.
 
1. You have a length restriction on float, do you see a need for begin able to do length restrictions on int, tstr and bstr?  I don't know if a restriction based on number of bytes or based on a value range would be better.  It make sense to use the () syntax to specify a length restriction since you are already using it for float.
 
2. You have removed the union/choice structure from the document.  I highly recommend that this be added back in some form.
 
3. I will reiterate the request for some type of alternate syntax for types
- i.e. TypeA or TypeB
 
4. A structure can be folded at the top level into a structure by not using
the '*' operator on a type.   Do you want to be able to do the same type of
thing for a map? 
 
5. I don't understand the last example in section 4.5.1 - You are combining a structure and a map together into a single item.  Would the syntax
"ToString: map(., tstr)" be a better example?  This is a map in this case and that is what you are talking about
 
 
Jim
.