idnits 2.17.1 draft-ietf-netmod-interfaces-cfg-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (April 29, 2012) is 4377 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-10) exists of draft-ietf-netmod-iana-if-type-02 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Bjorklund 3 Internet-Draft Tail-f Systems 4 Intended status: Standards Track April 29, 2012 5 Expires: October 31, 2012 7 A YANG Data Model for Interface Configuration 8 draft-ietf-netmod-interfaces-cfg-04 10 Abstract 12 This document defines a YANG data model for the configuration of 13 network interfaces. It is expected that interface type specific 14 configuration data models augment the generic interfaces data model 15 defined in this document. 17 Status of this Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on October 31, 2012. 34 Copyright Notice 36 Copyright (c) 2012 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 52 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 53 2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . 4 54 3. Interfaces Data Model . . . . . . . . . . . . . . . . . . . . 5 55 3.1. The interface List . . . . . . . . . . . . . . . . . . . . 5 56 3.2. Interface References . . . . . . . . . . . . . . . . . . . 6 57 3.3. Interface Layering . . . . . . . . . . . . . . . . . . . . 6 58 4. Relationship to the IF-MIB . . . . . . . . . . . . . . . . . . 8 59 5. Interfaces YANG Module . . . . . . . . . . . . . . . . . . . . 9 60 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 14 61 7. Security Considerations . . . . . . . . . . . . . . . . . . . 15 62 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 16 63 9. Normative References . . . . . . . . . . . . . . . . . . . . . 17 64 Appendix A. Example: Ethernet Interface Module . . . . . . . . . 18 65 Appendix B. Example: Ethernet Bonding Interface Module . . . . . 20 66 Appendix C. Example: VLAN Interface Module . . . . . . . . . . . 21 67 Appendix D. Example: NETCONF reply . . . . . . . . . . . . 22 68 Appendix E. ChangeLog . . . . . . . . . . . . . . . . . . . . . . 23 69 E.1. Version -04 . . . . . . . . . . . . . . . . . . . . . . . 23 70 E.2. Version -03 . . . . . . . . . . . . . . . . . . . . . . . 23 71 E.3. Version -02 . . . . . . . . . . . . . . . . . . . . . . . 23 72 E.4. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 23 73 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 24 75 1. Introduction 77 This document defines a YANG [RFC6020] data model for the 78 configuration of network interfaces. It is expected that interface 79 type specific configuration data models augment the generic 80 interfaces data model defined in this document. 82 Network interfaces are central to the configuration of many Internet 83 protocols. Thus, it is important to establish a common data model 84 for how interfaces are identified and configured. 86 1.1. Terminology 88 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 89 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 90 "OPTIONAL" in this document are to be interpreted as described in BCP 91 14, [RFC2119]. 93 The following terms are defined in [RFC6241] and are not redefined 94 here: 96 o client 98 o server 100 The following terms are defined in [RFC6020] and are not redefined 101 here: 103 o augment 105 o data model 107 o data node 109 2. Objectives 111 This section describes some of the design objectives for the model 112 presented in Section 5. 114 o It is recognized that existing implementations will have to map 115 the interface data model defined in this memo to their proprietary 116 native data model. The new data model should be simple to 117 facilitate such mappings. 119 o The data model should be suitable for new implementations to use 120 as-is, without requiring a mapping to a different native model. 122 o References to interfaces should be as simple as possible, 123 preferably by using a single leafref. 125 o The mapping to ifIndex [RFC2863] used by SNMP to identify 126 interfaces must be clear. 128 o The model must support interface layering, both simple layering 129 where one interface is layered on top of exactly one other 130 interface, and more complex scenarios where one interface is 131 aggregated over N other interfaces, or when N interfaces are 132 multiplexed over one other interface. 134 o The data model should support the pre-provisioning of interface 135 configuration, i.e., it should be possible to configure an 136 interface whose physical interface hardware is not present on the 137 device. It is recommended that devices that support dynamic 138 addition and removal of physical interfaces also support pre- 139 provisioning. 141 3. Interfaces Data Model 143 The data model in the module "ietf-interfaces" has the following 144 structure, where square brackets are used to enclose a list's keys, 145 and "?" means that the leaf is optional: 147 +--rw interfaces 148 +--rw interface [name] 149 +--rw name string 150 +--rw description? string 151 +--rw type ianaift:iana-if-type 152 +--rw location? string 153 +--rw enabled? boolean 154 +--ro if-index int32 155 +--rw mtu? uint32 156 +--rw link-up-down-trap-enable? enumeration 158 This module defines one YANG feature: 160 snmp-if-mib: Indicates that the server implements IF-MIB [RFC2863]. 162 3.1. The interface List 164 The data model for interface configuration presented in this document 165 uses a flat list of interfaces. Each interface in the list is 166 identified by its name. Furthermore, each interface has a mandatory 167 "type" leaf, and a "location" leaf. The combination of "type" and 168 "location" is unique within the interface list. 170 It is expected that interface type specific data models augment the 171 interface list, and use the "type" leaf to make the augmentation 172 conditional. 174 As an example of such an interface type specific augmentation, 175 consider this YANG snippet. For a more complete example, see 176 Appendix A. 178 import interfaces { 179 prefix "if"; 180 } 182 augment "/if:interfaces/if:interface" { 183 when "if:type = 'ethernetCsmacd'"; 185 container ethernet { 186 leaf duplex { 187 ... 188 } 189 } 190 } 192 The "location" leaf is a string. It is optional in the data model, 193 but if the type represents a physical interface, it is mandatory. 194 The format of this string is device- and type-dependent. The device 195 uses the location string to identify the physical or logical entity 196 that the configuration applies to. For example, if a device has a 197 single array of 8 ethernet ports, the location can be one of the 198 strings "1" to "8". As another example, if a device has N cards of M 199 ports, the location can be on the form "n/m", such as "1/0". 201 How a client can learn which types and locations are present on a 202 certain device is outside the scope of this document. 204 3.2. Interface References 206 An interface is identified by its name, which is unique within the 207 server. This property is captured in the "interface-ref" typedef, 208 which other YANG modules SHOULD use when they need to reference an 209 existing interface. 211 3.3. Interface Layering 213 There is no generic mechanism for how an interface is configured to 214 be layered on top of some other interface. It is expected that 215 interface type specific models define their own nodes for interface 216 layering, by using "interface-ref" types to reference lower layers. 218 Below is an example of a model with such nodes. For a more complete 219 example, see Appendix B. 221 augment "/if:interfaces/if:interface" { 222 when "if:type = 'ieee8023adLag'"; 224 leaf-list slave-if { 225 type if:interface-ref; 226 must "/if:interfaces/if:interface[if:name = current()]" 227 + "/if:type = 'ethernetCsmacd'" { 228 description 229 "The type of a slave interface must be ethernet"; 230 } 231 } 232 // other bonding config params, failover times etc. 233 } 235 4. Relationship to the IF-MIB 237 If the device implements IF-MIB [RFC2863], each entry in the 238 "interface" list is typically mapped to one ifEntry. The "if-index" 239 leaf contains the value of the corresponding ifEntry's ifIndex. 241 In most cases, the "name" of an "interface" entry is mapped to 242 ifName. ifName is defined as an DisplayString [RFC2579] which uses a 243 7-bit ASCII character set. An implementation MAY restrict the 244 allowed values for "name" to match the restrictions of ifName. 246 The IF-MIB allows two different ifEntries to have the same ifName. 247 Devices that support this feature, and also support the configuration 248 of these interfaces using the "interface" list, cannot have a 1-1 249 mapping between the "name" leaf and ifName. 251 The IF-MIB also defines the writable object ifPromiscuousMode. Since 252 this object typically is not a configuration object, it is not mapped 253 to the "ietf-interfaces" module. 255 The following table lists the YANG nodes with corresponding objects 256 in the IF-MIB. 258 +--------------------------+------------------------+ 259 | YANG node | IF-MIB object | 260 +--------------------------+------------------------+ 261 | interface | ifEntry | 262 | name | ifName | 263 | description | ifAlias | 264 | type | ifType | 265 | enabled | ifAdminStatus | 266 | if-index | ifIndex | 267 | mtu | ifMtu | 268 | link-up-down-trap-enable | ifLinkUpDownTrapEnable | 269 +--------------------------+------------------------+ 271 Mapping of YANG nodes to IF-MIB objects 273 5. Interfaces YANG Module 275 This YANG module imports a typedef from 276 [I-D.ietf-netmod-iana-if-type]. 278 RFC Ed.: update the date below with the date of RFC publication and 279 remove this note. 281 file "ietf-interfaces@2012-04-29.yang" 283 module ietf-interfaces { 285 namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; 286 prefix if; 288 import iana-if-type { 289 prefix ianaift; 290 } 292 organization 293 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 295 contact 296 "WG Web: 297 WG List: 299 WG Chair: David Kessens 300 302 WG Chair: Juergen Schoenwaelder 303 305 Editor: Martin Bjorklund 306 "; 308 description 309 "This module contains a collection of YANG definitions for 310 configuring network interfaces. 312 Copyright (c) 2011 IETF Trust and the persons identified as 313 authors of the code. All rights reserved. 315 Redistribution and use in source and binary forms, with or 316 without modification, is permitted pursuant to, and subject 317 to the license terms contained in, the Simplified BSD License 318 set forth in Section 4.c of the IETF Trust's Legal Provisions 319 Relating to IETF Documents 320 (http://trustee.ietf.org/license-info). 321 This version of this YANG module is part of RFC XXXX; see 322 the RFC itself for full legal notices."; 324 // RFC Ed.: replace XXXX with actual RFC number and remove this 325 // note. 327 // RFC Ed.: update the date below with the date of RFC publication 328 // and remove this note. 329 revision 2012-04-29 { 330 description 331 "Initial revision."; 332 reference 333 "RFC XXXX: A YANG Data Model for Interface Configuration"; 334 } 336 /* Typedefs */ 338 typedef interface-ref { 339 type leafref { 340 path "/if:interfaces/if:interface/if:name"; 341 } 342 description 343 "This type is used by data models that need to reference 344 interfaces."; 345 } 347 /* Features */ 349 feature snmp-if-mib { 350 description 351 "This feature indicates that the server implements IF-MIB."; 352 reference 353 "RFC 2863: The Interfaces Group MIB"; 354 } 356 /* Data nodes */ 358 container interfaces { 359 description 360 "Interface parameters."; 362 list interface { 363 key "name"; 364 unique "type location"; 366 description 367 "The list of configured interfaces on the device."; 369 leaf name { 370 type string; 371 description 372 "An arbitrary name for the interface. 374 A device MAY restrict the allowed values for this leaf, 375 possibly depending on the type and location. 377 For example, if a device has a single array of 8 ethernet 378 ports, the name might be restricted to be on the form 379 'ethN', where N is an integer between '1' and '8'. 381 This leaf MAY be mapped to ifName by an implementation. 382 Such an implementation MAY restrict the allowed values 383 for this leaf so that it matches the restrictions of 384 ifName."; 385 reference 386 "RFC 2863: The Interfaces Group MIB - ifName"; 387 } 389 leaf description { 390 type string; 391 description 392 "A textual description of the interface. 394 This leaf MAY be mapped to ifAlias by an implementation. 395 Such an implementation MAY restrict the allowed values 396 for this leaf so that it matches the restrictions of 397 ifAlias."; 398 reference 399 "RFC 2863: The Interfaces Group MIB - ifAlias"; 400 } 402 leaf type { 403 type ianaift:iana-if-type; 404 mandatory true; 405 description 406 "The type of the interface. 408 When an interface entry is created, a server MAY 409 initialize the type leaf with a valid value, e.g., if it 410 is possible to derive the type from the name of the 411 interface."; 412 } 414 leaf location { 415 type string; 416 description 417 "The device-specific location of the interface of a 418 particular type. The format of the location string 419 depends on the interface type and the device. 421 Media-specific modules must specify if the location 422 is needed for the given type. 424 For example, if a device has a single array of 8 ethernet 425 ports, the location can be one of '1' to '8'. As another 426 example, if a device has N cards of M ports, the location 427 can be on the form 'n/m'. 429 When an interface entry is created, a server MAY 430 initialize the location leaf with a valid value, e.g., if 431 it is possible to derive the location from the name of 432 the interface."; 433 } 435 leaf enabled { 436 type boolean; 437 default "true"; 438 description 439 "The desired state of the interface. 441 This leaf contains the configured, desired state of the 442 interface. Systems that implement the IF-MIB use the 443 value of this leaf to set IF-MIB.ifAdminStatus to 'up' or 444 'down' after an ifEntry has been initialized, as described 445 in RFC 2863."; 446 reference 447 "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; 448 } 450 leaf if-index { 451 if-feature snmp-if-mib; 452 type int32 { 453 range "1..2147483647"; 454 } 455 config false; 456 description 457 "The ifIndex value for the ifEntry represented by this 458 interface. 460 Media-specific modules must specify how the type is 461 mapped to entries in the ifTable."; 462 reference 463 "RFC 2863: The Interfaces Group MIB - ifIndex"; 464 } 465 leaf mtu { 466 type uint32; 467 description 468 "The size, in octets, of the largest packet that the 469 interface can send and receive. This node might not be 470 valid for all interface types. 472 Media-specific modules must specify any restrictions on 473 the mtu for their interface type."; 474 } 476 leaf link-up-down-trap-enable { 477 if-feature snmp-if-mib; 478 type enumeration { 479 enum enabled { 480 value 1; 481 } 482 enum disabled { 483 value 2; 484 } 485 } 486 description 487 "Indicates whether linkUp/linkDown SNMP notifications 488 should be generated for this interface. 490 If this node is not configured, the value 'enabled' is 491 operationally used by the server for interfaces which do 492 not operate on top of any other interface (as defined in 493 the ifStackTable), and 'disabled' otherwise."; 494 reference 495 "RFC 2863: The Interfaces Group MIB - 496 ifLinkUpDownTrapEnable"; 497 } 498 } 499 } 500 } 502 504 6. IANA Considerations 506 This document registers a URI in the IETF XML registry [RFC3688]. 507 Following the format in RFC 3688, the following registration is 508 requested to be made. 510 URI: urn:ietf:params:xml:ns:yang:ietf-interfaces 512 Registrant Contact: The IESG. 514 XML: N/A, the requested URI is an XML namespace. 516 This document registers a YANG module in the YANG Module Names 517 registry [RFC6020]. 519 name: ietf-interfaces 520 namespace: urn:ietf:params:xml:ns:yang:ietf-interfaces 521 prefix: if 522 reference: RFC XXXX 524 7. Security Considerations 526 The YANG module defined in this memo is designed to be accessed via 527 the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the 528 secure transport layer and the mandatory-to-implement secure 529 transport is SSH [RFC6242]. 531 There are a number of data nodes defined in the YANG module which are 532 writable/creatable/deletable (i.e., config true, which is the 533 default). These data nodes may be considered sensitive or vulnerable 534 in some network environments. Write operations (e.g., ) 535 to these data nodes without proper protection can have a negative 536 effect on network operations. These are the subtrees and data nodes 537 and their sensitivity/vulnerability: 539 /interfaces/interface: This list specifies the configured interfaces 540 on a device. Unauthorized access to this list could cause the 541 device to ignore packets destined to it. 543 /interfaces/interface/enabled: This leaf controls if an interface is 544 enabled or not. Unauthorized access to this leaf could cause the 545 device to ignore packets destined to it. 547 8. Acknowledgments 549 The author wishes to thank Per Hedeland, Ladislav Lhotka, and Juergen 550 Schoenwaelder for their helpful comments. 552 9. Normative References 554 [I-D.ietf-netmod-iana-if-type] 555 Bjorklund, M., "IANA Interface Type and Address Family 556 YANG Modules", draft-ietf-netmod-iana-if-type-02 (work in 557 progress), April 2012. 559 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 560 Requirement Levels", BCP 14, RFC 2119, March 1997. 562 [RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. 563 Schoenwaelder, Ed., "Textual Conventions for SMIv2", 564 STD 58, RFC 2579, April 1999. 566 [RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group 567 MIB", RFC 2863, June 2000. 569 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 570 January 2004. 572 [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the 573 Network Configuration Protocol (NETCONF)", RFC 6020, 574 October 2010. 576 [RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. 577 Bierman, "Network Configuration Protocol (NETCONF)", 578 RFC 6241, June 2011. 580 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 581 Shell (SSH)", RFC 6242, June 2011. 583 Appendix A. Example: Ethernet Interface Module 585 This section gives a simple example of how an Ethernet interface 586 module could be defined. It demonstrates how media-specific 587 configuration parameters can be conditionally augmented to the 588 generic interface list. It is not intended as a complete module for 589 ethernet configuration. 591 module ex-ethernet { 592 namespace "http://example.com/ethernet"; 593 prefix "eth"; 595 import ietf-interfaces { 596 prefix if; 597 } 599 augment "/if:interfaces/if:interface" { 600 when "if:type = 'ethernetCsmacd'"; 602 container ethernet { 603 must "../if:location" { 604 description 605 "An ethernet interface must specify the physical location 606 of the ethernet hardware."; 607 } 608 choice transmission-params { 609 case auto { 610 leaf auto-negotiate { 611 type empty; 612 } 613 } 614 case manual { 615 leaf duplex { 616 type enumeration { 617 enum "half"; 618 enum "full"; 619 } 620 } 621 leaf speed { 622 type enumeration { 623 enum "10Mb"; 624 enum "100Mb"; 625 enum "1Gb"; 626 enum "10Gb"; 627 } 628 } 629 } 630 } 631 // other ethernet specific params... 632 } 633 } 634 } 636 Appendix B. Example: Ethernet Bonding Interface Module 638 This section gives an example of how interface layering can be 639 defined. An ethernet bonding interface is defined, which bonds 640 several ethernet interfaces into one logical interface. 642 module ex-ethernet-bonding { 643 namespace "http://example.com/ethernet-bonding"; 644 prefix "bond"; 646 import ietf-interfaces { 647 prefix if; 648 } 650 augment "/if:interfaces/if:interface" { 651 when "if:type = 'ieee8023adLag'"; 653 leaf-list slave-if { 654 type if:interface-ref; 655 must "/if:interfaces/if:interface[if:name = current()]" 656 + "/if:type = 'ethernetCsmacd'" { 657 description 658 "The type of a slave interface must be ethernet."; 659 } 660 } 661 leaf bonding-mode { 662 type enumeration { 663 enum round-robin; 664 enum active-backup; 665 enum broadcast; 666 } 667 } 668 // other bonding config params, failover times etc. 669 } 670 } 672 Appendix C. Example: VLAN Interface Module 674 This section gives an example of how a vlan interface module can be 675 defined. 677 module ex-vlan { 678 namespace "http://example.com/vlan"; 679 prefix "vlan"; 681 import ietf-interfaces { 682 prefix if; 683 } 685 augment "/if:interfaces/if:interface" { 686 when "if:type = 'ethernetCsmacd' or 687 if:type = 'ieee8023adLag'"; 688 leaf vlan-tagging { 689 type boolean; 690 default false; 691 } 692 } 694 augment "/if:interfaces/if:interface" { 695 when "if:type = 'l2vlan'"; 697 leaf base-interface { 698 type if:interface-ref; 699 must "/if:interfaces/if:interface[if:name = current()]" 700 + "/vlan:vlan-tagging = true" { 701 description 702 "The base interface must have vlan tagging enabled."; 703 } 704 } 705 leaf vlan-id { 706 type uint16 { 707 range "1..4094"; 708 } 709 must "../base-interface"; 710 } 711 } 712 } 714 Appendix D. Example: NETCONF reply 716 This section gives an example of a reply to the NETCONF request 717 for a device that implements the example data models above. 719 722 723 725 726 eth0 727 ethernetCsmacd 728 0 729 true 730 2 731 732 733 eth1 734 ethernetCsmacd 735 1 736 true 737 7 738 true 740 741 742 743 745 Appendix E. ChangeLog 747 RFC Editor: remove this section upon publication as an RFC. 749 E.1. Version -04 751 o Clarified why ifPromiscuousMode is not part of this data model. 753 o Added a table that shows the mapping between this YANG data model 754 and IF-MIB. 756 E.2. Version -03 758 o Added the section Relationship to the IF-MIB. 760 o Changed if-index to be a leaf instead of leaf-list. 762 o Explained the notation used in the data model tree picture. 764 E.3. Version -02 766 o Editorial fixes 768 E.4. Version -01 770 o Changed leaf "if-admin-status" to leaf "enabled". 772 o Added Security Considerations 774 Author's Address 776 Martin Bjorklund 777 Tail-f Systems 779 Email: mbj@tail-f.com