Re: [netconf] get-data origin filters

"Rob Wilton (rwilton)" <rwilton@cisco.com> Mon, 07 October 2019 14:36 UTC

Return-Path: <rwilton@cisco.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B9F2912087E for <netconf@ietfa.amsl.com>; Mon, 7 Oct 2019 07:36:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.49
X-Spam-Level:
X-Spam-Status: No, score=-14.49 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=Udf1mg6U; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=A9hEQ+zj
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 BSsEw0UxDdAL for <netconf@ietfa.amsl.com>; Mon, 7 Oct 2019 07:36:39 -0700 (PDT)
Received: from alln-iport-2.cisco.com (alln-iport-2.cisco.com [173.37.142.89]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EDDA9120874 for <netconf@ietf.org>; Mon, 7 Oct 2019 07:36:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=34948; q=dns/txt; s=iport; t=1570458999; x=1571668599; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=P8+fWcVolSmUVwhUz4Bm7DGUVDoIhFYgpjhL9C8Iwl4=; b=Udf1mg6UL75hjqCkTVWGC7IWcgNmyQcCW8WyoL0MoGbQRqMrHZYvQVF4 Gb1l5lFFZbG88uM3n5DpvJdTAzGBz4CTee/y0GZGm9DmQ+kxbWrHAlILo udlyc+pfhzvr1dojolrtQo5nddhPV75sRZHqNd96BjXKdxALHCUk3wwfs I=;
IronPort-PHdr: 9a23:xvPKcxMmS8kqcL+SARcl6mtXPHoupqn0MwgJ65Eul7NJdOG58o//OFDEu60/l0fHCIPc7f8My/HbtaztQyQh2d6AqzhDFf4ETBoZkYMTlg0kDtSCDBjhM//ucys8NM9DT1RiuXq8NBsdFQ==
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CwAABeTJtd/5hdJa1mGgEBAQEBAgEBAQEMAgEBAQGBZ4EcL1ADbVYgBAsqCoQZg0cDikmCXJd8glIDVAkBAQEMAQEtAgEBhEACF4JFIzgTAgMJAQEEAQEBAgEFBG2FLQyFSwEBAQMBEhEKEwEBNwEECwIBCBEEAQEBIAcDAgICMBQJCAIEAQ0FCBqDAYEdTQMODwECo0sCgTiIYXWBMoJ9AQEFhQkYghcJgTSMDhiBQD+BEUaCTD6ELhg0glcygiaMdQ+CaYU1JIkIjnIKgiKMIIkTmT+OLJkyAgQCBAUCDgEBBYFpIoFYcBU7gmxQEBSBT4NzilN0gSmPIAGBIgEB
X-IronPort-AV: E=Sophos;i="5.67,268,1566864000"; d="scan'208,217";a="346103309"
Received: from rcdn-core-1.cisco.com ([173.37.93.152]) by alln-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 07 Oct 2019 14:36:38 +0000
Received: from XCH-ALN-015.cisco.com (xch-aln-015.cisco.com [173.36.7.25]) by rcdn-core-1.cisco.com (8.15.2/8.15.2) with ESMTPS id x97Eabxc000465 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 7 Oct 2019 14:36:37 GMT
Received: from xhs-aln-001.cisco.com (173.37.135.118) by XCH-ALN-015.cisco.com (173.36.7.25) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 7 Oct 2019 09:36:37 -0500
Received: from xhs-rcd-003.cisco.com (173.37.227.248) by xhs-aln-001.cisco.com (173.37.135.118) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 7 Oct 2019 09:36:36 -0500
Received: from NAM03-BY2-obe.outbound.protection.outlook.com (72.163.14.9) by xhs-rcd-003.cisco.com (173.37.227.248) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 7 Oct 2019 09:36:36 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cE1GEuHhbOOoiD0HVlRyo3BonQwwIU+aBXzED58gsR6fhTPLBTLYvSzoPejUqqDS5ZB2FP7qwrscOtW6v3M56TctDzWrVzxA3Dx2YP1CTeroPeYSshhPzVeq2Dsh7v+jOm1rSV8tNa56u9GlM1+F1QCgxf3KuZtiuSROMacwygc9Afo01lnwR72N3Wkxtdielny3clH1rkthvJd8fNRXMNtY03KpdcD311gqMSylm3pvS3sI1RLQavglSy6rZbg3uM14oWk51pXpVGv1Yah5eMOKTPjEk5CbX0ZLR0C7WU+KIt+GBV1YRkgp1mzn75LkjG8N46mpUJdAiqj/OZEupg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P8+fWcVolSmUVwhUz4Bm7DGUVDoIhFYgpjhL9C8Iwl4=; b=RRwGfN6o3TX1Y61gsiuxNCUOJD7S0X52LhMVnG3xRyiEVczLCHg9Mpg8/yRWbc/3EM9zSm265njVXKaKWVLLkUkOIZRm0oDE620H88m9RhsUyZe/w4RiKKaW2QkQ7iYuD1G2B5Ugd58ulmXVJfjX1bUD5/A56R6cgMdTikSD4ssV8faJL80wtJl9KQUucxlWeM6zd3mxAK0oCah7dF1prcrVrJaKBCr6b8ekTBust6xWql33uSes+uTbtlgoAgVXTt0Sk7q28BC0Bl9DauiwENhobBOK4IQ9IirV+emu0l114GtO7A3AuqD5J46DrXN02rXufVKss5oww4SEZfn4cA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P8+fWcVolSmUVwhUz4Bm7DGUVDoIhFYgpjhL9C8Iwl4=; b=A9hEQ+zju4V5uuQXJksX9kFmr9NZVn/FkGECbPRYFva/qEnKWYUHYv/vsNo3BR+goBi84CEo1Q1tprdoQCCbPaJoHBkn/XuzhW/tqGe//oVpGFZYTdYd6bIal9NWpe2K68tos5zP/Ej9nZbtA36Vryzj4EPj2B3wbOEi1nVIaUQ=
Received: from MN2PR11MB4366.namprd11.prod.outlook.com (52.135.38.209) by MN2PR11MB4144.namprd11.prod.outlook.com (20.179.150.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2327.23; Mon, 7 Oct 2019 14:36:35 +0000
Received: from MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::cca:41bd:b0bb:c549]) by MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::cca:41bd:b0bb:c549%2]) with mapi id 15.20.2327.023; Mon, 7 Oct 2019 14:36:35 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: Andy Bierman <andy@yumaworks.com>, Martin Bjorklund <mbj@tail-f.com>
CC: Netconf <netconf@ietf.org>
Thread-Topic: [netconf] get-data origin filters
Thread-Index: AQHVe+MoAYKZiUAaf0ueOxvsgdbYHKdNvuAAgAAMyQCAAQJggIAAbHSAgAAFLAA=
Date: Mon, 07 Oct 2019 14:36:35 +0000
Message-ID: <MN2PR11MB4366BB8F556DE7DC866FE27BB59B0@MN2PR11MB4366.namprd11.prod.outlook.com>
References: <CABCOCHSM0XO2tRDw44=jp3eaBxnhJciWOVvp8QJ+SgACjRZkEg@mail.gmail.com> <20191006.173256.1788347482117819951.mbj@tail-f.com> <CABCOCHRQDfprmHoMBBWK36DZH6-QQS1SkPu+V805XN3dBHW_FQ@mail.gmail.com> <20191007.094327.1923088106819713441.mbj@tail-f.com> <CABCOCHSMRrL4VR7eR8sQCtMnmg5=EE0d8g37Vr956vkUtVTBQA@mail.gmail.com>
In-Reply-To: <CABCOCHSMRrL4VR7eR8sQCtMnmg5=EE0d8g37Vr956vkUtVTBQA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [173.38.220.47]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: e678ff50-f740-469b-7e54-08d74b33c12c
x-ms-traffictypediagnostic: MN2PR11MB4144:
x-microsoft-antispam-prvs: <MN2PR11MB4144806744A04C089E81A0FEB59B0@MN2PR11MB4144.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7691;
x-forefront-prvs: 01834E39B7
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(366004)(136003)(396003)(376002)(189003)(199004)(8676002)(9326002)(6436002)(74316002)(25786009)(55016002)(476003)(81156014)(110136005)(446003)(53546011)(6506007)(316002)(8936002)(229853002)(76176011)(7736002)(54896002)(11346002)(81166006)(7696005)(6306002)(6246003)(186003)(14444005)(26005)(256004)(2906002)(9686003)(33656002)(86362001)(4326008)(71200400001)(71190400001)(76116006)(66556008)(99286004)(102836004)(478600001)(790700001)(236005)(66946007)(52536014)(5660300002)(66066001)(486006)(14454004)(3846002)(66446008)(6116002)(66476007)(64756008); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4144; H:MN2PR11MB4366.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: aadskABYDa6K7GUYQLWoU1VzMw9ktJ8RIK7GiDKMhUosNE/P3ambWd9PE8iGjgSv35ajSNM21vzCHIGhzOgiwmLaQ79evUz9r654JHeTFjpb4o2xcU/MbtYpFZ+EO3WQ+sWSsrMPdkiG59JJfLdcHUvOhbrSbyaAFyNtrBdh9uOrDoqqRdPhqYj1cIEfzIworNovXLTFkOK5yWzfLsUVSlsCuwYxUl1huE4MtTZA5zPE6jYCM/ee0XfF0NGSOyL/oCqf1K2lKQ9mlWAY5uM1Y37MGUtQUozRfLe1RyFPu5zVa+0/rdDwmIC7m11c+dD2secPTybVhkqacp/Ih2hVcmPJxAeyA4yY86enyO540Tb8SHPWrfhSgl5j5BchDYOOYj1tH+krdjRqxSkf5516X1WqZjky3mNwjh6v55xP35Q=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_MN2PR11MB4366BB8F556DE7DC866FE27BB59B0MN2PR11MB4366namp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: e678ff50-f740-469b-7e54-08d74b33c12c
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2019 14:36:35.0909 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 9wSBjHPjof6bCMs6EnpV6PdaD6Kjyxqr4i0j+HR+MQ8cJ4WiK8u2GFc8RgNIyFi2dZFnFnDKDkKDazNW4Pxpmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4144
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.25, xch-aln-015.cisco.com
X-Outbound-Node: rcdn-core-1.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/0GqDkE9se8kbOjnXevF2TNyXWE0>
Subject: Re: [netconf] get-data origin filters
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Oct 2019 14:36:50 -0000

