Re: [yang-doctors] Yangdoctors last call review of draft-ietf-ospf-yang-09

Ladislav Lhotka <lhotka@nic.cz> Mon, 15 January 2018 17:17 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4D1E112EADE for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 09:17:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.009
X-Spam-Level:
X-Spam-Status: No, score=-7.009 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_HI=-5, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 2JgoZtQU2CcY for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 09:17:13 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (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 CB40212EAC2 for <yang-doctors@ietf.org>; Mon, 15 Jan 2018 09:14:29 -0800 (PST)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:68c6:92ff:fe01:2298]) by mail.nic.cz (Postfix) with ESMTPSA id E9C5E6425D; Mon, 15 Jan 2018 18:14:27 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1516036468; bh=xevlaUrG1WAwLHDhNEHq/9Yr1fkKKb+uBf39n8KBTts=; h=From:To:Date; b=TS1lI2OXHTgzzZy9bAZmyNWewQ3E36wr2bfPCJc4EwtL5amBSyuSI/OUYSVpRdf/+ 8Xq4EoAFh0g0yb2iXs0AXhkDIQVJaemK8iwiffh0YhTcV4uTESPo14r48kYInCAyTK dhM2ujXS5e1kIPiVCdOL3sN9/WKAHj/QwoUH0XhY=
Message-ID: <1516036467.5426.90.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Andy Bierman <andy@yumaworks.com>, Martin Bjorklund <mbj@tail-f.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
Date: Mon, 15 Jan 2018 18:14:27 +0100
In-Reply-To: <CABCOCHQBwsi7WiUZw5V0QQ-t2n9Yy=nY_dWzyaixsrXwmo4k=w@mail.gmail.com>
References: <87po6fmlkn.fsf@nic.cz> <CABCOCHSFfgjVS58S0po-9yEUZw=cjzG6k_LY8V9NSdy+kHQvLg@mail.gmail.com> <1516006155.5426.3.camel@nic.cz> <20180115.095941.341257692373089671.mbj@tail-f.com> <CABCOCHQBwsi7WiUZw5V0QQ-t2n9Yy=nY_dWzyaixsrXwmo4k=w@mail.gmail.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.26.4
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/p-fO85gYArqZLt_Y-ARR_lW21cc>
Subject: Re: [yang-doctors] Yangdoctors last call review of draft-ietf-ospf-yang-09
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Jan 2018 17:17:16 -0000

On Mon, 2018-01-15 at 08:24 -0800, Andy Bierman wrote:
> > ....
> 
>  
> > > So what do you suggest? The last paragraph in sec. 9.10.3 is clearly
> > wrong.
> > 
> > I agree it is wrong, but only for identityref values that are defined
> > in a module that has not been imported.  I stronlgy agree w/ Andy that
> > this does NOT mean that we should change *working* and defined
> > behaviour in an errata.
> 
> 
> I think there is other text in the RFC that says a prefix is resolved in the
> local module.
> This is the only design that makes any sense, and the only design that could
> ever work.
> The module author has no control over prefix usage and imports in other
> modules.
> 
> 
> > The intention (for better or worse) was that the value would use the
> > prefix used in imports.  This means that if you want to do any kind of
> > comparision of the string value to some known identities, then you
> > must import that module so that there is a prefix defined.  This was
> > the intention.
> > 
> > From this follows that (for all practical matters), the string value
> > of an identity defined in a module that is not imported doesn't really
> > matter.
> > 
> > > Note also that this paragraphs tries to define the string value of an
> > > identityref node instance for any XPath expression, which needn't
> > necessarily be
> > > a simple EqualityExpr.
> > 
> 
> 
> The derived-from and derived-from-or-self functions are flawed
> because they use prefixes instead of module names and a missing
> prefix means the current module instead of the local module.
> I don't see how using derived-from-or-self(type, "foo") is any better
> than type="foo".  The latter is being used a lot and the XPath functions
> are not being used (by our customers).

Although I tend to agree that using module name as a parameter would be better
(it was I believe the original proposal), it is IMO not as flawed as the string
equality test because the semantics of the latter is defined by the XPath 1.0
spec. In contrast, the derived-from(-or-self) functions are defined in YANG, so
it is possible to specify additional semantics for its parameters.

I don't see any compelling reason why your customers couldn't use the functions.
The problem of sec. 9.10.3 is that it gives an excuse for using the plain string
test.

Lada

