idnits 2.17.1 draft-ietf-netmod-interfaces-cfg-08.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 (November 15, 2012) is 4179 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 November 15, 2012 5 Expires: May 19, 2013 7 A YANG Data Model for Interface Management 8 draft-ietf-netmod-interfaces-cfg-08 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 May 19, 2013. 33 Copyright Notice 35 Copyright (c) 2012 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 . . . . . . . . . . . . . . . . . . . . . . 36 76 F.1. Version -08 . . . . . . . . . . . . . . . . . . . . . . . 36 77 F.2. Version -07 . . . . . . . . . . . . . . . . . . . . . . . 36 78 F.3. Version -06 . . . . . . . . . . . . . . . . . . . . . . . 36 79 F.4. Version -05 . . . . . . . . . . . . . . . . . . . . . . . 36 80 F.5. Version -04 . . . . . . . . . . . . . . . . . . . . . . . 36 81 F.6. Version -03 . . . . . . . . . . . . . . . . . . . . . . . 36 82 F.7. Version -02 . . . . . . . . . . . . . . . . . . . . . . . 37 83 F.8. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 37 84 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 38 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 new data model should be simple to 128 facilitate 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 a 194 "location" leaf. The combination of "type" and "location" is unique 195 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 There are two state data leaf-list nodes "higher-layer-if" and 268 "lower-layer-if" defined, that contains a read-only view of the 269 interface layering hierarchy. 271 4. Relationship to the IF-MIB 273 If the device implements IF-MIB [RFC2863], each entry in the 274 "interface" list is typically mapped to one ifEntry. The "if-index" 275 leaf contains the value of the corresponding ifEntry's ifIndex. 277 In most cases, the "name" of an "interface" entry is mapped to 278 ifName. ifName is defined as an DisplayString [RFC2579] which uses a 279 7-bit ASCII character set. An implementation MAY restrict the 280 allowed values for "name" to match the restrictions of ifName. 282 The IF-MIB allows two different ifEntries to have the same ifName. 283 Devices that support this feature, and also support the configuration 284 of these interfaces using the "interface" list, cannot have a 1-1 285 mapping between the "name" leaf and ifName. 287 The IF-MIB also defines the writable object ifPromiscuousMode. Since 288 this object typically is not a configuration object, it is not mapped 289 to the "ietf-interfaces" module. 291 The following table lists the YANG data nodes with corresponding 292 objects in the IF-MIB. 294 +----------------------------------+------------------------+ 295 | YANG data node | IF-MIB object | 296 +----------------------------------+------------------------+ 297 | interface | ifEntry | 298 | name | ifName | 299 | description | ifAlias | 300 | type | ifType | 301 | enabled | ifAdminStatus | 302 | oper-status | ifOperStatus | 303 | last-change | ifLastChange | 304 | if-index | ifIndex | 305 | link-up-down-trap-enable | ifLinkUpDownTrapEnable | 306 | phys-address | ifPhysAddress | 307 | higher-layer-if / lower-layer-if | ifStackTable | 308 | speed | ifSpeed | 309 | in-octets | ifHCInOctets | 310 | in-unicast-pkts | ifHCInUcastPkts | 311 | in-broadcast-pkts | ifHCInBroadcastPkts | 312 | in-multicast-pkts | ifHCInMulticastPkts | 313 | in-discards | ifInDiscards | 314 | in-errors | ifInErrors | 315 | in-unknown-protos | ifInUnknownProtos | 316 | out-octets | ifHCOutOctets | 317 | out-unicast-pkts | ifHCOutUcastPkts | 318 | out-broadcast-pkts | ifHCOutBroadcastPkts | 319 | out-multicast-pkts | ifHCOutMulticastPkts | 320 | out-discards | ifOutDiscards | 321 | out-errors | ifOutErrors | 322 +----------------------------------+------------------------+ 324 Mapping of YANG data nodes to IF-MIB objects 326 5. Interfaces YANG Module 328 This YANG module imports a typedef from 329 [I-D.ietf-netmod-iana-if-type]. 331 RFC Ed.: update the date below with the date of RFC publication and 332 remove this note. 334 file "ietf-interfaces@2012-11-15.yang" 336 module ietf-interfaces { 338 namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; 339 prefix if; 341 import ietf-yang-types { 342 prefix yang; 343 } 344 import iana-if-type { 345 prefix ianaift; 346 } 348 organization 349 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 351 contact 352 "WG Web: 353 WG List: 355 WG Chair: David Kessens 356 358 WG Chair: Juergen Schoenwaelder 359 361 Editor: Martin Bjorklund 362 "; 364 description 365 "This module contains a collection of YANG definitions for 366 managing network interfaces. 368 Copyright (c) 2012 IETF Trust and the persons identified as 369 authors of the code. All rights reserved. 371 Redistribution and use in source and binary forms, with or 372 without modification, is permitted pursuant to, and subject 373 to the license terms contained in, the Simplified BSD License 374 set forth in Section 4.c of the IETF Trust's Legal Provisions 375 Relating to IETF Documents 376 (http://trustee.ietf.org/license-info). 378 This version of this YANG module is part of RFC XXXX; see 379 the RFC itself for full legal notices."; 381 // RFC Ed.: replace XXXX with actual RFC number and remove this 382 // note. 384 // RFC Ed.: update the date below with the date of RFC publication 385 // and remove this note. 386 revision 2012-11-15 { 387 description 388 "Initial revision."; 389 reference 390 "RFC XXXX: A YANG Data Model for Interface Management"; 391 } 393 /* Typedefs */ 395 typedef interface-ref { 396 type leafref { 397 path "/if:interfaces/if:interface/if:name"; 398 } 399 description 400 "This type is used by data models that need to reference 401 interfaces."; 402 } 404 /* Features */ 406 feature arbitrary-names { 407 description 408 "This feature indicates that the server allows interfaces to 409 be named arbitrarily."; 410 } 412 feature if-mib { 413 description 414 "This feature indicates that the server implements IF-MIB."; 415 reference 416 "RFC 2863: The Interfaces Group MIB"; 417 } 419 /* Data nodes */ 421 container interfaces { 422 description 423 "Interface parameters."; 425 list interface { 426 key "name"; 427 unique "type location"; 429 description 430 "The list of interfaces on the device."; 432 leaf name { 433 type string; 434 description 435 "The name of the interface. 437 A device MAY restrict the allowed values for this leaf, 438 possibly depending on the type and location. 440 If the device allows arbitrarily named interfaces, the 441 feature 'arbitrary-names' is advertised. 443 This leaf MAY be mapped to ifName by an implementation. 444 Such an implementation MAY restrict the allowed values for 445 this leaf so that it matches the restrictions of ifName. 446 If a NETCONF server that implements this restriction is 447 sent a value that doesn't match the restriction, it MUST 448 reply with an rpc-error with the error-tag 449 'invalid-value'."; 450 reference 451 "RFC 2863: The Interfaces Group MIB - ifName"; 452 } 454 leaf description { 455 type string; 456 description 457 "A textual description of the interface. 459 This leaf MAY be mapped to ifAlias by an implementation. 460 Such an implementation MAY restrict the allowed values for 461 this leaf so that it matches the restrictions of ifAlias. 462 If a NETCONF server that implements this restriction is 463 sent a value that doesn't match the restriction, it MUST 464 reply with an rpc-error with the error-tag 465 'invalid-value'."; 466 reference 467 "RFC 2863: The Interfaces Group MIB - ifAlias"; 468 } 469 leaf type { 470 type ianaift:iana-if-type; 471 mandatory true; 472 description 473 "The type of the interface. 475 When an interface entry is created, a server MAY 476 initialize the type leaf with a valid value, e.g., if it 477 is possible to derive the type from the name of the 478 interface."; 479 reference 480 "RFC 2863: The Interfaces Group MIB - ifType"; 481 } 483 leaf location { 484 type string; 485 description 486 "The device-specific location of the interface of a 487 particular type. The format of the location string 488 depends on the interface type and the device. 490 If the interface's type represents a physical interface, 491 this leaf MUST be set. 493 When an interface entry is created, a server MAY 494 initialize the location leaf with a valid value, e.g., if 495 it is possible to derive the location from the name of 496 the interface."; 497 } 499 leaf enabled { 500 type boolean; 501 default "true"; 502 description 503 "The desired state of the interface. 505 This leaf contains the configured, desired state of the 506 interface. Systems that implement the IF-MIB use the 507 value of this leaf to set IF-MIB.ifAdminStatus to 'up' or 508 'down' after an ifEntry has been initialized, as described 509 in RFC 2863."; 510 reference 511 "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; 512 } 514 leaf oper-status { 515 type enumeration { 516 enum up { 517 value 1; 518 description 519 "Ready to pass packets."; 520 } 521 enum down { 522 value 2; 523 description 524 "The interface does not pass any packets."; 525 } 526 enum testing { 527 value 3; 528 description 529 "In some test mode. No operational packets can 530 be passed."; 531 } 532 enum unknown { 533 value 4; 534 description 535 "Status cannot be determined for some reason."; 536 } 537 enum dormant { 538 value 5; 539 description 540 "Waiting for some external event."; 541 } 542 enum not-present { 543 value 6; 544 description 545 "Some component is missing."; 546 } 547 enum lower-layer-down { 548 value 7; 549 description 550 "Down due to state of lower-layer interface(s)."; 551 } 552 } 553 config false; 554 description 555 "The current operational state of the interface. 557 If 'enabled' is 'false' then 'oper-status' 558 should be 'down'. If 'enabled' is changed to 'true' 559 then 'oper-status' should change to 'up' if the interface 560 is ready to transmit and receive network traffic; it 561 should change to 'dormant' if the interface is waiting for 562 external actions (such as a serial line waiting for an 563 incoming connection); it should remain in the 'down' state 564 if and only if there is a fault that prevents it from 565 going to the 'up' state; it should remain in the 566 'not-present' state if the interface has missing 567 (typically, hardware) components."; 568 reference 569 "RFC 2863: The Interfaces Group MIB - ifOperStatus"; 570 } 572 leaf last-change { 573 type yang:date-and-time; 574 config false; 575 description 576 "The time the interface entered its current operational 577 state. If the current state was entered prior to the 578 last re-initialization of the local network management 579 subsystem, then this node is not present."; 580 reference 581 "RFC 2863: The Interfaces Group MIB - ifLastChange"; 582 } 584 leaf if-index { 585 if-feature if-mib; 586 type int32 { 587 range "1..2147483647"; 588 } 589 config false; 590 description 591 "The ifIndex value for the ifEntry represented by this 592 interface. 594 Media-specific modules must specify how the type is 595 mapped to entries in the ifTable."; 596 reference 597 "RFC 2863: The Interfaces Group MIB - ifIndex"; 598 } 600 leaf link-up-down-trap-enable { 601 if-feature if-mib; 602 type enumeration { 603 enum enabled { 604 value 1; 605 } 606 enum disabled { 607 value 2; 608 } 609 } 610 description 611 "Indicates whether linkUp/linkDown SNMP notifications 612 should be generated for this interface. 614 If this node is not configured, the value 'enabled' is 615 operationally used by the server for interfaces which do 616 not operate on top of any other interface (i.e., there are 617 no 'lower-layer-if' entries), and 'disabled' otherwise."; 618 reference 619 "RFC 2863: The Interfaces Group MIB - 620 ifLinkUpDownTrapEnable"; 621 } 623 leaf phys-address { 624 type yang:phys-address; 625 config false; 626 description 627 "The interface's address at its protocol sub-layer. For 628 example, for an 802.x interface, this object normally 629 contains a MAC address. The interface's media-specific 630 modules must define the bit and byte ordering and the 631 format of the value of this object. For interfaces that do 632 not have such an address (e.g., a serial line), this node 633 is not present."; 634 reference 635 "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; 636 } 638 leaf-list higher-layer-if { 639 type interface-ref; 640 config false; 641 description 642 "A list of references to interfaces layered on top of this 643 interface."; 644 reference 645 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 646 } 648 leaf-list lower-layer-if { 649 type interface-ref; 650 config false; 651 description 652 "A list of references to interfaces layered underneath this 653 interface."; 654 reference 655 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 656 } 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 } 803 leaf out-octets { 804 type yang:counter64; 805 description 806 "The total number of octets transmitted out of the 807 interface, including framing characters. 809 Discontinuities in the value of this counter can occur 810 at re-initialization of the management system, and at 811 other times as indicated by the value of 812 'discontinuity-time'."; 813 reference 814 "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; 815 } 816 leaf out-unicast-pkts { 817 type yang:counter64; 818 description 819 "The total number of packets that higher-level protocols 820 requested be transmitted, and which were not addressed 821 to a multicast or broadcast address at this sub-layer, 822 including those that were discarded or not sent. 824 Discontinuities in the value of this counter can occur 825 at re-initialization of the management system, and at 826 other times as indicated by the value of 827 'discontinuity-time'."; 828 reference 829 "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; 830 } 831 leaf out-broadcast-pkts { 832 type yang:counter64; 833 description 834 "The total number of packets that higher-level protocols 835 requested be transmitted, and which were addressed to a 836 broadcast address at this sub-layer, including those 837 that were discarded or not sent. 839 Discontinuities in the value of this counter can occur 840 at re-initialization of the management system, and at 841 other times as indicated by the value of 842 'discontinuity-time'."; 843 reference 844 "RFC 2863: The Interfaces Group MIB - 845 ifHCOutBroadcastPkts"; 846 } 847 leaf out-multicast-pkts { 848 type yang:counter64; 849 description 850 "The total number of packets that higher-level protocols 851 requested be transmitted, and which were addressed to a 852 multicast address at this sub-layer, including those 853 that were discarded or not sent. For a MAC layer 854 protocol, this includes both Group and Functional 855 addresses. 857 Discontinuities in the value of this counter can occur 858 at re-initialization of the management system, and at 859 other times as indicated by the value of 860 'discontinuity-time'."; 861 reference 862 "RFC 2863: The Interfaces Group MIB - 863 ifHCOutMulticastPkts"; 864 } 865 leaf out-discards { 866 type yang:counter32; 867 description 868 "The number of outbound packets which were chosen to be 869 discarded even though no errors had been detected to 870 prevent their being transmitted. One possible reason 871 for discarding such a packet could be to free up buffer 872 space. 874 Discontinuities in the value of this counter can occur 875 at re-initialization of the management system, and at 876 other times as indicated by the value of 877 'discontinuity-time'."; 878 reference 879 "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; 880 } 881 leaf out-errors { 882 type yang:counter32; 883 description 884 "For packet-oriented interfaces, the number of outbound 885 packets that could not be transmitted because of errors. 886 For character-oriented or fixed-length interfaces, the 887 number of outbound transmission units that could not be 888 transmitted because of errors. 890 Discontinuities in the value of this counter can occur 891 at re-initialization of the management system, and at 892 other times as indicated by the value of 893 'discontinuity-time'."; 894 reference 895 "RFC 2863: The Interfaces Group MIB - ifOutErrors"; 896 } 897 } 898 } 899 } 900 } 901 903 6. IANA Considerations 905 This document registers a URI in the IETF XML registry [RFC3688]. 906 Following the format in RFC 3688, the following registration is 907 requested to be made. 909 URI: urn:ietf:params:xml:ns:yang:ietf-interfaces 911 Registrant Contact: The IESG. 913 XML: N/A, the requested URI is an XML namespace. 915 This document registers a YANG module in the YANG Module Names 916 registry [RFC6020]. 918 name: ietf-interfaces 919 namespace: urn:ietf:params:xml:ns:yang:ietf-interfaces 920 prefix: if 921 reference: RFC XXXX 923 7. Security Considerations 925 The YANG module defined in this memo is designed to be accessed via 926 the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the 927 secure transport layer and the mandatory-to-implement secure 928 transport is SSH [RFC6242]. 930 There are a number of data nodes defined in the YANG module which are 931 writable/creatable/deletable (i.e., config true, which is the 932 default). These data nodes may be considered sensitive or vulnerable 933 in some network environments. Write operations (e.g., ) 934 to these data nodes without proper protection can have a negative 935 effect on network operations. These are the subtrees and data nodes 936 and their sensitivity/vulnerability: 938 /interfaces/interface: This list specifies the configured interfaces 939 on a device. Unauthorized access to this list could cause the 940 device to ignore packets it should receive and process. 942 /interfaces/interface/enabled: This leaf controls if an interface is 943 enabled or not. Unauthorized access to this leaf could cause the 944 device to ignore packets it should receive and process. 946 8. Acknowledgments 948 The author wishes to thank Alexander Clemm, Per Hedeland, Ladislav 949 Lhotka, and Juergen Schoenwaelder for their helpful comments. 951 9. References 953 9.1. Normative References 955 [I-D.ietf-netmod-iana-if-type] 956 Bjorklund, M., "IANA Interface Type and Address Family 957 YANG Modules", draft-ietf-netmod-iana-if-type-02 (work in 958 progress), April 2012. 960 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 961 Requirement Levels", BCP 14, RFC 2119, March 1997. 963 [RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group 964 MIB", RFC 2863, June 2000. 966 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 967 January 2004. 969 [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the 970 Network Configuration Protocol (NETCONF)", RFC 6020, 971 October 2010. 973 9.2. Informative References 975 [RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. 976 Schoenwaelder, Ed., "Textual Conventions for SMIv2", 977 STD 58, RFC 2579, April 1999. 979 [RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. 980 Bierman, "Network Configuration Protocol (NETCONF)", 981 RFC 6241, June 2011. 983 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 984 Shell (SSH)", RFC 6242, June 2011. 986 Appendix A. Example: Ethernet Interface Module 988 This section gives a simple example of how an Ethernet interface 989 module could be defined. It demonstrates how media-specific 990 configuration parameters can be conditionally augmented to the 991 generic interface list. It is not intended as a complete module for 992 ethernet configuration. 994 module ex-ethernet { 995 namespace "http://example.com/ethernet"; 996 prefix "eth"; 998 import ietf-interfaces { 999 prefix if; 1000 } 1002 augment "/if:interfaces/if:interface" { 1003 when "if:type = 'ethernetCsmacd'"; 1005 container ethernet { 1006 must "../if:location" { 1007 description 1008 "An ethernet interface must specify the physical location 1009 of the ethernet hardware."; 1010 } 1011 choice transmission-params { 1012 case auto { 1013 leaf auto-negotiate { 1014 type empty; 1015 } 1016 } 1017 case manual { 1018 leaf duplex { 1019 type enumeration { 1020 enum "half"; 1021 enum "full"; 1022 } 1023 } 1024 leaf speed { 1025 type enumeration { 1026 enum "10Mb"; 1027 enum "100Mb"; 1028 enum "1Gb"; 1029 enum "10Gb"; 1030 } 1031 } 1032 } 1033 } 1034 // other ethernet specific params... 1035 } 1036 } 1037 } 1039 Appendix B. Example: Ethernet Bonding Interface Module 1041 This section gives an example of how interface layering can be 1042 defined. An ethernet bonding interface is defined, which bonds 1043 several ethernet interfaces into one logical interface. 1045 module ex-ethernet-bonding { 1046 namespace "http://example.com/ethernet-bonding"; 1047 prefix "bond"; 1049 import ietf-interfaces { 1050 prefix if; 1051 } 1053 augment "/if:interfaces/if:interface" { 1054 when "if:type = 'ieee8023adLag'"; 1056 leaf-list slave-if { 1057 type if:interface-ref; 1058 must "/if:interfaces/if:interface[if:name = current()]" 1059 + "/if:type = 'ethernetCsmacd'" { 1060 description 1061 "The type of a slave interface must be ethernet."; 1062 } 1063 } 1064 leaf bonding-mode { 1065 type enumeration { 1066 enum round-robin; 1067 enum active-backup; 1068 enum broadcast; 1069 } 1070 } 1071 // other bonding config params, failover times etc. 1072 } 1073 } 1075 Appendix C. Example: VLAN Interface Module 1077 This section gives an example of how a vlan interface module can be 1078 defined. 1080 module ex-vlan { 1081 namespace "http://example.com/vlan"; 1082 prefix "vlan"; 1084 import ietf-interfaces { 1085 prefix if; 1086 } 1088 augment "/if:interfaces/if:interface" { 1089 when "if:type = 'ethernetCsmacd' or 1090 if:type = 'ieee8023adLag'"; 1091 leaf vlan-tagging { 1092 type boolean; 1093 default false; 1094 } 1095 } 1097 augment "/if:interfaces/if:interface" { 1098 when "if:type = 'l2vlan'"; 1100 leaf base-interface { 1101 type if:interface-ref; 1102 must "/if:interfaces/if:interface[if:name = current()]" 1103 + "/vlan:vlan-tagging = true" { 1104 description 1105 "The base interface must have vlan tagging enabled."; 1106 } 1107 } 1108 leaf vlan-id { 1109 type uint16 { 1110 range "1..4094"; 1111 } 1112 must "../base-interface" { 1113 description 1114 "If a vlan-id is defined, a base-interface must 1115 be specified."; 1116 } 1117 } 1118 } 1119 } 1121 Appendix D. Example: NETCONF reply 1123 This section gives an example of a reply to the NETCONF request 1124 for a device that implements the example data models above. 1126 1129 1130 1132 1133 eth0 1134 ethernetCsmacd 1135 0 1136 true 1137 2 1138 1139 1140 eth1 1141 ethernetCsmacd 1142 1 1143 true 1144 7 1145 true 1147 1148 1149 1150 1152 Appendix E. Examples: Interface Naming Schemes 1154 This section gives examples of some implementation strategies. 1156 E.1. Router with Restricted Interface Names 1158 In this example, a router has support for 4 line cards, each with 8 1159 ports. The slots for the cards are physically numbered from 0 to 3, 1160 and the ports on each card from 0 to 7. Each card has fast- or 1161 gigabit-ethernet ports. 1163 The implementation restricts the names of the interfaces to one of 1164 "fastethernet-N/M" or "gigabitethernet-N/M". The "location" of an 1165 interface is a string on the form "N/M". The implementation auto- 1166 initializes the values for "type" and "location" based on the 1167 interface name. 1169 An operator can configure a new interface by sending an 1170 containing: 1172 1173 fastethernet-1/0 1174 1176 When the server processes this request, it will set the leaf "type" 1177 to "ethernetCsmacd" and "location" to "1/0". Thus, if the client 1178 performs a right after the above, it will 1179 get: 1181 1182 fastethernet-1/0 1183 ethernetCsmacd 1184 1/0 1185 1187 If the client tries to change the location of this interface with an 1188 containing: 1190 1191 fastethernet-1/0 1192 1/1 1193 1195 then the server will reply with an "invalid-value" error, since the 1196 new location does not match the name. 1198 E.2. Router with Arbitrary Interface Names 1200 In this example, a router has support for 4 line cards, each with 8 1201 ports. The slots for the cards are physically numbered from 0 to 3, 1202 and the ports on each card from 0 to 7. Each card has fast- or 1203 gigabit-ethernet ports. 1205 The implementation does not restrict the interface names. This 1206 allows to more easily apply the interface configuration to a 1207 different physical interface. However, the additional level of 1208 indirection also makes it a bit more complex to map interface names 1209 found in other protocols to configuration entries. The "location" of 1210 an interface is a string on the form "N/M". 1212 An operator can configure a new interface by sending an 1213 containing: 1215 1216 acme-interface 1217 ethernetCsmacd 1218 1/0 1219 1221 If necessary, the operator can move the configuration named 1222 "acme-interface" over to a different physical interface with an 1223 containing: 1225 1226 acme-interface 1227 2/4 1228 1230 E.3. Ethernet Switch with Restricted Interface Names 1232 In this example, an ethernet switch has a number of ports, each port 1233 identified by a simple port number. 1235 The implementation restricts the interface names to numbers that 1236 match the physical port number. 1238 An operator can configure a new interface by sending an 1239 containing: 1241 1242 6 1243 1245 When the server processes this request, it will set the leaf "type" 1246 to "ethernetCsmacd" and "location" to "6". Thus, if the client 1247 performs a right after the above, it will 1248 get: 1250 1251 6 1252 ethernetCsmacd 1253 6 1254 1256 If the client tries to change the location of this interface with an 1257 containing: 1259 1260 6 1261 5 1262 1264 then the server will reply with an "invalid-value" error, since the 1265 new location does not match the name. 1267 E.4. Generic Host with Restricted Interface Names 1269 In this example, a generic host has interfaces named by the kernel 1270 and without easily usable location information. The system 1271 identifies the physical interface by the name assigned by the 1272 operating system to the interface. 1274 The implementation restricts the interface name to the operating 1275 system level name of the physical interface. 1277 An operator can configure a new interface by sending an 1278 containing: 1280 1281 eth8 1282 1284 When the server processes this request, it will set the leaf "type" 1285 to "ethernetCsmacd" and "location" to "eth8". Thus, if the client 1286 performs a right after the above, it will 1287 get: 1289 1290 eth8 1291 ethernetCsmacd 1292 eth8 1293 1295 If the client tries to change the location of this interface with an 1296 containing: 1298 1299 eth8 1300 eth7 1301 1303 then the server will reply with an "invalid-value" error, since the 1304 new location does not match the name. 1306 E.5. Generic Host with Arbitrary Interface Names 1308 In this example, a generic host has interfaces named by the kernel 1309 and without easily usable location information. The system 1310 identifies the physical interface by the name assigned by the 1311 operating system to the interface. 1313 The implementation does not restrict the interface name to the 1314 operating system level name of the physical interface. This allows 1315 to more easily apply the interface configuration to a different 1316 physical interface. However, the additional level of indirection 1317 also makes it a bit more complex to map interface names found in 1318 other protocols to configuration entries. 1320 An operator can configure a new interface by sending an 1321 containing: 1323 1324 acme-interface 1325 ethernetCsmacd 1326 eth4 1327 1329 If necessary, the operator can move the configuration named 1330 "acme-interface" over to a different physical interface with an 1331 containing: 1333 1334 acme-interface 1335 eth3 1336 1338 Appendix F. ChangeLog 1340 RFC Editor: remove this section upon publication as an RFC. 1342 F.1. Version -08 1344 o Removed the mtu leaf. 1346 o Added examples of different interface naming schemes. 1348 F.2. Version -07 1350 o Made leaf speed config false. 1352 F.3. Version -06 1354 o Added oper-status leaf. 1356 o Added leaf-lists higher-layer-if and lower-layer-if, that show the 1357 interface layering. 1359 o Added container statistics with counters. 1361 F.4. Version -05 1363 o Added an Informative References section. 1365 o Updated the Security Considerations section. 1367 o Clarified the behavior of an NETCONF server when invalid values 1368 are received. 1370 F.5. Version -04 1372 o Clarified why ifPromiscuousMode is not part of this data model. 1374 o Added a table that shows the mapping between this YANG data model 1375 and IF-MIB. 1377 F.6. Version -03 1379 o Added the section Relationship to the IF-MIB. 1381 o Changed if-index to be a leaf instead of leaf-list. 1383 o Explained the notation used in the data model tree picture. 1385 F.7. Version -02 1387 o Editorial fixes 1389 F.8. Version -01 1391 o Changed leaf "if-admin-status" to leaf "enabled". 1393 o Added Security Considerations 1395 Author's Address 1397 Martin Bjorklund 1398 Tail-f Systems 1400 Email: mbj@tail-f.com