idnits 2.17.1 draft-ietf-netmod-interfaces-cfg-06.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 (September 5, 2012) is 4241 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 September 5, 2012 5 Expires: March 9, 2013 7 A YANG Data Model for Interface Management 8 draft-ietf-netmod-interfaces-cfg-06 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 March 9, 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. ChangeLog . . . . . . . . . . . . . . . . . . . . . . 32 70 E.1. Version -06 . . . . . . . . . . . . . . . . . . . . . . . 32 71 E.2. Version -05 . . . . . . . . . . . . . . . . . . . . . . . 32 72 E.3. Version -04 . . . . . . . . . . . . . . . . . . . . . . . 32 73 E.4. Version -03 . . . . . . . . . . . . . . . . . . . . . . . 32 74 E.5. Version -02 . . . . . . . . . . . . . . . . . . . . . . . 32 75 E.6. Version -01 . . . . . . . . . . . . . . . . . . . . . . . 32 76 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 33 78 1. Introduction 80 This document defines a YANG [RFC6020] data model for the management 81 of network interfaces. It is expected that interface type specific 82 data models augment the generic interfaces data model defined in this 83 document. 85 Network interfaces are central to the management of many Internet 86 protocols. Thus, it is important to establish a common data model 87 for how interfaces are identified and configured. 89 1.1. Terminology 91 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 92 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 93 "OPTIONAL" in this document are to be interpreted as described in BCP 94 14, [RFC2119]. 96 The following terms are defined in [RFC6241] and are not redefined 97 here: 99 o client 101 o server 103 The following terms are defined in [RFC6020] and are not redefined 104 here: 106 o augment 108 o data model 110 o data node 112 2. Objectives 114 This section describes some of the design objectives for the model 115 presented in Section 5. 117 o It is recognized that existing implementations will have to map 118 the interface data model defined in this memo to their proprietary 119 native data model. The new data model should be simple to 120 facilitate such mappings. 122 o The data model should be suitable for new implementations to use 123 as-is, without requiring a mapping to a different native model. 125 o References to interfaces should be as simple as possible, 126 preferably by using a single leafref. 128 o The mapping to ifIndex [RFC2863] used by SNMP to identify 129 interfaces must be clear. 131 o The model must support interface layering, both simple layering 132 where one interface is layered on top of exactly one other 133 interface, and more complex scenarios where one interface is 134 aggregated over N other interfaces, or when N interfaces are 135 multiplexed over one other interface. 137 o The data model should support the pre-provisioning of interface 138 configuration, i.e., it should be possible to configure an 139 interface whose physical interface hardware is not present on the 140 device. It is recommended that devices that support dynamic 141 addition and removal of physical interfaces also support pre- 142 provisioning. 144 3. Interfaces Data Model 146 The data model in the module "ietf-interfaces" has the following 147 structure, where square brackets are used to enclose a list's keys, 148 "?" means that the leaf is optional, and "*" denotes a leaf-list: 150 +--rw interfaces 151 +--rw interface [name] 152 +--rw name string 153 +--rw description? string 154 +--rw type ianaift:iana-if-type 155 +--rw location? string 156 +--rw enabled? boolean 157 +--ro oper-status? enumeration 158 +--ro last-change? yang:date-and-time 159 +--ro if-index? int32 160 +--rw mtu? uint32 161 +--rw link-up-down-trap-enable? enumeration 162 +--ro phys-address? yang:phys-address 163 +--ro higher-layer-if* interface-ref 164 +--ro lower-layer-if* interface-ref 165 +--rw speed? yang:gauge64 166 +--ro statistics 167 +--ro discontinuity-time? yang:date-and-time 168 +--ro in-octets? yang:counter64 169 +--ro in-unicast-pkts? yang:counter64 170 +--ro in-broadcast-pkts? yang:counter64 171 +--ro in-multicast-pkts? yang:counter64 172 +--ro in-discards? yang:counter32 173 +--ro in-errors? yang:counter32 174 +--ro in-unknown-protos? yang:counter32 175 +--ro out-octets? yang:counter64 176 +--ro out-unicast-pkts? yang:counter64 177 +--ro out-broadcast-pkts? yang:counter64 178 +--ro out-multicast-pkts? yang:counter64 179 +--ro out-discards? yang:counter32 180 +--ro out-errors? yang:counter32 182 This module defines one YANG feature: 184 if-mib: Indicates that the server implements IF-MIB [RFC2863]. 186 3.1. The interface List 188 The data model for interfaces presented in this document uses a flat 189 list of interfaces. Each interface in the list is identified by its 190 name. Furthermore, each interface has a mandatory "type" leaf, and a 191 "location" leaf. The combination of "type" and "location" is unique 192 within the interface list. 194 It is expected that interface type specific data models augment the 195 interface list, and use the "type" leaf to make the augmentation 196 conditional. 198 As an example of such an interface type specific augmentation, 199 consider this YANG snippet. For a more complete example, see 200 Appendix A. 202 import interfaces { 203 prefix "if"; 204 } 206 augment "/if:interfaces/if:interface" { 207 when "if:type = 'ethernetCsmacd'"; 209 container ethernet { 210 leaf duplex { 211 ... 212 } 213 } 214 } 216 The "location" leaf is a string. It is optional in the data model, 217 but if the type represents a physical interface, it is mandatory. 218 The format of this string is device- and type-dependent. The device 219 uses the location string to identify the physical or logical entity 220 that the configuration applies to. For example, if a device has a 221 single array of 8 ethernet ports, the location can be one of the 222 strings "1" to "8". As another example, if a device has N cards of M 223 ports, the location can be on the form "n/m", such as "1/0". 225 How a client can learn which types and locations are present on a 226 certain device is outside the scope of this document. 228 3.2. Interface References 230 An interface is identified by its name, which is unique within the 231 server. This property is captured in the "interface-ref" typedef, 232 which other YANG modules SHOULD use when they need to reference an 233 existing interface. 235 3.3. Interface Layering 237 There is no generic mechanism for how an interface is configured to 238 be layered on top of some other interface. It is expected that 239 interface type specific models define their own data nodes for 240 interface layering, by using "interface-ref" types to reference lower 241 layers. 243 Below is an example of a model with such nodes. For a more complete 244 example, see Appendix B. 246 augment "/if:interfaces/if:interface" { 247 when "if:type = 'ieee8023adLag'"; 249 leaf-list slave-if { 250 type if:interface-ref; 251 must "/if:interfaces/if:interface[if:name = current()]" 252 + "/if:type = 'ethernetCsmacd'" { 253 description 254 "The type of a slave interface must be ethernet"; 255 } 256 } 257 // other bonding config params, failover times etc. 258 } 260 There are two state data leaf-list nodes "higher-layer-if" and 261 "lower-layer-if" defined, that contains a read-only view of the 262 interface layering hierarchy. 264 4. Relationship to the IF-MIB 266 If the device implements IF-MIB [RFC2863], each entry in the 267 "interface" list is typically mapped to one ifEntry. The "if-index" 268 leaf contains the value of the corresponding ifEntry's ifIndex. 270 In most cases, the "name" of an "interface" entry is mapped to 271 ifName. ifName is defined as an DisplayString [RFC2579] which uses a 272 7-bit ASCII character set. An implementation MAY restrict the 273 allowed values for "name" to match the restrictions of ifName. 275 The IF-MIB allows two different ifEntries to have the same ifName. 276 Devices that support this feature, and also support the configuration 277 of these interfaces using the "interface" list, cannot have a 1-1 278 mapping between the "name" leaf and ifName. 280 The IF-MIB also defines the writable object ifPromiscuousMode. Since 281 this object typically is not a configuration object, it is not mapped 282 to the "ietf-interfaces" module. 284 The following table lists the YANG data nodes with corresponding 285 objects in the IF-MIB. 287 +----------------------------------+------------------------+ 288 | YANG data node | IF-MIB object | 289 +----------------------------------+------------------------+ 290 | interface | ifEntry | 291 | name | ifName | 292 | description | ifAlias | 293 | type | ifType | 294 | enabled | ifAdminStatus | 295 | oper-status | ifOperStatus | 296 | last-change | ifLastChange | 297 | if-index | ifIndex | 298 | mtu | ifMtu | 299 | link-up-down-trap-enable | ifLinkUpDownTrapEnable | 300 | phys-address | ifPhysAddress | 301 | higher-layer-if / lower-layer-if | ifStackTable | 302 | speed | ifSpeed | 303 | in-octets | ifHCInOctets | 304 | in-unicast-pkts | ifHCInUcastPkts | 305 | in-broadcast-pkts | ifHCInBroadcastPkts | 306 | in-multicast-pkts | ifHCInMulticastPkts | 307 | in-discards | ifInDiscards | 308 | in-errors | ifInErrors | 309 | in-unknown-protos | ifInUnknownProtos | 310 | out-octets | ifHCOutOctets | 311 | out-unicast-pkts | ifHCOutUcastPkts | 312 | out-broadcast-pkts | ifHCOutBroadcastPkts | 313 | out-multicast-pkts | ifHCOutMulticastPkts | 314 | out-discards | ifOutDiscards | 315 | out-errors | ifOutErrors | 316 +----------------------------------+------------------------+ 318 Mapping of YANG data nodes to IF-MIB objects 320 5. Interfaces YANG Module 322 This YANG module imports a typedef from 323 [I-D.ietf-netmod-iana-if-type]. 325 RFC Ed.: update the date below with the date of RFC publication and 326 remove this note. 328 file "ietf-interfaces@2012-09-05.yang" 330 module ietf-interfaces { 332 namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces"; 333 prefix if; 335 import ietf-yang-types { 336 prefix yang; 337 } 338 import iana-if-type { 339 prefix ianaift; 340 } 342 organization 343 "IETF NETMOD (NETCONF Data Modeling Language) Working Group"; 345 contact 346 "WG Web: 347 WG List: 349 WG Chair: David Kessens 350 352 WG Chair: Juergen Schoenwaelder 353 355 Editor: Martin Bjorklund 356 "; 358 description 359 "This module contains a collection of YANG definitions for 360 managing network interfaces. 362 Copyright (c) 2012 IETF Trust and the persons identified as 363 authors of the code. All rights reserved. 365 Redistribution and use in source and binary forms, with or 366 without modification, is permitted pursuant to, and subject 367 to the license terms contained in, the Simplified BSD License 368 set forth in Section 4.c of the IETF Trust's Legal Provisions 369 Relating to IETF Documents 370 (http://trustee.ietf.org/license-info). 372 This version of this YANG module is part of RFC XXXX; see 373 the RFC itself for full legal notices."; 375 // RFC Ed.: replace XXXX with actual RFC number and remove this 376 // note. 378 // RFC Ed.: update the date below with the date of RFC publication 379 // and remove this note. 380 revision 2012-09-05 { 381 description 382 "Initial revision."; 383 reference 384 "RFC XXXX: A YANG Data Model for Interface Management"; 385 } 387 /* Typedefs */ 389 typedef interface-ref { 390 type leafref { 391 path "/if:interfaces/if:interface/if:name"; 392 } 393 description 394 "This type is used by data models that need to reference 395 interfaces."; 396 } 398 /* Features */ 400 feature if-mib { 401 description 402 "This feature indicates that the server implements IF-MIB."; 403 reference 404 "RFC 2863: The Interfaces Group MIB"; 405 } 407 /* Data nodes */ 409 container interfaces { 410 description 411 "Interface parameters."; 413 list interface { 414 key "name"; 415 unique "type location"; 416 description 417 "The list of interfaces on the device."; 419 leaf name { 420 type string; 421 description 422 "An arbitrary name for the interface. 424 A device MAY restrict the allowed values for this leaf, 425 possibly depending on the type and location. 427 For example, if a device has a single array of 8 ethernet 428 ports, the name might be restricted to be on the form 429 'ethN', where N is an integer between '1' and '8'. 431 This leaf MAY be mapped to ifName by an implementation. 432 Such an implementation MAY restrict the allowed values for 433 this leaf so that it matches the restrictions of ifName. 434 If a NETCONF server that implements this restriction is 435 sent a value that doesn't match the restriction, it MUST 436 reply with an rpc-error with the error-tag 437 'invalid-value'."; 438 reference 439 "RFC 2863: The Interfaces Group MIB - ifName"; 440 } 442 leaf description { 443 type string; 444 description 445 "A textual description of the interface. 447 This leaf MAY be mapped to ifAlias by an implementation. 448 Such an implementation MAY restrict the allowed values for 449 this leaf so that it matches the restrictions of ifAlias. 450 If a NETCONF server that implements this restriction is 451 sent a value that doesn't match the restriction, it MUST 452 reply with an rpc-error with the error-tag 453 'invalid-value'."; 454 reference 455 "RFC 2863: The Interfaces Group MIB - ifAlias"; 456 } 458 leaf type { 459 type ianaift:iana-if-type; 460 mandatory true; 461 description 462 "The type of the interface. 464 When an interface entry is created, a server MAY 465 initialize the type leaf with a valid value, e.g., if it 466 is possible to derive the type from the name of the 467 interface."; 468 reference 469 "RFC 2863: The Interfaces Group MIB - ifType"; 470 } 472 leaf location { 473 type string; 474 description 475 "The device-specific location of the interface of a 476 particular type. The format of the location string 477 depends on the interface type and the device. 479 If the interface's type represents a physical interface, 480 this leaf MUST be set. 482 For example, if a device has a single array of 8 ethernet 483 ports, the location can be one of '1' to '8'. As another 484 example, if a device has N cards of M ports, the location 485 can be on the form 'n/m'. 487 When an interface entry is created, a server MAY 488 initialize the location leaf with a valid value, e.g., if 489 it is possible to derive the location from the name of 490 the interface."; 491 } 493 leaf enabled { 494 type boolean; 495 default "true"; 496 description 497 "The desired state of the interface. 499 This leaf contains the configured, desired state of the 500 interface. Systems that implement the IF-MIB use the 501 value of this leaf to set IF-MIB.ifAdminStatus to 'up' or 502 'down' after an ifEntry has been initialized, as described 503 in RFC 2863."; 504 reference 505 "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; 506 } 508 leaf oper-status { 509 type enumeration { 510 enum up { 511 value 1; 512 description 513 "Ready to pass packets."; 514 } 515 enum down { 516 value 2; 517 } 518 enum testing { 519 value 3; 520 description 521 "In some test mode. No operational packets can 522 be passed."; 523 } 524 enum unknown { 525 value 4; 526 description 527 "Status can not be determined 528 for some reason."; 529 } 530 enum dormant { 531 value 5; 532 } 533 enum not-present { 534 value 6; 535 description 536 "Some component is missing."; 537 } 538 enum lower-layer-down { 539 value 7; 540 description 541 "Down due to state of lower-layer 542 interface(s)."; 543 } 544 } 545 config false; 546 description 547 "The current operational state of the interface. 549 If 'enabled' is 'false' then 'oper-status' 550 should be 'down'. If 'enabled' is changed to 'true' 551 then 'oper-status' should change to 'up' if the interface 552 is ready to transmit and receive network traffic; it 553 should change to 'dormant' if the interface is waiting for 554 external actions (such as a serial line waiting for an 555 incoming connection); it should remain in the 'down' state 556 if and only if there is a fault that prevents it from 557 going to the 'up' state; it should remain in the 558 'not-present' state if the interface has missing 559 (typically, hardware) components."; 561 reference 562 "RFC 2863: The Interfaces Group MIB - ifOperStatus"; 563 } 565 leaf last-change { 566 type yang:date-and-time; 567 config false; 568 description 569 "The time the interface entered its current operational 570 state. If the current state was entered prior to the 571 last re-initialization of the local network management 572 subsystem, then this node is not present."; 573 reference 574 "RFC 2863: The Interfaces Group MIB - ifLastChange"; 575 } 577 leaf if-index { 578 if-feature if-mib; 579 type int32 { 580 range "1..2147483647"; 581 } 582 config false; 583 description 584 "The ifIndex value for the ifEntry represented by this 585 interface. 587 Media-specific modules must specify how the type is 588 mapped to entries in the ifTable."; 589 reference 590 "RFC 2863: The Interfaces Group MIB - ifIndex"; 591 } 593 leaf mtu { 594 type uint32; 595 description 596 "The size, in octets, of the largest packet that the 597 interface can send and receive. This node might not be 598 valid for all interface types. 600 Media-specific modules must specify any restrictions on 601 the mtu for their interface type."; 602 reference 603 "RFC 2863: The Interfaces Group MIB - ifMtu"; 604 } 606 leaf link-up-down-trap-enable { 607 if-feature if-mib; 608 type enumeration { 609 enum enabled { 610 value 1; 611 } 612 enum disabled { 613 value 2; 614 } 615 } 616 description 617 "Indicates whether linkUp/linkDown SNMP notifications 618 should be generated for this interface. 620 If this node is not configured, the value 'enabled' is 621 operationally used by the server for interfaces which do 622 not operate on top of any other interface (i.e., there are 623 no 'lower-layer-if' entries), and 'disabled' otherwise."; 624 reference 625 "RFC 2863: The Interfaces Group MIB - 626 ifLinkUpDownTrapEnable"; 627 } 629 leaf phys-address { 630 type yang:phys-address; 631 config false; 632 description 633 "The interface's address at its protocol sub-layer. For 634 example, for an 802.x interface, this object normally 635 contains a MAC address. The interface's media-specific 636 modules must define the bit and byte ordering and the 637 format of the value of this object. For interfaces that do 638 not have such an address (e.g., a serial line), this node 639 is not present."; 640 reference 641 "RFC 2863: The Interfaces Group MIB - ifPhysAddress"; 642 } 644 leaf-list higher-layer-if { 645 type interface-ref; 646 config false; 647 description 648 "A list of references to interfaces layered on top of this 649 interface."; 650 reference 651 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 652 } 654 leaf-list lower-layer-if { 655 type interface-ref; 656 config false; 657 description 658 "A list of references to interfaces layered underneath this 659 interface."; 660 reference 661 "RFC 2863: The Interfaces Group MIB - ifStackTable"; 662 } 664 leaf speed { 665 type yang:gauge64; 666 units "bits / second"; 667 description 668 "An estimate of the interface's current bandwidth in bits 669 per second. For interfaces which do not vary in 670 bandwidth or for those where no accurate estimation can 671 be made, this node should contain the nominal bandwidth. 672 For interfaces that has no concept of bandwidth, this 673 node is not present."; 674 reference 675 "RFC 2863: The Interfaces Group MIB - 676 ifSpeed, ifHighSpeed"; 677 } 679 container statistics { 680 config false; 681 description 682 "A collection of interface-related statistics objects."; 684 leaf discontinuity-time { 685 type yang:date-and-time; 686 description 687 "The time on the most recent occasion at which any one or 688 more of this interface's counters suffered a 689 discontinuity. If no such discontinuities have occurred 690 since the last re-initialization of the local management 691 subsystem, then this node contains the time the local 692 management subsystem re-initialized itself."; 693 } 695 leaf in-octets { 696 type yang:counter64; 697 description 698 "The total number of octets received on the interface, 699 including framing characters. 701 Discontinuities in the value of this counter can occur 702 at re-initialization of the management system, and at 703 other times as indicated by the value of 704 'discontinuity-time'."; 706 reference 707 "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; 708 } 709 leaf in-unicast-pkts { 710 type yang:counter64; 711 description 712 "The number of packets, delivered by this sub-layer to a 713 higher (sub-)layer, which were not addressed to a 714 multicast or broadcast address at this sub-layer. 716 Discontinuities in the value of this counter can occur 717 at re-initialization of the management system, and at 718 other times as indicated by the value of 719 'discontinuity-time'."; 720 reference 721 "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; 722 } 723 leaf in-broadcast-pkts { 724 type yang:counter64; 725 description 726 "The number of packets, delivered by this sub-layer to a 727 higher (sub-)layer, which were addressed to a broadcast 728 address at this sub-layer. 730 Discontinuities in the value of this counter can occur 731 at re-initialization of the management system, and at 732 other times as indicated by the value of 733 'discontinuity-time'."; 734 reference 735 "RFC 2863: The Interfaces Group MIB - 736 ifHCInBroadcastPkts"; 737 } 738 leaf in-multicast-pkts { 739 type yang:counter64; 740 description 741 "The number of packets, delivered by this sub-layer to a 742 higher (sub-)layer, which were addressed to a multicast 743 address at this sub-layer. For a MAC layer protocol, 744 this includes both Group and Functional addresses. 746 Discontinuities in the value of this counter can occur 747 at re-initialization of the management system, and at 748 other times as indicated by the value of 749 'discontinuity-time'."; 750 reference 751 "RFC 2863: The Interfaces Group MIB - 752 ifHCInMulticastPkts"; 753 } 754 leaf in-discards { 755 type yang:counter32; 756 description 757 "The number of inbound packets which were chosen to be 758 discarded even though no errors had been detected to 759 prevent their being deliverable to a higher-layer 760 protocol. One possible reason for discarding such a 761 packet could be to free up buffer space. 763 Discontinuities in the value of this counter can occur 764 at re-initialization of the management system, and at 765 other times as indicated by the value of 766 'discontinuity-time'."; 767 reference 768 "RFC 2863: The Interfaces Group MIB - ifInDiscards"; 769 } 770 leaf in-errors { 771 type yang:counter32; 772 description 773 "For packet-oriented interfaces, the number of inbound 774 packets that contained errors preventing them from being 775 deliverable to a higher-layer protocol. For character- 776 oriented or fixed-length interfaces, the number of 777 inbound transmission units that contained errors 778 preventing them from being deliverable to a higher-layer 779 protocol. 781 Discontinuities in the value of this counter can occur 782 at re-initialization of the management system, and at 783 other times as indicated by the value of 784 'discontinuity-time'."; 785 reference 786 "RFC 2863: The Interfaces Group MIB - ifInErrors"; 787 } 788 leaf in-unknown-protos { 789 type yang:counter32; 790 description 791 "For packet-oriented interfaces, the number of packets 792 received via the interface which were discarded because 793 of an unknown or unsupported protocol. For 794 character-oriented or fixed-length interfaces that 795 support protocol multiplexing the number of transmission 796 units received via the interface which were discarded 797 because of an unknown or unsupported protocol. For any 798 interface that does not support protocol multiplexing, 799 this counter is not present. 801 Discontinuities in the value of this counter can occur 802 at re-initialization of the management system, and at 803 other times as indicated by the value of 804 'discontinuity-time'."; 805 reference 806 "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; 807 } 809 leaf out-octets { 810 type yang:counter64; 811 description 812 "The total number of octets transmitted out of the 813 interface, including framing characters. 815 Discontinuities in the value of this counter can occur 816 at re-initialization of the management system, and at 817 other times as indicated by the value of 818 'discontinuity-time'."; 819 reference 820 "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; 821 } 822 leaf out-unicast-pkts { 823 type yang:counter64; 824 description 825 "The total number of packets that higher-level protocols 826 requested be transmitted, and which were not addressed 827 to a multicast or broadcast address at this sub-layer, 828 including those that were discarded or not sent. 830 Discontinuities in the value of this counter can occur 831 at re-initialization of the management system, and at 832 other times as indicated by the value of 833 'discontinuity-time'."; 834 reference 835 "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; 836 } 837 leaf out-broadcast-pkts { 838 type yang:counter64; 839 description 840 "The total number of packets that higher-level protocols 841 requested be transmitted, and which were addressed to a 842 broadcast address at this sub-layer, including those 843 that were discarded or not sent. 845 Discontinuities in the value of this counter can occur 846 at re-initialization of the management system, and at 847 other times as indicated by the value of 848 'discontinuity-time'."; 849 reference 850 "RFC 2863: The Interfaces Group MIB - 851 ifHCOutBroadcastPkts"; 852 } 853 leaf out-multicast-pkts { 854 type yang:counter64; 855 description 856 "The total number of packets that higher-level protocols 857 requested be transmitted, and which were addressed to a 858 multicast address at this sub-layer, including those 859 that were discarded or not sent. For a MAC layer 860 protocol, this includes both Group and Functional 861 addresses. 863 Discontinuities in the value of this counter can occur 864 at re-initialization of the management system, and at 865 other times as indicated by the value of 866 'discontinuity-time'."; 867 reference 868 "RFC 2863: The Interfaces Group MIB - 869 ifHCOutMulticastPkts"; 870 } 871 leaf out-discards { 872 type yang:counter32; 873 description 874 "The number of outbound packets which were chosen to be 875 discarded even though no errors had been detected to 876 prevent their being transmitted. One possible reason 877 for discarding such a packet could be to free up buffer 878 space. 880 Discontinuities in the value of this counter can occur 881 at re-initialization of the management system, and at 882 other times as indicated by the value of 883 'discontinuity-time'."; 884 reference 885 "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; 886 } 887 leaf out-errors { 888 type yang:counter32; 889 description 890 "For packet-oriented interfaces, the number of outbound 891 packets that could not be transmitted because of errors. 892 For character-oriented or fixed-length interfaces, the 893 number of outbound transmission units that could not be 894 transmitted because of errors. 896 Discontinuities in the value of this counter can occur 897 at re-initialization of the management system, and at 898 other times as indicated by the value of 899 'discontinuity-time'."; 900 reference 901 "RFC 2863: The Interfaces Group MIB - ifOutErrors"; 902 } 903 } 904 } 905 } 906 } 908 910 6. IANA Considerations 912 This document registers a URI in the IETF XML registry [RFC3688]. 913 Following the format in RFC 3688, the following registration is 914 requested to be made. 916 URI: urn:ietf:params:xml:ns:yang:ietf-interfaces 918 Registrant Contact: The IESG. 920 XML: N/A, the requested URI is an XML namespace. 922 This document registers a YANG module in the YANG Module Names 923 registry [RFC6020]. 925 name: ietf-interfaces 926 namespace: urn:ietf:params:xml:ns:yang:ietf-interfaces 927 prefix: if 928 reference: RFC XXXX 930 7. Security Considerations 932 The YANG module defined in this memo is designed to be accessed via 933 the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the 934 secure transport layer and the mandatory-to-implement secure 935 transport is SSH [RFC6242]. 937 There are a number of data nodes defined in the YANG module which are 938 writable/creatable/deletable (i.e., config true, which is the 939 default). These data nodes may be considered sensitive or vulnerable 940 in some network environments. Write operations (e.g., ) 941 to these data nodes without proper protection can have a negative 942 effect on network operations. These are the subtrees and data nodes 943 and their sensitivity/vulnerability: 945 /interfaces/interface: This list specifies the configured interfaces 946 on a device. Unauthorized access to this list could cause the 947 device to ignore packets it should receive and process. 949 /interfaces/interface/enabled: This leaf controls if an interface is 950 enabled or not. Unauthorized access to this leaf could cause the 951 device to ignore packets it should receive and process. 953 /interfaces/interface/mtu: Setting this leaf to a very small value 954 can be used to slow down interfaces. 956 8. Acknowledgments 958 The author wishes to thank Alexander Clemm, Per Hedeland, Ladislav 959 Lhotka, and Juergen Schoenwaelder for their helpful comments. 961 9. References 963 9.1. Normative References 965 [I-D.ietf-netmod-iana-if-type] 966 Bjorklund, M., "IANA Interface Type and Address Family 967 YANG Modules", draft-ietf-netmod-iana-if-type-02 (work in 968 progress), April 2012. 970 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 971 Requirement Levels", BCP 14, RFC 2119, March 1997. 973 [RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group 974 MIB", RFC 2863, June 2000. 976 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 977 January 2004. 979 [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the 980 Network Configuration Protocol (NETCONF)", RFC 6020, 981 October 2010. 983 9.2. Informative References 985 [RFC2579] McCloghrie, K., Ed., Perkins, D., Ed., and J. 986 Schoenwaelder, Ed., "Textual Conventions for SMIv2", 987 STD 58, RFC 2579, April 1999. 989 [RFC6241] Enns, R., Bjorklund, M., Schoenwaelder, J., and A. 990 Bierman, "Network Configuration Protocol (NETCONF)", 991 RFC 6241, June 2011. 993 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 994 Shell (SSH)", RFC 6242, June 2011. 996 Appendix A. Example: Ethernet Interface Module 998 This section gives a simple example of how an Ethernet interface 999 module could be defined. It demonstrates how media-specific 1000 configuration parameters can be conditionally augmented to the 1001 generic interface list. It is not intended as a complete module for 1002 ethernet configuration. 1004 module ex-ethernet { 1005 namespace "http://example.com/ethernet"; 1006 prefix "eth"; 1008 import ietf-interfaces { 1009 prefix if; 1010 } 1012 augment "/if:interfaces/if:interface" { 1013 when "if:type = 'ethernetCsmacd'"; 1015 container ethernet { 1016 must "../if:location" { 1017 description 1018 "An ethernet interface must specify the physical location 1019 of the ethernet hardware."; 1020 } 1021 choice transmission-params { 1022 case auto { 1023 leaf auto-negotiate { 1024 type empty; 1025 } 1026 } 1027 case manual { 1028 leaf duplex { 1029 type enumeration { 1030 enum "half"; 1031 enum "full"; 1032 } 1033 } 1034 leaf speed { 1035 type enumeration { 1036 enum "10Mb"; 1037 enum "100Mb"; 1038 enum "1Gb"; 1039 enum "10Gb"; 1040 } 1041 } 1042 } 1043 } 1044 // other ethernet specific params... 1045 } 1046 } 1047 } 1049 Appendix B. Example: Ethernet Bonding Interface Module 1051 This section gives an example of how interface layering can be 1052 defined. An ethernet bonding interface is defined, which bonds 1053 several ethernet interfaces into one logical interface. 1055 module ex-ethernet-bonding { 1056 namespace "http://example.com/ethernet-bonding"; 1057 prefix "bond"; 1059 import ietf-interfaces { 1060 prefix if; 1061 } 1063 augment "/if:interfaces/if:interface" { 1064 when "if:type = 'ieee8023adLag'"; 1066 leaf-list slave-if { 1067 type if:interface-ref; 1068 must "/if:interfaces/if:interface[if:name = current()]" 1069 + "/if:type = 'ethernetCsmacd'" { 1070 description 1071 "The type of a slave interface must be ethernet."; 1072 } 1073 } 1074 leaf bonding-mode { 1075 type enumeration { 1076 enum round-robin; 1077 enum active-backup; 1078 enum broadcast; 1079 } 1080 } 1081 // other bonding config params, failover times etc. 1082 } 1083 } 1085 Appendix C. Example: VLAN Interface Module 1087 This section gives an example of how a vlan interface module can be 1088 defined. 1090 module ex-vlan { 1091 namespace "http://example.com/vlan"; 1092 prefix "vlan"; 1094 import ietf-interfaces { 1095 prefix if; 1096 } 1098 augment "/if:interfaces/if:interface" { 1099 when "if:type = 'ethernetCsmacd' or 1100 if:type = 'ieee8023adLag'"; 1101 leaf vlan-tagging { 1102 type boolean; 1103 default false; 1104 } 1105 } 1107 augment "/if:interfaces/if:interface" { 1108 when "if:type = 'l2vlan'"; 1110 leaf base-interface { 1111 type if:interface-ref; 1112 must "/if:interfaces/if:interface[if:name = current()]" 1113 + "/vlan:vlan-tagging = true" { 1114 description 1115 "The base interface must have vlan tagging enabled."; 1116 } 1117 } 1118 leaf vlan-id { 1119 type uint16 { 1120 range "1..4094"; 1121 } 1122 must "../base-interface" { 1123 description 1124 "If a vlan-id is defined, a base-interface must 1125 be specified."; 1126 } 1127 } 1128 } 1129 } 1131 Appendix D. Example: NETCONF reply 1133 This section gives an example of a reply to the NETCONF request 1134 for a device that implements the example data models above. 1136 1139 1140 1142 1143 eth0 1144 ethernetCsmacd 1145 0 1146 true 1147 2 1148 1149 1150 eth1 1151 ethernetCsmacd 1152 1 1153 true 1154 7 1155 true 1157 1158 1159 1160 1162 Appendix E. ChangeLog 1164 RFC Editor: remove this section upon publication as an RFC. 1166 E.1. Version -06 1168 o Added oper-status leaf. 1170 o Added leaf-lists higher-layer-if and lower-layer-if, that show the 1171 interface layering. 1173 o Added container statistics with counters. 1175 E.2. Version -05 1177 o Added an Informative References section. 1179 o Updated the Security Considerations section. 1181 o Clarified the behavior of an NETCONF server when invalid values 1182 are received. 1184 E.3. Version -04 1186 o Clarified why ifPromiscuousMode is not part of this data model. 1188 o Added a table that shows the mapping between this YANG data model 1189 and IF-MIB. 1191 E.4. Version -03 1193 o Added the section Relationship to the IF-MIB. 1195 o Changed if-index to be a leaf instead of leaf-list. 1197 o Explained the notation used in the data model tree picture. 1199 E.5. Version -02 1201 o Editorial fixes 1203 E.6. Version -01 1205 o Changed leaf "if-admin-status" to leaf "enabled". 1207 o Added Security Considerations 1209 Author's Address 1211 Martin Bjorklund 1212 Tail-f Systems 1214 Email: mbj@tail-f.com