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