Re: [netmod] comments on draft-ietf-netmod-yang-json-00.txt

Ladislav Lhotka <lhotka@nic.cz> Sun, 20 July 2014 14:13 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C62BA1B2B4E for <netmod@ietfa.amsl.com>; Sun, 20 Jul 2014 07:13:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham
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 GZ4rGgJMycVb for <netmod@ietfa.amsl.com>; Sun, 20 Jul 2014 07:13:09 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 347041B280B for <netmod@ietf.org>; Sun, 20 Jul 2014 07:13:08 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id 71735540749; Sun, 20 Jul 2014 16:13:05 +0200 (CEST)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9eglibHlTw0n; Sun, 20 Jul 2014 16:13:01 +0200 (CEST)
Received: from localhost (dhcp-8cc7.meeting.ietf.org [31.133.140.199]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id B1D125406BA; Sun, 20 Jul 2014 16:13:00 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, netmod@ietf.org
In-Reply-To: <20140715115511.GA534@elstar.local>
References: <20140715115511.GA534@elstar.local>
User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Sun, 20 Jul 2014 10:12:55 -0400
Message-ID: <m2tx6c2k60.fsf@dhcp-8cc7.meeting.ietf.org>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/LPoHZcrYytb_msCJ0aaAJOEydDY
Subject: Re: [netmod] comments on draft-ietf-netmod-yang-json-00.txt
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 20 Jul 2014 14:13:12 -0000

Hi Juergen,

thanks for reviewing the draft.

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> writes:

> I have reviewed draft-ietf-netmod-yang-json-00.txt and I have a couple
> of questions.
>
> * Relationship to <draft-ietf-json-i-json-02>:
>
>   - Lada, you once said that the JSON mapping leads to an I-JSON
>     message. I note that I-JSON puts constraints on say object member
>     names (section 2.1). Do we have the same constraints in YANG?

Yes, a member name in our case can be:
- YANG identifier
- pair of colon-separated YANG identifiers (explicit namespace)

Names of metadata objects also include "@".

>
>   - There is a recommendation (section 2.3) to encode large integers
>     (e.g. 64-bit integer values) as JSON string values.

It is an option to encode int64 and uint64 as strings, although it would
be awkward.

>
>   - What about the other recommendations, e.g. base64 vs. base64url?

IMO, in this case we should stick to base64 because this is what YANG
prescribes for the "binary" type. I don't think we need URL-safe
encoding.

>
>   Would it make sense to add a section to explain the relationship of
>   the JSON mapping of YANG to I-JSON messages?

Yes, although I don't know whether it is a good idea to use it as a
normative reference.

>
> * Numbers
>
>   RFC 7159 makes me believe numbers are always treated as floating
>   point numbers in JSON and hence there are precision limits. Note
>   that RFC 7159 says:
>
>     Note that when such software is used, numbers that are integers and
>     are in the range [-(2**53)+1, (2**53)-1] are interoperable in the
>     sense that implementations will agree exactly on their numeric
>     values.

I-JSON spec even says that the sender MUST NOT expect the receiver to treat
an integer outside that range as an exact value.

>
>   So how does this work with out 64-bit integer types?

For such large values it doesn't, I am afraid.

>
>   And should there be a discussion of YANG's decimal64 type? Can JSON
>   parsers always be expected to treat them nicely?

Probably not, it is the same problem. However, I wonder whether large
decimal64 values can be safely processed even if they are passed in XML
- most likely they will end up as double precision numbers anyway.

>
> * Namespaces
>
>   Is the module qualified notation a common convention or could it be
>   that JSON people eventually pick a different solution for dealing
>   with namespaces?

There is no standard solution. Expired I-D

http://tools.ietf.org/html/draft-saintandre-json-namespaces-00

proposed to use James Clark's notation, {URI}local-name, e.g.

{urn:ietf:params:xml:ns:yang:iana-if-type}interface

We are lucky that we can avoid the URI-prefix duality by using the
module name. And using colon as the separator is natural because it is
not allowed in identifiers.

>
> * IANA
>
>   The question should be answered, one way or the other.

RESTCONF spec registers the application/yang.data media type. I actually
think it would be more appropriate to bundle the registration with the
specification of the data format because the format can be used in
different protocols. So maybe the best place is 6020bis?
 
>
> * Security Considerations
>
>   An empty sections considerations section is not good.
>
> * Updates
>
>   [IF-CFG] became [RFC 7223]

Yes, I will write Security Considerations and update references in the next revision.

Thanks, Lada

>
> /js
>
> -- 
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C