Hi Andy,

Don’t all the filters effectively work this way?

They select a subset of the nodes to include in the response, and must also include all ancestor nodes and required list keys to the selected nodes, regardless of whether those ancestor/key nodes were also selected by the query.

E.g. a “config false” filter will still return “config true” nodes if they are ancestors or list keys to a descendant config false node.  The same logic applies for xpath and origin filters as well.

Thanks,
Rob


From: netconf <netconf-bounces@ietf.org> On Behalf Of Andy Bierman
Sent: 07 October 2019 15:12
To: Martin Bjorklund <mbj@tail-f.com>
Cc: Netconf <netconf@ietf.org>
Subject: Re: [netconf] get-data origin filters



On Mon, Oct 7, 2019 at 12:43 AM Martin Bjorklund <mbj@tail-f.com<mailto:mbj@tail-f.com>> wrote:
Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>> wrote:
> On Sun, Oct 6, 2019 at 8:32 AM Martin Bjorklund <mbj@tail-f.com<mailto:mbj@tail-f.com>> wrote:
>
> > Hi,
> >
> > Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>> wrote:
> > > Hi,
> > >
> > > I am trying to figure out how to use the origin-filter and
> > > negated-origin-filter
> > > in the <get-data> operation in RFC 8526.
> > >
> > >
> > >           leaf-list origin-filter {
> > >              type or:origin-ref;
> > >              description
> > >                "Filter based on the 'origin' annotation.  A
> > >                 configuration node matches the filter if its 'origin'
> > >                 annotation is derived from or equal to any of the given
> > >                 filter values.";
> > >            }
> > >
> > >
> > > These filters seem kind of worthless if implemented according to the
> > text.
> > > Consider a simple example where there is 1 learned leaf within a list:
> > >
> > > module: address
> > >   +--rw addresses
> > >      +--rw address* [last-name first-name]
> > >         +--rw last-name     string
> > >         +--rw first-name    string
> > >         +--rw street?       string
> > >         +--rw city?         string
> > >         +--rw zipcode?      string
> > >         +--rw phone* [phone-type]
> > >            +--rw phone-type      enumeration
> > >            +--rw phone-number    string
> > >
> > > Let's say the "zipcode" field is learned in <operational>
> > > (e.g. ZIP code lookup expands missing or 5 digit zipcode to full 9 digit
> > > zipcode).
> > > So /addresses and /addresses/address have origin "intended".
> > > Only the /addresses/address/zipcode leaf has origin "learned".
> > >
> > > So how does origin-filter=learned find all the learned leafs?
> >
> > Perhaps I don't understand your question; IMO you give the answer to
> > this question below:
> >
> > > What filters are required to return only the learned entries + ancestors
> > +
> > > ancestor-or-self keys?  Seems like this filter mechanism has to be used
> > > to retrieve the exact leaf that might be learned, and the client
> > > needs to know in advance all the possible nodes that might be learned.
> > >
> > > Want to be able to retrieve an ancestor that is intended and still find
> > the
> > > learned entries
> > >
> > >    get-data xpath-filter=/addresses/address origin-filtter=learned
> >
> > ... here.  So this request will return:
> >
> >    <addresses or:origin="or:intended">
> >      <address>
> >        <last-name>...</last-name>
> >        <first-name>...</first-name>
> >        <zipcode or:origin="or:learned">...</zipcode>
> >      </address>
> >      ...
> >    </addresses>
> >
> >
> I do not interpret the text the same way as you.

