Re: [netmod] schema mount and YANG library

Ladislav Lhotka <> Fri, 15 December 2017 13:59 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 541E6128B8F for <>; Fri, 15 Dec 2017 05:59:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id X1LX-tLGRrEl for <>; Fri, 15 Dec 2017 05:59:20 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 6792B126C25 for <>; Fri, 15 Dec 2017 05:59:20 -0800 (PST)
Received: by (Postfix, from userid 109) id 07B1E18215DE; Fri, 15 Dec 2017 14:58:33 +0100 (CET)
Received: from localhost ( []) by (Postfix) with ESMTPSA id 251911820E6E for <>; Fri, 15 Dec 2017 14:58:31 +0100 (CET)
From: Ladislav Lhotka <>
In-Reply-To: <>
References: <>
Mail-Followup-To: NETMOD WG <>
Date: Fri, 15 Dec 2017 14:59:16 +0100
Message-ID: <>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <>
Subject: Re: [netmod] schema mount and YANG library
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 15 Dec 2017 13:59:34 -0000


unfortunately, using an action for querying embedded YANG library data
(needed for the "inline" case of schema mount) doesn't work either
because now under NMDA actions can be used only on instances in the
<operational> datastore.

However, a good alternative seems to be a metadata annotation along the
lines of RFC 7952, for example with the alternative B of the newly
proposed YANG library schema:

     md:annotation schema-ref {
       type leafref {
         path "/yanglib:yang-library/yanglib:schema/yanglib:name";

In other words, all inline mounted schemas would be included in the
top-level YANG library, and mount point instances in all datastores
would be annotated with leafref pointing to the actual schema.

Unlike regular state data, it is IMO no problem to permit such
annotations in configuration datastores.


Thanks, Lada

Ladislav Lhotka <> writes:

> Hi,
> the following text in sec. 3.2 of schema-mount-08 is wrong for traditional
> datastores, and even more so for NDMA:
>    In case 1 ["inline"], the mounted schema is determined at run time: every
>    instance of the mount point that exists in the parent tree MUST
>    contain a copy of YANG library data [RFC7895] that defines the
>    mounted schema exactly as for a top-level data model.  A client is
>    expected to retrieve this data from the instance tree, possibly after
>    creating the mount point.  Instances of the same mount point MAY use
>    different mounted schemas.
> An instance of the mount point in any *configuration* datastores cannot contain
> YANG library (being state data), and so the MUST cannot hold.
> It is not clear to me how to repair this without considerable complications
> and/or a lot of handwaving. There is actually one good solution but it has
> impact on YANG library: the server could provide it in a reply to an operation,
> say "get-yang-library" rather than as state data. Then everything would be fine
> - this operation would turn into an action for the mount point, and it can be
> used equally well for config true and false mount points.
> So my proposal is to move from YANG library as state data to an operation. It
> could be done along with changing the YANG library structure, so there will be
> little extra impact on implementations. 
> Lada 
> -- 
> Ladislav Lhotka
> Head, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
> _______________________________________________
> netmod mailing list

Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67