1 module openconfig-interfaces {
6 namespace "http://openconfig.net/yang/interfaces";
10 // import some basic types
11 import ietf-interfaces { prefix ietf-if; }
12 import ietf-yang-types { prefix yang; }
13 import openconfig-extensions { prefix oc-ext; }
16 organization "OpenConfig working group";
19 "OpenConfig working group
20 netopenconfig@googlegroups.com";
23 "Model for managing network interfaces and subinterfaces. This
24 module also defines convenience types / groupings for other
25 models to create references to interfaces:
27 base-interface-ref (type) - reference to a base interface
28 interface-ref (grouping) - container for reference to a
29 interface + subinterface
30 interface-ref-state (grouping) - container for read-only
31 (opstate) reference to interface + subinterface
33 This model reuses data items defined in the IETF YANG model for
34 interfaces described by RFC 7223 with an alternate structure
35 (particularly for operational state data) and and with
36 additional configuration items.";
38 oc-ext:openconfig-version "1.0.1";
40 revision "2016-04-12" {
42 "OpenConfig public release";
49 typedef base-interface-ref {
51 path "/oc-if:interfaces/oc-if:interface/oc-if:name";
54 "Reusable type for by-name reference to a base interface.
55 This type may be used in cases where ability to reference
56 a subinterface is not required.";
59 typedef interface-id {
62 "User-defined identifier for an interface, generally used to
63 name a interface reference. The id can be arbitrary but a
64 useful convention is to use a combination of base interface
65 name and subinterface index.";
68 // grouping statements
70 grouping interface-ref-common {
72 "Reference leafrefs to interface / subinterface";
76 path "/oc-if:interfaces/oc-if:interface/oc-if:name";
79 "Reference to a base interface. If a reference to a
80 subinterface is required, this leaf must be specified
81 to indicate the base interface.";
86 path "/oc-if:interfaces/" +
87 "oc-if:interface[oc-if:name=current()/../interface]/" +
88 "oc-if:subinterfaces/oc-if:subinterface/oc-if:index";
91 "Reference to a subinterface -- this requires the base
92 interface to be specified using the interface leaf in
93 this container. If only a reference to a base interface
94 is requuired, this leaf should not be set.";
98 grouping interface-ref-state-container {
100 "Reusable opstate w/container for a reference to an
101 interface or subinterface";
106 "Operational state for interface-ref";
108 uses interface-ref-common;
112 grouping interface-ref {
114 "Reusable definition for a reference to an interface or
117 container interface-ref {
119 "Reference to an interface or subinterface";
123 "Configured reference to interface / subinterface";
125 uses interface-ref-common;
128 uses interface-ref-state-container;
132 grouping interface-ref-state {
134 "Reusable opstate w/container for a reference to an
135 interface or subinterface";
137 container interface-ref {
139 "Reference to an interface or subinterface";
141 uses interface-ref-state-container;
146 grouping interface-common-config {
148 "Configuration data data nodes common to physical interfaces
154 "[adapted from IETF interfaces model (RFC 7223)]
156 The name of the interface.
158 A device MAY restrict the allowed values for this leaf,
159 possibly depending on the type of the interface.
160 For system-controlled interfaces, this leaf is the
161 device-specific name of the interface. The 'config false'
162 list interfaces/interface[name]/state contains the currently
163 existing interfaces on the device.
165 If a client tries to create configuration for a
166 system-controlled interface that is not present in the
167 corresponding state list, the server MAY reject
168 the request if the implementation does not support
169 pre-provisioning of interfaces or if the name refers to
170 an interface that can never exist in the system. A
171 NETCONF server MUST reply with an rpc-error with the
172 error-tag 'invalid-value' in this case.
174 The IETF model in RFC 7223 provides YANG features for the
175 following (i.e., pre-provisioning and arbitrary-names),
176 however they are omitted here:
178 If the device supports pre-provisioning of interface
179 configuration, the 'pre-provisioning' feature is
182 If the device allows arbitrarily named user-controlled
183 interfaces, the 'arbitrary-names' feature is advertised.
185 When a configured user-controlled interface is created by
186 the system, it is instantiated with the same name in the
187 /interfaces/interface[name]/state list.";
189 "RFC 7223: A YANG Data Model for Interface Management";
195 "[adapted from IETF interfaces model (RFC 7223)]
197 A textual description of the interface.
199 A server implementation MAY map this leaf to the ifAlias
200 MIB object. Such an implementation needs to use some
201 mechanism to handle the differences in size and characters
202 allowed between this leaf and ifAlias. The definition of
203 such a mechanism is outside the scope of this document.
205 Since ifAlias is defined to be stored in non-volatile
206 storage, the MIB implementation MUST map ifAlias to the
207 value of 'description' in the persistently stored
210 Specifically, if the device supports ':startup', when
211 ifAlias is read the device MUST return the value of
212 'description' in the 'startup' datastore, and when it is
213 written, it MUST be written to the 'running' and 'startup'
214 datastores. Note that it is up to the implementation to
216 decide whether to modify this single leaf in 'startup' or
217 perform an implicit copy-config from 'running' to
220 If the device does not support ':startup', ifAlias MUST
221 be mapped to the 'description' leaf in the 'running'
224 "RFC 2863: The Interfaces Group MIB - ifAlias";
231 "[adapted from IETF interfaces model (RFC 7223)]
233 This leaf contains the configured, desired state of the
236 Systems that implement the IF-MIB use the value of this
237 leaf in the 'running' datastore to set
238 IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
239 has been initialized, as described in RFC 2863.
241 Changes in this leaf in the 'running' datastore are
242 reflected in ifAdminStatus, but if ifAdminStatus is
243 changed over SNMP, this leaf is not affected.";
245 "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
250 grouping interface-phys-config {
252 "Configuration data for physical interfaces";
256 base ietf-if:interface-type;
260 "[adapted from IETF interfaces model (RFC 7223)]
262 The type of the interface.
264 When an interface entry is created, a server MAY
265 initialize the type leaf with a valid value, e.g., if it
266 is possible to derive the type from the name of the
269 If a client tries to set the type of an interface to a
270 value that can never be used by the system, e.g., if the
271 type is not supported or if the type does not match the
272 name of the interface, the server MUST reject the request.
273 A NETCONF server MUST reply with an rpc-error with the
274 error-tag 'invalid-value' in this case.";
276 "RFC 2863: The Interfaces Group MIB - ifType";
282 "Set the max transmission unit size in octets
283 for the physical interface. If this is not set, the mtu is
284 set to the operational default -- e.g., 1514 bytes on an
285 Ethernet interface.";
288 uses interface-common-config;
291 grouping interface-phys-holdtime-config {
293 "Configuration data for interface hold-time settings --
294 applies to physical interfaces.";
301 "Dampens advertisement when the interface
302 transitions from down to up. A zero value means dampening
303 is turned off, i.e., immediate notification.";
311 "Dampens advertisement when the interface transitions from
312 up to down. A zero value means dampening is turned off,
313 i.e., immediate notification.";
317 grouping interface-phys-holdtime-state {
319 "Operational state data for interface hold-time.";
322 grouping interface-phys-holdtime-top {
324 "Top-level grouping for setting link transition
325 dampening on physical and other types of interfaces.";
327 container hold-time {
329 "Top-level container for hold-time settings to enable
330 dampening advertisements of interface transitions.";
334 "Configuration data for interface hold-time settings.";
336 uses interface-phys-holdtime-config;
344 "Operational state data for interface hold-time.";
346 uses interface-phys-holdtime-config;
347 uses interface-phys-holdtime-state;
352 grouping interface-common-state {
354 "Operational state data (in addition to intended configuration)
355 at the global level for this interface";
360 "System assigned number for each interface. Corresponds to
361 ifIndex object in SNMP Interface MIB";
363 "RFC 2863 - The Interfaces Group MIB";
370 "Ready to pass packets.";
374 "Not ready to pass packets and not in some test mode.";
377 //TODO: This is generally not supported as a configured
378 //admin state, though it's in the standard interfaces MIB.
379 //Consider removing it.
381 "In some test mode.";
384 //TODO:consider converting to an identity to have the
385 //flexibility to remove some values defined by RFC 7223 that
386 //are not used or not implemented consistently.
389 "[adapted from IETF interfaces model (RFC 7223)]
391 The desired state of the interface. In RFC 7223 this leaf
392 has the same read semantics as ifAdminStatus. Here, it
393 reflects the administrative state as set by enabling or
394 disabling the interface.";
396 "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
404 "Ready to pass packets.";
409 "The interface does not pass any packets.";
414 "In some test mode. No operational packets can
420 "Status cannot be determined for some reason.";
425 "Waiting for some external event.";
430 "Some component (typically hardware) is missing.";
432 enum LOWER_LAYER_DOWN {
435 "Down due to state of lower-layer interface(s).";
438 //TODO:consider converting to an identity to have the
439 //flexibility to remove some values defined by RFC 7223 that
440 //are not used or not implemented consistently.
443 "[adapted from IETF interfaces model (RFC 7223)]
445 The current operational state of the interface.
447 This leaf has the same semantics as ifOperStatus.";
449 "RFC 2863: The Interfaces Group MIB - ifOperStatus";
455 "Date and time of the last state change of the interface
456 (e.g., up-to-down transition). This corresponds to the
457 ifLastChange object in the standard interface MIB.";
459 "RFC 2863: The Interfaces Group MIB - ifLastChange";
465 grouping interface-counters-state {
467 "Operational state representing interface counters
468 and statistics. Some of these are adapted from RFC 7223";
470 //TODO: we may need to break this list of counters into those
471 //that would appear for physical vs. subinterface or logical
472 //interfaces. For now, just replicating the full stats
473 //grouping to both interface and subinterface.
477 "A collection of interface-related statistics objects.";
480 "RFC 7223 - A YANG Data Model for Interface
486 "[adapted from IETF interfaces model (RFC 7223)]
488 The total number of octets received on the interface,
489 including framing characters.
491 Discontinuities in the value of this counter can occur
492 at re-initialization of the management system, and at
493 other times as indicated by the value of
494 'discontinuity-time'.";
496 "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
499 leaf in-unicast-pkts {
502 "[adapted from IETF interfaces model (RFC 7223)]
504 The number of packets, delivered by this sub-layer to a
505 higher (sub-)layer, that were not addressed to a
506 multicast or broadcast address at this sub-layer.
508 Discontinuities in the value of this counter can occur
509 at re-initialization of the management system, and at
510 other times as indicated by the value of
511 'discontinuity-time'.";
513 "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
516 leaf in-broadcast-pkts {
519 "[adapted from IETF interfaces model (RFC 7223)]
521 The number of packets, delivered by this sub-layer to a
522 higher (sub-)layer, that were addressed to a broadcast
523 address at this sub-layer.
525 Discontinuities in the value of this counter can occur
526 at re-initialization of the management system, and at
527 other times as indicated by the value of
528 'discontinuity-time'.";
530 "RFC 2863: The Interfaces Group MIB -
531 ifHCInBroadcastPkts";
534 leaf in-multicast-pkts {
537 "[adapted from IETF interfaces model (RFC 7223)]
540 The number of packets, delivered by this sub-layer to a
541 higher (sub-)layer, that were addressed to a multicast
542 address at this sub-layer. For a MAC-layer protocol,
543 this includes both Group and Functional addresses.
545 Discontinuities in the value of this counter can occur
546 at re-initialization of the management system, and at
547 other times as indicated by the value of
548 'discontinuity-time'.";
550 "RFC 2863: The Interfaces Group MIB -
551 ifHCInMulticastPkts";
557 "[adapted from IETF interfaces model (RFC 7223)]
558 Changed the counter type to counter64.
560 The number of inbound packets that were chosen to be
561 discarded even though no errors had been detected to
562 prevent their being deliverable to a higher-layer
563 protocol. One possible reason for discarding such a
564 packet could be to free up buffer space.
566 Discontinuities in the value of this counter can occur
567 at re-initialization of the management system, and at
568 other times as indicated by the value of
569 'discontinuity-time'.";
573 "RFC 2863: The Interfaces Group MIB - ifInDiscards";
579 "[adapted from IETF interfaces model (RFC 7223)]
580 Changed the counter type to counter64.
582 For packet-oriented interfaces, the number of inbound
583 packets that contained errors preventing them from being
584 deliverable to a higher-layer protocol. For character-
585 oriented or fixed-length interfaces, the number of
586 inbound transmission units that contained errors
587 preventing them from being deliverable to a higher-layer
590 Discontinuities in the value of this counter can occur
591 at re-initialization of the management system, and at
592 other times as indicated by the value of
593 'discontinuity-time'.";
595 "RFC 2863: The Interfaces Group MIB - ifInErrors";
598 leaf in-unknown-protos {
601 "[adapted from IETF interfaces model (RFC 7223)]
602 Changed the counter type to counter64.
604 For packet-oriented interfaces, the number of packets
605 received via the interface that were discarded because
606 of an unknown or unsupported protocol. For
607 character-oriented or fixed-length interfaces that
608 support protocol multiplexing, the number of
609 transmission units received via the interface that were
610 discarded because of an unknown or unsupported protocol.
611 For any interface that does not support protocol
612 multiplexing, this counter is not present.
614 Discontinuities in the value of this counter can occur
615 at re-initialization of the management system, and at
616 other times as indicated by the value of
617 'discontinuity-time'.";
619 "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
625 "[adapted from IETF interfaces model (RFC 7223)]
626 Changed the counter type to counter64.
628 The total number of octets transmitted out of the
629 interface, including framing characters.
631 Discontinuities in the value of this counter can occur
632 at re-initialization of the management system, and at
633 other times as indicated by the value of
634 'discontinuity-time'.";
636 "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
639 leaf out-unicast-pkts {
642 "[adapted from IETF interfaces model (RFC 7223)]
644 The total number of packets that higher-level protocols
645 requested be transmitted, and that were not addressed
646 to a multicast or broadcast address at this sub-layer,
647 including those that were discarded or not sent.
649 Discontinuities in the value of this counter can occur
650 at re-initialization of the management system, and at
651 other times as indicated by the value of
652 'discontinuity-time'.";
654 "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
657 leaf out-broadcast-pkts {
660 "[adapted from IETF interfaces model (RFC 7223)]
662 The total number of packets that higher-level protocols
663 requested be transmitted, and that were addressed to a
664 broadcast address at this sub-layer, including those
665 that were discarded or not sent.
667 Discontinuities in the value of this counter can occur
668 at re-initialization of the management system, and at
669 other times as indicated by the value of
670 'discontinuity-time'.";
672 "RFC 2863: The Interfaces Group MIB -
673 ifHCOutBroadcastPkts";
677 leaf out-multicast-pkts {
680 "[adapted from IETF interfaces model (RFC 7223)]
681 Changed the counter type to counter64.
683 The total number of packets that higher-level protocols
684 requested be transmitted, and that were addressed to a
685 multicast address at this sub-layer, including those
686 that were discarded or not sent. For a MAC-layer
687 protocol, this includes both Group and Functional
690 Discontinuities in the value of this counter can occur
691 at re-initialization of the management system, and at
692 other times as indicated by the value of
693 'discontinuity-time'.";
695 "RFC 2863: The Interfaces Group MIB -
696 ifHCOutMulticastPkts";
702 "[adapted from IETF interfaces model (RFC 7223)]
703 Changed the counter type to counter64.
705 The number of outbound packets that were chosen to be
706 discarded even though no errors had been detected to
707 prevent their being transmitted. One possible reason
708 for discarding such a packet could be to free up buffer
711 Discontinuities in the value of this counter can occur
712 at re-initialization of the management system, and at
713 other times as indicated by the value of
714 'discontinuity-time'.";
716 "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
722 "[adapted from IETF interfaces model (RFC 7223)]
723 Changed the counter type to counter64.
725 For packet-oriented interfaces, the number of outbound
726 packets that could not be transmitted because of errors.
727 For character-oriented or fixed-length interfaces, the
728 number of outbound transmission units that could not be
729 transmitted because of errors.
731 Discontinuities in the value of this counter can occur
732 at re-initialization of the management system, and at
733 other times as indicated by the value of
734 'discontinuity-time'.";
736 "RFC 2863: The Interfaces Group MIB - ifOutErrors";
740 type yang:date-and-time;
742 "Indicates the last time the interface counters were
748 // data definition statements
750 grouping sub-unnumbered-config {
752 "Configuration data for unnumbered subinterfaces";
758 "Indicates that the subinterface is unnumbered. By default
759 the subinterface is numbered, i.e., expected to have an
760 IP address configuration.";
764 grouping sub-unnumbered-state {
766 "Operational state data unnumbered subinterfaces";
769 grouping sub-unnumbered-top {
771 "Top-level grouping unnumbered subinterfaces";
773 container unnumbered {
775 "Top-level container for setting unnumbered interfaces.
776 Includes reference the interface that provides the
777 address information";
781 "Configuration data for unnumbered interface";
783 uses sub-unnumbered-config;
791 "Operational state data for unnumbered interfaces";
793 uses sub-unnumbered-config;
794 uses sub-unnumbered-state;
797 uses oc-if:interface-ref;
801 grouping subinterfaces-config {
803 "Configuration data for subinterfaces";
809 "The index of the subinterface, or logical interface number.
810 On systems with no support for subinterfaces, or not using
811 subinterfaces, this value should default to 0, i.e., the
812 default subinterface.";
815 uses interface-common-config;
819 grouping subinterfaces-state {
821 "Operational state data for subinterfaces";
823 uses interface-common-state;
824 uses interface-counters-state;
827 grouping subinterfaces-top {
829 "Subinterface data for logical interfaces associated with a
832 container subinterfaces {
834 "Enclosing container for the list of subinterfaces associated
835 with a physical interface";
841 "The list of subinterfaces (logical interfaces) associated
842 with a physical interface";
846 path "../oc-if:config/oc-if:index";
849 "The index number of the subinterface -- used to address
850 the logical interface";
855 "Configurable items at the subinterface level";
857 uses subinterfaces-config;
864 "Operational state data for logical interfaces";
866 uses subinterfaces-config;
867 uses subinterfaces-state;
873 grouping interfaces-top {
875 "Top-level grouping for interface configuration and
876 operational state data";
878 container interfaces {
880 "Top level container for interfaces, including configuration
888 "The list of named interfaces on the device.";
892 path "../oc-if:config/oc-if:name";
895 "References the configured name of the interface";
896 //TODO: need to consider whether this should actually
897 //reference the name in the state subtree, which
898 //presumably would be the system-assigned name, or the
899 //configured name. Points to the config/name now
900 //because of YANG 1.0 limitation that the list
901 //key must have the same "config" as the list, and
902 //also can't point to a non-config node.
907 "Configurable items at the global, physical interface
910 uses interface-phys-config;
917 "Operational state data at the global interface level";
919 uses interface-phys-config;
920 uses interface-common-state;
921 uses interface-counters-state;
924 uses interface-phys-holdtime-top;
925 uses subinterfaces-top;