blob: d02aca2cc92bb8cafc715acc03eb161b111e8cd2 [file] [log] [blame]
Thomas Vachuska8ca75a22017-08-24 16:12:59 -07001module ietf-interfaces {
2
3 namespace "urn:ietf:params:xml:ns:yang:ietf-interfaces";
4 prefix if;
5
6 import ietf-yang-types {
7 prefix yang;
8 }
9
10 organization
11 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
12
13 contact
14 "WG Web: <http://tools.ietf.org/wg/netmod/>
15 WG List: <mailto:netmod@ietf.org>
16
17 WG Chair: Thomas Nadeau
18 <mailto:tnadeau@lucidvision.com>
19
20 WG Chair: Juergen Schoenwaelder
21 <mailto:j.schoenwaelder@jacobs-university.de>
22
23 Editor: Martin Bjorklund
24 <mailto:mbj@tail-f.com>";
25
26 description
27 "This module contains a collection of YANG definitions for
28 managing network interfaces.
29
30 Copyright (c) 2014 IETF Trust and the persons identified as
31 authors of the code. All rights reserved.
32
33 Redistribution and use in source and binary forms, with or
34 without modification, is permitted pursuant to, and subject
35 to the license terms contained in, the Simplified BSD License
36 set forth in Section 4.c of the IETF Trust's Legal Provisions
37 Relating to IETF Documents
38 (http://trustee.ietf.org/license-info).
39
40 This version of this YANG module is part of RFC 7223; see
41 the RFC itself for full legal notices.";
42
43 revision 2014-05-08 {
44 description
45 "Initial revision.";
46 reference
47 "RFC 7223: A YANG Data Model for Interface Management";
48 }
49
50 /*
51 * Typedefs
52 */
53
54 typedef interface-ref {
55 type leafref {
56 path "/if:interfaces/if:interface/if:name";
57 }
58 description
59 "This type is used by data models that need to reference
60 configured interfaces.";
61 }
62
63 typedef interface-state-ref {
64 type leafref {
65 path "/if:interfaces-state/if:interface/if:name";
66 }
67 description
68 "This type is used by data models that need to reference
69 the operationally present interfaces.";
70 }
71
72 /*
73 * Identities
74 */
75
76 identity interface-type {
77 description
78 "Base identity from which specific interface types are
79 derived.";
80 }
81
82 /*
83 * Features
84 */
85
86 feature arbitrary-names {
87 description
88 "This feature indicates that the device allows user-controlled
89 interfaces to be named arbitrarily.";
90 }
91
92
93 feature pre-provisioning {
94 description
95 "This feature indicates that the device supports
96 pre-provisioning of interface configuration, i.e., it is
97 possible to configure an interface whose physical interface
98 hardware is not present on the device.";
99 }
100
101 feature if-mib {
102 description
103 "This feature indicates that the device implements
104 the IF-MIB.";
105 reference
106 "RFC 2863: The Interfaces Group MIB";
107 }
108
109 /*
110 * Configuration data nodes
111 */
112
113 container interfaces {
114 description
115 "Interface configuration parameters.";
116
117 list interface {
118 key "name";
119
120 description
121 "The list of configured interfaces on the device.
122
123 The operational state of an interface is available in the
124 /interfaces-state/interface list. If the configuration of a
125 system-controlled interface cannot be used by the system
126 (e.g., the interface hardware present does not match the
127 interface type), then the configuration is not applied to
128 the system-controlled interface shown in the
129 /interfaces-state/interface list. If the configuration
130 of a user-controlled interface cannot be used by the system,
131 the configured interface is not instantiated in the
132 /interfaces-state/interface list.";
133
134 leaf name {
135 type string;
136 description
137 "The name of the interface.
138
139 A device MAY restrict the allowed values for this leaf,
140 possibly depending on the type of the interface.
141
142
143 For system-controlled interfaces, this leaf is the
144 device-specific name of the interface. The 'config false'
145 list /interfaces-state/interface contains the currently
146 existing interfaces on the device.
147
148 If a client tries to create configuration for a
149 system-controlled interface that is not present in the
150 /interfaces-state/interface list, the server MAY reject
151 the request if the implementation does not support
152 pre-provisioning of interfaces or if the name refers to
153 an interface that can never exist in the system. A
154 NETCONF server MUST reply with an rpc-error with the
155 error-tag 'invalid-value' in this case.
156
157 If the device supports pre-provisioning of interface
158 configuration, the 'pre-provisioning' feature is
159 advertised.
160
161 If the device allows arbitrarily named user-controlled
162 interfaces, the 'arbitrary-names' feature is advertised.
163
164 When a configured user-controlled interface is created by
165 the system, it is instantiated with the same name in the
166 /interface-state/interface list.";
167 }
168
169 leaf description {
170 type string;
171 description
172 "A textual description of the interface.
173
174 A server implementation MAY map this leaf to the ifAlias
175 MIB object. Such an implementation needs to use some
176 mechanism to handle the differences in size and characters
177 allowed between this leaf and ifAlias. The definition of
178 such a mechanism is outside the scope of this document.
179
180 Since ifAlias is defined to be stored in non-volatile
181 storage, the MIB implementation MUST map ifAlias to the
182 value of 'description' in the persistently stored
183 datastore.
184
185 Specifically, if the device supports ':startup', when
186 ifAlias is read the device MUST return the value of
187 'description' in the 'startup' datastore, and when it is
188 written, it MUST be written to the 'running' and 'startup'
189 datastores. Note that it is up to the implementation to
190
191 decide whether to modify this single leaf in 'startup' or
192 perform an implicit copy-config from 'running' to
193 'startup'.
194
195 If the device does not support ':startup', ifAlias MUST
196 be mapped to the 'description' leaf in the 'running'
197 datastore.";
198 reference
199 "RFC 2863: The Interfaces Group MIB - ifAlias";
200 }
201
202 leaf type {
203 type identityref {
204 base interface-type;
205 }
206 mandatory true;
207 description
208 "The type of the interface.
209
210 When an interface entry is created, a server MAY
211 initialize the type leaf with a valid value, e.g., if it
212 is possible to derive the type from the name of the
213 interface.
214
215 If a client tries to set the type of an interface to a
216 value that can never be used by the system, e.g., if the
217 type is not supported or if the type does not match the
218 name of the interface, the server MUST reject the request.
219 A NETCONF server MUST reply with an rpc-error with the
220 error-tag 'invalid-value' in this case.";
221 reference
222 "RFC 2863: The Interfaces Group MIB - ifType";
223 }
224
225 leaf enabled {
226 type boolean;
227 default "true";
228 description
229 "This leaf contains the configured, desired state of the
230 interface.
231
232 Systems that implement the IF-MIB use the value of this
233 leaf in the 'running' datastore to set
234 IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry
235 has been initialized, as described in RFC 2863.
236
237 Changes in this leaf in the 'running' datastore are
238 reflected in ifAdminStatus, but if ifAdminStatus is
239 changed over SNMP, this leaf is not affected.";
240 reference
241 "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
242 }
243
244 leaf link-up-down-trap-enable {
245 if-feature if-mib;
246 type enumeration {
247 enum enabled {
248 value 1;
249 }
250 enum disabled {
251 value 2;
252 }
253 }
254 description
255 "Controls whether linkUp/linkDown SNMP notifications
256 should be generated for this interface.
257
258 If this node is not configured, the value 'enabled' is
259 operationally used by the server for interfaces that do
260 not operate on top of any other interface (i.e., there are
261 no 'lower-layer-if' entries), and 'disabled' otherwise.";
262 reference
263 "RFC 2863: The Interfaces Group MIB -
264 ifLinkUpDownTrapEnable";
265 }
266 }
267 }
268
269 /*
270 * Operational state data nodes
271 */
272
273 container interfaces-state {
274 config false;
275 description
276 "Data nodes for the operational state of interfaces.";
277
278 list interface {
279 key "name";
280
281 description
282 "The list of interfaces on the device.
283
284 System-controlled interfaces created by the system are
285 always present in this list, whether they are configured or
286 not.";
287
288 leaf name {
289 type string;
290 description
291 "The name of the interface.
292
293 A server implementation MAY map this leaf to the ifName
294 MIB object. Such an implementation needs to use some
295 mechanism to handle the differences in size and characters
296 allowed between this leaf and ifName. The definition of
297 such a mechanism is outside the scope of this document.";
298 reference
299 "RFC 2863: The Interfaces Group MIB - ifName";
300 }
301
302 leaf type {
303 type identityref {
304 base interface-type;
305 }
306 mandatory true;
307 description
308 "The type of the interface.";
309 reference
310 "RFC 2863: The Interfaces Group MIB - ifType";
311 }
312
313 leaf admin-status {
314 if-feature if-mib;
315 type enumeration {
316 enum up {
317 value 1;
318 description
319 "Ready to pass packets.";
320 }
321 enum down {
322 value 2;
323 description
324 "Not ready to pass packets and not in some test mode.";
325 }
326
327 enum testing {
328 value 3;
329 description
330 "In some test mode.";
331 }
332 }
333 mandatory true;
334 description
335 "The desired state of the interface.
336
337 This leaf has the same read semantics as ifAdminStatus.";
338 reference
339 "RFC 2863: The Interfaces Group MIB - ifAdminStatus";
340 }
341
342 leaf oper-status {
343 type enumeration {
344 enum up {
345 value 1;
346 description
347 "Ready to pass packets.";
348 }
349 enum down {
350 value 2;
351 description
352 "The interface does not pass any packets.";
353 }
354 enum testing {
355 value 3;
356 description
357 "In some test mode. No operational packets can
358 be passed.";
359 }
360 enum unknown {
361 value 4;
362 description
363 "Status cannot be determined for some reason.";
364 }
365 enum dormant {
366 value 5;
367 description
368 "Waiting for some external event.";
369 }
370 enum not-present {
371 value 6;
372 description
373 "Some component (typically hardware) is missing.";
374 }
375
376 enum lower-layer-down {
377 value 7;
378 description
379 "Down due to state of lower-layer interface(s).";
380 }
381 }
382 mandatory true;
383 description
384 "The current operational state of the interface.
385
386 This leaf has the same semantics as ifOperStatus.";
387 reference
388 "RFC 2863: The Interfaces Group MIB - ifOperStatus";
389 }
390
391 leaf last-change {
392 type yang:date-and-time;
393 description
394 "The time the interface entered its current operational
395 state. If the current state was entered prior to the
396 last re-initialization of the local network management
397 subsystem, then this node is not present.";
398 reference
399 "RFC 2863: The Interfaces Group MIB - ifLastChange";
400 }
401
402 leaf if-index {
403 if-feature if-mib;
404 type int32 {
405 range "1..2147483647";
406 }
407 mandatory true;
408 description
409 "The ifIndex value for the ifEntry represented by this
410 interface.";
411 reference
412 "RFC 2863: The Interfaces Group MIB - ifIndex";
413 }
414
415 leaf phys-address {
416 type yang:phys-address;
417 description
418 "The interface's address at its protocol sub-layer. For
419 example, for an 802.x interface, this object normally
420 contains a Media Access Control (MAC) address. The
421 interface's media-specific modules must define the bit
422
423
424 and byte ordering and the format of the value of this
425 object. For interfaces that do not have such an address
426 (e.g., a serial line), this node is not present.";
427 reference
428 "RFC 2863: The Interfaces Group MIB - ifPhysAddress";
429 }
430
431 leaf-list higher-layer-if {
432 type interface-state-ref;
433 description
434 "A list of references to interfaces layered on top of this
435 interface.";
436 reference
437 "RFC 2863: The Interfaces Group MIB - ifStackTable";
438 }
439
440 leaf-list lower-layer-if {
441 type interface-state-ref;
442 description
443 "A list of references to interfaces layered underneath this
444 interface.";
445 reference
446 "RFC 2863: The Interfaces Group MIB - ifStackTable";
447 }
448
449 leaf speed {
450 type yang:gauge64;
451 units "bits/second";
452 description
453 "An estimate of the interface's current bandwidth in bits
454 per second. For interfaces that do not vary in
455 bandwidth or for those where no accurate estimation can
456 be made, this node should contain the nominal bandwidth.
457 For interfaces that have no concept of bandwidth, this
458 node is not present.";
459 reference
460 "RFC 2863: The Interfaces Group MIB -
461 ifSpeed, ifHighSpeed";
462 }
463
464
465 container statistics {
466 description
467 "A collection of interface-related statistics objects.";
468
469 leaf discontinuity-time {
470 type yang:date-and-time;
471 mandatory true;
472 description
473 "The time on the most recent occasion at which any one or
474 more of this interface's counters suffered a
475 discontinuity. If no such discontinuities have occurred
476 since the last re-initialization of the local management
477 subsystem, then this node contains the time the local
478 management subsystem re-initialized itself.";
479 }
480
481 leaf in-octets {
482 type yang:counter64;
483 description
484 "The total number of octets received on the interface,
485 including framing characters.
486
487 Discontinuities in the value of this counter can occur
488 at re-initialization of the management system, and at
489 other times as indicated by the value of
490 'discontinuity-time'.";
491 reference
492 "RFC 2863: The Interfaces Group MIB - ifHCInOctets";
493 }
494
495 leaf in-unicast-pkts {
496 type yang:counter64;
497 description
498 "The number of packets, delivered by this sub-layer to a
499 higher (sub-)layer, that were not addressed to a
500 multicast or broadcast address at this sub-layer.
501
502 Discontinuities in the value of this counter can occur
503 at re-initialization of the management system, and at
504 other times as indicated by the value of
505 'discontinuity-time'.";
506 reference
507 "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts";
508 }
509
510 leaf in-broadcast-pkts {
511 type yang:counter64;
512 description
513 "The number of packets, delivered by this sub-layer to a
514 higher (sub-)layer, that were addressed to a broadcast
515 address at this sub-layer.
516
517 Discontinuities in the value of this counter can occur
518 at re-initialization of the management system, and at
519 other times as indicated by the value of
520 'discontinuity-time'.";
521 reference
522 "RFC 2863: The Interfaces Group MIB -
523 ifHCInBroadcastPkts";
524 }
525
526 leaf in-multicast-pkts {
527 type yang:counter64;
528 description
529 "The number of packets, delivered by this sub-layer to a
530 higher (sub-)layer, that were addressed to a multicast
531 address at this sub-layer. For a MAC-layer protocol,
532 this includes both Group and Functional addresses.
533
534 Discontinuities in the value of this counter can occur
535 at re-initialization of the management system, and at
536 other times as indicated by the value of
537 'discontinuity-time'.";
538 reference
539 "RFC 2863: The Interfaces Group MIB -
540 ifHCInMulticastPkts";
541 }
542
543 leaf in-discards {
544 type yang:counter32;
545 description
546 "The number of inbound packets that were chosen to be
547 discarded even though no errors had been detected to
548 prevent their being deliverable to a higher-layer
549 protocol. One possible reason for discarding such a
550 packet could be to free up buffer space.
551
552 Discontinuities in the value of this counter can occur
553 at re-initialization of the management system, and at
554 other times as indicated by the value of
555 'discontinuity-time'.";
556
557 reference
558 "RFC 2863: The Interfaces Group MIB - ifInDiscards";
559 }
560
561 leaf in-errors {
562 type yang:counter32;
563 description
564 "For packet-oriented interfaces, the number of inbound
565 packets that contained errors preventing them from being
566 deliverable to a higher-layer protocol. For character-
567 oriented or fixed-length interfaces, the number of
568 inbound transmission units that contained errors
569 preventing them from being deliverable to a higher-layer
570 protocol.
571
572 Discontinuities in the value of this counter can occur
573 at re-initialization of the management system, and at
574 other times as indicated by the value of
575 'discontinuity-time'.";
576 reference
577 "RFC 2863: The Interfaces Group MIB - ifInErrors";
578 }
579
580 leaf in-unknown-protos {
581 type yang:counter32;
582 description
583 "For packet-oriented interfaces, the number of packets
584 received via the interface that were discarded because
585 of an unknown or unsupported protocol. For
586 character-oriented or fixed-length interfaces that
587 support protocol multiplexing, the number of
588 transmission units received via the interface that were
589 discarded because of an unknown or unsupported protocol.
590 For any interface that does not support protocol
591 multiplexing, this counter is not present.
592
593 Discontinuities in the value of this counter can occur
594 at re-initialization of the management system, and at
595 other times as indicated by the value of
596 'discontinuity-time'.";
597 reference
598 "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos";
599 }
600
601 leaf out-octets {
602 type yang:counter64;
603 description
604 "The total number of octets transmitted out of the
605 interface, including framing characters.
606
607 Discontinuities in the value of this counter can occur
608 at re-initialization of the management system, and at
609 other times as indicated by the value of
610 'discontinuity-time'.";
611 reference
612 "RFC 2863: The Interfaces Group MIB - ifHCOutOctets";
613 }
614
615 leaf out-unicast-pkts {
616 type yang:counter64;
617 description
618 "The total number of packets that higher-level protocols
619 requested be transmitted, and that were not addressed
620 to a multicast or broadcast address at this sub-layer,
621 including those that were discarded or not sent.
622
623 Discontinuities in the value of this counter can occur
624 at re-initialization of the management system, and at
625 other times as indicated by the value of
626 'discontinuity-time'.";
627 reference
628 "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts";
629 }
630
631 leaf out-broadcast-pkts {
632 type yang:counter64;
633 description
634 "The total number of packets that higher-level protocols
635 requested be transmitted, and that were addressed to a
636 broadcast address at this sub-layer, including those
637 that were discarded or not sent.
638
639 Discontinuities in the value of this counter can occur
640 at re-initialization of the management system, and at
641 other times as indicated by the value of
642 'discontinuity-time'.";
643 reference
644 "RFC 2863: The Interfaces Group MIB -
645 ifHCOutBroadcastPkts";
646 }
647
648 leaf out-multicast-pkts {
649 type yang:counter64;
650 description
651 "The total number of packets that higher-level protocols
652 requested be transmitted, and that were addressed to a
653 multicast address at this sub-layer, including those
654 that were discarded or not sent. For a MAC-layer
655 protocol, this includes both Group and Functional
656 addresses.
657
658 Discontinuities in the value of this counter can occur
659 at re-initialization of the management system, and at
660 other times as indicated by the value of
661 'discontinuity-time'.";
662 reference
663 "RFC 2863: The Interfaces Group MIB -
664 ifHCOutMulticastPkts";
665 }
666
667 leaf out-discards {
668 type yang:counter32;
669 description
670 "The number of outbound packets that were chosen to be
671 discarded even though no errors had been detected to
672 prevent their being transmitted. One possible reason
673 for discarding such a packet could be to free up buffer
674 space.
675
676 Discontinuities in the value of this counter can occur
677 at re-initialization of the management system, and at
678 other times as indicated by the value of
679 'discontinuity-time'.";
680 reference
681 "RFC 2863: The Interfaces Group MIB - ifOutDiscards";
682 }
683
684 leaf out-errors {
685 type yang:counter32;
686 description
687 "For packet-oriented interfaces, the number of outbound
688 packets that could not be transmitted because of errors.
689 For character-oriented or fixed-length interfaces, the
690 number of outbound transmission units that could not be
691 transmitted because of errors.
692
693 Discontinuities in the value of this counter can occur
694 at re-initialization of the management system, and at
695 other times as indicated by the value of
696 'discontinuity-time'.";
697 reference
698 "RFC 2863: The Interfaces Group MIB - ifOutErrors";
699 }
700 }
701 }
702 }
703 }