--- 1/draft-ietf-netmod-interfaces-cfg-11.txt 2013-07-04 15:14:25.454678864 -0700 +++ 2/draft-ietf-netmod-interfaces-cfg-12.txt 2013-07-04 15:14:25.526680800 -0700 @@ -1,18 +1,18 @@ Network Working Group M. Bjorklund Internet-Draft Tail-f Systems -Intended status: Standards Track May 15, 2013 -Expires: November 16, 2013 +Intended status: Standards Track July 4, 2013 +Expires: January 5, 2014 A YANG Data Model for Interface Management - draft-ietf-netmod-interfaces-cfg-11 + draft-ietf-netmod-interfaces-cfg-12 Abstract This document defines a YANG data model for the management of network interfaces. It is expected that interface type specific data models augment the generic interfaces data model defined in this document. The data model includes configuration data, state data and counters for the collection of statistics. Status of this Memo @@ -23,47 +23,47 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on November 16, 2013. + This Internet-Draft will expire on January 5, 2014. Copyright Notice Copyright (c) 2013 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 - 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 + 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 4 2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3. Interfaces Data Model . . . . . . . . . . . . . . . . . . . . 6 3.1. The interface Lists . . . . . . . . . . . . . . . . . . . 6 - 3.2. Interface References . . . . . . . . . . . . . . . . . . . 7 - 3.3. Interface Layering . . . . . . . . . . . . . . . . . . . . 7 + 3.2. Interface References . . . . . . . . . . . . . . . . . . . 8 + 3.3. Interface Layering . . . . . . . . . . . . . . . . . . . . 8 4. Relationship to the IF-MIB . . . . . . . . . . . . . . . . . . 9 5. Interfaces YANG Module . . . . . . . . . . . . . . . . . . . . 11 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 7. Security Considerations . . . . . . . . . . . . . . . . . . . 27 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 28 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 29 9.1. Normative References . . . . . . . . . . . . . . . . . . . 29 9.2. Informative References . . . . . . . . . . . . . . . . . . 29 Appendix A. Example: Ethernet Interface Module . . . . . . . . . 30 Appendix B. Example: Ethernet Bonding Interface Module . . . . . 32 @@ -101,27 +101,45 @@ The data model includes configuration data, state data and counters for the collection of statistics. 1.1. Terminology The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14, [RFC2119]. + The following terms are used within this document: + + o system-controlled interface: An interface is said to be system- + controlled if the system creates and deletes the interface + independently of what has been explicitly configured. Examples + are interfaces representing physical hardware that appear and + disappear when hardware (e.g., a line card) is added or removed. + System-controlled interfaces may also appear if a certain + functionality is enabled (e.g., a loopback interface might appear + if the IP protocol stack is enabled). + + o user-controlled interface: An interface is said to be user- + controlled if the creation of the interface is controlled by + adding explicit interface configuration to the running + configuration datastore and the removal of the interface is + controlled by removing explicit interface configuration from the + running configuration datastore. Examples are VLAN interfaces + configured on a system-controlled Ethernet interface. + The following terms are defined in [RFC6241] and are not redefined here: o client o configuration data - o server o state data The following terms are defined in [RFC6020] and are not redefined here: o augment o data model @@ -231,53 +249,62 @@ The data model for interfaces presented in this document uses a flat list of interfaces. Each interface in the list is identified by its name. Furthermore, each interface has a mandatory "type" leaf. There is one list of configured interfaces ("/interfaces/interface"), and a separate list for the operational state of all interfaces ("/interfaces-state/interface"). It is expected that interface type specific data models augment the - interface lists, and use the "type" leaf to make the augmentation - conditional. + interface lists, and possibly use the "type" leaf to make the + augmentation conditional. As an example of such an interface type specific augmentation, consider this YANG snippet. For a more complete example, see Appendix A. import interfaces { prefix "if"; } augment "/if:interfaces/if:interface" { when "if:type = 'ethernetCsmacd'"; container ethernet { leaf duplex { ... } } } - For physical interfaces, the "name" is the device-specific name of - the interface. It is used to identify the physical hardware - interface. The 'config false' list "/interfaces-state/interface" - contains all currently existing interfaces on the device. + For system-controlled interfaces, the "name" is the device-specific + name of the interface. The 'config false' list "/interfaces-state/ + interface" contains all existing interfaces on the device. - If the device supports arbitrarily named logical interfaces, the - NETCONF server advertises the feature "arbitrary-names". If the - device does not advertise this feature, the names of logical + If the device supports arbitrarily named user-controlled interfaces, + the NETCONF server advertises the feature "arbitrary-names". If the + device does not advertise this feature, the names of user-controlled interfaces MUST match the device's naming scheme. How a client can learn the naming scheme of such devices is outside the scope of this document. + When a system-controlled interface is created by the system, the + system tries to apply the interface configuration in /interfaces/ + interface with the same name as the new interface. If no such + interface configuration is found, or if the configured type does not + match the real interface type, the system creates the interface + without applying explicit configuration. + + When a user-controlled interface is created, the configuration + determines the name of the interface. + 3.2. Interface References An interface is identified by its name, which is unique within the server. This property is captured in the "interface-ref" and "interface-state-ref" typedefs, which other YANG modules SHOULD use when they need to reference a configured interface or operationally used interface, respectively. 3.3. Interface Layering @@ -344,22 +371,22 @@ differ in the time granularity in which they provide access to the counters. For example, it is common that SNMP implementations cache counter values for some time. The following table lists the YANG data nodes with corresponding objects in the IF-MIB. +----------------------------------+------------------------+ | YANG data node | IF-MIB object | +----------------------------------+------------------------+ - | interface | ifEntry | - | name | ifName | + | /interfaces-state/interface | ifEntry | + | /interfaces-state/name | ifName | | description | ifAlias | | type | ifType | | enabled / admin-status | ifAdminStatus | | oper-status | ifOperStatus | | last-change | ifLastChange | | if-index | ifIndex | | link-up-down-trap-enable | ifLinkUpDownTrapEnable | | phys-address | ifPhysAddress | | higher-layer-if / lower-layer-if | ifStackTable | | speed | ifSpeed | @@ -381,21 +408,21 @@ YANG data nodes and related IF-MIB objects 5. Interfaces YANG Module This YANG module imports typedefs from [I-D.ietf-netmod-rfc6021-bis] and [I-D.ietf-netmod-iana-if-type]. RFC Ed.: update the date below with the date of RFC publication and remove this note. - file "ietf-interfaces@2013-05-15.yang" + file "ietf-interfaces@2013-07-04.yang" module ietf-interfaces { namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; prefix if; import ietf-yang-types { prefix yang; } import iana-if-type { @@ -433,21 +460,21 @@ (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; // RFC Ed.: replace XXXX with actual RFC number and remove this // note. // RFC Ed.: update the date below with the date of RFC publication // and remove this note. - revision 2013-05-15 { + revision 2013-07-04 { description "Initial revision."; reference "RFC XXXX: A YANG Data Model for Interface Management"; } /* Typedefs */ typedef interface-ref { type leafref { @@ -464,21 +491,21 @@ } description "This type is used by data models that need to reference the operationally present interfaces."; } /* Features */ feature arbitrary-names { description - "This feature indicates that the device allows logical + "This feature indicates that the device allows user-controlled interfaces to be named arbitrarily."; } feature pre-provisioning { description "This feature indicates that the device supports pre-provisioning of interface configuration, i.e., it is possible to configure an interface whose physical interface hardware is not present on the device."; } @@ -497,58 +524,60 @@ "Interface configuration parameters."; list interface { key "name"; description "The list of configured interfaces on the device. The operational state of an interface is available in the /interfaces-state/interface list. If the configuration of a - physical interface cannot be used by the system (e.g., the - physical interface present is not matching the interface - type), then the configuration is not applied to the physical - interface shown in the /interfaces-state/interface list. If - the the configuration of a logical interface cannot be used - by the system, the configured interface is not instantiated - in the /interfaces-state/interface list."; + system-controlled interface cannot be used by the system + (e.g., the interface hardware present does not match the + interface type), then the configuration is not applied to + the system-controlled interface shown in the + /interfaces-state/interface list. If the the configuration + of a user-controlled interface cannot be used by the system, + the configured interface is not instantiated in the + /interfaces-state/interface list."; leaf name { type string; description "The name of the interface. A device MAY restrict the allowed values for this leaf, possibly depending on the type of the interface. - For physical interfaces, this leaf is the device-specific - name of the interface. The 'config false' list - /interfaces-state/interface contains the currently + For system-controlled interfaces, this leaf is the + device-specific name of the interface. The 'config false' + list /interfaces-state/interface contains the currently existing interfaces on the device. - If a client tries to create configuration for a physical - interface that is not present, the server MAY reject the - request, if the implementation does not support + If a client tries to create configuration for a + system-controlled interface that is not present in the + /interfaces-state/interface list, the server MAY reject + the request, if the implementation does not support pre-provisioning of interfaces, or if the name refers to - an interface that can never exist in the system. - A NETCONF server MUST reply with an rpc-error with the + an interface that can never exist in the system. A + NETCONF server MUST reply with an rpc-error with the error-tag 'invalid-value' in this case. If the device supports pre-provisioning of interface configuration, the feature 'pre-provisioning' is advertised. - If the device allows arbitrarily named logical interfaces, - the feature 'arbitrary-names' is advertised. + If the device allows arbitrarily named user-controlled + interfaces, the feature 'arbitrary-names' is advertised. - When a configured logical interface is created by the - system, it is instantiated in the + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the /interface-state/interface list. Since the name in that list MAY be mapped to ifName by an implementation, such an implementation MUST restrict the allowed values for this leaf so that it matches the restrictions of ifName. If a NETCONF server that implements this restriction is sent a value that doesn't match the restriction, it MUST reply with an rpc-error with the error-tag 'invalid-value'."; } @@ -562,21 +591,21 @@ Such an implementation MUST restrict the allowed values for this leaf so that it matches the restrictions of ifAlias. If a NETCONF server that implements this restriction is sent a value that doesn't match the restriction, it MUST reply with an rpc-error with the error-tag 'invalid-value'. Since ifAlias is defined to be stored in non-volatile - storage, the SNMP implementation MUST map ifAlias to the + storage, the MIB implementation MUST map ifAlias to the value of 'description' in the persistently stored datastore. Specifically, if the device supports ':startup', when ifAlias is read the device MUST return the value of 'description' in the 'startup' datastore, and when it is written, it MUST be written to the 'running' and 'startup' datastores. Note that it is up to the implementation if it modifies this single leaf in 'startup', or if it performs an implicit copy-config from 'running' to @@ -658,32 +687,30 @@ config false; description "Data nodes for the operational state of interfaces."; list interface { key "name"; description "The list of interfaces on the device. - Physical interfaces detected by the system are always - present in this list, if they are configured or not."; + System-controlled interfaces created by the system are + always present in this list, whether they are configured or + not."; leaf name { type string; description "The name of the interface. - This leaf MAY be mapped to ifName by an implementation. - Such an implementation MUST restrict the values - for this leaf so that it matches the restrictions of - ifName."; + This leaf MAY be mapped to ifName by an implementation."; reference "RFC 2863: The Interfaces Group MIB - ifName"; } leaf type { type ianaift:iana-if-type; mandatory true; description "The type of the interface."; reference @@ -706,24 +733,26 @@ enum testing { value 3; description "In some test mode."; } } mandatory true; description "The desired state of the interface. - This leaf has the same semantics as ifAdminStatus."; + This leaf has the same read semantics as ifAdminStatus."; reference "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + leaf oper-status { type enumeration { enum up { value 1; description "Ready to pass packets."; } enum down { value 2; description @@ -1116,28 +1145,28 @@ 8. Acknowledgments The author wishes to thank Alexander Clemm, Per Hedeland, Ladislav Lhotka, and Juergen Schoenwaelder for their helpful comments. 9. References 9.1. Normative References [I-D.ietf-netmod-iana-if-type] - Bjorklund, M., "IANA Interface Type and Address Family - YANG Modules", draft-ietf-netmod-iana-if-type-06 (work in - progress), April 2013. + Bjorklund, M., "IANA Interface Type YANG Module", + draft-ietf-netmod-iana-if-type-07 (work in progress), + July 2013. [I-D.ietf-netmod-rfc6021-bis] Schoenwaelder, J., "Common YANG Data Types", - draft-ietf-netmod-rfc6021-bis-02 (work in progress), - May 2013. + draft-ietf-netmod-rfc6021-bis-03 (work in progress), + June 2013. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group MIB", RFC 2863, June 2000. [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004. @@ -1358,88 +1387,98 @@ xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> eth0 ethernetCsmacd down down 2 00:01:02:03:04:05 - 2013-04-01T03:00:00Z + + 2013-04-01T03:00:00+00:00 + eth1 ethernetCsmacd up up 7 00:01:02:03:04:06 eth1.10 - 2013-04-01T03:00:00Z + + 2013-04-01T03:00:00+00:00 + eth1.10 l2vlan up up 9 eth1 - 2013-04-01T03:00:00Z + + 2013-04-01T03:00:00+00:00 + eth2 ethernetCsmacd down down 8 00:01:02:03:04:07 - 2013-04-01T03:00:00Z + + 2013-04-01T03:00:00+00:00 + lo1 softwareLoopback up up 1 - 2013-04-01T03:00:00Z + + 2013-04-01T03:00:00+00:00 + Appendix E. Examples: Interface Naming Schemes This section gives examples of some implementation strategies. The examples make use of the example data model "ex-vlan" (see - Appendix C) to show how logical interfaces can be configured. + Appendix C) to show how user-controlled interfaces can be configured. E.1. Router with Restricted Interface Names In this example, a router has support for 4 line cards, each with 8 ports. The slots for the cards are physically numbered from 0 to 3, and the ports on each card from 0 to 7. Each card has fast- or gigabit-ethernet ports. The device-specific names for these physical interfaces are "fastethernet-N/M" or "gigabitethernet-N/M". @@ -1494,32 +1533,32 @@ E.2. Router with Arbitrary Interface Names In this example, a router has support for 4 line cards, each with 8 ports. The slots for the cards are physically numbered from 0 to 3, and the ports on each card from 0 to 7. Each card has fast- or gigabit-ethernet ports. The device-specific names for these physical interfaces are "fastethernet-N/M" or "gigabitethernet-N/M". - The implementation does not restrict the logical interface names. - This allows to more easily apply the interface configuration to a - different interface. However, the additional level of indirection - also makes it a bit more complex to map interface names found in - other protocols to configuration entries. + The implementation does not restrict the user-controlled interface + names. This allows to more easily apply the interface configuration + to a different interface. However, the additional level of + indirection also makes it a bit more complex to map interface names + found in other protocols to configuration entries. The NETCONF server advertises the 'arbitrary-names' feature in the message. Physical interfaces are configured as in Appendix E.1. - An operator can configure a logical interface by sending an + An operator can configure a VLAN interface by sending an containing: acme-interface l2-vlan fastethernet-1/0 5 If necessary, the operator can move the configuration named @@ -1592,32 +1631,32 @@ eth8 5 E.5. Generic Host with Arbitrary Interface Names In this example, a generic host has interfaces named by the kernel. The system identifies the physical interface by the name assigned by the operating system to the interface. - The implementation does not restrict the logical interface names. - This allows to more easily apply the interface configuration to a - different interface. However, the additional level of indirection - also makes it a bit more complex to map interface names found in - other protocols to configuration entries. + The implementation does not restrict the user-controlled interface + names. This allows to more easily apply the interface configuration + to a different interface. However, the additional level of + indirection also makes it a bit more complex to map interface names + found in other protocols to configuration entries. The NETCONF server advertises the 'arbitrary-names' feature in the message. Physical interfaces are configured as in Appendix E.4. - An operator can configure a logical interface by sending an + An operator can configure a VLAN interface by sending an containing: acme-interface l2-vlan eth8 5