Re: [yang-doctors] Yangdoctors last call review of draft-ietf-ospf-yang-09
Andy Bierman <andy@yumaworks.com> Mon, 15 January 2018 17:31 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 13A5012E89F for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 09:31:57 -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 G8GEYPPeGaBz for <yang-doctors@ietfa.amsl.com>; Mon, 15 Jan 2018 09:31:53 -0800 (PST)
Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) (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 7AB2A12EA9E for <yang-doctors@ietf.org>; Mon, 15 Jan 2018 09:31:42 -0800 (PST)
Received: by mail-lf0-x229.google.com with SMTP id o89so10141509lfg.10 for <yang-doctors@ietf.org>; Mon, 15 Jan 2018 09:31:42 -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=Sd6RjXlkUa4Oou9ZBnsQUi9gScNeRdugYj0tqsOkheU=; b=flEcx6wufplP7ufvcmFoLMtu8wIZc+xHaUCq4aGbrXhSF+NBgwYgjh68efHhw294Fw kpriZi2h09QMUsqLdVaWUx4vt6frCf1E4TDdQ1y5ZdeaGdITG3oqW1705ouHydnT2hr/ 4KtPL8+F4gQ05i+t8g3OFjHsJPUAadB5dlHhI/qIezM8PSlubNctXlSRklOZ5QN2AwV6 vZtGv82+NMiv30qwOzmMYH0VYVyZqT2+If5etFk2Qw8FR0RMx9C1wz5adCc35iCG2H8+ iSHGy1clx3uP4Am30SxW3+50O9aLT0MDaugKeTW4mnBopfr5JuQVblpjskzVZFP2l585 d82g==
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=Sd6RjXlkUa4Oou9ZBnsQUi9gScNeRdugYj0tqsOkheU=; b=hiT4Q4zwkUbeOwufPDMidrUKpUfPZKkIzx2xs5vW3LutugGanx8Kpo0gAA4Z0nz34A fpJqwToVl+jYMJmPZIQr2mtB8aQk5tMKLBqmbHBh9JBlGkGuo/zXaChWryRJA1RXAOjK 0hDQSS3T685/1yjx4jtxcIvTm3jVXwtv0INAFvMyNygCgWJykYNbqL9rvkC0VevmFZN0 LXehz+vpwW+34hNVnEDRb22n3al9KIImTWCC6wiBOskpptRu7+NtDw2i8eb28pgWl2rq XP5U6D6k66htXg2+c6OffL8QKo9jV59lENVpA86UtKlYpfO5g/LfZU1c6li2gnWtXIDh nBgg==
X-Gm-Message-State: AKGB3mI9h0VBKn1qXMLMDlGs6md9MhJ93w3gyUtyQyF/3RFi7e2UaWld +V4gh4VILK1PHBuNMNsZs/WSCZICKYr/jqmhYPkftQ==
X-Google-Smtp-Source: ACJfBov/PI8rkRtVIr/xt+tw13LkvmwcB6kezquqttpu/nYSQAePEDyY60b2Yv3Akp6G/XvT/zv5Bh3m3MBFMKz3dXI=
X-Received: by 10.46.41.23 with SMTP id u23mr20107180lje.15.1516037500518; Mon, 15 Jan 2018 09:31:40 -0800 (PST)
MIME-Version: 1.0
Received: by 10.25.196.65 with HTTP; Mon, 15 Jan 2018 09:31:39 -0800 (PST)
In-Reply-To: <1516036467.5426.90.camel@nic.cz>
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> <1516036467.5426.90.camel@nic.cz>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 15 Jan 2018 09:31:39 -0800
Message-ID: <CABCOCHSWsptUT_riewt3fY74EmSnZF70uQf=5tLFjy9maaYNMQ@mail.gmail.com>
To: Ladislav Lhotka <lhotka@nic.cz>
Cc: Martin Bjorklund <mbj@tail-f.com>, YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c1c0694afa5430562d3fce5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/6lla_TwB2cSVLB8tlDTj94eGkXY>
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:31:57 -0000
On Mon, Jan 15, 2018 at 9:14 AM, Ladislav Lhotka <lhotka@nic.cz> wrote: > 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. > > This sort of distinction is not relevant to engineers writing YANG modules. > 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. > > The <node> = <value> construct is quite familiar and intuitive to people. A good API avoids confusion instead of promoting it. The XPath function should have used a module-name parameter or made the module name a mandatory prefix in the identity string. The best-case for API stability is where the canonical representation is also the only representation. The worst-case (current prefix) is where the representation has a different interpretation everywhere it is used. Context-free value comparison is kind of useful. Lada > Andy > > > > > 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 >
- [yang-doctors] Yangdoctors last call review of dr… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Andy Bierman
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Juergen Schoenwaelder
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Juergen Schoenwaelder
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Andy Bierman
- Re: [yang-doctors] Yangdoctors last call review o… Ladislav Lhotka
- Re: [yang-doctors] Yangdoctors last call review o… Andy Bierman
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Martin Bjorklund
- Re: [yang-doctors] Yangdoctors last call review o… Acee Lindem (acee)
- Re: [yang-doctors] [Lsr] Yangdoctors last call re… Rob Shakir
- Re: [yang-doctors] [Lsr] Yangdoctors last call re… Acee Lindem (acee)
- Re: [yang-doctors] Yangdoctors last call review o… Christian Hopps