[netmod] Question on multiple content match nodes in subtree filter

Qin Wu <bill.wu@huawei.com> Fri, 12 June 2020 08:09 UTC

Return-Path: <bill.wu@huawei.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7C5EB3A0D00 for <netmod@ietfa.amsl.com>; Fri, 12 Jun 2020 01:09:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 x6tZC67h4vpc for <netmod@ietfa.amsl.com>; Fri, 12 Jun 2020 01:09:00 -0700 (PDT)
Received: from huawei.com (lhrrgout.huawei.com [185.176.76.210]) (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 9554A3A0CFC for <netmod@ietf.org>; Fri, 12 Jun 2020 01:09:00 -0700 (PDT)
Received: from lhreml730-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 41739E17B451B763E2FA for <netmod@ietf.org>; Fri, 12 Jun 2020 09:08:57 +0100 (IST)
Received: from lhreml730-chm.china.huawei.com (10.201.108.81) by lhreml730-chm.china.huawei.com (10.201.108.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Fri, 12 Jun 2020 09:08:56 +0100
Received: from DGGEML405-HUB.china.huawei.com (10.3.17.49) by lhreml730-chm.china.huawei.com (10.201.108.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.1.1913.5 via Frontend Transport; Fri, 12 Jun 2020 09:08:56 +0100
Received: from DGGEML531-MBS.china.huawei.com ([169.254.5.218]) by dggeml405-hub.china.huawei.com ([10.3.17.49]) with mapi id 14.03.0487.000; Fri, 12 Jun 2020 16:08:49 +0800
From: Qin Wu <bill.wu@huawei.com>
To: NETMOD Group <netmod@ietf.org>
Thread-Topic: Question on multiple content match nodes in subtree filter
Thread-Index: AdZAj1VnmKkzkD5oQcCJO4RLtikt6g==
Date: Fri, 12 Jun 2020 08:08:49 +0000
Message-ID: <B8F9A780D330094D99AF023C5877DABAAD75D896@dggeml531-mbs.china.huawei.com>
Accept-Language: zh-CN, en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.164.150.251]
Content-Type: multipart/alternative; boundary="_000_B8F9A780D330094D99AF023C5877DABAAD75D896dggeml531mbschi_"
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/IoAINaL65Bc9r05MQx4Z1ZW0YXY>
Subject: [netmod] Question on multiple content match nodes in subtree filter
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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: Fri, 12 Jun 2020 08:09:03 -0000

Hi, folks:
Suppose we have multiple content match nodes, however these content match nodes are not sibling nodes, instead, they are child nodes of each sibling node,

Should we see Multiple content match nodes (i.e., sibling nodes) being logically
combined in an "AND" expression or in an "OR" expression? Depending on the answer, here are two usage example:
<rpc message-id="101"  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
<get>
  <filter type="subtree">
    <top>
      <interfaces>
        <interface>
            <ipv4>
              <forwarding>false</forwarding>
                              <enable/>
                              <mtu/>
            </ipv4>
            <ipv6>
              <mtu>1000</mtu>
                              <enable/>
                              <forwarding/>
            </ipv6
          </ipv6>
        </interface>
      </interfaces>
    </top>
  </filter>
</get>
</rpc>
In this example, <mtu> and <forwarding> leaf are child node of <ipv4> container node and <ipv6> container node respectively,
<ipv4> container node and <ipv6> container node are sibling nodes.

The RPC-reply could have two options,
Option A: both <forwarding> under <ipv4> container and <mtu> under <ipv6> container are matched,
<rpc-reply message-id="101"  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <top>
  <interfaces>
    <interface>
           <ipv4>
            <enable>true</enable>
       <forwarding>false</forwarding>
       <mtu>1400</mtu>
           </ipv4>
           <ipv6>
            <enable>true</enable>
            <forwarding>true</forwarding>
            <mtu>1000</mtu>
           </ipv6>
    </interface>
   </interfaces>
  </top>
</data>
</rpc-reply>
Option B: only <mtu> under <ipv6> container is matched and <forwarding> under <ipv4> is not matched
<rpc-reply message-id="101"  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" >
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <top>
  <interfaces>
    <interface>
           <ipv6>
            <enable>true</enable>
            <forwarding>true</forwarding>
            <mtu>1000</mtu>
           </ipv6>
    </interface>
   </interfaces>
  </top>
</data>
</rpc-reply>
Are these RPC-reply correct? How do we see the matching relation between these content matches nodes?

-Qin