<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>

<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>

<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc rfcedstyle="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>

<rfc number="7277" category="std" submissionType="IETF" consensus="yes" ipr="trust200902">
   <front>
     <title abbrev="YANG IP Management">A YANG Data Model for IP Management</title>
  
     <author initials="M" surname="Bjorklund" fullname='Martin Bjorklund'>
     <organization>Tail-f Systems</organization>
  
     <address>
       <email>mbj@tail-f.com</email>
     </address>
   </author>

   <date month="June" year="2014" />

   <abstract>
<t>This document defines a YANG data model for management of IP
implementations.  The data model includes configuration data and state
data. </t>
   </abstract>
   </front>

<middle>

<section title="Introduction">

<t>This document defines a YANG <xref target="RFC6020"/> data model for
management of IP implementations.</t>

<t>The data model covers configuration of per-interface IPv4 and IPv6
parameters, and mappings of IP addresses to link-layer addresses.  It
also provides information about which IP addresses are operationally
used, and which link-layer mappings exist.  Per-interface parameters
are added through augmentation of the interface data model defined in
<xref target="RFC7223"/>. </t>

<section title="Terminology">

<t>The following terms are defined in <xref target="RFC6241"/> and are not
redefined here: </t>
<t>
<list style="symbols">
<t>
client
</t>
<t>
configuration data
</t>
<t>
server
</t>
<t>
state data
</t>
</list>
</t>
   <t>
The following terms are defined in <xref target="RFC6020"/> and are not
redefined
here:
   </t>
<t>
<list style="symbols">
<t>
augment
</t>
<t>
data model
</t>
<t>
data node
</t>
</list>
</t>
   <t>
The terminology for describing YANG data models is found in
<xref target="RFC6020"/>.
   </t>
</section>
<section title="Tree Diagrams">
   <t>
A simplified graphical representation of the data model is used in
this document.  The meaning of the symbols in these
diagrams is as follows:
   </t>
<t>
<list style="symbols">
<t>
Brackets &quot;[&quot; and &quot;]&quot; enclose list keys.
</t>
<t>
Abbreviations before data node names: &quot;rw&quot; means configuration
data (read-write), and &quot;ro&quot; means state data (read-only).
</t>
<t>
Symbols after data node names: &quot;?&quot; means an optional node,
&quot;!&quot; means
a presence container, and &quot;*&quot; denotes a list and leaf-list.
</t>
<t>
Parentheses enclose choice and case nodes, and case nodes are also
marked with a colon (&quot;:&quot;).
</t>
<t>
Ellipsis (&quot;...&quot;) stands for contents of subtrees that are not shown.
</t>
</list>
</t>
</section>
</section>
<section title="IP Data Model">
   <t>
This document defines the YANG module &quot;ietf&nbhy;ip&quot;, which
augments the &quot;interface&quot; and &quot;interface&nbhy;state&quot;
lists defined in the &quot;ietf&nbhy;interfaces&quot; module <xref
target="RFC7223"/> with IP-specific data nodes, and also adds IP-specific
state data.
   </t>
   <t>
The data model has the following structure for IP configuration per
interface:
   </t>
   <figure>
         <artwork><![CDATA[
  +--rw if:interfaces
     +--rw if:interface* [name]
        ...
        +--rw ipv4!
        |  +--rw enabled?            boolean
        |  +--rw forwarding?         boolean
        |  +--rw mtu?                uint16
        |  +--rw address* [ip]
        |  |  +--rw ip               inet:ipv4-address-no-zone
        |  |  +--rw (subnet)
        |  |     +--:(prefix-length)
        |  |     |  +--rw ip:prefix-length?   uint8
        |  |     +--:(netmask)
        |  |        +--rw ip:netmask?         yang:dotted-quad
        |  +--rw neighbor* [ip]
        |     +--rw ip                    inet:ipv4-address-no-zone
        |     +--rw link-layer-address    yang:phys-address
        +--rw ipv6!
           +--rw enabled?            boolean
           +--rw forwarding?         boolean
           +--rw mtu?                uint32
           +--rw address* [ip]
           |  +--rw ip               inet:ipv6-address-no-zone
           |  +--rw prefix-length    uint8
           +--rw neighbor* [ip]
           |  +--rw ip                    inet:ipv6-address-no-zone
           |  +--rw link-layer-address    yang:phys-address
           +--rw dup-addr-detect-transmits?   uint32
           +--rw autoconf
              +--rw create-global-addresses?        boolean
              +--rw create-temporary-addresses?     boolean
              +--rw temporary-valid-lifetime?       uint32
              +--rw temporary-preferred-lifetime?   uint32
	          ]]></artwork>
   </figure>
   <t>
