Subject: [netmod] Schema mount and Network Instance model

From: Mahesh Jethanandani <[email-masked]>
Date: Tue, 21 Jan 2020 15:25:48 -0800

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. 

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?

Thanks.

Mahesh Jethanandani
[email-masked]

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 22 Jan 2020 08:39:13 +0100 (CET)

Hi,

Mahesh Jethanandani <[email-masked]> 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?
> 
> err : Unknown element
> "routing". (/ietf-network-instance:network-instances/network-instance[name='vrf-red']/vrf-root)
> failed (error code: 0)
> 
> 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