Add supoprt for D release use-case.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / ietf-ip@2018-02-22.yang
1 module ietf-ip {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
4   prefix ip;
5
6   import ietf-interfaces {
7     prefix if;
8   }
9   import ietf-inet-types {
10     prefix inet;
11   }
12   import ietf-yang-types {
13     prefix yang;
14   }
15
16   organization
17     "IETF NETMOD (Network Modeling) Working Group";
18
19   contact
20     "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
21      WG List:  <mailto:netmod@ietf.org>
22      Editor:   Martin Bjorklund
23                <mailto:mbj@tail-f.com>";
24   description
25     "This module contains a collection of YANG definitions for
26      managing IP implementations.
27      Copyright (c) 2018 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      (https://trustee.ietf.org/license-info).
35      This version of this YANG module is part of RFC 8344; see
36      the RFC itself for full legal notices.";
37
38   revision 2018-02-22 {
39     description
40       "Updated to support NMDA.";
41     reference
42       "RFC 8344: A YANG Data Model for IP Management";
43   }
44
45   revision 2014-06-16 {
46     description
47       "Initial revision.";
48     reference
49       "RFC 7277: A YANG Data Model for IP Management";
50   }
51
52   /*
53    * Features
54    */
55
56   feature ipv4-non-contiguous-netmasks {
57     description
58       "Indicates support for configuring non-contiguous
59        subnet masks.";
60   }
61
62   feature ipv6-privacy-autoconf {
63     description
64       "Indicates support for privacy extensions for stateless address
65        autoconfiguration in IPv6.";
66     reference
67       "RFC 4941: Privacy Extensions for Stateless Address
68                  Autoconfiguration in IPv6";
69   }
70
71   /*
72    * Typedefs
73    */
74
75   typedef ip-address-origin {
76     type enumeration {
77       enum other {
78         description
79           "None of the following.";
80       }
81
82       enum static {
83         description
84           "Indicates that the address has been statically
85            configured -- for example, using the Network Configuration
86            Protocol (NETCONF) or a command line interface.";
87       }
88       enum dhcp {
89         description
90           "Indicates an address that has been assigned to this
91            system by a DHCP server.";
92       }
93       enum link-layer {
94         description
95           "Indicates an address created by IPv6 stateless
96            autoconfiguration that embeds a link-layer address in its
97            interface identifier.";
98       }
99       enum random {
100         description
101           "Indicates an address chosen by the system at
102            random, e.g., an IPv4 address within 169.254/16, a
103            temporary address as described in RFC 4941, or a
104            semantically opaque address as described in RFC 7217.";
105         reference
106           "RFC 4941: Privacy Extensions for Stateless Address
107                      Autoconfiguration in IPv6
108            RFC 7217: A Method for Generating Semantically Opaque
109                      Interface Identifiers with IPv6 Stateless
110                      Address Autoconfiguration (SLAAC)";
111       }
112     }
113     description
114       "The origin of an address.";
115   }
116
117   typedef neighbor-origin {
118     type enumeration {
119       enum other {
120         description
121           "None of the following.";
122       }
123       enum static {
124         description
125           "Indicates that the mapping has been statically
126            configured -- for example, using NETCONF or a command line
127            interface.";
128       }
129
130       enum dynamic {
131         description
132           "Indicates that the mapping has been dynamically resolved
133            using, for example, IPv4 ARP or the IPv6 Neighbor
134            Discovery protocol.";
135       }
136     }
137     description
138       "The origin of a neighbor entry.";
139   }
140
141   /*
142    * Data nodes
143    */
144
145   augment "/if:interfaces/if:interface" {
146     description
147       "IP parameters on interfaces.
148        If an interface is not capable of running IP, the server
149        must not allow the client to configure these parameters.";
150
151     container ipv4 {
152       presence
153         "Enables IPv4 unless the 'enabled' leaf
154          (which defaults to 'true') is set to 'false'";
155       description
156         "Parameters for the IPv4 address family.";
157
158       leaf enabled {
159         type boolean;
160         default true;
161         description
162           "Controls whether IPv4 is enabled or disabled on this
163            interface.  When IPv4 is enabled, this interface is
164            connected to an IPv4 stack, and the interface can send
165            and receive IPv4 packets.";
166       }
167       leaf forwarding {
168         type boolean;
169         default false;
170         description
171           "Controls IPv4 packet forwarding of datagrams received by,
172            but not addressed to, this interface.  IPv4 routers
173            forward datagrams.  IPv4 hosts do not (except those
174            source-routed via the host).";
175       }
176
177       leaf mtu {
178         type uint16 {
179           range "68..max";
180         }
181         units "octets";
182         description
183           "The size, in octets, of the largest IPv4 packet that the
184            interface will send and receive.
185            The server may restrict the allowed values for this leaf,
186            depending on the interface's type.
187            If this leaf is not configured, the operationally used MTU
188            depends on the interface's type.";
189         reference
190           "RFC 791: Internet Protocol";
191       }
192       list address {
193         key "ip";
194         description
195           "The list of IPv4 addresses on the interface.";
196
197         leaf ip {
198           type inet:ipv4-address-no-zone;
199           description
200             "The IPv4 address on the interface.";
201         }
202         choice subnet {
203           mandatory true;
204           description
205             "The subnet can be specified as a prefix length or,
206              if the server supports non-contiguous netmasks, as
207              a netmask.";
208           leaf prefix-length {
209             type uint8 {
210               range "0..32";
211             }
212             description
213               "The length of the subnet prefix.";
214           }
215           leaf netmask {
216             if-feature ipv4-non-contiguous-netmasks;
217             type yang:dotted-quad;
218             description
219               "The subnet specified as a netmask.";
220           }
221         }
222
223         leaf origin {
224           type ip-address-origin;
225           config false;
226           description
227             "The origin of this address.";
228         }
229       }
230       list neighbor {
231         key "ip";
232         description
233           "A list of mappings from IPv4 addresses to
234            link-layer addresses.
235            Entries in this list in the intended configuration are
236            used as static entries in the ARP Cache.
237            In the operational state, this list represents the ARP
238            Cache.";
239         reference
240           "RFC 826: An Ethernet Address Resolution Protocol";
241
242         leaf ip {
243           type inet:ipv4-address-no-zone;
244           description
245             "The IPv4 address of the neighbor node.";
246         }
247         leaf link-layer-address {
248           type yang:phys-address;
249           mandatory true;
250           description
251             "The link-layer address of the neighbor node.";
252         }
253         leaf origin {
254           type neighbor-origin;
255           config false;
256           description
257             "The origin of this neighbor entry.";
258         }
259       }
260     }
261
262     container ipv6 {
263       presence
264         "Enables IPv6 unless the 'enabled' leaf
265          (which defaults to 'true') is set to 'false'";
266       description
267         "Parameters for the IPv6 address family.";
268
269       leaf enabled {
270         type boolean;
271         default true;
272         description
273           "Controls whether IPv6 is enabled or disabled on this
274            interface.  When IPv6 is enabled, this interface is
275            connected to an IPv6 stack, and the interface can send
276            and receive IPv6 packets.";
277       }
278       leaf forwarding {
279         type boolean;
280         default false;
281         description
282           "Controls IPv6 packet forwarding of datagrams received by,
283            but not addressed to, this interface.  IPv6 routers
284            forward datagrams.  IPv6 hosts do not (except those
285            source-routed via the host).";
286         reference
287           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
288                      Section 6.2.1, IsRouter";
289       }
290       leaf mtu {
291         type uint32 {
292           range "1280..max";
293         }
294         units "octets";
295         description
296           "The size, in octets, of the largest IPv6 packet that the
297            interface will send and receive.
298            The server may restrict the allowed values for this leaf,
299            depending on the interface's type.
300            If this leaf is not configured, the operationally used MTU
301            depends on the interface's type.";
302         reference
303           "RFC 8200: Internet Protocol, Version 6 (IPv6)
304                      Specification
305                      Section 5";
306       }
307
308       list address {
309         key "ip";
310         description
311           "The list of IPv6 addresses on the interface.";
312
313         leaf ip {
314           type inet:ipv6-address-no-zone;
315           description
316             "The IPv6 address on the interface.";
317         }
318         leaf prefix-length {
319           type uint8 {
320             range "0..128";
321           }
322           mandatory true;
323           description
324             "The length of the subnet prefix.";
325         }
326         leaf origin {
327           type ip-address-origin;
328           config false;
329           description
330             "The origin of this address.";
331         }
332         leaf status {
333           type enumeration {
334             enum preferred {
335               description
336                 "This is a valid address that can appear as the
337                  destination or source address of a packet.";
338             }
339             enum deprecated {
340               description
341                 "This is a valid but deprecated address that should
342                  no longer be used as a source address in new
343                  communications, but packets addressed to such an
344                  address are processed as expected.";
345             }
346             enum invalid {
347               description
348                 "This isn't a valid address, and it shouldn't appear
349                  as the destination or source address of a packet.";
350             }
351
352             enum inaccessible {
353               description
354                 "The address is not accessible because the interface
355                  to which this address is assigned is not
356                  operational.";
357             }
358             enum unknown {
359               description
360                 "The status cannot be determined for some reason.";
361             }
362             enum tentative {
363               description
364                 "The uniqueness of the address on the link is being
365                  verified.  Addresses in this state should not be
366                  used for general communication and should only be
367                  used to determine the uniqueness of the address.";
368             }
369             enum duplicate {
370               description
371                 "The address has been determined to be non-unique on
372                  the link and so must not be used.";
373             }
374             enum optimistic {
375               description
376                 "The address is available for use, subject to
377                  restrictions, while its uniqueness on a link is
378                  being verified.";
379             }
380           }
381           config false;
382           description
383             "The status of an address.  Most of the states correspond
384              to states from the IPv6 Stateless Address
385              Autoconfiguration protocol.";
386           reference
387             "RFC 4293: Management Information Base for the
388                        Internet Protocol (IP)
389                        - IpAddressStatusTC
390              RFC 4862: IPv6 Stateless Address Autoconfiguration";
391         }
392       }
393
394       list neighbor {
395         key "ip";
396         description
397           "A list of mappings from IPv6 addresses to
398            link-layer addresses.
399            Entries in this list in the intended configuration are
400            used as static entries in the Neighbor Cache.
401            In the operational state, this list represents the
402            Neighbor Cache.";
403         reference
404           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
405
406         leaf ip {
407           type inet:ipv6-address-no-zone;
408           description
409             "The IPv6 address of the neighbor node.";
410         }
411         leaf link-layer-address {
412           type yang:phys-address;
413           mandatory true;
414           description
415             "The link-layer address of the neighbor node.
416              In the operational state, if the neighbor's 'state' leaf
417              is 'incomplete', this leaf is not instantiated.";
418         }
419         leaf origin {
420           type neighbor-origin;
421           config false;
422           description
423             "The origin of this neighbor entry.";
424         }
425         leaf is-router {
426           type empty;
427           config false;
428           description
429             "Indicates that the neighbor node acts as a router.";
430         }
431
432         leaf state {
433           type enumeration {
434             enum incomplete {
435               description
436                 "Address resolution is in progress, and the
437                  link-layer address of the neighbor has not yet been
438                  determined.";
439             }
440             enum reachable {
441               description
442                 "Roughly speaking, the neighbor is known to have been
443                  reachable recently (within tens of seconds ago).";
444             }
445             enum stale {
446               description
447                 "The neighbor is no longer known to be reachable, but
448                  until traffic is sent to the neighbor no attempt
449                  should be made to verify its reachability.";
450             }
451             enum delay {
452               description
453                 "The neighbor is no longer known to be reachable, and
454                  traffic has recently been sent to the neighbor.
455                  Rather than probe the neighbor immediately, however,
456                  delay sending probes for a short while in order to
457                  give upper-layer protocols a chance to provide
458                  reachability confirmation.";
459             }
460             enum probe {
461               description
462                 "The neighbor is no longer known to be reachable, and
463                  unicast Neighbor Solicitation probes are being sent
464                  to verify reachability.";
465             }
466           }
467           config false;
468           description
469             "The Neighbor Unreachability Detection state of this
470              entry.";
471           reference
472             "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
473                        Section 7.3.2";
474         }
475       }
476
477       leaf dup-addr-detect-transmits {
478         type uint32;
479         default 1;
480         description
481           "The number of consecutive Neighbor Solicitation messages
482            sent while performing Duplicate Address Detection on a
483            tentative address.  A value of zero indicates that
484            Duplicate Address Detection is not performed on
485            tentative addresses.  A value of one indicates a single
486            transmission with no follow-up retransmissions.";
487         reference
488           "RFC 4862: IPv6 Stateless Address Autoconfiguration";
489       }
490       container autoconf {
491         description
492           "Parameters to control the autoconfiguration of IPv6
493            addresses, as described in RFC 4862.";
494         reference
495           "RFC 4862: IPv6 Stateless Address Autoconfiguration";
496
497         leaf create-global-addresses {
498           type boolean;
499           default true;
500           description
501             "If enabled, the host creates global addresses as
502              described in RFC 4862.";
503           reference
504             "RFC 4862: IPv6 Stateless Address Autoconfiguration
505                        Section 5.5";
506         }
507         leaf create-temporary-addresses {
508           if-feature ipv6-privacy-autoconf;
509           type boolean;
510           default false;
511           description
512             "If enabled, the host creates temporary addresses as
513              described in RFC 4941.";
514           reference
515             "RFC 4941: Privacy Extensions for Stateless Address
516                        Autoconfiguration in IPv6";
517         }
518
519         leaf temporary-valid-lifetime {
520           if-feature ipv6-privacy-autoconf;
521           type uint32;
522           units "seconds";
523           default 604800;
524           description
525             "The time period during which the temporary address
526              is valid.";
527           reference
528             "RFC 4941: Privacy Extensions for Stateless Address
529                        Autoconfiguration in IPv6
530                        - TEMP_VALID_LIFETIME";
531         }
532         leaf temporary-preferred-lifetime {
533           if-feature ipv6-privacy-autoconf;
534           type uint32;
535           units "seconds";
536           default 86400;
537           description
538             "The time period during which the temporary address is
539              preferred.";
540           reference
541             "RFC 4941: Privacy Extensions for Stateless Address
542                        Autoconfiguration in IPv6
543                        - TEMP_PREFERRED_LIFETIME";
544         }
545       }
546     }
547   }
548
549   /*
550    * Legacy operational state data nodes
551    */
552
553   augment "/if:interfaces-state/if:interface" {
554     status deprecated;
555     description
556       "Data nodes for the operational state of IP on interfaces.";
557
558     container ipv4 {
559       presence
560         "Present if IPv4 is enabled on this interface";
561       config false;
562       status deprecated;
563       description
564         "Interface-specific parameters for the IPv4 address family.";
565
566       leaf forwarding {
567         type boolean;
568         status deprecated;
569         description
570           "Indicates whether IPv4 packet forwarding is enabled or
571            disabled on this interface.";
572       }
573       leaf mtu {
574         type uint16 {
575           range "68..max";
576         }
577         units "octets";
578         status deprecated;
579         description
580           "The size, in octets, of the largest IPv4 packet that the
581            interface will send and receive.";
582         reference
583           "RFC 791: Internet Protocol";
584       }
585       list address {
586         key "ip";
587         status deprecated;
588         description
589           "The list of IPv4 addresses on the interface.";
590
591         leaf ip {
592           type inet:ipv4-address-no-zone;
593           status deprecated;
594           description
595             "The IPv4 address on the interface.";
596         }
597         choice subnet {
598           status deprecated;
599           description
600             "The subnet can be specified as a prefix length or,
601              if the server supports non-contiguous netmasks, as
602              a netmask.";
603           leaf prefix-length {
604             type uint8 {
605               range "0..32";
606             }
607             status deprecated;
608             description
609               "The length of the subnet prefix.";
610           }
611           leaf netmask {
612             if-feature ipv4-non-contiguous-netmasks;
613             type yang:dotted-quad;
614             status deprecated;
615             description
616               "The subnet specified as a netmask.";
617           }
618         }
619         leaf origin {
620           type ip-address-origin;
621           status deprecated;
622           description
623             "The origin of this address.";
624         }
625       }
626       list neighbor {
627         key "ip";
628         status deprecated;
629         description
630           "A list of mappings from IPv4 addresses to
631            link-layer addresses.
632            This list represents the ARP Cache.";
633         reference
634           "RFC 826: An Ethernet Address Resolution Protocol";
635
636         leaf ip {
637           type inet:ipv4-address-no-zone;
638           status deprecated;
639           description
640             "The IPv4 address of the neighbor node.";
641         }
642
643         leaf link-layer-address {
644           type yang:phys-address;
645           status deprecated;
646           description
647             "The link-layer address of the neighbor node.";
648         }
649         leaf origin {
650           type neighbor-origin;
651           status deprecated;
652           description
653             "The origin of this neighbor entry.";
654         }
655       }
656     }
657
658     container ipv6 {
659       presence
660         "Present if IPv6 is enabled on this interface";
661       config false;
662       status deprecated;
663       description
664         "Parameters for the IPv6 address family.";
665
666       leaf forwarding {
667         type boolean;
668         default false;
669         status deprecated;
670         description
671           "Indicates whether IPv6 packet forwarding is enabled or
672            disabled on this interface.";
673         reference
674           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
675                      Section 6.2.1, IsRouter";
676       }
677       leaf mtu {
678         type uint32 {
679           range "1280..max";
680         }
681         units "octets";
682         status deprecated;
683         description
684           "The size, in octets, of the largest IPv6 packet that the
685            interface will send and receive.";
686         reference
687           "RFC 8200: Internet Protocol, Version 6 (IPv6)
688                      Specification
689                      Section 5";
690       }
691       list address {
692         key "ip";
693         status deprecated;
694         description
695           "The list of IPv6 addresses on the interface.";
696
697         leaf ip {
698           type inet:ipv6-address-no-zone;
699           status deprecated;
700           description
701             "The IPv6 address on the interface.";
702         }
703         leaf prefix-length {
704           type uint8 {
705             range "0..128";
706           }
707           mandatory true;
708           status deprecated;
709           description
710             "The length of the subnet prefix.";
711         }
712         leaf origin {
713           type ip-address-origin;
714           status deprecated;
715           description
716             "The origin of this address.";
717         }
718         leaf status {
719           type enumeration {
720             enum preferred {
721               description
722                 "This is a valid address that can appear as the
723                  destination or source address of a packet.";
724             }
725             enum deprecated {
726               description
727                 "This is a valid but deprecated address that should
728                  no longer be used as a source address in new
729                  communications, but packets addressed to such an
730                  address are processed as expected.";
731             }
732             enum invalid {
733               description
734                 "This isn't a valid address, and it shouldn't appear
735                  as the destination or source address of a packet.";
736             }
737
738             enum inaccessible {
739               description
740                 "The address is not accessible because the interface
741                  to which this address is assigned is not
742                  operational.";
743             }
744             enum unknown {
745               description
746                 "The status cannot be determined for some reason.";
747             }
748             enum tentative {
749               description
750                 "The uniqueness of the address on the link is being
751                  verified.  Addresses in this state should not be
752                  used for general communication and should only be
753                  used to determine the uniqueness of the address.";
754             }
755             enum duplicate {
756               description
757                 "The address has been determined to be non-unique on
758                  the link and so must not be used.";
759             }
760             enum optimistic {
761               description
762                 "The address is available for use, subject to
763                  restrictions, while its uniqueness on a link is
764                  being verified.";
765             }
766           }
767           status deprecated;
768           description
769             "The status of an address.  Most of the states correspond
770              to states from the IPv6 Stateless Address
771              Autoconfiguration protocol.";
772           reference
773             "RFC 4293: Management Information Base for the
774                        Internet Protocol (IP)
775                        - IpAddressStatusTC
776              RFC 4862: IPv6 Stateless Address Autoconfiguration";
777         }
778       }
779
780       list neighbor {
781         key "ip";
782         status deprecated;
783         description
784           "A list of mappings from IPv6 addresses to
785            link-layer addresses.
786            This list represents the Neighbor Cache.";
787         reference
788           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";
789
790         leaf ip {
791           type inet:ipv6-address-no-zone;
792           status deprecated;
793           description
794             "The IPv6 address of the neighbor node.";
795         }
796         leaf link-layer-address {
797           type yang:phys-address;
798           status deprecated;
799           description
800             "The link-layer address of the neighbor node.";
801         }
802         leaf origin {
803           type neighbor-origin;
804           status deprecated;
805           description
806             "The origin of this neighbor entry.";
807         }
808         leaf is-router {
809           type empty;
810           status deprecated;
811           description
812             "Indicates that the neighbor node acts as a router.";
813         }
814         leaf state {
815           type enumeration {
816             enum incomplete {
817               description
818                 "Address resolution is in progress, and the
819                  link-layer address of the neighbor has not yet been
820                  determined.";
821             }
822             enum reachable {
823               description
824                 "Roughly speaking, the neighbor is known to have been
825                  reachable recently (within tens of seconds ago).";
826             }
827             enum stale {
828               description
829                 "The neighbor is no longer known to be reachable, but
830                  until traffic is sent to the neighbor no attempt
831                  should be made to verify its reachability.";
832             }
833             enum delay {
834               description
835                 "The neighbor is no longer known to be reachable, and
836                  traffic has recently been sent to the neighbor.
837                  Rather than probe the neighbor immediately, however,
838                  delay sending probes for a short while in order to
839                  give upper-layer protocols a chance to provide
840                  reachability confirmation.";
841             }
842             enum probe {
843               description
844                 "The neighbor is no longer known to be reachable, and
845                  unicast Neighbor Solicitation probes are being sent
846                  to verify reachability.";
847             }
848           }
849           status deprecated;
850           description
851             "The Neighbor Unreachability Detection state of this
852              entry.";
853           reference
854             "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
855                        Section 7.3.2";
856         }
857       }
858     }
859   }
860 }