Re: [netmod] js review of draft-ietf-netmod-schema-mount-09

Martin Bjorklund <mbj@tail-f.com> Fri, 06 April 2018 13:27 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 859351270AB for <netmod@ietfa.amsl.com>; Fri, 6 Apr 2018 06:27:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 hwOxFUs_LmFJ for <netmod@ietfa.amsl.com>; Fri, 6 Apr 2018 06:27:28 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id E2BD31270B4 for <netmod@ietf.org>; Fri, 6 Apr 2018 06:27:11 -0700 (PDT)
Received: from localhost (h-80-27.A165.priv.bahnhof.se [212.85.80.27]) by mail.tail-f.com (Postfix) with ESMTPSA id 59E621AE034E; Fri, 6 Apr 2018 15:27:10 +0200 (CEST)
Date: Fri, 06 Apr 2018 15:27:10 +0200
Message-Id: <20180406.152710.818971844955208858.mbj@tail-f.com>
To: j.schoenwaelder@jacobs-university.de
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20180406122406.wdba43mr3bxsnyce@elstar.local>
References: <20180329090305.eqshcqvqo33r5bsf@elstar.local> <20180405.143340.1930670144610383537.mbj@tail-f.com> <20180406122406.wdba43mr3bxsnyce@elstar.local>
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/WOhpfqEG0F_FDW-RW9a8fk8MqxA>
Subject: Re: [netmod] js review of draft-ietf-netmod-schema-mount-09
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: Fri, 06 Apr 2018 13:27:31 -0000

