Re: [netmod] Schema mount and Network Instance model

Martin Bjorklund <mbj@tail-f.com> Wed, 22 January 2020 07:39 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 B010C120052; Tue, 21 Jan 2020 23:39:53 -0800 (PST)
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_HELO_NONE=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 plQXnc7jJEWG; Tue, 21 Jan 2020 23:39:52 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 180D2120013; Tue, 21 Jan 2020 23:39:51 -0800 (PST)
Received: from localhost (unknown [173.38.220.41]) by mail.tail-f.com (Postfix) with ESMTPSA id D49301AE02F0; Wed, 22 Jan 2020 08:39:50 +0100 (CET)
Date: Wed, 22 Jan 2020 08:39:13 +0100
Message-Id: <20200122.083913.1144371370754358519.mbj@tail-f.com>
To: mjethanandani@gmail.com
Cc: netmod@ietf.org, jhaas@juniper.net, draft-ietf-idr-bgp-model@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <D551C809-9650-4DFB-A4E3-607CC88A4F8C@gmail.com>
References: <D551C809-9650-4DFB-A4E3-607CC88A4F8C@gmail.com>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/RV2aJxM119ATBPST7BKHCp9a0ow>
Subject: Re: [netmod] Schema mount and Network Instance model
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: Wed, 22 Jan 2020 07:39:54 -0000

Hi,

Mahesh Jethanandani <mjethanandani@gmail.com> wrote:
> The network-instances YANG model [RFC8529] gives an example in
> Appendix A.1 <https://tools.ietf.org/html/rfc8529#appendix-A.1> of how
> to use schema mount to mount the routing protocol. An example modeled
> along those lines for the BGP YANG model, and enclosed herewith fails
> validation using yanglint with the following error. What am I doing
> wrong?
> 
> Validating yang/example-bgp-configuration-a.1.3.xml
> err : Unknown element
> "routing". (/ietf-network-instance:network-instances/network-instance[name='vrf-red']/vrf-root)
> failed (error code: 0)
> 
> With confdc it fails as follows:
> 
> Loading Data for example a.1.3
> confd_load: 666: maapi_load_config(sock, tid, flags, abspath(argv[0]))
> failed: external error (19): Error on line 9: unknown element: routing
> in
> /ni:network-instances/ni:network-instance[ni:name='vrf-red']/ni:vrf-root/rt:routing
> 
> If what I have is not an error, it raises two questions. Is schema
> mount supported? Supported from a validation perspective. I can
> imagine that not everyone (or anyone) may have actually implemented
> schema mount.

Schema mount is (i) a generic mechanism for composing models at
specific mount points and (ii) a way for a server to report to clients
how this composition is done in the specific server (this may vary
dynamically over time).

The network-instance model is generic; it just defines a mount point
in the data model.  A specific server might be implemented to mount
the "ietf-routing" model under the mount point, and in that case it
will be able to validate the instance document you provided.

However, a generic YANG validator tool does not know (*) which models
are supposed to be mounted under any given mount point, and thus it
will probably raise an error (as you saw).

(*) unless you also pass it additional information about this in some
way (this could e.g. in the form of an instance document that contains
the /schema-mounts subtree and the ietf-yang-library contents for the
mount point)

As for implmentation support, we have implemented YANG schema mount in
NSO.

> And the second and more important question is how are routing
> protocols supposed to support VRF if the two models, network instance
> and routing protocol, do not work together? What needs to change to
> get them to work?

I think they do work together!


/martin