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