[netmod] schema mount open issue #1

Martin Bjorklund <mbj@tail-f.com> Tue, 22 August 2017 10:21 UTC

Return-Path: <mbj@tail-f.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 AF817132949 for <netmod@ietfa.amsl.com>; Tue, 22 Aug 2017 03:21:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=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 HzrWqCKK0_1V for <netmod@ietfa.amsl.com>; Tue, 22 Aug 2017 03:21:52 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id E90781321C4 for <netmod@ietf.org>; Tue, 22 Aug 2017 03:21:51 -0700 (PDT)
Received: from localhost (unknown [173.38.220.57]) by mail.tail-f.com (Postfix) with ESMTPSA id 25F8D1AE02C9 for <netmod@ietf.org>; Tue, 22 Aug 2017 12:21:51 +0200 (CEST)
Date: Tue, 22 Aug 2017 12:20:22 +0200
Message-Id: <20170822.122022.1375224682803846655.mbj@tail-f.com>
To: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/ec3j3cecttk6jQFWJ_u8x1f_PEo>
Subject: [netmod] schema mount open issue #1
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Tue, 22 Aug 2017 10:21:54 -0000

Hi,

Lada presented an open issue in schema mount in Prague.  (See slide 6
in
https://datatracker.ietf.org/meeting/99/materials/slides-99-netmod-sessb-schema-mount)

The original problem comes from the NI use case
(https://tools.ietf.org/html/draft-ietf-rtgwg-ni-model).  In this
use case, interfaces are assigned to NIs by:

   augment /if:interfaces/if:interface:
     +--rw bind-ni-name?   -> /network-instances/network-instance/name

Modules that are mounted within the NI might have references to
interfaces.  The idea is that a specific NI can only reference the
interfaces that has been assigned to it.

In schema mount, we have the "parent-reference" XPath expression that
in this case will be "/if:interfaces/if:interface".  The problem is
that this XPath expression will evaluate to a node set that contains
*all* interfaces in the system.  We would like this to contain just
the interfaces assigned to the NI.

It turns out that this can be done with a simple change to the
"parent-reference" node.  If we state that this XPath expression is
evaluated in an XPath context where the context node is the node in
the data tree where the mount point is defined (instead of "/"), we
can use as parent-reference:

  /if:interfaces/if:interface[ni:bind-network-instance-name = ../ni:name]

Putting this together we'd have:

  augment "/if:interfaces/if:interface" {
    leaf bind-ni-name {
      type leafref {
        path "/network-instances/network-instance/name";
      }
    }
  }

  container network-instances {
    list network-instance {
      key name;
      leaf name { ... }
      ...
      container root {
        // this would be the XPath context root for parent-reference
        yangmnt:mount-point ni-root;
      }
    }
  }

And in state data:


"ietf-yang-schema-mount:schema-mounts": {
  "namespace": [
    {
      "prefix": "ni",
      "uri": "urn:ietf:params:xml:ns:yang:ietf-network-instance"
    },
    {
      "prefix": "if",
      "uri": "urn:ietf:params:xml:ns:yang:ietf-interfaces"
    }
  ]
  "mount-point": [
    {
      "target": "/ni:network-instances/ni:network-instance/ni:root",
      "parent-reference": [
            "/if:interfaces/if:interface
             [ni:bind-network-instance-name = ../ni:name]"
                          ],
      "use-schema": [
        {
          "name": "ni-schema"
        }
      ]
    }
  ]



Note that this does NOT affect the schema that is mounted; it only
affects the result of the parent-reference XPath expressions.


I think that we should make this change, since it allows for more
precise parent-references.



/martin