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

Andy Bierman <andy@yumaworks.com> Mon, 15 January 2018 16:24 UTC

Return-Path: <andy@yumaworks.com>
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 0CD25127775 for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 08:24:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 xBW5nrzmVUyN for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 08:24:40 -0800 (PST)
Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CD4D8126DFB for <yang-doctors@ietf.org>; Mon, 15 Jan 2018 08:24:39 -0800 (PST)
Received: by mail-lf0-x234.google.com with SMTP id h137so14019198lfe.8 for <yang-doctors@ietf.org>; Mon, 15 Jan 2018 08:24:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wwe40pVEqGgYwtmCXzdxygPGKYvmqLG2+tA6EXcVzoI=; b=W4abyxw4NL3IwHlMziXIop1gC7B6AyYz22m15O5IucYLVv/LnGDUIhZ+xfU8vcqzPN iqc08bBY4FuLx4NGitaSM0KpVitdGKlVIAXBVKtdyO5HOGdDam2QdEjqnpyukt5P3hnw S9XtVVOxYehUBlVc7ygqrM+XhBcRbAyQq3TIRcz8UDLbRFjktTjAjzd75Wd2seVQdEmp 0E3rWRUM+K+idC+Crz9R0toijzL96gOuqaPQp4dpJ22NSRnPez2rZFtg7QXvmhXAmwEX q1SUhilf0POkdgu+Igi4YupmtXiuWRYsD2QrlHEgjxSeSnlgvr5gfMgULWjNfN3v0paa rQKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wwe40pVEqGgYwtmCXzdxygPGKYvmqLG2+tA6EXcVzoI=; b=ACFFJKfkoJLrGRAsN+Re57jjbYhkcGE8i+wj+y6NHqQAN1Pc5+eJEnydPqqU8Pb6d4 ySMYFvlMvGDksoOmI/AOdciXCrM+pe3T4tDLTea+d6POM0TpRr9Tblp8NqvNoounUd26 LvajJUHbd560lGuhRDGG/KNvHjXBiWcDJ3MYWiyiKaatko+3SdoXDX8yEEULEayNrcsl HlnFikEgtCDai/HI3ovbpJMmSyMbQ1xMKiGz5zYiEKQ28D+yvf9DB/EnqKNQNWS2T6Sh jgNJxWLBg5xlXgvycmT3pR99eBZB2lRNZAsMRwz5scypZPE+5t6eJKbtWgWScREM/iym e3dA==
X-Gm-Message-State: AKGB3mIYeS4ij8bmAo2AKBrYS4uVUyjiOrLimkvOkxVa0xXfZOV0xVAh ALD299EzxIvIWLnHdt8dyxWKpqwrXYO8b9UMcB5hPg==
X-Google-Smtp-Source: ACJfBotqPRUQklbaNGEwWMmU1X/B3jyBLBHLUWyBQUAQbZwXBGtiEIMBdBcUCA6opOFrmT3FdYLN1tWLUBWDv8YiMAI=
X-Received: by 10.46.23.24 with SMTP id l24mr19582711lje.146.1516033478018; Mon, 15 Jan 2018 08:24:38 -0800 (PST)
MIME-Version: 1.0
Received: by 10.25.196.65 with HTTP; Mon, 15 Jan 2018 08:24:36 -0800 (PST)
In-Reply-To: <20180115.095941.341257692373089671.mbj@tail-f.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>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 15 Jan 2018 08:24:36 -0800
Message-ID: <CABCOCHQBwsi7WiUZw5V0QQ-t2n9Yy=nY_dWzyaixsrXwmo4k=w@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: Ladislav Lhotka <lhotka@nic.cz>, YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c1c016aed24c80562d30c65"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/60FkViVo4GL72koeaFSQ5CykjSM>
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 16:24:43 -0000

>
> ....




> > 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).

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
> >
>