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