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