Hi,

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> On Thu, Apr 05, 2018 at 02:33:40PM +0200, Martin Bjorklund wrote:
> > Hi,
> > 
> > Thank you for this review!  Comments inline.
> > 
> > Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > > Here is my review of draft-ietf-netmod-schema-mount-09.
> > > 
> > > * Abstract
> > > 
> > >    This document defines a mechanism to combine YANG modules into the
> > >    schema defined in other YANG modules.
> > > 
> > >   I do not know what this says - I think this text is confusing. What
> > >   does it mean to 'combine' YANG modules? What is the notion of
> > >   'schema' used here?
> > 
> > Howabout:
> > 
> >   This document defines a mechanism to add the schema trees defined by
> >   a set of YANG modules into the schema tree defined in another YANG
> >   module.
> >
> 
> This is better.
> 
> > (see more below on terminology)
> > 
> > >   Does the text help someone to decide whether
> > >   this mechanisms is something worth to study in order to solve a
> > >   given modeling problem?  (A good abstract would IMHO do that.)
> > > 
> > >   Note that the mount mechanisms has serious limitations as well that
> > >   perhaps need to spelled out right up-front, i.e., it only works with
> > >   pre-defined mount-points (augments are much more flexible in this
> > >   regard, the schema mount defined here is by its very design not
> > >   very flexible.
> > 
> > I don't agree that this is a "serious limitation", and I don't think
> > an abstract should list things that the document doesn't do.
> 
> OK. Remove 'serious' but clearly this schema mount mechanism is not as
> flexible as it could me. What about this:
> 
>    This document defines a mechanism to add the schema trees defined
>    by a set of YANG modules onto mount points defined in another YANG
>    module.
> 
> This at least hints at the fact that mount points are rather static
> citizens.

Ok.  I tweaked it to:

  This document defines a mechanism to add the schema trees defined
  by a set of YANG modules onto a mount point defined in the schema
  tree in some YANG module.

> > >   While I think I understand the difference made between
> > >   implementation-time and run-time, the description is somewhat
> > >   confusing since the run-time mount will also be exposed via YANG
> > >   library and hence defining implementation-time by 'defined by a
> > >   server implementor and is as stable as YANG library information of
> > >   the server' is somewhat fuzzy. I assume what you mean is that in the
> > >   case 2. the mounted schema is fixed at implementation time while in
> > >   the case 3. the mounted schema may vary and be discovered at
> > >   run-time. However, you do not define things this way but rather talk
> > >   about properties that do however not define things.
> > 
> > Howabout:
> > 
> > OLD:
> > 
> > + Run-time: the mounted schema is defined by instance data that is
> >   part of the mounted data model. If there are multiple instances of
> >   the same mount point (e.g., in multiple entries of a list), the
> >   mounted data model may be different for each instance.
> > 
> > NEW:
> > 
> > + Run-time: the mounted schema can vary at run time and is defined by
> >   instance data that is part of the mounted data model. If there are
> >   multiple instances of the same mount point (e.g., in multiple
> >   entries of a list), the mounted data model may be different for each
> >   instance.
> 
> Better.
>  
> > > * Glossary of New Terms
> > > 
> > >      o  top-level schema: a schema according to [RFC7950] in which schema
> > >       trees of each module (except augments) start at the root node.
> > > 
> > >   You do not import 'schema' from RFC 7950 since, well, it is not
> > >   defined in RFC 7950. I think you often mean a schema tree (as
> > >   defined in RFC 7950) when you use 'schema'. Well, even this is not
> > >   true since a 'schema tree' according to RFC 7950 is scoped to a
> > >   module. RFC 8342 defines a 'datastore schema' but then I am not sure
> > >   this corresponds to 'schema' as used in this draft. In fact, the
> > >   mounted schema may be considered part of the 'datastore schema'.  I
> > >   think we are handwaving with our terminology here but then perhaps I
> > >   am the only one who cares...
> > 
> > I have imported "schema tree" from 7950, and changed teh definition of
> > top-level schema to:
> > 
> > - top-level schema: a set of modules in which the schema
> >   trees of each module (except augments) start at the root node.
> 
> Still sounds complicated and not quite clear. Do you mean this:
> 
> - top-level schema: a set of schema trees of a set of modules starting
>   at the root node
> 
> > >   What we actually have are schema tree (of a module per RFC 7950) and
> > >   a collection of schema trees sharing a common root (this is likely
> > >   what is meant with "schema" in this document). And then schema mount
> > >   simply provides a mechanism to have additional (statically defined)
> > >   roots in a schema.
> 
> So what are you planning to do about the term 'schema' used throughout
> the module? We kind of define what a top-level schema is but leave
> schema undefined and perhaps we would also benefit from having a term
> like mounted schema. I am thinking along these lines:
> 
>   schema = collection of schema trees with a common root
>   top-level schema = schema rooted at the root node
>   mounted schema = schema rooted at a mount point
>   parent schema (of a mounted schema) = schema containing the mount point

These are good definitions, I have added them.  Thank you!

> > > * Multiple Levels of Schema Mount
> > > 
> > >   What is a 'subschema'? What is a 'schema level'? Is a subschema the
> > >   same as a schema, i.e. a collection of schema trees with a common
> > >   root? If we need terms such as 'subschema' or 'schema level', then
> > >   we should define them. But perhaps just some tweaking the text to
> > >   avoid new terms can solve the issue.
> > 
> > I have changed "subschema" to "schema", and removed "schema level":
> > 
> > NEW:
> > 
> >   YANG modules in a mounted schema MAY again contain mount points
> >   under which other schemas can be mounted.  Consequently, it is
> >   possible to construct data models with an arbitrary number of
> >   mounted schemas.  A schema for a mount point contained in a mounted
> >   module can be specified by implementing "ietf-yang-library" and
> >   "ietf-yang-schema-mount" modules in the mounted schema, and
> >   specifying the schemas exactly as it is done in the top-level
> >   schema.
> 
> OK 
> 
> > >   Why are parent-references only useful for the 'shared-schema' case?
> > >   An 'inline' mount can't refer to stuff outside the mount jail?
> > 
> > Correct.  We have debated if this makes sense for inline or not.  As
> > it is, the model is designed so that this can be added in the future,
> > if it turns out that this is needed.
> 
> OK
> 
> > >   Looking at the YANG definition of 'parent-reference', I am left
> > >   somewhat clueless in which situations these xpath expressions are
> > >   evaluations and when the nodesets are merged with other xpath
> > >   expression evaluation results.
> > 
> > The YANG module says:
> > 
> >              When XPath expressions in the mounted schema
> >              are evaluated, the 'parent-reference' leaf-list is taken
> >              into account.
> > 
> > and
> > 
> >                For the purposes of evaluating XPath
> >                expressions whose context nodes are defined in the
> >                mounted schema, the union of all these nodesets
> >                together with ancestor nodes are added to the
> >                accessible data tree.
> 
> OK. I probably did not read carefully enough. My understanding is now
> that the set of parent-reference xpath expressions yields a union of
> nodesets that are becoming part of the context for the evaluation of
> any xpath expression appearing in a mounted schema. And these parent
> references are specific to a mount point instance. May make sense.
> 
> > >   It seems that these parent references
> > >   are the only actual difference between 'inline' and 'shared-schema'
> > >   mounts.
> > > 
> > > * Data Model
> > > 
> > >   I have not really understood what the difference between 'inline'
> > >   and 'shared-schema' is. I understand that the later can have
> > >   'parent-references' but it is unclear why the other can't and if
> > >   there is not strong architectural reason why there have to be two
> > >   choices. It also seems that the 'namespace' list is only meaningful
> > >   if there are parent references, no? So why is this then global, i.e.
> > >   also provided for 'inline' mounts?
> > 
> > As you note, the 'namespace' list is global, so there is just one list
> > that covers all mount-points.  It's not really correct to state that
> > the 'namespace' list is "provided for 'inline' mounts".
> 
> OK. It seems that for a client capable to support a 'shared schema',
> the 'inline' schema really is just a special case without parent
> references. (I wonder whether anything should be said to YANG library
> version numbers, whether they are always scoped by the mount point
> or have meaning across mount points; if two YANG library instances
> in mounted schemas have the same version number, does this imply
> that these YANG library instances are identical or is this just a
> version number clash? But then this probably goes across the spirit
> of not talking about YANG library too much.)

When you say "version number" do you mean the YANG library checksum?
I don't think the YL document guarantees that there can never be
clashes.

> > >   I guess I do not really
> > >   understand the distinction. If there are no parent-references, what
> > >   is the difference between 'shared-schema' and 'inline'?
> > 
> > The difference is that shared-schema can have parent-references, and
> > that all instances of such a mount point have exactly the same
> > schema.
> 
> See comment above about YANG library version numbers. I am trying to
> understand which assumption a client can make to be efficient in both
> cases (and whether it is possible to be efficient while essentially
> handling inline and shared-schema using a common approach).
> 
> > > * Security Considerations
> > > 
> > >   I agree with others that something needs to be said how NACM applies
> > >   to mounted schemas.
> > 
> > I have added the following (short) section:
> > 
> > 7.  Interaction with the Network Configuration Access Control Model
> >     (NACM)
> > 
> >    If NACM [RFC8341] is implemented on a server, it can be used to
> >    control access to nodes defined by the mounted schema in the same way
> >    as for nodes defined by the top-level schema.
> > 
> >    For example, suppose the module "ietf-interfaces" is mounted in the
> >    "root" container in the "logical-network-element" list defined in
> >    [I-D.ietf-rtgwg-lne-model].  Then the following NACM path can be used
> >    to control access to the "interfaces" container (where the character
> >    '\' is used where a line break has been inserted for formatting
> >    reasons):
> > 
> >      <path xmlns:lne=
> >              "urn:ietf:params:xml:ns:yang:ietf-logical-network-element"
> >            xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
> >        /lne:logical-network-elements\
> >          /lne:logical-network-element/lne:root/if:interfaces
> >      </path>
> 
> This helps. Can I also mount NACM into a mount point? If yes, what if
> both are present?

Yes you can mount NACM.  To keep things simple, I think the inner NACM
should not affect the access control done in the parent.  Consider the
use cases for this.  In a NI situation, it doesn't make much sense to
mount NACM.  In an LNE (or in a "peer mount") situation, it may make
sense to mount NACM if the LNE (or device) supports it.  In this case,
if I try to access any mounted data in the parent, access is
controlled by the parent.  If I have access, the parent may send a
request over to the mounted device to read/write the data.  That
device will use its local copy of NACM to control access, or some
other mechanism.


/martin