Re: [netmod] namespace encoding in draft-ietf-netmod-yang-json-02

Martin Bjorklund <mbj@tail-f.com> Thu, 11 December 2014 15:41 UTC

Return-Path: <mbj@tail-f.com>
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 3CF9B1A212D for <netmod@ietfa.amsl.com>; Thu, 11 Dec 2014 07:41:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 Nkz7IA78aPg8 for <netmod@ietfa.amsl.com>; Thu, 11 Dec 2014 07:41:10 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [83.241.162.140]) by ietfa.amsl.com (Postfix) with ESMTP id 3F85E1A1AEA for <netmod@ietf.org>; Thu, 11 Dec 2014 07:41:10 -0800 (PST)
Received: from localhost (x15.tail-f.com [192.168.1.60]) by mail.tail-f.com (Postfix) with ESMTPSA id 041831280A90; Thu, 11 Dec 2014 16:41:09 +0100 (CET)
Date: Thu, 11 Dec 2014 16:41:08 +0100
Message-Id: <20141211.164108.1819427320573439358.mbj@tail-f.com>
To: lhotka@nic.cz
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <7F37594C-C5FE-4620-86F3-54E668783EB2@nic.cz>
References: <m2388my5fb.fsf@nic.cz> <CABCOCHTvT0F2rE9SPm=-geY5DqKc27gcRoOUS2M2i+NcNBkLGg@mail.gmail.com> <7F37594C-C5FE-4620-86F3-54E668783EB2@nic.cz>
X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/n--R-LEZR7mp3i8qzwPFAtBOlp8
Cc: netmod@ietf.org
Subject: Re: [netmod] namespace encoding in draft-ietf-netmod-yang-json-02
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: Thu, 11 Dec 2014 15:41:12 -0000

Ladislav Lhotka <lhotka@nic.cz> wrote:
> 
> > On 11 Dec 2014, at 16:01, Andy Bierman <andy@yumaworks.com> wrote:
> > 
> > On Thu, Dec 11, 2014 at 12:08 AM, Ladislav Lhotka <lhotka@nic.cz>
> > wrote:
> >> Andy Bierman <andy@yumaworks.com> writes:
> >> 
> >>> Hi,
> >>> 
> >>> Sec 4 has changed the rules for module names:
> >>> 
> >>>   Names with namespace identifiers in the form shown in Figure 1 MUST
> >>>   be used for all top-level YANG data nodes, and also for all nodes
> >>>   whose parent node belongs to a different namespace.  Otherwise, names
> >>>   with namespace identifiers MUST NOT be used.
> >>> 
> >>> 
> >>> So it is a protocol error if a prefix is used twice in a row:
> >>> 
> >>>   /A:foo/A:bar     --> causes a protocol error and MUST be rejected
> >>>   /A:foo/bar MUST be used instead
> >>> 
> >>> IMO this is very fragile and does not follow the Postel Principle.
> >> 
> >> I don't agree it is fragile. The rule for deciding about the presence
> >> or
> >> absence of a namespace ID is robust and dead simple: compare the
> >> namespaces of the current node and its parent - if they differ, add
> >> the
> >> namespace ID.
> >> 
> > 
> > It is not robust at all.
> > If the correct prefix is provided it should be accepted.
> > That would be robust.  Rejecting an identifier for using
> > the correct prefix for a node is fragile, and quite counter-intuitive
> > for anybody familiar with XPath.
> > 
> > 
> >>> In this example the server knows module 'A' and it is the correct
> >>> module for node 'bar'.  Yet it MUST reject the input according
> >>> to the new rules.
> >>> 
> >>> I prefer these rules:
> >>> 
> >>>   - The namespace for a node MUST be uses in top-level
> >>>     nodes and if the namespace is changing.
> >>>   - If no prefix is present, then the namespace associated with
> >>>     the parent node is used
> >>> 
> >> 
> >> This would be useful for senders that want to skip making the above
> >> decision a instead attach namespace IDs to all names. But this just
> >> shifts the burden to the receiving side.
> >> 
> > 
> > 
> > The receiver already has to check for a prefix so I do not see
> 
> The receiver only needs to check whether the member name contains a
> colon, and nothing else has to be done if it doesn’t - and this is the
> most frequent case by far.
> 
> > any burden.  It is an added burden to check the prefix
> > and decide it is invalid just because it is redundant.
> > 
> >>> IMO it is too much work for the server to verify that
> >>> a prefix is not used. Parsing a prefix is not a burden,
> >> 
> >> I don't think it is difficult, see above.
> >> 
> >>> since the code to parse the prefix must be already there.
> >> 
> >> Parsing is one thing and comparing the namespace ID with the parent is
> >> another. With the existing rules, the namespace change is signalled in
> >> a
> >> much clearer way.

+1  Easier to read, and less error-prone, and consistent.

> > That encoding is also accepted.
> > Redundant information is not the same thing as incorrect information.
> > The receiver must be liberal in what it accepts.  Rejecting redundant
> > but valid data does not follow the Postel Principle.
> 
> Although I prefer to have namespace ID only where the namespace
> changes, I could live with your proposal. I just want to hear others
> to express their opinion.

I also prefer to have the prefix only when the namespace changes.



/martin