> 
> Seems new XPath functions are needed, like
>    derived-from2(type, "iana-if-type", "ethernetCsmacd")
> 
> 
>  
> > 
> > /martin
> > 
> 
> Andy
>  
> > 
> > >
> > > Lada
> > >
> > > >
> > > >
> > > > > Lada
> > > >
> > > >
> > > > Andy
> > > >
> > > > > >
> > > > > >
> > > > > > /martin
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >>
> > > > > >> Lada
> > > > > >>
> > > > > >> >
> > > > > >> >
> > > > > >> > /martin
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > >
> > > > > >> > > Lada
> > > > > >> > >
> > > > > >> > >
> > > > > >> > > >
> > > > > >> > > > and
> > > > > >> > > >
> > > > > >> > > >   module b {
> > > > > >> > > >     ...
> > > > > >> > > >     import ietf-ospf {
> > > > > >> > > >       prefix y;
> > > > > >> > > >     }
> > > > > >> > > >     ...
> > > > > >> > > >     leaf bar {
> > > > > >> > > >       when "../type = 'y:ospfv3'";
> > > > > >> > > >       ...
> > > > > >> > > >     }
> > > > > >> > > >   }
> > > > > >> > > >
> > > > > >> > > > You may not like it, but these two modules are both correct
> > > > > according
> > > > > >> > > > to the rules defined in RFC 7950.  The string value of the
> > "type"
> > > > > leaf
> > > > > >> > > > *when evaluating the when expression* is different in the
> > different
> > > > > >> > > > modules.  See the last paragraph of section 9.10.3 in RFC
> > 7950.
> > > > > >> > > >
> > > > > >> > > > > > > Also, potentially there can be a collision in prefixes
> > and
> > > > > then this
> > > > > >> > > >
> > > > > >> > > > also
> > > > > >> > > > > > > breaks down.
> > > > > >> > > > > >
> > > > > >> > > > > >
> > > > > >> > > > > > No, two modules cannot be imported with the same prefix.
> > > > > >> > > > >
> > > > > >> > > > > I have to disagree. An identity derived from the
> > > > > >> > > > > "ietf-routing:control-protocol-type" base identity can be
> > defined
> > > > > >> > > > > in a module that is not imported anywhere. If a server
> > declares
> > > > > such
> > > > > >> > > > > a module as implemented, then "rt:type" may have this value
> > per
> > > > > >> > > > > sec. 9.10.2.
> > > > > >> > > > >
> > > > > >> > > > > And, consequently, there may be two different modules with
> > > > > >> > > > > conflicting prefixes defining identities that are derived
> > from
> > > > > >> > > > > "ietf-routing:control-protocol-type".
> > > > > >> > > >
> > > > > >> > > > Sure, but this is not the point.
> > > > > >> > > >
> > > > > >> > > > > > > A moral of the namespace/prefix story in XML was that
> > relying
> > > > > of
> > > > > >> > > > > > > namespace prefixes having a particular value is a
> > really bad
> > > > > >> > > > > > > idea. I know that the cited paragraph was intended to
> > make
> > > > > such
> > > > > >> > > > > > > XPath string comparisons more deterministic, but it is
> > also
> > > > > >> > > > > > > problematic and should be avoided if possible.
> > > > > >> > > > > >
> > > > > >> > > > > > Note that this prefix is under the control of the module
> > > > > designer
> > > > > >> > > > > > writing the XPath expression.  The same identityref value
> > might
> > > > > use a
> > > > > >> > > > >
> > > > > >> > > > > No, it is not. The prefixes appear in instance data.
> > > > > >> > > >
> > > > > >> > > > The prefix *in the when expression* is under the control of
> > the
> > > > > module
> > > > > >> > > > designer, as explained above.
> > > > > >> > > >
> > > > > >> > > > You are correct that the prefix in an XML encoding is not
> > under
> > > > > >> > > > control of the module designer, but noone has claimed that.
> > > > > >> > > >
> > > > > >> > > > I agree that it is unfortunate that context-specific prefixes
> > are
> > > > > used
> > > > > >> > > > for the identityref values.  It would have been better if we
> > used a
> > > > > >> > > > context free representation, e.g. "<module-
> > name>:<identity>".  But
> > > > > >> > > > that's another discussion.
> > > > > >> > > >
> > > > > >> > > >
> > > > > >> > > >
> > > > > >> > > > /martin
> > > > > >> > >
> > > > > >> > > --
> > > > > >> > > Ladislav Lhotka
> > > > > >> > > Head, CZ.NIC Labs
> > > > > >> > > PGP Key ID: 0xB8F92B08A9F76C67
> > > > > >> > >
> > > > > >> --
> > > > > >> Ladislav Lhotka
> > > > > >> Head, CZ.NIC Labs
> > > > > >> PGP Key ID: 0xB8F92B08A9F76C67
> > > > > >>
> > > > > >> _______________________________________________
> > > > > >> yang-doctors mailing list
> > > > > >> yang-doctors@ietf.org
> > > > > >> https://www.ietf.org/mailman/listinfo/yang-doctors
> > > > > >>
> > > > >
> > > > > --
> > > > > Ladislav Lhotka
> > > > > Head, CZ.NIC Labs
> > > > > PGP Key ID: 0xB8F92B08A9F76C67
> > > > >
> > > > > _______________________________________________
> > > > > yang-doctors mailing list
> > > > > yang-doctors@ietf.org
> > > > > https://www.ietf.org/mailman/listinfo/yang-doctors
> > > >
> > > >
> > > --
> > > Ladislav Lhotka
> > > Head, CZ.NIC Labs
> > > PGP Key ID: 0xB8F92B08A9F76C67
> > >
> 
> 
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67