module openconfig-network-instance { yang-version "1"; // namespace namespace "http://openconfig.net/yang/network-instance"; prefix "netinst"; // import some basic types //import ietf-inet-types { prefix inet; } import ietf-yang-types { prefix "yang"; } import ietf-inet-types { prefix "inet"; } import openconfig-network-instance-types { prefix "nit"; } import openconfig-policy-types { prefix "pt"; } import openconfig-routing-policy { prefix "rpol"; } import openconfig-local-routing { prefix "lroute"; } import openconfig-interfaces { prefix "ocif"; } import openconfig-extensions { prefix "ocext"; } // meta organization "OpenConfig working group"; contact "OpenConfig working group www.openconfig.net"; description "An OpenConfig description of a network-instance. This may be a Layer 3 forwarding construct such as a virtual routing and forwarding (VRF) instance, or a Layer 2 instance such as a virtual switch instance (VSI). Mixed Layer 2 and Layer 3 instances are also supported."; ocext:openconfig-version "0.1.0"; revision "2015-10-18" { description "Initial revision"; reference "0.1.0"; } grouping network-instance-top { description "Top-level grouping containing a list of network instances."; container network-instances { description "The L2, L3, or L2+L3 forwarding instances that are configured on the local system"; list network-instance { key "name"; description "Network instances configured on the local system"; leaf name { type leafref { path "../config/name"; } description "A unique name identifying the network instance"; } container config { description "Configuration parameters relating to a network instance"; uses network-instance-config; uses network-instance-l3vrf-config { when "../type = 'L3VRF'" { description "Layer 3 VRF configuration parameters included when a network instance is of type L3VRF"; } } } container state { config false; description "Operational state parameters relating to a network instance"; uses network-instance-config; uses network-instance-l3vrf-config { when "../type = 'L3VRF'" { description "Layer 3 VRF configuration parameters included when a network instance is of type L3VRF"; } } uses network-instance-state; } container inter-instance-policies { description "Policies dictating how RIB or FIB entries are imported to and exported from this instance"; uses rpol:apply-policy-group; } container table-connections { description "Policies dictating how RIB or FIB entries are propagated between tables"; list table-connection { key "src-table dst-table"; description "A list of connections between pairs of routing or forwarding tables, the leaking of entries between which is specified by the import and export policy"; leaf src-table { type leafref { path "../config/src-table"; } description "The name of the table which should be utilised as the source of forwarding or routing information"; } leaf dst-table { type leafref { path "../config/dst-table"; } description "The table to which routing entries should be exported"; } container config { description "Configuration parameters relating to the connection between tables"; uses inter-table-policies-config; } container state { config false; description "State parameters relating to the connection between tables"; uses inter-table-policies-config; } uses rpol:apply-policy-group; } } container tables { description "The routing tables that are managed by this network instance"; list table { key "table-name"; description "A network instance manages one or more forwarding or routing tables. These may reflect the Layer 2 forwarding information base, the Layer 3 routing information base of the MPLS LFIB. Protocols may be explictly associated with a particular table into which they populate entries. Multiple protocols may install entries into a single table, or there may be a 1:1 relationship between a routing protocol and a table .The import-policy and export-policy lists are used to specify how routes leak between different tables within the same forwarding instance."; leaf table-name { type leafref { path "../config/table-name"; } description "A name for the table"; } container config { description "Configuration parameters related to the table"; uses table-config; } container state { config false; description "State parameters related to the table"; uses table-config; } } } container interfaces { description "Interfaces associated with this network intance"; container config { description "Configuration parameters relating to interfaces associated with the instance"; uses instance-interfaces-config; } container state { config false; description "State parameters relating to interfaces associated with the instance"; uses instance-interfaces-config; uses instance-interfaces-state; } } container connection-points { description "The set of connection points within a forwarding instance"; list connection-point { key "connection-point-id"; description "A connection point within a Layer 2 network instance. Each connection-point consists of a set of interfaces only one of which is active at any one time. Other than the specification of whether an interface is local (i.e., exists within this network-instance), or remote, all configuration and state parameters are common"; leaf connection-point-id { type leafref { path "../config/connection-point-id"; } description "A locally significant reference for the connection-point"; } container config { description "Configuration parameters relating to a Layer 2 network instance connection point"; uses instance-connection-point-config; } container state { config false; description "Operational state parameters relating to a Layer 2 network instance connection point"; uses instance-connection-point-config; uses instance-connection-point-state; } container endpoints { when "../config/type = 'L2P2P' " + "or ../config/type = 'L2VSI'" { description "Configuration parameters to associate interfaces into a common group for use in Layer 2 network instances"; } description "The set of endpoints which are grouped within the connection point"; list endpoint { key "endpoint-id"; description "A list of the endpoints (interfaces or remote connection points that can be used for this connection point). The active endpoint is selected based on the precedence that it is configured with"; leaf endpoint-id { type leafref { path "../config/endpoint-id"; } description "A pointer to the configured identifier for the endpoint"; } container config { description "Configuration parameters relating to the endpoint"; uses instance-endpoint-config; } container state { config false; description "Operational state parameters relating to the endpoint"; uses instance-endpoint-config; uses instance-endpoint-state; } } } } } container protocols { description "The routing protocols that are enabled for this network-instance."; list protocol { key "identifier name"; description "A process (instance) of a routing protocol. Some systems may not support more than one instance of a particular routing protocol"; leaf identifier { type leafref { path "../config/identifier"; } description "The protocol name for the routing or forwarding protocol to be instantiated"; } leaf name { type leafref { path "../config/name"; } description "An operator-assigned identifier for the routing or forwarding protocol. For some processes this leaf may be system defined."; } container config { description "Configuration parameters relating to the routing protocol instance"; uses protocols-config; } container state { config false; description "State parameters relating to the routing protocol instance"; uses protocols-config; uses protocols-state; } container static { when "../config/identifier = 'STATIC'" { description "Include static route parameters only when the protocol is set to static"; } description "Configuration and state parameters relating to static routes"; uses lroute:local-static-top; } container aggregate { when "../config/identifier = 'LOCAL-AGGREGATE'" { description "Include aggregate route parameters only when the protocol is set to aggregate"; } description "Configuration and state parameters relating to locally generated aggregate routes"; uses lroute:local-aggregate-top; } } } } } } grouping instance-endpoint-config { description "Configuration data relating to an forwarding-instance endpoint"; leaf endpoint-id { type string; description "An identifier for the endpoint"; } uses instance-endpoint-local-remote; leaf precedence { type uint16; description "The precedence of the endpoint - the lowest precendence viable endpoint will be utilised as the active endpoint within a connection"; } } grouping instance-endpoint-local-remote { description "A generic specification of a local or remote endpoint"; choice local-remote { case local { leaf interface { type leafref { path "/network-instances/network-instance" + "/interfaces/config/interface"; } description "Reference to the local interface that is a member of the forwarding-instance"; } } case remote { leaf neighbor { type inet:ip-address; description "The IP address of the device which hosts the remote end-point"; } leaf virtual-circuit-identifier { type uint32; description "The virtual-circuit identifier that identifies the connection at the remote end-point"; } } description "Configuration relating to an endpoint which can either be local (an interface), or remote. In the case where it is remote a neighbor IP address and virtual-circuit identifier must be specified"; } } grouping instance-endpoint-state { description "Operational state data relating to a forwarding-instance endpoint"; leaf active { type boolean; description "When the backup endpoint is active, the value of this parameter is set to true"; } } grouping instance-connection-point-config { description "Configuration data relating to a forwarding-instance connection point"; leaf connection-point-id { type string; description "An identifier for a connection point"; } } grouping instance-connection-point-state { description "Operational state data relating to a forwarding-instance connection point"; } grouping table-config { description "Configuration parameters relating to a L2/L2.5/L3 table that exists within the network instance"; leaf table-name { type string; description "A human-readable name for the table"; } } grouping table-state { description "State parameters relating to a table - this may be utilised to store generic structure for retrieving the contents of a RIB, FIB or LFIB"; // placeholder } grouping inter-table-policies-config { description "Configuration entries that relate to how RIB or FIB entries are propagated between tables within the same network instance"; leaf src-table { // FIXME: BUG-4625: DTO generation cannot handle this case in Binding Spec v1 // type leafref { // path "../../../../tables/table/table-name"; // } type string; description "The source protocol for the table connection"; } leaf dst-table { // FIXME: BUG-4625: DTO generation cannot handle this case in Binding Spec v1 // type leafref { // path "../../../../tables/table/table-name"; // } type string; description "The destination protocol for the table connection"; } } grouping network-instance-config { description "Configuration parameters relating to a top-level network instance"; leaf name { type string; description "An operator-assigned unique name for the forwarding instance"; } leaf type { type identityref { base "nit:network-instance-type"; } description "The type of network instance. The value of this leaf indicates the type of forwarding entries that should be supported by this network instance"; } leaf enabled { type boolean; description "Whether the network instance should be configured to be active on the network element"; } leaf description { type string; description "A free-form string to be used by the network operator to describe the function of this network instance"; } leaf router-id { type yang:dotted-quad; description "A identifier for the local network instance - typically used within associated routing protocols or signalling routing information in another network instance"; } leaf route-distinguisher { type nit:route-distinguisher; description "The route distinguisher that should be used for the local VRF or VSI instance when it is signalled via BGP."; } } grouping network-instance-state { description "Operational state parameters relating to a network instance"; } grouping network-instance-l3vrf-config { description "Configuration parameters for a network instance of type l3vrf"; } grouping protocols-config { description "Configuration parameters relating to a generic protocol instance within a network instance"; leaf identifier { type identityref { base "pt:install-protocol-type"; } description "The protocol identifier for the instance"; } leaf name { type string; description "A unique name for the protocol instance"; } leaf enabled { type boolean; description "A boolean value indicating whether the local protocol instance is enabled."; } leaf target-table { // FIXME: BUG-4625: DTO generation cannot handle this case in Binding Spec v1 // type leafref { // path "../../../../tables/table/table-name"; // } type string; description "The table (RIB, FIB, or LFIB) that the protocol should populate its entries in."; } } grouping protocols-state { description "Operational state parameters relating to a protocol instance"; } grouping instance-interfaces-config { description "Base configuration parameters relating to the interfaces associated with a network instance"; leaf-list interface { type leafref { path "/ocif:interfaces/ocif:interface/ocif:name"; } description "Interfaces that are associated with the network instance"; } } grouping instance-interfaces-state { description "State parameters relating to the interfaces associated with a network instance"; } uses network-instance-top; }