Does this mean that you think that the reply is different from what I
show above?  If so, what would it be, and why?




Explain how the list address node has origin "learned".

The filter is for /addresses/address and only origin=learned.
How does the list node have origin=learned?
It can only have 1 value.
It has child nodes with both intended and learned as origin.
I do no understand how the origin=learned matched this node.




>
>                      The content returned
>
>           by get-data must satisfy all filters, i.e., the filter
>           criteria are logically ANDed.
>
>
>           leaf-list origin-filter {
>              type or:origin-ref;
>              description
>                "Filter based on the 'origin' annotation.  A
>                 configuration node matches the filter if its 'origin'
>                 annotation is derived from or equal to any of the given
>                 filter values.";
>            }
>
>
>               Configuration nodes that do not have an
>               'origin' annotation are treated as if they have the
>               'origin' annotation 'or:unknown'.
>
>
>
> > The draft shows an example where both "intended" and "system" are given
> > > as filters.  This will work but will include all the "intended" leafs as
> > > well.
> > > What if a "learned" node is within a "system" node within an "intended"
> > > node?
> >
> > This works as well.  Note that the get-data description says:
> >
> >           Any ancestor nodes (including list keys) of nodes selected by
> >           the filters are included in the response.
> >
> >
> >
>
> The issue is how the /iaddresses and /addresses/address nodes match the
> origin "learned".