The data model defines two configuration containers per interface --
&quot;ipv4&quot; and &quot;ipv6&quot;, representing the IPv4 and IPv6 address
families.
In each container, there is a leaf &quot;enabled&quot; that controls whether
or not the address family is enabled on that interface, and a leaf
&quot;forwarding&quot; that controls whether or not IP packet forwarding for the
address family is enabled on the interface.  In each container,
there is also a list of configured addresses, and a list of configured
mappings from IP addresses to link-layer addresses.
   </t>
   <t>
The data model has the following structure for IP state per
interface:
   </t>
   <figure>
         <artwork><![CDATA[
  +--ro if:interfaces-state
     +--ro if:interface* [name]
        ...
        +--ro ipv4!
        |  +--ro forwarding?   boolean
        |  +--ro mtu?          uint16
        |  +--ro address* [ip]
        |  |  +--ro ip               inet:ipv4-address-no-zone
        |  |  +--ro (subnet)?
        |  |  |  +--:(prefix-length)
        |  |  |  |  +--ro prefix-length?   uint8
        |  |  |  +--:(netmask)
        |  |  |     +--ro netmask?         yang:dotted-quad
        |  |  +--ro origin?          ip-address-origin
        |  +--ro neighbor* [ip]
        |     +--ro ip                    inet:ipv4-address-no-zone
        |     +--ro link-layer-address?   yang:phys-address
        |     +--ro origin?               neighbor-origin
        +--ro ipv6!
           +--ro forwarding?   boolean
           +--ro mtu?          uint32
           +--ro address* [ip]
           |  +--ro ip               inet:ipv6-address-no-zone
           |  +--ro prefix-length    uint8
           |  +--ro origin?          ip-address-origin
           |  +--ro status?          enumeration
           +--ro neighbor* [ip]
              +--ro ip                    inet:ipv6-address-no-zone
              +--ro link-layer-address?   yang:phys-address
              +--ro origin?               neighbor-origin
              +--ro is-router?            empty
              +--ro state?                enumeration
	          ]]></artwork>
   </figure>
   <t>
The data model defines two state containers per interface -- &quot;ipv4&quot;
and &quot;ipv6&quot;, representing the IPv4 and IPv6 address families.
In each container, there is a leaf &quot;forwarding&quot; that indicates
whether or not IP packet forwarding is enabled on that interface.  In each
container, there is also a list of all addresses in use and a list of
known mappings from IP addresses to link-layer addresses.
   </t>
 </section>
<section title="Relationship to the IP-MIB">
   <t>
If the device implements the IP-MIB <xref target="RFC4293"/>, each entry in the
&quot;ipv4/address&quot; and &quot;ipv6/address&quot; lists is mapped to one
ipAddressEntry, where the ipAddressIfIndex refers to the &quot;address&quot;
entry&apos;s interface.
   </t>
   <t>
The IP-MIB defines objects to control IPv6 Router Advertisement messages.
The corresponding YANG data nodes are defined
in <xref target="ROUTING-MGMT"/>.
   </t>
   <t>
The entries in &quot;ipv4/neighbor&quot; and &quot;ipv6/neighbor&quot; are
mapped to ipNetToPhysicalTable.
   </t>
   <t>
The following tables list the YANG data nodes with corresponding objects
in the IP-MIB.
   </t>

<?rfc compact="yes"?>
<texttable title="YANG Interface Configuration Data Nodes and Related IP-MIB
  Objects">
<ttcol align='left'>YANG data node in /if:interfaces/if:interface</ttcol>
<ttcol align='left'>IP-MIB object</ttcol>
<c>ipv4/enabled</c>
<c>ipv4InterfaceEnableStatus</c>
<c>ipv4/address</c>
<c>ipAddressEntry</c>
<c>ipv4/address/ip</c>
<c>ipAddressAddrType ipAddressAddr</c>
<c>ipv4/neighbor</c>
<c>ipNetToPhysicalEntry</c>
<c>ipv4/neighbor/ip</c>
<c>ipNetToPhysicalNetAddressType ipNetToPhysicalNetAddress</c>
<c>ipv4/neighbor/link-layer-address</c>
<c>ipNetToPhysicalPhysAddress</c>
<c></c><c></c>
<c>ipv6/enabled</c>
<c>ipv6InterfaceEnableStatus</c>
<c>ipv6/forwarding</c>
<c>ipv6InterfaceForwarding</c>
<c>ipv6/address</c>
<c>ipAddressEntry</c>
<c>ipv6/address/ip</c>
<c>ipAddressAddrType ipAddressAddr</c>
<c>ipv6/neighbor</c>
<c>ipNetToPhysicalEntry</c>
<c>ipv6/neighbor/link-layer-address</c>
<c>ipNetToPhysicalPhysAddress</c>
<c>ipv6/neighbor/origin</c>
<c>ipNetToPhysicalType</c>
</texttable>

