openconfig-extensions.yang 000664 001750 001750 00000005374 13076064563 016461 0 ustar 00root1 root1 000000 000000 module openconfig-extensions {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/openconfig-ext";
prefix "oc-ext";
// meta
organization "OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module provides extensions to the YANG language to allow
OpenConfig specific functionality and meta-data to be defined.";
revision "2017-01-29" {
description
"Added extension for annotating encrypted values.";
reference "TBD";
}
revision "2015-10-09" {
description
"Initial OpenConfig public release";
reference "TBD";
}
revision "2015-10-05" {
description
"Initial revision";
reference "TBD";
}
// extension statements
extension openconfig-version {
argument "semver" {
yin-element false;
}
description
"The OpenConfig version number for the module. This is
expressed as a semantic version number of the form:
x.y.z
where:
* x corresponds to the major version,
* y corresponds to a minor version,
* z corresponds to a patch version.
This version corresponds to the model file within which it is
defined, and does not cover the whole set of OpenConfig models.
Where several modules are used to build up a single block of
functionality, the same module version is specified across each
file that makes up the module.
A major version number of 0 indicates that this model is still
in development (whether within OpenConfig or with industry
partners), and is potentially subject to change.
Following a release of major version 1, all modules will
increment major revision number where backwards incompatible
changes to the model are made.
The minor version is changed when features are added to the
model that do not impact current clients use of the model.
The patch-level version is incremented when non-feature changes
(such as bugfixes or clarifications to human-readable
descriptions that do not impact model functionality) are made
that maintain backwards compatibility.
The version number is stored in the module meta-data.";
}
extension openconfig-encrypted-value {
description
"This extension provides an annotation on schema nodes to
indicate that the corresponding value should be stored and
reported in encrypted form.
Clients reading the configuration or applied configuration
for the node should expect to receive only the encrypted value.
This annotation may be used on nodes such as secure passwords
in which the device never reports a cleartext value, even
if the input is provided as cleartext.";
}
} openconfig-aft-types.yang 000664 001750 001750 00000004327 13104310167 016155 0 ustar 00root1 root1 000000 000000 module openconfig-aft-types {
namespace "http://openconfig.net/yang/fib-types";
prefix "oc-aftt";
import openconfig-extensions { prefix "oc-ext"; }
organization
"OpenConfig Working Group";
contact
"OpenConfig Working Group
www.openconfig.net";
description
"Types related to the OpenConfig Abstract Forwarding
Table (AFT) model";
//oc-ext:openconfig-version "0.2.1";
revision 2017-01-13 {
description
"Updated revision for external review";
reference "0.2.1";
}
revision 2016-09-07 {
description
"Initial revision for external review";
reference "0.2.0";
}
typedef encapsulation-header-type {
type enumeration {
enum GRE {
description
"The encapsulation header is a Generic Routing Encapsulation
header.";
}
enum IPV4 {
description
"The encapsulation header is an IPv4 packet header";
}
enum IPV6 {
description
"The encapsulation header is an IPv6 packet header";
}
enum MPLS {
description
"The encapsulation header is one or more MPLS labels indicated
by the pushed and popped label stack lists.";
}
}
description
"Types of tunnel encapsulation that are supported by systems as either
head- or tail-end.";
}
identity AFT_ADDRESS_FAMILY {
description
"A base identity that is used for address families that have
distinct Abstract Forwarding Tables (AFTs).";
}
identity IPV4_UNICAST {
base AFT_ADDRESS_FAMILY;
description
"The AFT entries within the corresponding table relate to unicast
IPv4 forwarding entries.";
}
identity IPV6_UNICAST {
base AFT_ADDRESS_FAMILY;
description
"The AFT entries within the corresponding table relate to unicast
IPv6 forwarding entries.";
}
identity MPLS {
base AFT_ADDRESS_FAMILY;
description
"The AFT entries within the corresponding table relate to labelled
forwarding entries using MPLS labels.";
}
identity L2_ETHERNET {
base AFT_ADDRESS_FAMILY;
description
"The AFT entries within the corresponding table relate to Ethernet
switched forwarding entries.";
}
}
openconfig-aft-network-instance.yang 000664 001750 001750 00000005117 13104310171 020275 0 ustar 00root1 root1 000000 000000 module openconfig-aft-network-instance {
yang-version "1";
namespace "http://openconfig.net/yang/aft/ni";
prefix "oc-aftni";
import openconfig-extensions { prefix "oc-ext"; }
import openconfig-network-instance { prefix "oc-ni"; }
organization
"OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"This module provides augmentations that are utilized
when building the OpenConfig network instance model to
add per-NI AFTs.";
//oc-ext:openconfig-version "0.2.1";
revision 2017-01-13 {
description
"Updated revision for external review";
reference "0.2.1";
}
augment "/oc-ni:network-instances/oc-ni:network-instance/" +
"oc-ni:afts/oc-ni:aft/oc-ni:entries/oc-ni:entry/" +
"oc-ni:next-hops/oc-ni:next-hop/oc-ni:state" {
description
"Add leaves that require referencing of a network instance to the
operational state parameters of a next-hop within the AFT.";
uses aft-nexthop-ni-state;
}
grouping aft-nexthop-ni-state {
description
"Operational state parameters relating to a next-hop which reference a
network instance.";
leaf network-instance {
type oc-ni:network-instance-ref;
description
"The network-instance within which the next-hop should be resolved.
When this leaf is unspecified, the next-hop is resolved within
the local instance.";
}
}
augment "/oc-ni:network-instances/oc-ni:network-instance/" +
"oc-ni:afts/oc-ni:aft/oc-ni:entries/oc-ni:entry/" +
"oc-ni:match/oc-ni:state" {
description
"Add leaves that require referencing of a network instance to the
operational state parmaeters of an entry within the AFT.";
uses aft-entry-ni-state;
}
grouping aft-entry-ni-state {
description
"Operational state parameters relating to an AFT entry which reference
a network instance.";
leaf origin-network-instance {
type oc-ni:network-instance-ref;
description
"If the AFT entry was imported from another network instance (e.g., it
corresponds to a L3 forwarding entry which was learned within another
network-instance), the value of this leaf reflects the network-instance
from which it was learned.
For example, if the local network-instance corresponds to a L3VRF, and
routes are imported from the VPNv4 address-family of the BGP instance
in the DEFAULT_INSTANCE, then this value would reflect the
DEFAULT_INSTANCE as the origin-network-instance.";
}
}
}
openconfig-aft.yang 000664 001750 001750 00000031541 13104310172 015005 0 ustar 00root1 root1 000000 000000 module openconfig-aft {
yang-version "1";
namespace "http://openconfig.net/yang/aft";
prefix "oc-aft";
import openconfig-extensions { prefix "oc-ext"; }
import ietf-inet-types { prefix "inet"; }
import ietf-yang-types { prefix "yang"; }
import openconfig-aft-types { prefix "oc-aftt"; }
import openconfig-mpls-types { prefix "oc-mplst"; }
import openconfig-interfaces { prefix "oc-if"; }
import openconfig-packet-match-types { prefix oc-pkt-match-types; }
import openconfig-policy-types { prefix "oc-pol-types"; }
import openconfig-types { prefix "oc-types"; }
organization
"OpenConfig working group";
contact
"OpenConfig working group
www.openconfig.net";
description
"A model describing the forwarding entries installed on a network
element. It should be noted that this model is not expected to
align 1:1 with the underlying structure used directly by a
forwarding element (e.g., linecard), but rather provide an
abstraction that can be consumed by an NMS to observe, and in some
cases manipulate, the internal forwarding database in a simplified
manner. Since the underlying model of the forwarding table is not
expected to align with this model, the structure described herein
is referred to as an Abstract Forwarding Table (AFT), rather than
the FIB.";
//oc-ext:openconfig-version "0.2.1";
revision 2017-01-13 {
description
"Updated revision to address review comments";
reference "0.2.1";
}
revision 2016-09-07 {
description
"Initial revision for external review";
reference "0.2.0";
}
// config + state groupings
grouping aft-entry-config {
description
"Configuration parameters relating to a forwarding entry";
leaf index {
type uint64;
description
"A unique index referring to the AFT entry";
}
}
grouping aft-entry-state {
description
"Operational state parameters relating to a forwarding entry";
leaf packets-forwarded {
type yang:counter64;
description
"The number of packets which have matched, and been forwarded,
based on the AFT entry.";
}
leaf octets-forwarded {
type yang:counter64;
description
"The number of octets which have matched, and been forwarded,
based on the AFT entry";
}
}
grouping aft-entry-match-state {
description
"Match critiera for AFT entries";
leaf ip-prefix {
type inet:ip-prefix;
description
"The IP prefix that the forwarding entry matches. Used for
Layer 3 forwarding entries.";
}
leaf mac-address {
type yang:mac-address;
description
"The MAC address that the forwarding entry matches. Used for
Layer 2 forwarding entries, e.g., within a VSI instance.";
}
leaf mpls-label {
type oc-mplst:mpls-label;
description
"The MPLS label that the forwarding entry matches. Used for
MPLS forwarding entries, whereby the local device acts as an
LSR.";
}
leaf mpls-tc {
type uint8 {
range "0..7";
}
description
"The value of the MPLS Traffic Class bits (formerly known as
the MPLS experimental bits) that are to be matched by the AFT
entry.";
reference
"RFC5462: Multiprotocol Label Switching (MPLS) Label Stack
Entry: 'EXP' Field Renamed to 'Traffic Class' Field"; }
leaf ip-dscp {
type inet:dscp;
description
"The value of the differentiated services code point (DSCP) to
be matched for the forwarding entry. The value is specified in
cases where specific class-based forwarding based on IP is
implemented by the device.";
}
leaf ip-protocol {
type oc-pkt-match-types:ip-protocol-type;
description
"The value of the IP protocol field of an IPv4 packet, or the
next-header field of an IPv6 packet which is to be matched by
the AFT entry. This field is utilised where forwarding is
performed based on L4 information.";
}
leaf l4-src-port {
type inet:port-number;
description
"The value of the source port field of the transport header
that is to be matched by the AFT entry.";
}
leaf l4-dst-port {
type inet:port-number;
description
"The value of the destination port field of the transport
header that is to be matched by the AFT entry.";
}
}
grouping aft-entry-nexthop-config {
description
"Configuration parameters relating to a next-hop entry for a AFT
entry";
leaf index {
type uint64;
description
"A unique entry for the next-hop";
}
}
grouping aft-entry-nexthop-state {
description
"Parameters relating to a next-hop within the AFT entry";
leaf weight {
type uint32;
description
"The weight of the next-hop. Traffic is balanced according to
the ratio described by the relative weights of the next hops
that exist for the AFT entry. Note that all next-hops that are
specified are assumed to be active next-hops and therefore
eligible (and selected) to be installed in the FIB, and hence
used for packet forwarding.";
}
leaf ip-address {
type inet:ip-address-no-zone;
description
"The IP address of the next-hop system.";
}
leaf mac-address {
type yang:mac-address;
description
"The MAC address of the next-hop if resolved by the local
network instance.";
}
leaf-list popped-mpls-label-stack {
type oc-mplst:mpls-label;
description
"The MPLS label stack to be popped from the packet when
switched by the system. The stack is encoding as a leaf-list
whereby the other of the entries is such that the first entry
is the label lowest down the label stack to be popped.
If the local system pops the outer-most label 400, then the
value of this list is [400,]. If the local system removes two
labels, the outer-most being 500, and the second of which is
500, then the value of the list is [500, 400].
A swap operation is reflected by entries in the
popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
}
leaf-list pushed-mpls-label-stack {
type oc-mplst:mpls-label;
ordered-by user;
description
"The MPLS label stack imposed when forwarding packets to the
next-hop
- the stack is encoded as a leaf list whereby the order of the
entries is such that the first entry in the list is the
label at the bottom of the stack to be pushed.
To this end, a packet which is to forwarded to a device using
a service label of 42, and a transport label of 8072 will be
represented with a label stack list of [42, 8072].
The MPLS label stack list is ordered by the user, such that no
system re-ordering of leaves is permitted by the system.
A swap operation is reflected by entries in the
popped-mpls-label-stack and pushed-mpls-label-stack nodes.";
}
leaf decapsulate-header {
type oc-aftt:encapsulation-header-type;
description
"When forwarding a packet to the specified next-hop, the local
system performs a decapsulation of the packet - removing the
specified header type. In the case that no next-hop is
specified, the packet header is removed, and a subsequent
forwarding lookup is performed on the packet encapsulated
within the header, matched within the relevant AFT within the
specified network-instance.";
}
leaf encapsulate-header {
type oc-aftt:encapsulation-header-type;
description
"When forwarding a packet to the specified next-hop the local
system performs an encapsulation of the packet - adding the
specified header type.";
}
leaf origin-protocol {
type identityref {
base "oc-pol-types:INSTALL_PROTOCOL_TYPE";
}
description
"The protocol from which the AFT entry was learned.";
}
}
grouping aft-config {
description
"Configuration parameters relating to an Abstract Forwarding
Table (AFT) for a particular address family.";
leaf address-family {
type identityref {
base "oc-types:ADDRESS_FAMILY";
}
description
"The address family of entries that are described by the
AFT.";
}
}
// structural groupings
grouping aft-proto-top {
description
"Top level per-protocol grouping for the AFT.";
container entries {
description
"Enclosing container for a list of abstract forwarding table
entries within the network instance for a particular protocol
(e.g., IPv4, IPv6, MPLS).";
list entry {
key "index";
description
"A forwarding database entry within the network instance";
leaf index {
type leafref {
path "../config/index";
}
description
"A pointer to the index of the AFT entry within the
network instance";
}
container config {
description
"Configuration parameters relating to the forwarding
entry";
uses aft-entry-config;
}
container state {
config false;
description
"Operational state parameters relating to the forwarding
entry";
uses aft-entry-config;
uses aft-entry-state;
}
container match {
description
"Match criteria for the AFT entry";
container config {
description
"Configuration of match criteria for the AFT entry";
}
container state {
config false;
description
"Operational state parameters for match criteria of the
AFT entry";
uses aft-entry-match-state;
}
uses oc-if:interface-ref-state;
}
container next-hops {
description
"Enclosing container for the list of next-hops associated
with the forwarding entry";
list next-hop {
key "index";
description
"A next-hop associated with the forwarding instance. The
entries within the next-hop list should only reflect
next-hops that are actively used by the local system.
That is to say inactive, backup or FRR next-hops should
not be included within this list.";
leaf index {
type leafref {
path "../config/index";
}
description
"A unique index identifying the next-hop entry for the
AFT entry";
}
container config {
description
"Configuration parameters relating to the AFT next-hop
entry";
uses aft-entry-nexthop-config;
}
container state {
config false;
description
"Operational state parameters relating to the AFT
next-hop entry";
uses aft-entry-nexthop-config;
uses aft-entry-nexthop-state;
}
uses oc-if:interface-ref;
}
}
}
}
}
grouping aft-top {
description
"Top-level grouping allowing per-protocol instantiation of the
AFT.";
container afts {
description
"The abstract forwarding tables (AFTs) that are associated
with the network instance. An AFT is instantiated per-protocol
running within the network-instance - such that one exists for
IPv4 Unicast, IPv6 Unicast, MPLS, L2 forwarding entries, etc.
A forwarding entry within the FIB has a set of next-hops,
which may be a reference to an entry within another table -
e.g., where a Layer 3 next-hop has an associated Layer 2
forwarding entry.";
list aft {
key "address-family";
description
"An individual abstract forwarding table associated with a
an address family wtihin the network instance.";
leaf address-family {
type leafref {
path "../config/address-family";
}
description
"Reference to the address family with which the AFT is
associated";
}
container config {
description
"Configuration parameters relating to the AFT.";
uses aft-config;
}
container state {
config false;
description
"Operational state parameters relating to the AFT.";
uses aft-config;
}
uses aft-proto-top;
}
}
}
}
openconfig-network-instance.yang 000664 001750 001750 00000074523 13104310442 017535 0 ustar 00root1 root1 000000 000000 module openconfig-network-instance {
yang-version "1";
// namespace
namespace "http://openconfig.net/yang/network-instance";
prefix "oc-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 "oc-ni-types"; }
import openconfig-policy-types { prefix "oc-pol-types"; }
import openconfig-routing-policy { prefix "oc-rpol"; }
import openconfig-local-routing { prefix "oc-loc-rt"; }
import openconfig-interfaces { prefix "oc-if"; }
import openconfig-extensions { prefix "oc-ext"; }
import openconfig-network-instance-l3 { prefix "oc-ni-l3"; }
import openconfig-types { prefix "oc-types"; }
import openconfig-bgp { prefix "oc-bgp"; }
import openconfig-mpls { prefix "oc-mpls"; }
import openconfig-vlan { prefix "oc-vlan"; }
import openconfig-ospfv2 { prefix "oc-ospfv2"; }
import openconfig-policy-forwarding { prefix "oc-pf"; }
import openconfig-segment-routing { prefix "oc-sr"; }
import openconfig-isis { prefix "oc-isis"; }
import openconfig-aft { prefix "oc-aft"; }
// include submodules
include openconfig-network-instance-l2;
// 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.";
//oc-ext:openconfig-version "0.8.0";
revision "2017-02-28" {
description
"Add OSPFv2 to network instance";
reference "0.8.0";
}
revision "2017-01-26" {
description
"Add policy forwarding to network instance";
reference "0.7.0";
}
revision "2017-01-13" {
description
"Add AFT to the network instance";
reference "0.6.0";
}
revision "2016-12-15" {
description
"Add segment routing to network instance";
reference "0.5.0";
}
revision "2016-11-10" {
description
"Add IS-IS to OpenConfig network instance";
reference "0.4.1";
}
revision "2016-10-12" {
description
"Update table connections";
reference "0.4.0";
}
revision "2016-09-28" {
description
"Change L2 instance to submodule; add MAC table";
reference "0.3.0";
}
revision "2016-08-11" {
description
"Resolve repeated container names in routing protocols";
reference "0.2.3";
}
revision "2016-07-08" {
description
"Updated with refactored routing protocol models";
reference "0.2.1";
}
revision "2016-03-29" {
description
"Initial revision";
reference "0.2.0";
}
revision "2015-10-18" {
description
"Initial revision";
reference "0.1.0";
}
typedef network-instance-ref {
type leafref {
path "/network-instances/network-instance/config/name";
}
description
"A re-usable type that can be referenced within other
modules that references a network instance.";
}
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";
}
uses l2ni-instance {
when "../type = 'L2VSI' or ../type = 'L2P2P'" +
" or ../type = 'L2L3' or ../type = 'DEFAULT_INSTANCE'" {
description
"Layer 2 configuration parameters included when
a network instance is a Layer 2 instance or a
combined L2L3 instance";
}
}
container config {
description
"Configuration parameters relating to a network
instance";
uses network-instance-config;
uses network-instance-type-dependent-config;
}
container state {
config false;
description
"Operational state parameters relating to a network
instance";
uses network-instance-config;
uses network-instance-type-dependent-config;
uses network-instance-state;
}
container encapsulation {
when "../config/type != 'DEFAULT_INSTANCE'" {
description
"Only allow the encapsulation of the instance to be
set when the instance is not the default instance";
}
description
"Configuration parameters relating to the encapsulation
used for the network instance";
container config {
description
"Configuration parameters relating to the encapsulation
of the network instance";
uses encapsulation-config;
uses l2ni-encapsulation-config {
when "../../../type = 'L2VSI' or ../../../type = 'L2P2P'
or ../../../type = 'L2L3'" {
description
"Only allow L2 encapsulations to be set
when the instance is of a type that supports
L2";
}
}
}
container state {
config false;
description
"State parameters relating to the encapsulation of
the network instance";
uses encapsulation-config;
uses l2ni-encapsulation-config {
when "../../../type = 'L2VSI' or ../../../type = 'L2P2P'
or ../../../type = 'L2L3'" {
description
"Only allow L2 encapsulations to be set
when the instance is of a type that supports
L2";
}
}
}
}
container inter-instance-policies {
description
"Policies dictating how RIB or FIB entries are imported
to and exported from this instance";
uses oc-rpol:apply-policy-group;
}
container table-connections {
description
"Policies dictating how RIB or FIB entries are propagated
between tables";
list table-connection {
key "src-protocol dst-protocol address-family";
description
"A list of connections between pairs of routing or
forwarding tables, the leaking of entries between
which is specified by the import policy.
A connection connecting a source table to a destination
table implies that routes that match the policy specified
for the connection are available for the destination
protocol to advertise, or match within its policies.";
leaf src-protocol {
type leafref {
path "../config/src-protocol";
}
description
"The name of the protocol associated with the table
which should be utilised as the source of forwarding
or routing information";
}
leaf dst-protocol {
type leafref {
path "../config/dst-protocol";
}
description
"The table to which routing entries should be
exported";
}
leaf address-family {
type leafref {
path "../config/address-family";
}
description
"The address family associated with the connection";
}
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;
}
}
}
container interfaces {
description
"The interfaces that are associated with this network
instance";
list interface {
key "id";
unique "config/interface config/subinterface";
description
"An interface associated with the network instance";
leaf id {
type leafref {
path "../config/id";
}
description
"A reference to an identifier for this interface which
acts as a key for this list";
}
container config {
description
"Configuration parameters relating to the associated
interface";
uses instance-interfaces-config;
}
container state {
config false;
description
"Operational state parameters relating to the
associated interface";
uses instance-interfaces-config;
uses instance-interfaces-state;
}
}
}
container tables {
description
"The routing tables that are managed by this network
instance";
list table {
key "protocol address-family";
description
"A network instance manages one or more forwarding or
routing tables. These may reflect a Layer 2 forwarding
information base, a Layer 3 routing table, or an MPLS
LFIB.
The table populated by a protocol within an instance is
identified by the protocol identifier (e.g., BGP, IS-IS)
and the address family (e.g., IPv4, IPv6) supported by
that protocol. Multiple instances of the same protocol
populate a single table -- such that
a single IS-IS or OSPF IPv4 table exists per network
instance.
An implementation is expected to create entries within
this list when the relevant protocol context is enabled.
i.e., when a BGP instance is created with IPv4 and IPv6
address families enabled, the protocol=BGP,
address-family=IPv4 table is created by the system.";
leaf protocol {
type leafref {
path "../config/protocol";
}
description
"A reference to the protocol that populates
the table";
}
leaf address-family {
type leafref {
path "../config/address-family";
}
description
"A reference to the address-family that the
table represents";
}
container config {
description
"Configuration parameters relating to the
table";
uses table-config;
}
container state {
config false;
description
"State parameters related to the table";
uses table-config;
}
}
}
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 local {
when "../config/type = 'LOCAL'" {
description
"Only include the local configuration when
the endpoint is specified to be local to
the network element";
}
description
"Configuration and operational state parameters
relating to a local interface";
container config {
description
"Configuration parameters relating to a local
endpoint";
uses instance-endpoint-local-config;
}
container state {
config false;
description
"Operational state parameters relating to a
local endpoint";
uses instance-endpoint-local-config;
}
}
container remote {
when "../config/type = 'REMOTE'" {
description
"Only include the remote configuration when
the endpoint is specified to be remote to
the network element";
}
description
"Configuration and operational state parameters
relating to a remote interface";
container config {
description
"Configuration parameters relating to a remote
endpoint";
uses instance-endpoint-remote-config;
}
container state {
config false;
description
"Operational state parameters relating to
a remote endpoint";
uses instance-endpoint-remote-config;
}
}
}
}
}
}
uses oc-mpls:mpls-top {
when "../config/type = 'DEFAULT'" {
description
"MPLS configuration is only valid within the default
network instance.";
}
}
uses oc-sr:sr-top {
when "../config/type = 'DEFAULT'" {
description
"Segment routing configuration is only valid with the default
network instance.";
}
}
uses oc-vlan:vlan-top;
uses oc-pf:policy-forwarding-top;
uses oc-aft:aft-top;
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;
}
uses oc-loc-rt:local-static-top {
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 oc-loc-rt:local-aggregate-top {
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 oc-bgp:bgp-top {
when "../config/identifier = 'BGP'" {
description
"Include BGP parameters only when the protocol
is of type BGP";
}
description
"Configuration and state parameters relating to
Border Gateway Protocol (BGP)";
}
uses oc-ospfv2:ospfv2-top {
when "../config/identifier = 'OSPF2'" {
description
"Include OSPFv2 parameters only when the protocol
is of type OSPFv2";
}
}
uses oc-isis:isis-top {
when "../config/identifier = 'ISIS'" {
description
"Include IS-IS configuration when the protocol is of type
IS-IS";
}
description
"Configuration and state parameters relating to Intermediate
System to Intermediate System (IS-IS).";
}
}
}
}
}
}
grouping network-instance-type-dependent-config {
description
"Type dependent network instance configuration";
uses oc-ni-l3:l3ni-instance-common-config {
when "../type = 'L3VRF' or ../type = 'L2L3'" {
description
"Layer 3 VRF configuration parameters included when a
network instance is a L3VRF or combined L2L3 instance";
}
}
uses l2ni-instance-common-config {
when "../type = 'L2VSI' or ../type = 'L2P2P'" +
" or ../type = 'L2L3'" {
description
"Layer 2 configuration parameters included when
a network instance is a Layer 2 instance or a
combined L2L3 instance";
}
}
}
grouping instance-endpoint-config {
description
"Configuration data relating to an forwarding-instance
endpoint";
leaf endpoint-id {
type string;
description
"An identifier for the endpoint";
}
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";
}
leaf type {
type identityref {
base "oc-ni-types:ENDPOINT_TYPE";
}
description
"The type of endpoint that is referred to by the current
endpoint";
}
}
grouping instance-endpoint-local-config {
description
"Configuration parameters relating to an endpoint that is local
to the current system";
uses oc-if:interface-ref-common;
}
grouping instance-endpoint-remote-config {
description
"Configuration parameters relating to an endpoint that is
remote from the local system";
leaf remote-system {
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";
}
}
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
"Config parameters relating to an L2/L2.5/L3 table that exists
within a network instance";
leaf protocol {
type leafref {
path "../../../../protocols/protocol/config/identifier";
}
description
"Reference to the protocol that the table is associated with.";
}
leaf address-family {
type identityref {
base oc-types:ADDRESS_FAMILY;
}
description
"The address family (IPv4, IPv6) of the table's entries";
}
}
grouping instance-interfaces-config {
description
"Configuration parameters related to an interface associated
with the network instance";
leaf id {
type string;
description
"A unique identifier for this interface - this is expressed
as a free-text string";
}
uses oc-if:interface-ref-common;
leaf-list associated-address-families {
type identityref {
base oc-types:ADDRESS_FAMILY;
}
description
"The address families on the subinterface which are to be
associated with this network instance. When this leaf-list
is empty and the network instance requires Layer 3 information
the address families for which the network instance is
enabled should be imported. If the value of this leaf-list
is specified then the association MUST only be made for
those address families that are included in the list.";
}
}
grouping instance-interfaces-state {
description
"Operational state parameters relating to an interface
associated with this network instance";
}
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-protocol {
type leafref {
// we are at table-connections/table-connection/config/.
path "../../../../tables/table/config/protocol";
}
description
"The source protocol for the table connection";
}
leaf address-family {
type leafref {
// we are at table-connections/table-connection/config/.
path "../../../../tables/" +
"table[protocol=current()/../src-protocol]/" +
"config/address-family";
}
description
"The address family associated with the connection. This
must be defined for the source protocol. The target
address family is implicitly defined by the address family
specified for the source protocol.";
}
leaf dst-protocol {
type leafref {
path "../../../../tables/table/config/protocol";
}
description
"The destination protocol for the table connection";
}
uses oc-rpol:apply-policy-import-config;
}
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 "oc-ni-types: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 oc-ni-types: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 protocols-config {
description
"Configuration parameters relating to a generic protocol
instance within a network instance";
leaf identifier {
type identityref {
base "oc-pol-types: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 default-metric {
type uint32;
description
"The default metric within the RIB for entries that are
installed by this protocol instance. This value may
be overridden by protocol specific configuration options.
The lower the metric specified the more preferable the RIB
entry is to be selected for use within the network instance.
Where multiple entries have the same metric value then these
equal cost paths should be treated according to the specified
ECMP path selection behaviour for the instance";
}
}
grouping protocols-state {
description
"Operational state parameters relating to a protocol instance";
}
grouping instance-interface-association-config {
description
"Grouping containing leaves that are to be augmented into an
interface or subinterface to include mapping to a network
instance";
leaf network-instance {
type leafref {
path "/network-instances/network-instance/name";
}
description
"The network instance that this interface is associated
with";
}
}
grouping encapsulation-config {
description
"Type agnostic configuration parameters relating to the
encapsulation of the network instance";
leaf encapsulation-type {
type identityref {
base oc-ni-types:ENCAPSULATION;
}
description
"The on-the-wire encapsulation that should be used when
sending traffic from this network instance";
}
// rjs: This is left here as I suspect that this can
// be used in EVPN. Need to validate implementations, otherwise
// move to L3. (TODO)
leaf label-allocation-mode {
type identityref {
base oc-ni-types:LABEL_ALLOCATION_MODE;
}
description
"The label allocation mode to be used for L3 entries
in the network instance";
}
}
uses network-instance-top;
}
ietf-inet-types.yang 000664 001750 001750 00000040567 12715140015 015150 0 ustar 00root1 root1 000000 000000 module ietf-inet-types {
yang-version 1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-inet-types";
prefix inet;
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web:
WG List:
WG Chair: David Kessens
WG Chair: Juergen Schoenwaelder
Editor: Juergen Schoenwaelder
";
description
"This module contains a collection of generally useful derived
YANG data types for Internet addresses and related things.
Copyright (c) 2013 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC 6991; see
the RFC itself for full legal notices.";
revision "2013-07-15" {
description
"This revision adds the following new data types:
- ip-address-no-zone
- ipv4-address-no-zone
- ipv6-address-no-zone";
reference
"RFC 6991: Common YANG Data Types";
}
revision "2010-09-24" {
description "Initial revision.";
reference
"RFC 6021: Common YANG Data Types";
}
typedef ip-version {
type enumeration {
enum "unknown" {
value 0;
description
"An unknown or unspecified version of the Internet
protocol.";
}
enum "ipv4" {
value 1;
description
"The IPv4 protocol as defined in RFC 791.";
}
enum "ipv6" {
value 2;
description
"The IPv6 protocol as defined in RFC 2460.";
}
}
description
"This value represents the version of the IP protocol.
In the value set and its semantics, this type is equivalent
to the InetVersion textual convention of the SMIv2.";
reference
"RFC 791: Internet Protocol
RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
RFC 4001: Textual Conventions for Internet Network Addresses";
}
typedef dscp {
type uint8 {
range "0..63";
}
description
"The dscp type represents a Differentiated Services Code Point
that may be used for marking packets in a traffic stream.
In the value set and its semantics, this type is equivalent
to the Dscp textual convention of the SMIv2.";
reference
"RFC 3289: Management Information Base for the Differentiated
Services Architecture
RFC 2474: Definition of the Differentiated Services Field
(DS Field) in the IPv4 and IPv6 Headers
RFC 2780: IANA Allocation Guidelines For Values In
the Internet Protocol and Related Headers";
}
typedef ipv6-flow-label {
type uint32 {
range "0..1048575";
}
description
"The ipv6-flow-label type represents the flow identifier or Flow
Label in an IPv6 packet header that may be used to
discriminate traffic flows.
In the value set and its semantics, this type is equivalent
to the IPv6FlowLabel textual convention of the SMIv2.";
reference
"RFC 3595: Textual Conventions for IPv6 Flow Label
RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
}
typedef port-number {
type uint16 {
range "0..65535";
}
description
"The port-number type represents a 16-bit port number of an
Internet transport-layer protocol such as UDP, TCP, DCCP, or
SCTP. Port numbers are assigned by IANA. A current list of
all assignments is available from .
Note that the port number value zero is reserved by IANA. In
situations where the value zero does not make sense, it can
be excluded by subtyping the port-number type.
In the value set and its semantics, this type is equivalent
to the InetPortNumber textual convention of the SMIv2.";
reference
"RFC 768: User Datagram Protocol
RFC 793: Transmission Control Protocol
RFC 4960: Stream Control Transmission Protocol
RFC 4340: Datagram Congestion Control Protocol (DCCP)
RFC 4001: Textual Conventions for Internet Network Addresses";
}
typedef as-number {
type uint32;
description
"The as-number type represents autonomous system numbers
which identify an Autonomous System (AS). An AS is a set
of routers under a single technical administration, using
an interior gateway protocol and common metrics to route
packets within the AS, and using an exterior gateway
protocol to route packets to other ASes. IANA maintains
the AS number space and has delegated large parts to the
regional registries.
Autonomous system numbers were originally limited to 16
bits. BGP extensions have enlarged the autonomous system
number space to 32 bits. This type therefore uses an uint32
base type without a range restriction in order to support
a larger autonomous system number space.
In the value set and its semantics, this type is equivalent
to the InetAutonomousSystemNumber textual convention of
the SMIv2.";
reference
"RFC 1930: Guidelines for creation, selection, and registration
of an Autonomous System (AS)
RFC 4271: A Border Gateway Protocol 4 (BGP-4)
RFC 4001: Textual Conventions for Internet Network Addresses
RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
Number Space";
}
typedef ip-address {
type union {
type ipv4-address;
type ipv6-address;
}
description
"The ip-address type represents an IP address and is IP
version neutral. The format of the textual representation
implies the IP version. This type supports scoped addresses
by allowing zone identifiers in the address format.";
reference
"RFC 4007: IPv6 Scoped Address Architecture";
}
typedef ipv4-address {
type string {
pattern
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(%[\p{N}\p{L}]+)?';
}
description
"The ipv4-address type represents an IPv4 address in
dotted-quad notation. The IPv4 address may include a zone
index, separated by a % sign.
The zone index is used to disambiguate identical address
values. For link-local addresses, the zone index will
typically be the interface index number or the name of an
interface. If the zone index is not present, the default
zone of the device will be used.
The canonical format for the zone index is the numerical
format";
}
typedef ipv6-address {
type string {
pattern
'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(%[\p{N}\p{L}]+)?';
pattern
'(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(%.+)?';
}
description
"The ipv6-address type represents an IPv6 address in full,
mixed, shortened, and shortened-mixed notation. The IPv6
address may include a zone index, separated by a % sign.
The zone index is used to disambiguate identical address
values. For link-local addresses, the zone index will
typically be the interface index number or the name of an
interface. If the zone index is not present, the default
zone of the device will be used.
The canonical format of IPv6 addresses uses the textual
representation defined in Section 4 of RFC 5952. The
canonical format for the zone index is the numerical
format as described in Section 11.2 of RFC 4007.";
reference
"RFC 4291: IP Version 6 Addressing Architecture
RFC 4007: IPv6 Scoped Address Architecture
RFC 5952: A Recommendation for IPv6 Address Text
Representation";
}
typedef ip-address-no-zone {
type union {
type ipv4-address-no-zone;
type ipv6-address-no-zone;
}
description
"The ip-address-no-zone type represents an IP address and is
IP version neutral. The format of the textual representation
implies the IP version. This type does not support scoped
addresses since it does not allow zone identifiers in the
address format.";
reference
"RFC 4007: IPv6 Scoped Address Architecture";
}
typedef ipv4-address-no-zone {
type ipv4-address {
pattern '[0-9\.]*';
}
description
"An IPv4 address without a zone index. This type, derived from
ipv4-address, may be used in situations where the zone is
known from the context and hence no zone index is needed.";
}
typedef ipv6-address-no-zone {
type ipv6-address {
pattern '[0-9a-fA-F:\.]*';
}
description
"An IPv6 address without a zone index. This type, derived from
ipv6-address, may be used in situations where the zone is
known from the context and hence no zone index is needed.";
reference
"RFC 4291: IP Version 6 Addressing Architecture
RFC 4007: IPv6 Scoped Address Architecture
RFC 5952: A Recommendation for IPv6 Address Text
Representation";
}
typedef ip-prefix {
type union {
type ipv4-prefix;
type ipv6-prefix;
}
description
"The ip-prefix type represents an IP prefix and is IP
version neutral. The format of the textual representations
implies the IP version.";
}
typedef ipv4-prefix {
type string {
pattern
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))';
}
description
"The ipv4-prefix type represents an IPv4 address prefix.
The prefix length is given by the number following the
slash character and must be less than or equal to 32.
A prefix length value of n corresponds to an IP address
mask that has n contiguous 1-bits from the most
significant bit (MSB) and all other bits set to 0.
The canonical format of an IPv4 prefix has all bits of
the IPv4 address set to zero that are not part of the
IPv4 prefix.";
}
typedef ipv6-prefix {
type string {
pattern
'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
pattern
'(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)(/.+)';
}
description
"The ipv6-prefix type represents an IPv6 address prefix.
The prefix length is given by the number following the
slash character and must be less than or equal to 128.
A prefix length value of n corresponds to an IP address
mask that has n contiguous 1-bits from the most
significant bit (MSB) and all other bits set to 0.
The IPv6 address should have all bits that do not belong
to the prefix set to zero.
The canonical format of an IPv6 prefix has all bits of
the IPv6 address set to zero that are not part of the
IPv6 prefix. Furthermore, the IPv6 address is represented
as defined in Section 4 of RFC 5952.";
reference
"RFC 5952: A Recommendation for IPv6 Address Text
Representation";
}
typedef domain-name {
type string {
length "1..253";
pattern
'((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\.';
}
description
"The domain-name type represents a DNS domain name. The
name SHOULD be fully qualified whenever possible.
Internet domain names are only loosely specified. Section
3.5 of RFC 1034 recommends a syntax (modified in Section
2.1 of RFC 1123). The pattern above is intended to allow
for current practice in domain name use, and some possible
future expansion. It is designed to hold various types of
domain names, including names used for A or AAAA records
(host names) and other records, such as SRV records. Note
that Internet host names have a stricter syntax (described
in RFC 952) than the DNS recommendations in RFCs 1034 and
1123, and that systems that want to store host names in
schema nodes using the domain-name type are recommended to
adhere to this stricter standard to ensure interoperability.
The encoding of DNS names in the DNS protocol is limited
to 255 characters. Since the encoding consists of labels
prefixed by a length bytes and there is a trailing NULL
byte, only 253 characters can appear in the textual dotted
notation.
The description clause of schema nodes using the domain-name
type MUST describe when and how these names are resolved to
IP addresses. Note that the resolution of a domain-name value
may require to query multiple DNS records (e.g., A for IPv4
and AAAA for IPv6). The order of the resolution process and
which DNS record takes precedence can either be defined
explicitly or may depend on the configuration of the
resolver.
Domain-name values use the US-ASCII encoding. Their canonical
format uses lowercase US-ASCII characters. Internationalized
domain names MUST be A-labels as per RFC 5890.";
reference
"RFC 952: DoD Internet Host Table Specification
RFC 1034: Domain Names - Concepts and Facilities
RFC 1123: Requirements for Internet Hosts -- Application
and Support
RFC 2782: A DNS RR for specifying the location of services
(DNS SRV)
RFC 5890: Internationalized Domain Names in Applications
(IDNA): Definitions and Document Framework";
}
typedef host {
type union {
type ip-address;
type domain-name;
}
description
"The host type represents either an IP address or a DNS
domain name.";
}
typedef uri {
type string;
description
"The uri type represents a Uniform Resource Identifier
(URI) as defined by STD 66.
Objects using the uri type MUST be in US-ASCII encoding,
and MUST be normalized as described by RFC 3986 Sections
6.2.1, 6.2.2.1, and 6.2.2.2. All unnecessary
percent-encoding is removed, and all case-insensitive
characters are set to lowercase except for hexadecimal
digits, which are normalized to uppercase as described in
Section 6.2.2.1.
The purpose of this normalization is to help provide
unique URIs. Note that this normalization is not
sufficient to provide uniqueness. Two URIs that are
textually distinct after this normalization may still be
equivalent.
Objects using the uri type may restrict the schemes that
they permit. For example, 'data:' and 'urn:' schemes
might not be appropriate.
A zero-length URI is not a valid URI. This can be used to
express 'URI absent' where required.
In the value set and its semantics, this type is equivalent
to the Uri SMIv2 textual convention defined in RFC 5017.";
reference
"RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
Group: Uniform Resource Identifiers (URIs), URLs,
and Uniform Resource Names (URNs): Clarifications
and Recommendations
RFC 5017: MIB Textual Conventions for Uniform Resource
Identifiers (URIs)";
}
} // module ietf-inet-types