They don't, but they are included b/c of the quoted text above (i.e.:
      Any ancestor nodes (including list keys) of nodes selected by
      the filters are included in the response.)


No.

If the filter was for /addresses/address/zipcode then maybe that text applies.
It is still unclear that the XPath is fully processed and then the origin-filter is processed.
The RFC just says they are ANDed together.



> The leafs in list "address" are a mixture of "intended" and "learned"
> origin.
> The text clearly says that a node has a single origin property, coupled to
> the annotation.
>
> Issue 1: mixed origin descendant nodes
> So how does a search on /addresses/address match origin-filter=learned?
> I cannot find any text that says what the origin of a list or P-container
> is if it
> contains nodes of mixed origin.

See above.

No text above explains how the list origin is tagged if it has multiple types of child nodes.



> Issue 2: NP-containers
>
> Also from RFC 8342:
>
>    The origin applies to all configuration nodes except non-presence
>    containers.
>
>
> What if the top-level node is an NP-container in this case.
> I thought the top-level node MUST have an origin attribute.
>
> The text is not clear how NP-containers are handled.
> Do they have an origin attribute? If not then RFC 8526 says they have
> origin "unknown".
> Is the intent that NP-containers always pass the origin-filter tests (test
> skipped)?

No, since they don't have an origin value they will not be selected by
the filter.  But an NP-container will be included in the reply if it
is the ancestor of a node that is selected by the filter.

The RFC text does not really say that.
Since it is very difficult to know if a data node 5 layers deep is going to match,
implementing these filters according to this vague interpretation is unlikely.


/martin

Andy



>
>
>
> /martin
> >
> >
> Andy
>
>
> >
> > > Seems like the client needs to know a lot about the server implementation
> > > details
> > > in order to use the origin filters.
> > >
> > >
> > > Andy
> >