<texttable title="YANG Interface State Data Nodes and Related IP-MIB Objects">
<ttcol align='left'>YANG data node in
/if:interfaces&nbhy;state/if:interface</ttcol>
<ttcol align='left'>IP-MIB object</ttcol>
<c>ipv4</c>
<c>ipv4InterfaceEnableStatus</c>
<c>ipv4/address</c>
<c>ipAddressEntry</c>
<c>ipv4/address/ip</c>
<c>ipAddressAddrType ipAddressAddr</c>
<c>ipv4/address/origin</c>
<c>ipAddressOrigin</c>
<c>ipv4/neighbor</c>
<c>ipNetToPhysicalEntry</c>
<c>ipv4/neighbor/ip</c>
<c>ipNetToPhysicalNetAddressType ipNetToPhysicalNetAddress</c>
<c>ipv4/neighbor/link-layer-address</c>
<c>ipNetToPhysicalPhysAddress</c>
<c>ipv4/neighbor/origin</c>
<c>ipNetToPhysicalType</c>
<c></c><c></c>
<c>ipv6</c>
<c>ipv6InterfaceEnableStatus</c>
<c>ipv6/forwarding</c>
<c>ipv6InterfaceForwarding</c>
<c>ipv6/address</c>
<c>ipAddressEntry</c>
<c>ipv6/address/ip</c>
<c>ipAddressAddrType ipAddressAddr</c>
<c>ipv6/address/origin</c>
<c>ipAddressOrigin</c>
<c>ipv6/address/status</c>
<c>ipAddressStatus</c>
<c>ipv6/neighbor</c>
<c>ipNetToPhysicalEntry</c>
<c>ipv6/neighbor/ip</c>
<c>ipNetToPhysicalNetAddressType ipNetToPhysicalNetAddress</c>
<c>ipv6/neighbor/link-layer-address</c>
<c>ipNetToPhysicalPhysAddress</c>
<c>ipv6/neighbor/origin</c>
<c>ipNetToPhysicalType</c>
<c>ipv6/neighbor/state</c>
<c>ipNetToPhysicalState</c>
</texttable>
<?rfc compact="no"?>
</section>

<section title="IP Management YANG Module" anchor="module">
   <t>
This module imports typedefs from <xref target="RFC6991"/> and
<xref target="RFC7223"/>, and it references
<xref target="RFC0791"/>, <xref target="RFC0826"/>,
<xref target="RFC2460"/>, <xref target="RFC4861"/>,
<xref target="RFC4862"/>, <xref target="RFC4941"/>, and
<xref target="RFC7217"/>.
   </t>

<t>&lt;CODE BEGINS> file "ietf-ip@2014-06-10.yang"</t>

