Appendix A. Examples
The following subsections provide example uses of LNEs.A.1. Example: Host-Device-Managed LNE
This section describes an example of the LNE model using schema mount to achieve the parent management. An example device supports multiple instances of LNEs (logical routers), each of which supports features of Layer 2 and Layer 3 interfaces [RFC8343], a routing information base [RFC8349], and the OSPF protocol [OSPF-YANG]. Each of these features is specified by a YANG model, and they are combined using the YANG schema mount as shown below. Not all possible mounted modules are shown. For example, implementations could also mount the model defined in [RFC8348].
module: ietf-logical-network-element +--rw logical-network-elements +--rw logical-network-element* [name] +--rw name string +--mp root +--ro yanglib:modules-state/ | +--ro module-set-id string | +--ro module* [name revision] | +--ro name yang:yang-identifier +--rw sys:system/ | +--rw contact? string | +--rw hostname? inet:domain-name | +--rw authentication {authentication}? | +--rw user-authentication-order* identityref | +--rw user* [name] {local-users}? | +--rw name string | +--rw password? ianach:crypt-hash | +--rw authorized-key* [name] | +--rw name string | +--rw algorithm string | +--rw key-data binary +--ro sys:system-state/ | ... +--rw rt:routing/ | +--rw router-id? yang:dotted-quad | +--rw control-plane-protocols | +--rw control-plane-protocol* [type name] | +--rw ospf:ospf/ | +--rw areas | +--rw area* [area-id] | +--rw interfaces | +--rw interface* [name] | +--rw name if:interface-ref | +--rw cost? uint16 +--rw if:interfaces/ +--rw interface* [name] +--rw name string +--rw ip:ipv4!/ | +--rw address* [ip] | ...
module: ietf-interfaces +--rw interfaces +--rw interface* [name] +--rw name string +--rw lne:bind-lne-name? string +--ro oper-status enumeration module: ietf-yang-library +--ro modules-state +--ro module-set-id string +--ro module* [name revision] +--ro name yang:yang-identifier module: ietf-system +--rw system | +--rw contact? string | +--rw hostname? inet:domain-name | +--rw authentication {authentication}? | +--rw user-authentication-order* identityref | +--rw user* [name] {local-users}? | +--rw name string | +--rw password? ianach:crypt-hash | +--rw authorized-key* [name] | +--rw name string | +--rw algorithm string | +--rw key-data binary +--ro system-state +--ro platform | +--ro os-name? string | +--ro os-release? string To realize the above schema, the example device implements the following schema mount instance: "ietf-yang-schema-mount:schema-mounts": { "mount-point": [ { "module": "ietf-logical-network-element", "label": "root", "shared-schema": {} } ] }
By using the implementation of the YANG schema mount, an operator can create instances of logical routers. An interface can be assigned to a logical router, so that the logical router has the permission to access this interface. The OSPF protocol can then be enabled on this assigned interface. For this implementation, a parent management session has access to the schemas of both the parent hosting system and the child logical routers. In addition, each child logical router can grant its own management sessions, which have the following schema: module: ietf-yang-library +--ro modules-state +--ro module-set-id string +--ro module* [name revision] +--ro name yang:yang-identifier module: ietf-system +--rw system | +--rw contact? string | +--rw hostname? inet:domain-name | +--rw authentication {authentication}? | +--rw user-authentication-order* identityref | +--rw user* [name] {local-users}? | +--rw name string | +--rw password? ianach:crypt-hash | +--rw authorized-key* [name] | +--rw name string | +--rw algorithm string | +--rw key-data binary +--ro system-state +--ro platform +--ro os-name? string +--ro os-release? string module: ietf-routing rw-- routing +--rw router-id? yang:dotted-quad +--rw control-plane-protocols +--rw control-plane-protocol* [type name] +--rw ospf:ospf/ +--rw areas +--rw area* [area-id] +--rw interfaces +--rw interface* [name] +--rw name if:interface-ref +--rw cost? uint16
module: ietf-interfaces +--rw interfaces +--rw interface* [name] +--rw name string +--ro oper-status enumerationA.1.1. Configuration Data
The following shows an example where two customer-specific LNEs are configured: { "ietf-logical-network-element:logical-network-elements": { "logical-network-element": [ { "name": "cust1", "root": { "ietf-system:system": { "authentication": { "user": [ { "name": "john", "password": "$0$password" } ] } }, "ietf-routing:routing": { "router-id": "192.0.2.1", "control-plane-protocols": { "control-plane-protocol": [ { "type": "ietf-routing:ospf", "name": "1", "ietf-ospf:ospf": { "af": "ipv4", "areas": { "area": [ { "area-id": "203.0.113.1", "interfaces": { "interface": [ { "name": "eth1", "cost": 10 } ] }
} ] } } } ] } }, "ietf-interfaces:interfaces": { "interface": [ { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.11", "prefix-length": 24 } ] }, "ietf-ip:ipv6": { "address": [ { "ip": "2001:db8:0:2::11", "prefix-length": 64 } ] } } ] } } }, { "name": "cust2", "root": { "ietf-system:system": { "authentication": { "user": [ { "name": "john", "password": "$0$password" } ] } }, "ietf-routing:routing": {
"router-id": "192.0.2.2", "control-plane-protocols": { "control-plane-protocol": [ { "type": "ietf-routing:ospf", "name": "1", "ietf-ospf:ospf": { "af": "ipv4", "areas": { "area": [ { "area-id": "203.0.113.1", "interfaces": { "interface": [ { "name": "eth1", "cost": 10 } ] } } ] } } } ] } }, "ietf-interfaces:interfaces": { "interface": [ { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.11", "prefix-length": 24 } ] } } ] } } } ] },
"ietf-interfaces:interfaces": { "interface": [ { "name": "eth0", "type": "iana-if-type:ethernetCsmacd", "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.10", "prefix-length": 24 } ] }, "ietf-ip:ipv6": { "address": [ { "ip": "2001:db8:0:2::10", "prefix-length": 64 } ] } }, { "name": "cust1:eth1", "type": "iana-if-type:ethernetCsmacd", "ietf-logical-network-element:bind-lne-name": "cust1" }, { "name": "cust2:eth1", "type": "iana-if-type:ethernetCsmacd", "ietf-logical-network-element:bind-lne-name": "cust2" } ] }, "ietf-system:system": { "authentication": { "user": [ { "name": "root", "password": "$0$password" } ] } } }
A.1.2. State Data
The following shows possible state data associated with the above configuration data: { "ietf-logical-network-element:logical-network-elements": { "logical-network-element": [ { "name": "cust1", "root": { "ietf-yang-library:modules-state": { "module-set-id": "123e4567-e89b-12d3-a456-426655440000", "module": [ { "name": "iana-if-type", "revision": "2014-05-08", "namespace": "urn:ietf:params:xml:ns:yang:iana-if-type", "conformance-type": "import" }, { "name": "ietf-inet-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types", "conformance-type": "import" }, { "name": "ietf-interfaces", "revision": "2014-05-08", "feature": [ "arbitrary-names", "pre-provisioning" ], "namespace": "urn:ietf:params:xml:ns:yang:ietf-interfaces", "conformance-type": "implement" }, { "name": "ietf-ip", "revision": "2014-06-16", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ip", "conformance-type": "implement" }, { "name": "ietf-ospf", "revision": "2018-03-03", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ospf",
"conformance-type": "implement" }, { "name": "ietf-routing", "revision": "2018-03-13", "namespace": "urn:ietf:params:xml:ns:yang:ietf-routing", "conformance-type": "implement" }, { "name": "ietf-system", "revision": "2014-08-06", "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", "conformance-type": "implement" }, { "name": "ietf-yang-library", "revision": "2016-06-21", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-library", "conformance-type": "implement" }, { "name": "ietf-yang-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types", "conformance-type": "import" } ] }, "ietf-system:system-state": { "platform": { "os-name": "NetworkOS" } }, "ietf-routing:routing": { "router-id": "192.0.2.1", "control-plane-protocols": { "control-plane-protocol": [ { "type": "ietf-routing:ospf", "name": "1", "ietf-ospf:ospf": { "af": "ipv4", "areas": { "area": [ { "area-id": "203.0.113.1",
"interfaces": { "interface": [ { "name": "eth1", "cost": 10 } ] } } ] } } } ] } }, "ietf-interfaces:interfaces": { "interface": [ { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "phys-address": "00:01:02:A1:B1:C1", "statistics": { "discontinuity-time": "2017-06-26T12:34:56-05:00" }, "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.11", "prefix-length": 24 } ] }, "ietf-ip:ipv6": { "address": [ { "ip": "2001:db8:0:2::11", "prefix-length": 64 } ] } } ] } } }, {
"name": "cust2", "root": { "ietf-yang-library:modules-state": { "module-set-id": "123e4567-e89b-12d3-a456-426655440000", "module": [ { "name": "iana-if-type", "revision": "2014-05-08", "namespace": "urn:ietf:params:xml:ns:yang:iana-if-type", "conformance-type": "import" }, { "name": "ietf-inet-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types", "conformance-type": "import" }, { "name": "ietf-interfaces", "revision": "2014-05-08", "feature": [ "arbitrary-names", "pre-provisioning" ], "namespace": "urn:ietf:params:xml:ns:yang:ietf-interfaces", "conformance-type": "implement" }, { "name": "ietf-ip", "revision": "2014-06-16", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ip", "conformance-type": "implement" }, { "name": "ietf-ospf", "revision": "2018-03-03", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ospf", "conformance-type": "implement" }, { "name": "ietf-routing", "revision": "2018-03-13", "namespace": "urn:ietf:params:xml:ns:yang:ietf-routing", "conformance-type": "implement" }, {
"name": "ietf-system", "revision": "2014-08-06", "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", "conformance-type": "implement" }, { "name": "ietf-yang-library", "revision": "2016-06-21", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-library", "conformance-type": "implement" }, { "name": "ietf-yang-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types", "conformance-type": "import" } ] }, "ietf-system:system-state": { "platform": { "os-name": "NetworkOS" } }, "ietf-routing:routing": { "router-id": "192.0.2.2", "control-plane-protocols": { "control-plane-protocol": [ { "type": "ietf-routing:ospf", "name": "1", "ietf-ospf:ospf": { "af": "ipv4", "areas": { "area": [ { "area-id": "203.0.113.1", "interfaces": { "interface": [ { "name": "eth1", "cost": 10 } ] } }
] } } } ] } }, "ietf-interfaces:interfaces": { "interface": [ { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "phys-address": "00:01:02:A1:B1:C2", "statistics": { "discontinuity-time": "2017-06-26T12:34:56-05:00" }, "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.11", "prefix-length": 24 } ] } } ] } } } ] }, "ietf-interfaces:interfaces": { "interface": [ { "name": "eth0", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "phys-address": "00:01:02:A1:B1:C0", "statistics": { "discontinuity-time": "2017-06-26T12:34:56-05:00" }, "ietf-ip:ipv4": { "address": [ { "ip": "192.0.2.10", "prefix-length": 24
} ] }, "ietf-ip:ipv6": { "address": [ { "ip": "2001:db8:0:2::10", "prefix-length": 64 } ] } }, { "name": "cust1:eth1", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "phys-address": "00:01:02:A1:B1:C1", "statistics": { "discontinuity-time": "2017-06-26T12:34:56-05:00" }, "ietf-logical-network-element:bind-lne-name": "cust1" }, { "name": "cust2:eth1", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "phys-address": "00:01:02:A1:B1:C2", "statistics": { "discontinuity-time": "2017-06-26T12:34:56-05:00" }, "ietf-logical-network-element:bind-lne-name": "cust2" } ] }, "ietf-system:system-state": { "platform": { "os-name": "NetworkOS" } }, "ietf-yang-library:modules-state": { "module-set-id": "123e4567-e89b-12d3-a456-426655440000", "module": [ { "name": "iana-if-type", "revision": "2014-05-08", "namespace": "urn:ietf:params:xml:ns:yang:iana-if-type",
"conformance-type": "import" }, { "name": "ietf-inet-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-inet-types", "conformance-type": "import" }, { "name": "ietf-interfaces", "revision": "2014-05-08", "feature": [ "arbitrary-names", "pre-provisioning" ], "namespace": "urn:ietf:params:xml:ns:yang:ietf-interfaces", "conformance-type": "implement" }, { "name": "ietf-ip", "revision": "2014-06-16", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ip", "conformance-type": "implement" }, { "name": "ietf-logical-network-element", "revision": "2017-03-13", "feature": [ "bind-lne-name" ], "namespace": "urn:ietf:params:xml:ns:yang:ietf-logical-network-element", "conformance-type": "implement" }, { "name": "ietf-ospf", "revision": "2018-03-03", "namespace": "urn:ietf:params:xml:ns:yang:ietf-ospf", "conformance-type": "implement" }, { "name": "ietf-routing", "revision": "2018-03-13", "namespace": "urn:ietf:params:xml:ns:yang:ietf-routing", "conformance-type": "implement" }, { "name": "ietf-system",
"revision": "2014-08-06", "namespace": "urn:ietf:params:xml:ns:yang:ietf-system", "conformance-type": "implement" }, { "name": "ietf-yang-library", "revision": "2016-06-21", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-library", "conformance-type": "implement" }, { "name": "ietf-yang-schema-mount", "revision": "2017-05-16", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-schema-mount", "conformance-type": "implement" }, { "name": "ietf-yang-types", "revision": "2013-07-15", "namespace": "urn:ietf:params:xml:ns:yang:ietf-yang-types", "conformance-type": "import" } ] }, "ietf-yang-schema-mount:schema-mounts": { "mount-point": [ { "module": "ietf-logical-network-element", "label": "root", "shared-schema": {} } ] } }