idnits 2.17.1 draft-ietf-netmod-interfaces-cfg-10.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 19, 2013) is 4024 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 19, 2013 5 Expires: October 21, 2013 7 A YANG Data Model for Interface Management 8 draft-ietf-netmod-interfaces-cfg-10 10 Abstract 12 This document defines a YANG data model for the management of network 13 interfaces. It is expected that interface type specific data models 14 augment the generic interfaces data model defined in this document. 16 Status of this Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on October 21, 2013. 33 Copyright Notice 35 Copyright (c) 2013 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 51 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 52 2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . 4 53 3. Interfaces Data Model . . . . . . . . . . . . . . . . . . . . 5 54 3.1. The interface List . . . . . . . . . . . . . . . . . . . . 5 55 3.2. Interface References . . . . . . . . . . . . . . . . . . . 6 56 3.3. Interface Layering . . . . . . . . . . . . . . . . . . . . 6 57 4. Relationship to the IF-MIB . . . . . . . . . . . . . . . . . . 8 58 5. Interfaces YANG Module . . . . . . . . . . . . . . . . . . . . 10 59 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 60 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24 61 8. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 25 62 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26 63 9.1. Normative References . . . . . . . . . . . . . . . . . . . 26 64 9.2. Informative References . . . . . . . . . . . . . . . . . . 26 65 Appendix A. Example: Ethernet Interface Module . . . . . . . . . 27 66 Appendix B. Example: Ethernet Bonding Interface Module . . . . . 29 67 Appendix C. Example: VLAN Interface Module . . . . . . . . . . . 30 68 Appendix D. Example: NETCONF reply . . . . . . . . . . . . 31 69 Appendix E. Examples: Interface Naming Schemes . . . . . . . . . 32 70 E.1. Router with Restricted Interface Names . . . . . . . . . . 32 71 E.2. Router with Arbitrary Interface Names . . . . . . . . . . 33 72 E.3. Ethernet Switch with Restricted Interface Names . . . . . 33 73 E.4. Generic Host with Restricted Interface Names . . . . . . . 34 74 E.5. Generic Host with Arbitrary Interface Names . . . . . . . 35 75 Appendix F. ChangeLog . . . . . . . . . . . . . . . . . . . . . . 37 76 F.1. Version -08 . . . . . . . . . . . . . . . . . . . . . . . 37 77 F.2. Version -07 . . . . . . . . . . . . . . . . . . . . . . . 37 78 F.3. Version -06 . . . . . . . . . . . . . . . . . . . . . . . 37 79 F.4. Version -05 . . . . . . . . . . . . . . . . . . . . . . . 37 80 F.5. Version -04 . . . . . . . . . . . . . . . . . . . . . . . 37 81 F.6. Version -03 . . . . . . . . . . . . . . . . . . . . . . . 37 82 F.7. Version -02 . . . . . . . . . . . . . . . . . . . . . . . 38 83 F.8. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 38 84 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 39 86 1. Introduction 88 This document defines a YANG [RFC6020] data model for the management 89 of network interfaces. It is expected that interface type specific 90 data models augment the generic interfaces data model defined in this 91 document. 93 Network interfaces are central to the management of many Internet 94 protocols. Thus, it is important to establish a common data model 95 for how interfaces are identified and configured. 97 1.1. Terminology 99 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 100 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 101 "OPTIONAL" in this document are to be interpreted as described in BCP 102 14, [RFC2119]. 104 The following terms are defined in [RFC6241] and are not redefined 105 here: 107 o client 109 o server 111 The following terms are defined in [RFC6020] and are not redefined 112 here: 114 o augment 116 o data model 118 o data node 120 2. Objectives 122 This section describes some of the design objectives for the model 123 presented in Section 5. 125 o It is recognized that existing implementations will have to map 126 the interface data model defined in this memo to their proprietary 127 native data model. The data model should be simple to facilitate 128 such mappings. 130 o The data model should be suitable for new implementations to use 131 as-is, without requiring a mapping to a different native model. 133 o References to interfaces should be as simple as possible, 134 preferably by using a single leafref. 136 o The mapping to ifIndex [RFC2863] used by SNMP to identify 137 interfaces must be clear. 139 o The model must support interface layering, both simple layering 140 where one interface is layered on top of exactly one other 141 interface, and more complex scenarios where one interface is 142 aggregated over N other interfaces, or when N interfaces are 143 multiplexed over one other interface. 145 o The data model should support the pre-provisioning of interface 146 configuration, i.e., it should be possible to configure an 147 interface whose physical interface hardware is not present on the 148 device. It is recommended that devices that support dynamic 149 addition and removal of physical interfaces also support pre- 150 provisioning. 152 3. Interfaces Data Model 154 The data model in the module "ietf-interfaces" has the following 155 structure, where square brackets are used to enclose a list's keys, 156 "?" means that the leaf is optional, and "*" denotes a leaf-list: 158 +--rw interfaces 159 +--rw interface [name] 160 +--rw name string 161 +--rw description? string 162 +--rw type ianaift:iana-if-type 163 +--rw location? string 164 +--rw enabled? boolean 165 +--ro oper-status? enumeration 166 +--ro last-change? yang:date-and-time 167 +--ro if-index? int32 168 +--rw link-up-down-trap-enable? enumeration 169 +--ro phys-address? yang:phys-address 170 +--ro higher-layer-if* interface-ref 171 +--ro lower-layer-if* interface-ref 172 +--ro speed? yang:gauge64 173 +--ro statistics 174 +--ro discontinuity-time? yang:date-and-time 175 +--ro in-octets? yang:counter64 176 +--ro in-unicast-pkts? yang:counter64 177 +--ro in-broadcast-pkts? yang:counter64 178 +--ro in-multicast-pkts? yang:counter64 179 +--ro in-discards? yang:counter32 180 +--ro in-errors? yang:counter32 181 +--ro in-unknown-protos? yang:counter32 182 +--ro out-octets? yang:counter64 183 +--ro out-unicast-pkts? yang:counter64 184 +--ro out-broadcast-pkts? yang:counter64 185 +--ro out-multicast-pkts? yang:counter64 186 +--ro out-discards? yang:counter32 187 +--ro out-errors? yang:counter32 189 3.1. The interface List 191 The data model for interfaces presented in this document uses a flat 192 list of interfaces. Each interface in the list is identified by its 193 name. Furthermore, each interface has a mandatory "type" leaf, and 194 an optional "location" leaf. The combination of "type" and 195 "location" is unique within the interface list. 197 It is expected that interface type specific data models augment the 198 interface list, and use the "type" leaf to make the augmentation 199 conditional. 201 As an example of such an interface type specific augmentation, 202 consider this YANG snippet. For a more complete example, see 203 Appendix A. 205 import interfaces { 206 prefix "if"; 207 } 209 augment "/if:interfaces/if:interface" { 210 when "if:type = 'ethernetCsmacd'"; 212 container ethernet { 213 leaf duplex { 214 ... 215 } 216 } 217 } 219 The "location" leaf is a string. It is optional in the data model, 220 but if the type represents a physical interface, it is mandatory. 221 The format of this string is device- and type-dependent. The device 222 uses the location string to identify the physical or logical entity 223 that the configuration applies to. For example, if a device has a 224 single array of 8 ethernet ports, the location can be one of the 225 strings "1" to "8". As another example, if a device has N cards of M 226 ports, the location can be on the form "n/m", such as "1/0". 228 How a client can learn which types and locations are present on a 229 certain device is outside the scope of this document. 231 3.2. Interface References 233 An interface is identified by its name, which is unique within the 234 server. This property is captured in the "interface-ref" typedef, 235 which other YANG modules SHOULD use when they need to reference an 236 existing interface. 238 3.3. Interface Layering 240 There is no generic mechanism for how an interface is configured to 241 be layered on top of some other interface. It is expected that 242 interface type specific models define their own data nodes for 243 interface layering, by using "interface-ref" types to reference lower 244 layers. 246 Below is an example of a model with such nodes. For a more complete 247 example, see Appendix B. 249 import interfaces { 250 prefix "if"; 251 } 253 augment "/if:interfaces/if:interface" { 254 when "if:type = 'ieee8023adLag'"; 256 leaf-list slave-if { 257 type if:interface-ref; 258 must "/if:interfaces/if:interface[if:name = current()]" 259 + "/if:type = 'ethernetCsmacd'" { 260 description 261 "The type of a slave interface must be ethernet"; 262 } 263 } 264 // other bonding config params, failover times etc. 265 } 267 Two state data leaf-lists, "higher-layer-if" and "lower-layer-if", 268 represent a read-only view of the interface layering hierarchy. 270 4. Relationship to the IF-MIB 272 If the device implements IF-MIB [RFC2863], each entry in the 273 "interface" list is typically mapped to one ifEntry. The "if-index" 274 leaf MUST contain the value of the corresponding ifEntry's ifIndex. 276 In most cases, the "name" of an "interface" entry is mapped to 277 ifName. ifName is defined as an DisplayString [RFC2579] which uses a 278 7-bit ASCII character set. An implementation MAY restrict the 279 allowed values for "name" to match the restrictions of ifName. 281 The IF-MIB allows two different ifEntries to have the same ifName. 282 Devices that support this feature, and also support the configuration 283 of these interfaces using the "interface" list, cannot have a 1-1 284 mapping between the "name" leaf and ifName. 286 The IF-MIB also defines the writable object ifPromiscuousMode. Since 287 this object typically is not a configuration object, it is not mapped 288 to the "ietf-interfaces" module. 290 The following table lists the YANG data nodes with corresponding 291 objects in the IF-MIB. 293 +----------------------------------+------------------------+ 294 | YANG data node | IF-MIB object | 295 +----------------------------------+------------------------+ 296 | interface | ifEntry | 297 | name | ifName | 298 | description | ifAlias | 299 | type | ifType | 300 | enabled | ifAdminStatus | 301 | oper-status | ifOperStatus | 302 | last-change | ifLastChange | 303 | if-index | ifIndex | 304 | link-up-down-trap-enable | ifLinkUpDownTrapEnable | 305 | phys-address | ifPhysAddress | 306 | higher-layer-if / lower-layer-if | ifStackTable | 307 | speed | ifSpeed | 308 | in-octets | ifHCInOctets | 309 | in-unicast-pkts | ifHCInUcastPkts | 310 | in-broadcast-pkts | ifHCInBroadcastPkts | 311 | in-multicast-pkts | ifHCInMulticastPkts | 312 | in-discards | ifInDiscards | 313 | in-errors | ifInErrors | 314 | in-unknown-protos | ifInUnknownProtos | 315 | out-octets | ifHCOutOctets | 316 | out-unicast-pkts | ifHCOutUcastPkts | 317 | out-broadcast-pkts | ifHCOutBroadcastPkts | 318 | out-multicast-pkts | ifHCOutMulticastPkts | 319 | out-discards | ifOutDiscards | 320 | out-errors | ifOutErrors | 321 +----------------------------------+------------------------+ 323 Mapping of YANG data nodes to IF-MIB objects 325 5. Interfaces YANG Module 327 This YANG module imports a typedef from 328 [I-D.ietf-netmod-iana-if-type]. 330 RFC Ed.: update the date below with the date of RFC publication and 331 remove this note. 333 file "ietf-interfaces@2013-02-06.yang" 335 module ietf-interfaces { 337 namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; 338 prefix if; 340 import ietf-yang-types { 341 prefix yang; 342 } 343 import iana-if-type { 344 prefix ianaift; 345 } 347 organization 348 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 350 contact 351 "WG Web: 352 WG List: 354 WG Chair: David Kessens 355 357 WG Chair: Juergen Schoenwaelder 358 360 Editor: Martin Bjorklund 361 "; 363 description 364 "This module contains a collection of YANG definitions for 365 managing network interfaces. 367 Copyright (c) 2012 IETF Trust and the persons identified as 368 authors of the code. All rights reserved. 370 Redistribution and use in source and binary forms, with or 371 without modification, is permitted pursuant to, and subject 372 to the license terms contained in, the Simplified BSD License 373 set forth in Section 4.c of the IETF Trust's Legal Provisions 374 Relating to IETF Documents 375 (http://trustee.ietf.org/license-info). 377 This version of this YANG module is part of RFC XXXX; see 378 the RFC itself for full legal notices."; 380 // RFC Ed.: replace XXXX with actual RFC number and remove this 381 // note. 383 // RFC Ed.: update the date below with the date of RFC publication 384 // and remove this note. 385 revision 2013-02-06 { 386 description 387 "Initial revision."; 388 reference 389 "RFC XXXX: A YANG Data Model for Interface Management"; 390 } 392 /* Typedefs */ 394 typedef interface-ref { 395 type leafref { 396 path "/if:interfaces/if:interface/if:name"; 397 } 398 description 399 "This type is used by data models that need to reference 400 interfaces."; 401 } 403 /* Features */ 405 feature arbitrary-names { 406 description 407 "This feature indicates that the server allows interfaces to 408 be named arbitrarily."; 409 } 411 feature if-mib { 412 description 413 "This feature indicates that the server implements IF-MIB."; 414 reference 415 "RFC 2863: The Interfaces Group MIB"; 416 } 418 /* Data nodes */ 420 container interfaces { 421 description 422 "Interface parameters."; 424 list interface { 425 key "name"; 426 unique "type location"; 428 description 429 "The list of interfaces on the device."; 431 leaf name { 432 type string; 433 description 434 "The name of the interface. 436 A device MAY restrict the allowed values for this leaf, 437 possibly depending on the type and location. 439 If the device allows arbitrarily named interfaces, the 440 feature 'arbitrary-names' is advertised. 442 This leaf MAY be mapped to ifName by an implementation. 443 Such an implementation MAY restrict the allowed values for 444 this leaf so that it matches the restrictions of ifName. 445 If a NETCONF server that implements this restriction is 446 sent a value that doesn't match the restriction, it MUST 447 reply with an rpc-error with the error-tag 448 'invalid-value'."; 449 reference 450 "RFC 2863: The Interfaces Group MIB - ifName"; 451 } 453 leaf description { 454 type string; 455 description 456 "A textual description of the interface. 458 This leaf MAY be mapped to ifAlias by an implementation. 459 Such an implementation MAY restrict the allowed values for 460 this leaf so that it matches the restrictions of ifAlias. 461 If a NETCONF server that implements this restriction is 462 sent a value that doesn't match the restriction, it MUST 463 reply with an rpc-error with the error-tag 464 'invalid-value'."; 465 reference 466 "RFC 2863: The Interfaces Group MIB - ifAlias"; 467 } 468 leaf type { 469 type ianaift:iana-if-type; 470 mandatory true; 471 description 472 "The type of the interface. 474 When an interface entry is created, a server MAY 475 initialize the type leaf with a valid value, e.g., if it 476 is possible to derive the type from the name of the 477 interface."; 478 reference 479 "RFC 2863: The Interfaces Group MIB - ifType"; 480 } 482 leaf location { 483 type string; 484 description 485 "The device-specific location of the interface of a 486 particular type. The format of the location string 487 depends on the interface type and the device. If a 488 NETCONF server is sent a value that doesn't match this 489 format, it MUST reply with an rpc-error with the error-tag 490 'invalid-value'. 492 If the interface's type represents a physical interface, 493 this leaf MUST be set. 495 When an interface entry is created, a server MAY 496 initialize the location leaf with a valid value, e.g., if 497 it is possible to derive the location from the name of 498 the interface."; 499 } 501 leaf enabled { 502 type boolean; 503 default "true"; 504 description 505 "The desired state of the interface. 507 This leaf contains the configured, desired state of the 508 interface. Systems that implement the IF-MIB use the 509 value of this leaf to set IF-MIB.ifAdminStatus to 'up' or 510 'down' after an ifEntry has been initialized, as described 511 in RFC 2863."; 512 reference 513 "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; 514 } 515 leaf oper-status { 516 type enumeration { 517 enum up { 518 value 1; 519 description 520 "Ready to pass packets."; 521 } 522 enum down { 523 value 2; 524 description 525 "The interface does not pass any packets."; 526 } 527 enum testing { 528 value 3; 529 description 530 "In some test mode. No operational packets can 531 be passed."; 532 } 533 enum unknown { 534 value 4; 535 description 536 "Status cannot be determined for some reason."; 537 } 538 enum dormant { 539 value 5; 540 description 541 "Waiting for some external event."; 542 } 543 enum not-present { 544 value 6; 545 description 546 "Some component (typically hardware) is missing."; 547 } 548 enum lower-layer-down { 549 value 7; 550 description 551 "Down due to state of lower-layer interface(s)."; 552 } 553 } 554 config false; 555 description 556 "The current operational state of the interface. 558 If 'enabled' is 'false' then 'oper-status' 559 should be 'down'. If 'enabled' is changed to 'true' 560 then 'oper-status' should change to 'up' if the interface 561 is ready to transmit and receive network traffic; it 562 should change to 'dormant' if the interface is waiting for 563 external actions (such as a serial line waiting for an 564 incoming connection); it should remain in the 'down' state 565 if and only if there is a fault that prevents it from 566 going to the 'up' state; it should remain in the 567 'not-present' state if the interface has missing 568 (typically, hardware) components."; 569 reference 570 "RFC 2863: The Interfaces Group MIB - ifOperStatus"; 571 } 573 leaf last-change { 574 type yang:date-and-time; 575 config false; 576 description 577 "The time the interface entered its current operational 578 state. If the current state was entered prior to the 579 last re-initialization of the local network management 580 subsystem, then this node is not present."; 581 reference 582 "RFC 2863: The Interfaces Group MIB - ifLastChange"; 583 } 585 leaf if-index { 586 if-feature if-mib; 587 type int32 { 588 range "1..2147483647"; 589 } 590 config false; 591 description 592 "The ifIndex value for the ifEntry represented by this 593 interface. 595 Media-specific modules must specify how the type is 596 mapped to entries in the ifTable."; 597 reference 598 "RFC 2863: The Interfaces Group MIB - ifIndex"; 599 } 601 leaf link-up-down-trap-enable { 602 if-feature if-mib; 603 type enumeration { 604 enum enabled { 605 value 1; 606 } 607 enum disabled { 608 value 2; 609 } 610 } 611 description 612 "Indicates whether linkUp/linkDown SNMP notifications 613 should be generated for this interface. 615 If this node is not configured, the value 'enabled' is 616 operationally used by the server for interfaces which do 617 not operate on top of any other interface (i.e., there are 618 no 'lower-layer-if' entries), and 'disabled' otherwise."; 619 reference 620 "RFC 2863: The Interfaces Group MIB - 621 ifLinkUpDownTrapEnable"; 622 } 624 leaf phys-address { 625 type yang:phys-address; 626 config false; 627 description 628 "The interface's address at its protocol sub-layer. For 629 example, for an 802.x interface, this object normally 630 contains a MAC address. The interface's media-specific 631 modules must define the bit and byte ordering and the 632 format of the value of this object. For interfaces that do 633 not have such an address (e.g., a serial line), this node 634 is not present."; 635 reference 636 "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; 637 } 639 leaf-list higher-layer-if { 640 type interface-ref; 641 config false; 642 description 643 "A list of references to interfaces layered on top of this 644 interface."; 645 reference 646 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 647 } 649 leaf-list lower-layer-if { 650 type interface-ref; 651 config false; 652 description 653 "A list of references to interfaces layered underneath this 654 interface."; 655 reference 656 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 657 } 658 leaf speed { 659 type yang:gauge64; 660 units "bits / second"; 661 config false; 662 description 663 "An estimate of the interface's current bandwidth in bits 664 per second. For interfaces which do not vary in 665 bandwidth or for those where no accurate estimation can 666 be made, this node should contain the nominal bandwidth. 667 For interfaces that has no concept of bandwidth, this 668 node is not present."; 669 reference 670 "RFC 2863: The Interfaces Group MIB - 671 ifSpeed, ifHighSpeed"; 672 } 674 container statistics { 675 config false; 676 description 677 "A collection of interface-related statistics objects."; 679 leaf discontinuity-time { 680 type yang:date-and-time; 681 description 682 "The time on the most recent occasion at which any one or 683 more of this interface's counters suffered a 684 discontinuity. If no such discontinuities have occurred 685 since the last re-initialization of the local management 686 subsystem, then this node contains the time the local 687 management subsystem re-initialized itself."; 688 } 690 leaf in-octets { 691 type yang:counter64; 692 description 693 "The total number of octets received on the interface, 694 including framing characters. 696 Discontinuities in the value of this counter can occur 697 at re-initialization of the management system, and at 698 other times as indicated by the value of 699 'discontinuity-time'."; 700 reference 701 "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; 702 } 703 leaf in-unicast-pkts { 704 type yang:counter64; 705 description 706 "The number of packets, delivered by this sub-layer to a 707 higher (sub-)layer, which were not addressed to a 708 multicast or broadcast address at this sub-layer. 710 Discontinuities in the value of this counter can occur 711 at re-initialization of the management system, and at 712 other times as indicated by the value of 713 'discontinuity-time'."; 714 reference 715 "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; 716 } 717 leaf in-broadcast-pkts { 718 type yang:counter64; 719 description 720 "The number of packets, delivered by this sub-layer to a 721 higher (sub-)layer, which were addressed to a broadcast 722 address at this sub-layer. 724 Discontinuities in the value of this counter can occur 725 at re-initialization of the management system, and at 726 other times as indicated by the value of 727 'discontinuity-time'."; 728 reference 729 "RFC 2863: The Interfaces Group MIB - 730 ifHCInBroadcastPkts"; 731 } 732 leaf in-multicast-pkts { 733 type yang:counter64; 734 description 735 "The number of packets, delivered by this sub-layer to a 736 higher (sub-)layer, which were addressed to a multicast 737 address at this sub-layer. For a MAC layer protocol, 738 this includes both Group and Functional addresses. 740 Discontinuities in the value of this counter can occur 741 at re-initialization of the management system, and at 742 other times as indicated by the value of 743 'discontinuity-time'."; 744 reference 745 "RFC 2863: The Interfaces Group MIB - 746 ifHCInMulticastPkts"; 747 } 748 leaf in-discards { 749 type yang:counter32; 750 description 751 "The number of inbound packets which were chosen to be 752 discarded even though no errors had been detected to 753 prevent their being deliverable to a higher-layer 754 protocol. One possible reason for discarding such a 755 packet could be to free up buffer space. 757 Discontinuities in the value of this counter can occur 758 at re-initialization of the management system, and at 759 other times as indicated by the value of 760 'discontinuity-time'."; 761 reference 762 "RFC 2863: The Interfaces Group MIB - ifInDiscards"; 763 } 764 leaf in-errors { 765 type yang:counter32; 766 description 767 "For packet-oriented interfaces, the number of inbound 768 packets that contained errors preventing them from being 769 deliverable to a higher-layer protocol. For character- 770 oriented or fixed-length interfaces, the number of 771 inbound transmission units that contained errors 772 preventing them from being deliverable to a higher-layer 773 protocol. 775 Discontinuities in the value of this counter can occur 776 at re-initialization of the management system, and at 777 other times as indicated by the value of 778 'discontinuity-time'."; 779 reference 780 "RFC 2863: The Interfaces Group MIB - ifInErrors"; 781 } 782 leaf in-unknown-protos { 783 type yang:counter32; 784 description 785 "For packet-oriented interfaces, the number of packets 786 received via the interface which were discarded because 787 of an unknown or unsupported protocol. For 788 character-oriented or fixed-length interfaces that 789 support protocol multiplexing the number of transmission 790 units received via the interface which were discarded 791 because of an unknown or unsupported protocol. For any 792 interface that does not support protocol multiplexing, 793 this counter is not present. 795 Discontinuities in the value of this counter can occur 796 at re-initialization of the management system, and at 797 other times as indicated by the value of 798 'discontinuity-time'."; 799 reference 800 "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; 801 } 802 leaf out-octets { 803 type yang:counter64; 804 description 805 "The total number of octets transmitted out of the 806 interface, including framing characters. 808 Discontinuities in the value of this counter can occur 809 at re-initialization of the management system, and at 810 other times as indicated by the value of 811 'discontinuity-time'."; 812 reference 813 "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; 814 } 815 leaf out-unicast-pkts { 816 type yang:counter64; 817 description 818 "The total number of packets that higher-level protocols 819 requested be transmitted, and which were not addressed 820 to a multicast or broadcast address at this sub-layer, 821 including those that were discarded or not sent. 823 Discontinuities in the value of this counter can occur 824 at re-initialization of the management system, and at 825 other times as indicated by the value of 826 'discontinuity-time'."; 827 reference 828 "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; 829 } 830 leaf out-broadcast-pkts { 831 type yang:counter64; 832 description 833 "The total number of packets that higher-level protocols 834 requested be transmitted, and which were addressed to a 835 broadcast address at this sub-layer, including those 836 that were discarded or not sent. 838 Discontinuities in the value of this counter can occur 839 at re-initialization of the management system, and at 840 other times as indicated by the value of 841 'discontinuity-time'."; 842 reference 843 "RFC 2863: The Interfaces Group MIB - 844 ifHCOutBroadcastPkts"; 845 } 846 leaf out-multicast-pkts { 847 type yang:counter64; 848 description 849 "The total number of packets that higher-level protocols 850 requested be transmitted, and which were addressed to a 851 multicast address at this sub-layer, including those 852 that were discarded or not sent. For a MAC layer 853 protocol, this includes both Group and Functional 854 addresses. 856 Discontinuities in the value of this counter can occur 857 at re-initialization of the management system, and at 858 other times as indicated by the value of 859 'discontinuity-time'."; 860 reference 861 "RFC 2863: The Interfaces Group MIB - 862 ifHCOutMulticastPkts"; 863 } 864 leaf out-discards { 865 type yang:counter32; 866 description 867 "The number of outbound packets which were chosen to be 868 discarded even though no errors had been detected to 869 prevent their being transmitted. One possible reason 870 for discarding such a packet could be to free up buffer 871 space. 873 Discontinuities in the value of this counter can occur 874 at re-initialization of the management system, and at 875 other times as indicated by the value of 876 'discontinuity-time'."; 877 reference 878 "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; 879 } 880 leaf out-errors { 881 type yang:counter32; 882 description 883 "For packet-oriented interfaces, the number of outbound 884 packets that could not be transmitted because of errors. 885 For character-oriented or fixed-length interfaces, the 886 number of outbound transmission units that could not be 887 transmitted because of errors. 889 Discontinuities in the value of this counter can occur 890 at re-initialization of the management system, and at 891 other times as indicated by the value of 892 'discontinuity-time'."; 893 reference 894 "RFC 2863: The Interfaces Group MIB - ifOutErrors"; 895 } 896 } 897 } 899 } 900 } 902 904 6. IANA Considerations 906 This document registers a URI in the IETF XML registry [RFC3688]. 907 Following the format in RFC 3688, the following registration is 908 requested to be made. 910 URI: urn:ietf:params:xml:ns:yang:ietf-interfaces 912 Registrant Contact: The IESG. 914 XML: N/A, the requested URI is an XML namespace. 916 This document registers a YANG module in the YANG Module Names 917 registry [RFC6020]. 919 name: ietf-interfaces 920 namespace: urn:ietf:params:xml:ns:yang:ietf-interfaces 921 prefix: if 922 reference: RFC XXXX 924 7. Security Considerations 926 The YANG module defined in this memo is designed to be accessed via 927 the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the 928 secure transport layer and the mandatory-to-implement secure 929 transport is SSH [RFC6242]. 931 There are a number of data nodes defined in the YANG module which are 932 writable/creatable/deletable (i.e., config true, which is the 933 default). These data nodes may be considered sensitive or vulnerable 934 in some network environments. Write operations (e.g., ) 935 to these data nodes without proper protection can have a negative 936 effect on network operations. These are the subtrees and data nodes 937 and their sensitivity/vulnerability: 939 /interfaces/interface: This list specifies the configured interfaces 940 on a device. Unauthorized access to this list could cause the 941 device to ignore packets it should receive and process. 943 /interfaces/interface/enabled: This leaf controls if an interface is 944 enabled or not. Unauthorized access to this leaf could cause the 945 device to ignore packets it should receive and process. 947 8. Acknowledgments 949 The author wishes to thank Alexander Clemm, Per Hedeland, Ladislav 950 Lhotka, and Juergen Schoenwaelder for their helpful comments. 952 9. References 954 9.1. Normative References 956 [I-D.ietf-netmod-iana-if-type] 957 Bjorklund, M., "IANA Interface Type and Address Family 958 YANG Modules", draft-ietf-netmod-iana-if-type-02 (work in 959 progress), April 2012. 961 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 962 Requirement Levels", BCP 14, RFC 2119, March 1997. 964 [RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group 965 MIB", RFC 2863, June 2000. 967 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 968 January 2004. 970 [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the 971 Network Configuration Protocol (NETCONF)", RFC 6020, 972 October 2010. 974 9.2. Informative References 976 [RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. 977 Schoenwaelder, Ed., "Textual Conventions for SMIv2", 978 STD 58, RFC 2579, April 1999. 980 [RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. 981 Bierman, "Network Configuration Protocol (NETCONF)", 982 RFC 6241, June 2011. 984 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 985 Shell (SSH)", RFC 6242, June 2011. 987 Appendix A. Example: Ethernet Interface Module 989 This section gives a simple example of how an Ethernet interface 990 module could be defined. It demonstrates how media-specific 991 configuration parameters can be conditionally augmented to the 992 generic interface list. It is not intended as a complete module for 993 ethernet configuration. 995 module ex-ethernet { 996 namespace "http://example.com/ethernet"; 997 prefix "eth"; 999 import ietf-interfaces { 1000 prefix if; 1001 } 1003 augment "/if:interfaces/if:interface" { 1004 when "if:type = 'ethernetCsmacd'"; 1006 container ethernet { 1007 must "../if:location" { 1008 description 1009 "An ethernet interface must specify the physical location 1010 of the ethernet hardware."; 1011 } 1012 choice transmission-params { 1013 case auto { 1014 leaf auto-negotiate { 1015 type empty; 1016 } 1017 } 1018 case manual { 1019 leaf duplex { 1020 type enumeration { 1021 enum "half"; 1022 enum "full"; 1023 } 1024 } 1025 leaf speed { 1026 type enumeration { 1027 enum "10Mb"; 1028 enum "100Mb"; 1029 enum "1Gb"; 1030 enum "10Gb"; 1031 } 1032 } 1033 } 1034 } 1035 // other ethernet specific params... 1036 } 1037 } 1038 } 1040 Appendix B. Example: Ethernet Bonding Interface Module 1042 This section gives an example of how interface layering can be 1043 defined. An ethernet bonding interface is defined, which bonds 1044 several ethernet interfaces into one logical interface. 1046 module ex-ethernet-bonding { 1047 namespace "http://example.com/ethernet-bonding"; 1048 prefix "bond"; 1050 import ietf-interfaces { 1051 prefix if; 1052 } 1054 augment "/if:interfaces/if:interface" { 1055 when "if:type = 'ieee8023adLag'"; 1057 leaf-list slave-if { 1058 type if:interface-ref; 1059 must "/if:interfaces/if:interface[if:name = current()]" 1060 + "/if:type = 'ethernetCsmacd'" { 1061 description 1062 "The type of a slave interface must be ethernet."; 1063 } 1064 } 1065 leaf bonding-mode { 1066 type enumeration { 1067 enum round-robin; 1068 enum active-backup; 1069 enum broadcast; 1070 } 1071 } 1072 // other bonding config params, failover times etc. 1073 } 1074 } 1076 Appendix C. Example: VLAN Interface Module 1078 This section gives an example of how a vlan interface module can be 1079 defined. 1081 module ex-vlan { 1082 namespace "http://example.com/vlan"; 1083 prefix "vlan"; 1085 import ietf-interfaces { 1086 prefix if; 1087 } 1089 augment "/if:interfaces/if:interface" { 1090 when "if:type = 'ethernetCsmacd' or 1091 if:type = 'ieee8023adLag'"; 1092 leaf vlan-tagging { 1093 type boolean; 1094 default false; 1095 } 1096 } 1098 augment "/if:interfaces/if:interface" { 1099 when "if:type = 'l2vlan'"; 1101 leaf base-interface { 1102 type if:interface-ref; 1103 must "/if:interfaces/if:interface[if:name = current()]" 1104 + "/vlan:vlan-tagging = 'true'" { 1105 description 1106 "The base interface must have vlan tagging enabled."; 1107 } 1108 } 1109 leaf vlan-id { 1110 type uint16 { 1111 range "1..4094"; 1112 } 1113 must "../base-interface" { 1114 description 1115 "If a vlan-id is defined, a base-interface must 1116 be specified."; 1117 } 1118 } 1119 } 1120 } 1122 Appendix D. Example: NETCONF reply 1124 This section gives an example of a reply to the NETCONF request 1125 for a device that implements the example data models above. 1127 1130 1131 1134 1135 eth0 1136 ethernetCsmacd 1137 0 1138 true 1139 2 1140 1141 1142 eth1 1143 ethernetCsmacd 1144 1 1145 true 1146 7 1147 true 1148 1149 1150 eth1.10 1151 l2vlan 1152 true 1153 9 1154 eth1 1155 10 1156 1157 1158 1159 1161 Appendix E. Examples: Interface Naming Schemes 1163 This section gives examples of some implementation strategies. 1165 E.1. Router with Restricted Interface Names 1167 In this example, a router has support for 4 line cards, each with 8 1168 ports. The slots for the cards are physically numbered from 0 to 3, 1169 and the ports on each card from 0 to 7. Each card has fast- or 1170 gigabit-ethernet ports. 1172 The implementation restricts the names of the interfaces to one of 1173 "fastethernet-N/M" or "gigabitethernet-N/M". The "location" of an 1174 interface is a string on the form "N/M". The implementation auto- 1175 initializes the values for "type" and "location" based on the 1176 interface name. 1178 The NETCONF server does not advertise the 'arbitrary-names' feature 1179 in the message. 1181 An operator can configure a new interface by sending an 1182 containing: 1184 1185 fastethernet-1/0 1186 1188 When the server processes this request, it will set the leaf "type" 1189 to "ethernetCsmacd" and "location" to "1/0". Thus, if the client 1190 performs a right after the above, it will 1191 get: 1193 1194 fastethernet-1/0 1195 ethernetCsmacd 1196 1/0 1197 1199 If the client tries to change the location of this interface with an 1200 containing: 1202 1203 fastethernet-1/0 1204 1/1 1205 1207 then the server will reply with an "invalid-value" error, since the 1208 new location does not match the name. 1210 E.2. Router with Arbitrary Interface Names 1212 In this example, a router has support for 4 line cards, each with 8 1213 ports. The slots for the cards are physically numbered from 0 to 3, 1214 and the ports on each card from 0 to 7. Each card has fast- or 1215 gigabit-ethernet ports. 1217 The implementation does not restrict the interface names. This 1218 allows to more easily apply the interface configuration to a 1219 different physical interface. However, the additional level of 1220 indirection also makes it a bit more complex to map interface names 1221 found in other protocols to configuration entries. The "location" of 1222 an interface is a string on the form "N/M". 1224 The NETCONF server advertises the 'arbitrary-names' feature in the 1225 message. 1227 An operator can configure a new interface by sending an 1228 containing: 1230 1231 acme-interface 1232 ethernetCsmacd 1233 1/0 1234 1236 If necessary, the operator can move the configuration named 1237 "acme-interface" over to a different physical interface with an 1238 containing: 1240 1241 acme-interface 1242 2/4 1243 1245 E.3. Ethernet Switch with Restricted Interface Names 1247 In this example, an ethernet switch has a number of ports, each port 1248 identified by a simple port number. 1250 The implementation restricts the interface names to numbers that 1251 match the physical port number. 1253 The NETCONF server does not advertise the 'arbitrary-names' feature 1254 in the message. 1256 An operator can configure a new interface by sending an 1257 containing: 1259 1260 6 1261 1263 When the server processes this request, it will set the leaf "type" 1264 to "ethernetCsmacd" and "location" to "6". Thus, if the client 1265 performs a right after the above, it will 1266 get: 1268 1269 6 1270 ethernetCsmacd 1271 6 1272 1274 If the client tries to change the location of this interface with an 1275 containing: 1277 1278 6 1279 5 1280 1282 then the server will reply with an "invalid-value" error, since the 1283 new location does not match the name. 1285 E.4. Generic Host with Restricted Interface Names 1287 In this example, a generic host has interfaces named by the kernel 1288 and without easily usable location information. The system 1289 identifies the physical interface by the name assigned by the 1290 operating system to the interface. 1292 The implementation restricts the interface name to the operating 1293 system level name of the physical interface. 1295 The NETCONF server does not advertise the 'arbitrary-names' feature 1296 in the message. 1298 An operator can configure a new interface by sending an 1299 containing: 1301 1302 eth8 1303 1305 When the server processes this request, it will set the leaf "type" 1306 to "ethernetCsmacd" and "location" to "eth8". Thus, if the client 1307 performs a right after the above, it will 1308 get: 1310 1311 eth8 1312 ethernetCsmacd 1313 eth8 1314 1316 If the client tries to change the location of this interface with an 1317 containing: 1319 1320 eth8 1321 eth7 1322 1324 then the server will reply with an "invalid-value" error, since the 1325 new location does not match the name. 1327 E.5. Generic Host with Arbitrary Interface Names 1329 In this example, a generic host has interfaces named by the kernel 1330 and without easily usable location information. The system 1331 identifies the physical interface by the name assigned by the 1332 operating system to the interface. 1334 The implementation does not restrict the interface name to the 1335 operating system level name of the physical interface. This allows 1336 to more easily apply the interface configuration to a different 1337 physical interface. However, the additional level of indirection 1338 also makes it a bit more complex to map interface names found in 1339 other protocols to configuration entries. 1341 The NETCONF server advertises the 'arbitrary-names' feature in the 1342 message. 1344 An operator can configure a new interface by sending an 1345 containing: 1347 1348 acme-interface 1349 ethernetCsmacd 1350 eth4 1351 1353 If necessary, the operator can move the configuration named 1354 "acme-interface" over to a different physical interface with an 1355 containing: 1357 1358 acme-interface 1359 eth3 1360 1362 Appendix F. ChangeLog 1364 RFC Editor: remove this section upon publication as an RFC. 1366 F.1. Version -08 1368 o Removed the mtu leaf. 1370 o Added examples of different interface naming schemes. 1372 F.2. Version -07 1374 o Made leaf speed config false. 1376 F.3. Version -06 1378 o Added oper-status leaf. 1380 o Added leaf-lists higher-layer-if and lower-layer-if, that show the 1381 interface layering. 1383 o Added container statistics with counters. 1385 F.4. Version -05 1387 o Added an Informative References section. 1389 o Updated the Security Considerations section. 1391 o Clarified the behavior of an NETCONF server when invalid values 1392 are received. 1394 F.5. Version -04 1396 o Clarified why ifPromiscuousMode is not part of this data model. 1398 o Added a table that shows the mapping between this YANG data model 1399 and IF-MIB. 1401 F.6. Version -03 1403 o Added the section Relationship to the IF-MIB. 1405 o Changed if-index to be a leaf instead of leaf-list. 1407 o Explained the notation used in the data model tree picture. 1409 F.7. Version -02 1411 o Editorial fixes 1413 F.8. Version -01 1415 o Changed leaf "if-admin-status" to leaf "enabled". 1417 o Added Security Considerations 1419 Author's Address 1421 Martin Bjorklund 1422 Tail-f Systems 1424 Email: mbj@tail-f.com