<figure>
      <artwork><![CDATA[
module ietf-ip {

 namespace "urn:ietf:params:xml:ns:yang:ietf-ip";
 prefix ip;

 import ietf-interfaces {
   prefix if;
 }
 import ietf-inet-types {
   prefix inet;
 }
 import ietf-yang-types {
   prefix yang;
 }

 organization
   "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

 contact
   "WG Web:   <http://tools.ietf.org/wg/netmod/>
    WG List:  <mailto:netmod@ietf.org>

    WG Chair: Thomas Nadeau
              <mailto:tnadeau@lucidvision.com>

    WG Chair: Juergen Schoenwaelder
              <mailto:j.schoenwaelder@jacobs-university.de>

    Editor:   Martin Bjorklund
              <mailto:mbj@tail-f.com>";

 description
   "This module contains a collection of YANG definitions for
    configuring IP implementations.

    Copyright (c) 2014 IETF Trust and the persons identified as
    authors of the code.  All rights reserved.

    Redistribution and use in source and binary forms, with or
    without modification, is permitted pursuant to, and subject
    to the license terms contained in, the Simplified BSD License
    set forth in Section 4.c of the IETF Trust's Legal Provisions
    Relating to IETF Documents
    (http://trustee.ietf.org/license-info).

    This version of this YANG module is part of RFC 7277; see
    the RFC itself for full legal notices.";

 revision 2014-06-10 {
   description
     "Initial revision.";
   reference
     "RFC 7277: A YANG Data Model for IP Management";
 }

 /*
  * Features
  */

 feature ipv4-non-contiguous-netmasks {
   description
     "Indicates support for configuring non-contiguous
      subnet masks.";
 }

 feature ipv6-privacy-autoconf {
   description
     "Indicates support for Privacy Extensions for Stateless Address
      Autoconfiguration in IPv6.";
   reference
     "RFC 4941: Privacy Extensions for Stateless Address
                Autoconfiguration in IPv6";
 }

 /*
  * Typedefs
  */

 typedef ip-address-origin {
   type enumeration {
     enum other {
       description
         "None of the following.";
     }
     enum static {
       description
         "Indicates that the address has been statically
          configured - for example, using NETCONF or a Command Line
          Interface.";
     }
     enum dhcp {
       description
         "Indicates an address that has been assigned to this
          system by a DHCP server.";
     }
     enum link-layer {
       description
         "Indicates an address created by IPv6 stateless
          autoconfiguration that embeds a link-layer address in its
          interface identifier.";
     }
     enum random {
       description
         "Indicates an address chosen by the system at
          random, e.g., an IPv4 address within 169.254/16, an
          RFC 4941 temporary address, or an RFC 7217 semantically
          opaque address.";
       reference
         "RFC 4941: Privacy Extensions for Stateless Address
                    Autoconfiguration in IPv6
          RFC 7217: A Method for Generating Semantically Opaque
                    Interface Identifiers with IPv6 Stateless
                    Address Autoconfiguration (SLAAC)";
     }
   }
   description
     "The origin of an address.";
 }

 typedef neighbor-origin {
   type enumeration {
     enum other {
       description
         "None of the following.";
     }
     enum static {
       description
         "Indicates that the mapping has been statically
          configured - for example, using NETCONF or a Command Line
          Interface.";
     }
     enum dynamic {
       description
         "Indicates that the mapping has been dynamically resolved
          using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery
          protocol.";
     }
   }
   description
     "The origin of a neighbor entry.";
 }

 /*
  * Configuration data nodes
  */

 augment "/if:interfaces/if:interface" {
   description
     "Parameters for configuring IP on interfaces.

      If an interface is not capable of running IP, the server
      must not allow the client to configure these parameters.";

   container ipv4 {
     presence
       "Enables IPv4 unless the 'enabled' leaf
        (which defaults to 'true') is set to 'false'";
     description
       "Parameters for the IPv4 address family.";

     leaf enabled {
       type boolean;
       default true;
       description
         "Controls whether IPv4 is enabled or disabled on this
          interface.  When IPv4 is enabled, this interface is
          connected to an IPv4 stack, and the interface can send
          and receive IPv4 packets.";
     }
     leaf forwarding {
       type boolean;
       default false;
       description
         "Controls IPv4 packet forwarding of datagrams received by,
          but not addressed to, this interface.  IPv4 routers
          forward datagrams.  IPv4 hosts do not (except those
          source-routed via the host).";
     }
     leaf mtu {
       type uint16 {
         range "68..max";
       }
       units octets;
       description
         "The size, in octets, of the largest IPv4 packet that the
          interface will send and receive.

          The server may restrict the allowed values for this leaf,
          depending on the interface's type.

          If this leaf is not configured, the operationally used MTU
          depends on the interface's type.";
       reference
         "RFC 791: Internet Protocol";
     }
     list address {
       key "ip";
       description
         "The list of configured IPv4 addresses on the interface.";

       leaf ip {
         type inet:ipv4-address-no-zone;
         description
           "The IPv4 address on the interface.";
       }
       choice subnet {
         mandatory true;
         description
           "The subnet can be specified as a prefix-length, or,
            if the server supports non-contiguous netmasks, as
            a netmask.";
         leaf prefix-length {
           type uint8 {
             range "0..32";
           }
           description
             "The length of the subnet prefix.";
         }
         leaf netmask {
           if-feature ipv4-non-contiguous-netmasks;
           type yang:dotted-quad;
           description
             "The subnet specified as a netmask.";
         }
       }
     }
     list neighbor {
       key "ip";
       description
         "A list of mappings from IPv4 addresses to
          link-layer addresses.

          Entries in this list are used as static entries in the
          ARP Cache.";
       reference
         "RFC 826: An Ethernet Address Resolution Protocol";

       leaf ip {
         type inet:ipv4-address-no-zone;
         description
           "The IPv4 address of the neighbor node.";
       }
       leaf link-layer-address {
         type yang:phys-address;
         mandatory true;
         description
           "The link-layer address of the neighbor node.";
       }
     }

   }
   container ipv6 {
     presence
       "Enables IPv6 unless the 'enabled' leaf
        (which defaults to 'true') is set to 'false'";
     description
       "Parameters for the IPv6 address family.";

     leaf enabled {
       type boolean;
       default true;
       description
         "Controls whether IPv6 is enabled or disabled on this
          interface.  When IPv6 is enabled, this interface is
          connected to an IPv6 stack, and the interface can send
          and receive IPv6 packets.";
     }
     leaf forwarding {
       type boolean;
       default false;
       description
         "Controls IPv6 packet forwarding of datagrams received by,
          but not addressed to, this interface.  IPv6 routers
          forward datagrams.  IPv6 hosts do not (except those
          source-routed via the host).";
       reference
         "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                    Section 6.2.1, IsRouter";
     }
     leaf mtu {
       type uint32 {
         range "1280..max";
       }
       units octets;
       description
         "The size, in octets, of the largest IPv6 packet that the
          interface will send and receive.

          The server may restrict the allowed values for this leaf,
          depending on the interface's type.

          If this leaf is not configured, the operationally used MTU
          depends on the interface's type.";
       reference
         "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                    Section 5";
     }
     list address {
       key "ip";
       description
         "The list of configured IPv6 addresses on the interface.";

       leaf ip {
         type inet:ipv6-address-no-zone;
         description
           "The IPv6 address on the interface.";
       }
       leaf prefix-length {
         type uint8 {
           range "0..128";
         }
         mandatory true;
         description
           "The length of the subnet prefix.";
       }
     }
     list neighbor {
       key "ip";
       description
         "A list of mappings from IPv6 addresses to
          link-layer addresses.

          Entries in this list are used as static entries in the
          Neighbor Cache.";
       reference
         "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

       leaf ip {
         type inet:ipv6-address-no-zone;
         description
           "The IPv6 address of the neighbor node.";
       }
       leaf link-layer-address {
         type yang:phys-address;
         mandatory true;
         description
           "The link-layer address of the neighbor node.";
       }
     }
     leaf dup-addr-detect-transmits {
       type uint32;
       default 1;
       description
         "The number of consecutive Neighbor Solicitation messages
          sent while performing Duplicate Address Detection on a
          tentative address.  A value of zero indicates that
          Duplicate Address Detection is not performed on
          tentative addresses.  A value of one indicates a single
          transmission with no follow-up retransmissions.";
       reference
         "RFC 4862: IPv6 Stateless Address Autoconfiguration";
     }
     container autoconf {
       description
         "Parameters to control the autoconfiguration of IPv6
          addresses, as described in RFC 4862.";
       reference
         "RFC 4862: IPv6 Stateless Address Autoconfiguration";

       leaf create-global-addresses {
         type boolean;
         default true;
         description
           "If enabled, the host creates global addresses as
            described in RFC 4862.";
         reference
           "RFC 4862: IPv6 Stateless Address Autoconfiguration
                      Section 5.5";
       }
       leaf create-temporary-addresses {
         if-feature ipv6-privacy-autoconf;
         type boolean;
         default false;
         description
           "If enabled, the host creates temporary addresses as
            described in RFC 4941.";
         reference
           "RFC 4941: Privacy Extensions for Stateless Address
                      Autoconfiguration in IPv6";
       }
       leaf temporary-valid-lifetime {
         if-feature ipv6-privacy-autoconf;
         type uint32;
         units "seconds";
         default 604800;
         description
           "The time period during which the temporary address
            is valid.";
         reference
           "RFC 4941: Privacy Extensions for Stateless Address
                      Autoconfiguration in IPv6
                      - TEMP_VALID_LIFETIME";
       }
       leaf temporary-preferred-lifetime {
         if-feature ipv6-privacy-autoconf;
         type uint32;
         units "seconds";
         default 86400;
         description
           "The time period during which the temporary address is
            preferred.";
         reference
           "RFC 4941: Privacy Extensions for Stateless Address
                      Autoconfiguration in IPv6
                      - TEMP_PREFERRED_LIFETIME";
       }
     }
   }
 }

 /*
  * Operational state data nodes
  */

 augment "/if:interfaces-state/if:interface" {
   description
     "Data nodes for the operational state of IP on interfaces.";

   container ipv4 {
     presence "Present if IPv4 is enabled on this interface";
     config false;
     description
       "Interface-specific parameters for the IPv4 address family.";

     leaf forwarding {
       type boolean;
       description
         "Indicates whether IPv4 packet forwarding is enabled or
          disabled on this interface.";
     }
     leaf mtu {
       type uint16 {
         range "68..max";
       }
       units octets;
       description
         "The size, in octets, of the largest IPv4 packet that the
          interface will send and receive.";
       reference
         "RFC 791: Internet Protocol";
     }
     list address {
       key "ip";
       description
         "The list of IPv4 addresses on the interface.";

       leaf ip {
         type inet:ipv4-address-no-zone;
         description
           "The IPv4 address on the interface.";
       }
       choice subnet {
         description
           "The subnet can be specified as a prefix-length, or,
            if the server supports non-contiguous netmasks, as
            a netmask.";
         leaf prefix-length {
           type uint8 {
             range "0..32";
           }
           description
             "The length of the subnet prefix.";
         }
         leaf netmask {
           if-feature ipv4-non-contiguous-netmasks;
           type yang:dotted-quad;
           description
             "The subnet specified as a netmask.";
         }
       }
       leaf origin {
         type ip-address-origin;
         description
           "The origin of this address.";
       }
     }
     list neighbor {
       key "ip";
       description
         "A list of mappings from IPv4 addresses to
          link-layer addresses.

          This list represents the ARP Cache.";
       reference
         "RFC 826: An Ethernet Address Resolution Protocol";

       leaf ip {
         type inet:ipv4-address-no-zone;
         description
           "The IPv4 address of the neighbor node.";
       }
       leaf link-layer-address {
         type yang:phys-address;
         description
           "The link-layer address of the neighbor node.";
       }
       leaf origin {
         type neighbor-origin;
         description
           "The origin of this neighbor entry.";
       }
     }

   }

   container ipv6 {
     presence "Present if IPv6 is enabled on this interface";
     config false;
     description
       "Parameters for the IPv6 address family.";

     leaf forwarding {
       type boolean;
       default false;
       description
         "Indicates whether IPv6 packet forwarding is enabled or
          disabled on this interface.";
       reference
         "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                    Section 6.2.1, IsRouter";
     }
     leaf mtu {
       type uint32 {
         range "1280..max";
       }
       units octets;
       description
         "The size, in octets, of the largest IPv6 packet that the
          interface will send and receive.";
       reference
         "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
                    Section 5";
     }
     list address {
       key "ip";
       description
         "The list of IPv6 addresses on the interface.";

       leaf ip {
         type inet:ipv6-address-no-zone;
         description
           "The IPv6 address on the interface.";
       }
       leaf prefix-length {
         type uint8 {
           range "0..128";
         }
         mandatory true;
         description
           "The length of the subnet prefix.";
       }
       leaf origin {
         type ip-address-origin;
         description
           "The origin of this address.";
       }
       leaf status {
         type enumeration {
           enum preferred {
             description
               "This is a valid address that can appear as the
                destination or source address of a packet.";
           }
           enum deprecated {
             description
               "This is a valid but deprecated address that should
                no longer be used as a source address in new
                communications, but packets addressed to such an
                address are processed as expected.";
           }
           enum invalid {
             description
               "This isn't a valid address, and it shouldn't appear
                as the destination or source address of a packet.";
           }
           enum inaccessible {
             description
               "The address is not accessible because the interface
                to which this address is assigned is not
                operational.";
           }
           enum unknown {
             description
               "The status cannot be determined for some reason.";
           }
           enum tentative {
             description
               "The uniqueness of the address on the link is being
                verified.  Addresses in this state should not be
                used for general communication and should only be
                used to determine the uniqueness of the address.";
           }
           enum duplicate {
             description
               "The address has been determined to be non-unique on
                the link and so must not be used.";
           }
           enum optimistic {
             description
               "The address is available for use, subject to
                restrictions, while its uniqueness on a link is
                being verified.";
           }
         }
         description
           "The status of an address.  Most of the states correspond
            to states from the IPv6 Stateless Address
            Autoconfiguration protocol.";
         reference
           "RFC 4293: Management Information Base for the
                      Internet Protocol (IP)
                      - IpAddressStatusTC
            RFC 4862: IPv6 Stateless Address Autoconfiguration";
       }
     }
     list neighbor {
       key "ip";
       description
         "A list of mappings from IPv6 addresses to
          link-layer addresses.

          This list represents the Neighbor Cache.";
       reference
         "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)";

       leaf ip {
         type inet:ipv6-address-no-zone;
         description
           "The IPv6 address of the neighbor node.";
       }
       leaf link-layer-address {
         type yang:phys-address;
         description
           "The link-layer address of the neighbor node.";
       }
       leaf origin {
         type neighbor-origin;
         description
           "The origin of this neighbor entry.";
       }
       leaf is-router {
         type empty;
         description
           "Indicates that the neighbor node acts as a router.";
       }
       leaf state {
         type enumeration {
           enum incomplete {
             description
               "Address resolution is in progress, and the link-layer
                address of the neighbor has not yet been
                determined.";
           }
           enum reachable {
             description
               "Roughly speaking, the neighbor is known to have been
                reachable recently (within tens of seconds ago).";
           }
           enum stale {
             description
               "The neighbor is no longer known to be reachable, but
                until traffic is sent to the neighbor no attempt
                should be made to verify its reachability.";
           }
           enum delay {
             description
               "The neighbor is no longer known to be reachable, and
                traffic has recently been sent to the neighbor.
                Rather than probe the neighbor immediately, however,
                delay sending probes for a short while in order to
                give upper-layer protocols a chance to provide
                reachability confirmation.";
           }
           enum probe {
             description
               "The neighbor is no longer known to be reachable, and
                unicast Neighbor Solicitation probes are being sent
                to verify reachability.";
           }
         }
         description
           "The Neighbor Unreachability Detection state of this
            entry.";
         reference
           "RFC 4861: Neighbor Discovery for IP version 6 (IPv6)
                      Section 7.3.2";
       }
     }
   }
 }
}
    ]]></artwork>
    </figure>
<t>&lt;CODE ENDS></t>
</section>
<section title="IANA Considerations" anchor="iana">
   <t>
This document registers a URI in the "IETF XML Registry"
<xref target="RFC3688"/>. Following the format in RFC 3688, the following
registration has been made.
   </t>
   <figure>
         <artwork><![CDATA[
    URI: urn:ietf:params:xml:ns:yang:ietf-ip

    Registrant Contact: The NETMOD WG of the IETF.

    XML: N/A; the requested URI is an XML namespace.
        ]]></artwork>
   </figure>
   <t>
This document registers a YANG module in the "YANG Module Names"
registry <xref target="RFC6020"/>.
   </t>
   <figure>
         <artwork><![CDATA[
 Name:         ietf-ip
 Namespace:    urn:ietf:params:xml:ns:yang:ietf-ip
 Prefix:       ip
 Reference:    RFC 7277
     ]]></artwork>
   </figure>
</section>
<section title="Security Considerations">
   <t>
The YANG module defined in this memo is designed to be accessed via
the NETCONF protocol <xref target="RFC6241"/>.  The lowest NETCONF layer is
the secure transport layer and the mandatory-to-implement secure transport
is SSH <xref target="RFC6242"/>.  The NETCONF access control model <xref
target="RFC6536"/> provides the means to restrict access for particular
NETCONF users to a pre-configured subset of all available NETCONF
protocol operations and content.
   </t>
   <t>
There are a number of data nodes defined in the YANG module which are
writable/creatable/deletable (i.e., config true, which is the
default).  These data nodes may be considered sensitive or vulnerable
in some network environments.  Write operations (e.g., edit-config) to
these data nodes without proper protection can have a negative effect
on network operations.  These are the subtrees and data nodes and
their sensitivity/vulnerability:
   </t>

<t>
<list style="hanging">
  <t hangText="ipv4/enabled and ipv6/enabled:">
These leafs are used to enable or disable IPv4 and IPv6 on a specific
interface.  By enabling a protocol on an interface, an attacker might
be able to create an unsecured path into a node (or through it if
routing is also enabled).  By disabling a protocol on an interface, an
attacker might be able to force packets to be routed through some
other interface or deny access to some or all of the network via that
protocol.
  </t>

  <t hangText="ipv4/address and ipv6/address:">
These lists specify the configured IP addresses on an interface.  By
modifying this information, an attacker can cause a node to either
ignore messages destined to it or accept (at least at the IP layer)
messages it would otherwise ignore.  The use of filtering or security
associations may reduce the potential damage in the latter case.
  </t>

  <t hangText="ipv4/forwarding and ipv6/forwarding:">
These leafs allow a client to enable or disable the forwarding functions
on the entity.  By disabling the forwarding functions, an attacker would
possibly be able to deny service to users.  By enabling the forwarding
functions, an attacker could open a conduit into an area.  This might
result in the area providing transit for packets it shouldn&apos;t, or
it might allow the attacker access to the area, bypassing security
safeguards.
  </t>

  <t hangText="ipv6/autoconf:">
The leafs in this branch control the autoconfiguration
of IPv6 addresses and, in particular, whether or not temporary addresses are
used. By modifying the corresponding leafs, an attacker might
impact the addresses used by a node and thus indirectly the
privacy of the users using the node.
  </t>

  <t hangText="ipv4/mtu and ipv6/mtu:">
Setting these leafs to very small values can be used to slow down
interfaces.
  </t>
</list>
</t>
</section>

<section title="Acknowledgments">
   <t>
The author wishes to thank Jeffrey Lange, Ladislav Lhotka, Juergen
Schoenwaelder, and Dave Thaler for their helpful comments.
   </t>
</section>
</middle>

 <back>
  <references title="Normative References">
    <?rfc include="reference.RFC.0791.xml"?>

    <?rfc include="reference.RFC.2460.xml"?>

    <?rfc include="reference.RFC.3688.xml"?>

    <?rfc include="reference.RFC.4861.xml"?>

    <?rfc include="reference.RFC.4862.xml"?>

    <?rfc include="reference.RFC.4941.xml"?>

    <?rfc include="reference.RFC.6020.xml"?>

    <?rfc include="reference.RFC.6241.xml"?>

    <?rfc include="reference.RFC.6991.xml"?>

<!-- draft-ietf-netmod-interfaces-cfg (RFC 7223/publ. May 2014) -->
    <?rfc include="reference.RFC.7223.xml"?>

      <reference anchor="XML" target="http://www.w3.org/TR/xml/">
	<front>
          <title>Extensible Markup Language (XML) 1.0 (Fifth Edition)</title>
            <author initials="T." surname="Bray" fullname="Bray, T." />
            <author initials="J." surname="Paoli" fullname="Paoli, J." />
            <author initials="C." surname="Sperberg-McQueen"
		    fullname="Sperberg-McQueen, C." />
            <author initials="E." surname="Maler" fullname="Maler, E." />
            <author initials="F." surname="Yergeau" fullname="Yergeau, F." />
          <date month="November" year="2008" />
        </front>
        <seriesInfo name="W3C" value="Recommendation" />
      </reference>

  </references>


<references title="Informative References">

  <?rfc include="reference.RFC.0826.xml"?>

<!--draft-ietf-netmod-routing-cfg ("Submitted to IESG for Pub.") -->
  <reference anchor="ROUTING-MGMT">
    <front>
      <title>A YANG Data Model for Routing Management</title>
      <author initials="L" surname="Lhotka" fullname="Ladislav Lhotka">
	<organization/>
      </author>
      <date month="May" year="2014"/>
    </front>
    <seriesInfo name="Work in" value="Progress"/>
 </reference>

<?rfc include="reference.RFC.4293.xml"?> 

<?rfc include="reference.RFC.6242.xml"?> 

<?rfc include="reference.RFC.6536.xml"?> 

<!-- draft-ietf-6man-stable-privacy-addresses (RFC 7217/publ. April 2014) -->
<?rfc include="reference.RFC.7217.xml"?>

</references>

<section title="Example: NETCONF &lt;get&gt; Reply" anchor="get">

   <t>
This section gives an example of a reply to the NETCONF &lt;get&gt; request
for a device that implements the data model defined in this document.
The example is written in XML <xref target="XML"/>.
   </t>
   <figure>
         <artwork><![CDATA[
<rpc-reply
   xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
   message-id="101">
 <data>
   <interfaces
       xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
       xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
     <interface>
       <name>eth0</name>
       <type>ianaift:ethernetCsmacd</type>
       <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
         <address>
           <ip>192.0.2.1</ip>
           <prefix-length>24</prefix-length>
         </address>
       </ipv4>
       <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
         <mtu>1280</mtu>
         <address>
           <ip>2001:db8::10</ip>
           <prefix-length>32</prefix-length>
         </address>
         <dup-addr-detect-transmits>0</dup-addr-detect-transmits>
       </ipv6>
     </interface>
   </interfaces>

   <interfaces-state
       xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
       xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">
     <interface>
       <name>eth0</name>
       <type>ianaift:ethernetCsmacd</type>
       <!-- other parameters from ietf-interfaces omitted -->

       <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
         <forwarding>false</forwarding>
         <mtu>1500</mtu>
         <address>
           <ip>192.0.2.1</ip>
           <prefix-length>24</prefix-length>
           <origin>static</origin>
         </address>
         <neighbor>
           <ip>192.0.2.2</ip>
           <link-layer-address>00:01:02:03:04:05</link-layer-address>
         </neighbor>
       </ipv4>
       <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
         <forwarding>false</forwarding>
         <mtu>1500</mtu>
         <address>
           <ip>2001:db8::10</ip>
           <prefix-length>32</prefix-length>
           <origin>static</origin>
           <status>preferred</status>
         </address>
         <address>
           <ip>2001:db8::1:100</ip>
           <prefix-length>32</prefix-length>
           <origin>dhcp</origin>
           <status>preferred</status>
         </address>
         <neighbor>
           <ip>2001:db8::1</ip>
           <link-layer-address>00:01:02:03:04:05</link-layer-address>
           <origin>dynamic</origin>
           <is-router/>
           <state>reachable</state>
         </neighbor>
         <neighbor>
           <ip>2001:db8::4</ip>
           <origin>dynamic</origin>
           <state>incomplete</state>
         </neighbor>
       </ipv6>
     </interface>
   </interfaces-state>
 </data>
</rpc-reply>
    ]]></artwork>
   </figure>
 </section>
   </back>
</rfc>
