module ietf-interfaces-common { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces-common"; prefix if-cmn; import ietf-interfaces { prefix if; } import iana-if-type { prefix ianaift; } organization "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; contact "WG Web: WG List: WG Chair: Lou Berger WG Chair: Kent Watsen Editor: Robert Wilton "; description "This module contains common definitions for extending the IETF interface YANG model (RFC 7223) with common configurable layer 2 properties. Copyright (c) 2016 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 XXX; see the RFC itself for full legal notices."; revision 2016-10-27 { description "Initial version"; reference "Internet draft: draft-ietf-netmod-intf-ext-yang-02"; } feature bandwidth { description "This feature indicates that the device supports configurable interface bandwidth."; reference "Section 3.1 Bandwidth"; } feature carrier-delay { description "This feature indicates that configurable interface carrier delay is supported, which is a feature is used to limit the propagation of very short interface link state flaps."; reference "Section 3.2 Carrier Delay"; } feature dampening { description "This feature indicates that the device supports interface dampening, which is a feature that is used to limit the propagation of interface link state flaps over longer periods"; reference "Section 3.3 Dampening"; } feature loopback { description "This feature indicates that configurable interface loopback is supported."; reference "Section 3.5 Loopback"; } feature configurable-l2-mtu { description "This feature indicates that the device supports configuring layer 2 MTUs on interfaces. Such MTU configurations include the layer 2 header overheads (but exclude any FCS overhead). The payload MTU available to higher layer protocols is either derived from the layer 2 MTU, taking into account the size of the layer 2 header, or is further restricted by explicit layer 3 or protocol specific MTU configuration."; reference "Section 3.6 MTU"; } feature sub-interfaces { description "This feature indicates that the device supports the instantiation of sub-interfaces. Sub-interfaces are defined as logical child interfaces that allow features and forwarding decisions to be applied to a subset of the traffic processed on the specified parent interface."; reference "Section 3.7 Sub-interface"; } feature transport-layer { description "This feature indicates that the device supports configurable transport layer."; reference "Section 3.8 Transport Layer"; } /* * Define common identities to help allow interface types to be * assigned properties. */ identity sub-interface { description "Base type for generic sub-interfaces. New or custom interface types can derive from this type to inherit generic sub-interface configuration"; } identity ethSubInterface{ base ianaift:l2vlan; base sub-interface; description "Sub-interface of any interface types that uses Ethernet framing (with or without 802.1Q tagging)"; } identity loopback { description "Base type for interface loopback options"; } identity loopback-internal { base loopback; description "All egress traffic on the interface is internally looped back within the interface to be received on the ingress path."; } identity loopback-line { base loopback; description "All ingress traffic received on the interface is internally looped back within the interface to the egress path."; } identity loopback-connector { base loopback; description "The interface has a physical loopback connector attached to that loops all egress traffic back into the interface's ingress path, with equivalent semantics to loopback-internal"; } /* * Augments the IETF interfaces model with a leaf to explicitly * specify the bandwidth available on an interface. */ augment "/if:interfaces/if:interface" { if-feature "bandwidth"; description "Add a top level node for interface bandwidth."; leaf bandwidth { type uint64; units kbps; description "The bandwidth available on the interface in Kb/s. This configuration is used by routing protocols to adjust the metrics associated with the interface, but does not limit the amount of traffic that can be sent or received on the interface. A separate QoS policy would need to be configured to limit the ingress or egress traffic. If not configured, the default bandwidth is the maximum available bandwidth of the underlying interface."; } } /* * Defines standard YANG for the Carrier Delay feature. */ augment "/if:interfaces/if:interface" { if-feature "carrier-delay"; description "Augments the IETF interface model with carrier delay configuration for interfaces that support it."; container carrier-delay { description "Holds carrier delay related feature configuration"; leaf down { type uint32; units milliseconds; description "Delays the propagation of a 'loss of carrier signal' event that would cause the interface state to go down, i.e. the command allows short link flaps to be suppressed. The configured value indicates the minimum time interval (in milliseconds) that the carrier signal must be continuously down before the interface state is brought down. If not configured, the behaviour on loss of carrier signal is vendor/interface specific, but with the general expectation that there should be little or no delay."; } leaf up { type uint32; units milliseconds; description "Defines the minimum time interval (in milliseconds) that the carrier signal must be continuously present and error free before the interface state is allowed to transition from down to up. If not configured, the behaviour is vendor/interface specific, but with the general expectation that sufficient default delay should be used to ensure that the interface is stable when enabled before being reported as being up. Configured values that are too low for the hardware capabilties may be rejected."; } } } /* * Augments the IETF interfaces model with a container to hold * generic interface dampening */ augment "/if:interfaces/if:interface" { if-feature "dampening"; description "Add a container for interface dampening configuration"; container dampening { presence "Enable interface link flap dampening with default settings (that are vendor/device specific)"; description "Interface dampening limits the propagation of interface link state flaps over longer periods"; leaf half-life { type uint32; units seconds; description "The Time (in seconds) after which a penalty reaches half its original value. Once the interface has been assigned a penalty, the penalty is decreased by half after the half-life period. For some devices, the allowed values may be restricted to particular multiples of seconds. The default value is vendor/device specific."; } leaf reuse { type uint32; description "Penalty value below which a stable interface is unsuppressed (i.e. brought up) (no units). The default value is vendor/device specific. The penalty value for a link up->down state change is nominally 1000 units."; } leaf suppress { type uint32; description "Limit at which an interface is suppressed (i.e. held down) when its penalty exceeds that limit (no units). The value must be greater than the reuse threshold. The default value is vendor/device specific. The penalty value for a link up->down state change is nominally 1000 units."; } leaf max-suppress-time { type uint32; units seconds; description "Maximum time (in seconds) that an interface can be suppressed. This value effectively acts as a ceiling that the penalty value cannot exceed. The default value is vendor/device specific."; } } } /* * Various types of interfaces support a configurable layer 2 * encapsulation, any that are supported by YANG should be * listed here. * * Different encapsulations can hook into the common encaps-type * choice statement. */ augment "/if:interfaces/if:interface" { when "derived-from-or-self(if:type, 'ianaift:ethernetCsmacd') or derived-from-or-self(if:type, 'ianaift:ieee8023adLag') or derived-from-or-self(if:type, 'ianaift:pos') or derived-from-or-self(if:type, 'ianaift:atmSubInterface') or derived-from-or-self(if:type, 'ethSubInterface')" { description "All interface types that can have a configurable L2 encapsulation"; /* * TODO - Should we introduce an abstract type to make this * extensible to new interface types, or vendor specific * interface types? */ } description "Add encapsulation top level node to interface types that support a configurable L2 encapsulation"; container encapsulation { description "Holds the L2 encapsulation associated with an interface"; choice encaps-type { description "Extensible choice of L2 encapsulations"; } } } /* * Various types of interfaces support loopback configuration, any * that are supported by YANG should be listed here. */ augment "/if:interfaces/if:interface" { when "derived-from-or-self(if:type, 'ianaift:ethernetCsmacd') or derived-from-or-self(if:type, 'ianaift:sonet') or derived-from-or-self(if:type, 'ianaift:atm') or derived-from-or-self(if:type, 'ianaift:otnOtu')" { description "All interface types that support loopback configuration."; } if-feature "loopback"; description "Augments the IETF interface model with loopback configuration for interfaces that support it."; leaf loopback { type identityref { base loopback; } description "Enables traffic loopback."; } } /* * Many types of interfaces support a configurable layer 2 MTU. */ augment "/if:interfaces/if:interface" { description "Add configurable layer 2 MTU to all appropriate interface types."; leaf l2-mtu { if-feature "configurable-l2-mtu"; type uint16 { range "64 .. 65535"; } description "The maximum size of layer 2 frames that may be transmitted or received on the interface (excluding any FCS overhead). In the case of Ethernet interfaces it also excludes the 4-8 byte overhead of any known (i.e. explicitly matched by a child sub-interface) 801.1Q VLAN tags."; } } /* * Add generic support for sub-interfaces. * * This should be extended to cover all interface types that are * child interfaces of other interfaces. */ augment "/if:interfaces/if:interface" { when "derived-from(if:type, 'sub-interface') or derived-from-or-self(if:type, 'ianaift:atmSubInterface') or derived-from-or-self(if:type, 'ianaift:frameRelay')" { description "Any ianaift:types that explicitly represent sub-interfaces or any types that derive from the sub-interface identity"; } if-feature "sub-interfaces"; description "Add a parent interface field to interfaces that model sub-interfaces"; leaf parent-interface { type if:interface-ref; mandatory true; description "This is the reference to the parent interface of this sub-interface."; } } /* * Augments the IETF interfaces model with a leaf that indicates * which layer traffic is to be transported at. */ augment "/if:interfaces/if:interface" { if-feature "transport-layer"; description "Add a top level node to appropriate interfaces to indicate which tranport layer an interface is operating at"; leaf transport-layer { type enumeration { enum layer-1 { value 1; description "Layer 1 transport."; } enum layer-2 { value 2; description "Layer 2 transport"; } enum layer-3 { value 3; description "Layer 3 transport"; } } default layer-3; description "The transport layer at which the interface is operating at"; } } }