<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,               
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.             
    There has to be one entity for each item to be referenced.                    
    An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2697 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2697.xml">
<!ENTITY RFC2698 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2698.xml">
<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
]>
<rfc category="std" docName="draft-ietf-rtgwg-arp-yang-model-00"
     ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <!-- used by XSLT processors -->

  <!-- For a complete list and description of processing instructions (PIs),        
    please see http://xml.resource.org/authoring/README.html. -->

  <!-- Below are generally applicable Processing Instructions (PIs) that
    most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc
    v1.32) -->

  <?rfc strict="yes" ?>

  <!-- give errors regarding ID-nits and DTD validation -->

  <!-- control the table of contents (ToC) -->

  <?rfc toc="yes"?>

  <!-- generate a ToC -->

  <?rfc tocdepth="4"?>

  <?rfc compact="yes" ?>

  <front>
    <title abbrev="ARP YANG model">YANG Data Model for ARP</title>

    <author fullname="Xiaojian Ding" initials="X." surname="Ding">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>dingxiaojian1@huawei.com</email>
      </address>
    </author>

    <author fullname="Feng Zheng" initials="F." surname="Zheng">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>habby.zheng@huawei.com</email>
      </address>
    </author>

    <author fullname="Robert Wilton" initials="R" surname="Wilton">
      <organization>Cisco Systems</organization>

      <address>
        <email>rwilton@cisco.com</email>
      </address>
    </author>

    <date year="2018"/>
	
    <area>Routing Area</area>

    <workgroup>RTGWG</workgroup>

    <abstract>
      <t>This document defines a YANG data model to describe Address Resolution
	  Protocol (ARP) configurations. The data model performs as a guideline for
	  configuring ARP capabilities on a system. It is intended this model be
	  used by service providers who manipulate devices from different vendors
	  in a standard way.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">  
	  <t>This document defines a YANG [RFC7950] data model for Address Resolution
	  Protocol [RFC826] implementation and identification of some common properties
	  within a device. Devices have common properties that need to be configured
	  and monitored in a standard way. This document is intended to present universal
	  ARP protocol configuration and many vendors can implement it.
	  </t>

      <t>The data model convers configuration of system parameters of ARP, such as
	  static ARP entries, timeout for dynamic ARP entries, interface ARP, proxy ARP,
	  and so on. It also provides information about running state of ARP implementations.</t>

      <section title="Terminology">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14, [RFC2119].</t>

        <t>The following terms are defined in [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>
      </section>

      <section title="Tree Diagrams">
        <t>A simplified graphical representation of the data model is
        presented in Section 3.</t>

        <t><list style="symbols">
            <t>Brackets "[" and "]" enclose list keys.</t>

            <t>Abbreviations before data node names: "rw" means configuration
            (read-write) and "ro" state data (read-only).</t>

            <t>Symbols after data node names: "?" means an optional node, "!"
            means a presence container, and "*" denotes a list and
            leaf-list.</t>

            <t>Parentheses enclose choice and case nodes, and case nodes are
            also marked with a colon (":").</t>

            <t>Ellipsis ("...") stands for contents of subtrees that are not
            shown.</t>
          </list></t>
		  
	   <t>Tree diagrams used in this document use the notation defined in
	   [RFC8340].</t>

      </section>
    </section>

    <!-- intro -->

    <section anchor="problem" title="Problem Statement">
      <t>This document defines a YANG [RFC7950] configuration data model that
	  may be used to configure the ARP feature running on a system. Data model
	  "ietf-ip" [I-D.ietf-netmod-rfc7277bis] covers the address mapping
	  functionality. However, this functionality is strictly dependent on IPv4
	  networks, and many ARP related functionalities are missing, e.g. device
	  global ARP entries and control, configuration related to dynamic ARP
	  learning, proxy ARP, gratuitous ARP, etc. 	
	  </t>

      <t>The data model makes use of the YANG "feature" construct which allows
      implementations to support only those ARP features that lie within their
      capabilities. It is intended this model be used by service providers who
      manipulate devices from different vendors in a standard way.</t>

      <t>This model can be used to configure the ARP applications for
      discovering the link layer address associated with a given Internet
      layer address.</t>
    </section>

    <!-- problem -->

    <section anchor="design" title="Design of the Data Model">
      <t>This data model intends to describe the processing that a protocol
      finds the hardware address, also known as Media Access Control (MAC)
      address, of a host from its known IP address. These tasks include, but
      are not limited to, adding a static entry in the ARP cache, configuring
      dynamic ARP learning, proxy ARP, gratuitous ARP. There are two kind of 
	  ARP configurations: global ARP configuration, which is across all
	  interfaces on the device, and per interface ARP configuration. 
	  </t>

      <section title="ARP Caching">	  
      <t>ARP caching is the method of storing network addresses and the
	  associated data-link addresses in memory for a period of time as the
	  addresses are learned. This minimizes the use of valuable network 
	  resources to broadcast for the same address each time a datagram is sent. 
	  </t>	  
	  
      <t>There are static ARP cache entries and dynamic ARP cache entries.
	  Static entries are manually configured and kept in the cache table on a
	  permanent basis. Dynamic entries are added by vendor software, kept for
	  a period of time, and then removed. We can specify how long an entry
	  remains in the ARP cache. If we specify a timeout of 0 seconds, entries
	  are never cleared from the ARP cache. 
	  </t>	  	
	  </section>
	  
      <section title="proxy ARP">	  
      <t>Proxy ARP [RFC1027] can be configured to enable the switch to respond
	  to ARP queries for network addresses by offering its own Ethernet media
	  access control (MAC) address. With proxy ARP enabled, the switch captures
	  and routes traffic to the intended destination. 
	  </t>
	  </section>
	  
      <section title="gratuitous ARP">	  
      <t>Gratuitous ARP requests help detect duplicate IP addresses. A gratuitous
	  ARP is a broadcast request for a router&apos;s own IP address. If a router or
	  switch sends an ARP request for its own IP address and no ARP replies are
	  received, the router- or switch-assigned IP address is not being used by
	  other nodes. However, if a router or switch sends an ARP request for its
	  own IP address and an ARP reply is received, the router- or switch-assigned
	  IP address is already being used by another node.
	  </t>
	  </section>
	  
	  
      <section title="ietf-arp Module ">
      <t>This module has one top level container, ARP, which consists of
	  two second level containers, which are used for static entries configuration and
	  global parameters control.
	  </t>

        <figure>
          <artwork><![CDATA[
module: ietf-arp
    +--rw arp
       +--rw global-static-entries {global-static-entries}?
       |  +--rw static-entry* [ip-address]
       |     +--rw ip-address     inet:ipv4-address-no-zone
       |     +--rw mac-address    yang:mac-address
       +--rw global-control
          +--rw enable-learning?      boolean
          +--rw enable-proxy?         boolean
augment /if:interfaces/if:interface:
    +--rw arp-dynamic-learning
       +--rw expire-time?     uint32
       +--rw learn-disable?   boolean
       +--rw proxy   
       |  +--rw mode          enumeration
       +--rw probe
       |  +--rw interval?   uint8
       |  +--rw times?      uint8
       |  +--rw unicast?    boolean
       +--rw gratuitous
       |  +--rw gratuitous-enable?   boolean
       |  +--rw interval?            uint32
       |  +--rw drop?                boolean
       +--ro statistics
          +--ro in-requests-pkts?      uint16
          +--ro in-replies-pkts?       uint16
          +--ro in-gratuitous-pkts?    uint16
          +--ro out-requests-pkts?     uint16
          +--ro out-replies-pkts?      uint16
          +--ro out-gratuitous-pkts?   uint16
  augment /if:interfaces/if:interface/ip:ipv4/ip:neighbor:
    +--ro remaining-expire-time?   uint32
		  
		  ]]></artwork>
        </figure>
      </section>

    </section>

    <section anchor="yangmodel" title="ARP YANG Module">
      <t>This section presents the ARP YANG module defined in this document.
      This YANG module imports typedefs from [RFC6991].</t>

      <figure>
        <artwork><![CDATA[
<CODE BEGINS>file "ietf-arp@2018-01-27.yang"		
	
module ietf-arp {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-arp";
  prefix arp;

  import ietf-inet-types {
    prefix inet;
        reference "RFC 6991: INET Types Model";
  }

  import ietf-yang-types {
    prefix yang;
        reference "RFC 6991: yang Types Model";
  }
  
  import ietf-interfaces {
    prefix if;
    description
      "A Network Management Datastore Architecture (NMDA)
       compatible version of the ietf-interfaces module
       is required.";
  }
  import ietf-ip {
    prefix ip;
    description
      "A Network Management Datastore Architecture (NMDA)
       compatible version of the ietf-ip module is
       required.";
  }  

  organization
    "IETF Routing Area Working Group (rtgwg)";
  contact
    "WG Web: <http://tools.ietf.org/wg/rtgwg/>
     WG List: <mailto: rtgwg@ietf.org>
     Editor: Xiaojian Ding
         dingxiaojian1@huawei.com
     Editor: Feng Zheng
         habby.zheng@huawei.com
     Editor: Robert Wilton
         rwilton@cisco.com";
  description
    "Address Resolution Protocol (ARP) management, which includes
     static ARP configuration, dynamic ARP learning, ARP entry query,
     and packet statistics collection.";

  revision 2018-01-27 {
    description
      "Init revision";
          NOTE TO RFC EDITOR:
      Please replace the following reference
      to draft-ding-rtgwg-arp-yang-model-02 with
      RFC number when published (i.e. RFC xxxx).
    reference
         "draft-ding-rtgwg-arp-yang-model-02";
  }
  
      /*
      * Features
      */
  
    feature global-static-entries {
    description
      "This feature indicates that the device allows static entries
       to be configured globally.";
  }

  
  container arp {
    description
      "Address Resolution Protocol (ARP) management, which includes
        static ARP configuration, dynamic ARP learning, ARP entry
        query, and packet statistics collection.";
		
    container global-static-entries {
      if-feature "global-static-entries";
      description
        "Set a global static ARP entry, which is independent of the interface.";
      list static-entry {
        key "ip-address";
        description
          "List of ARP static entries that can be configured globally.";
        leaf ip-address {
          type inet:ipv4-address-no-zone;
          description
            "IP address, in dotted decimal notation.";
        }
        leaf mac-address {
          type yang:mac-address;
          mandatory true;
          description
            "MAC address in the format of H-H-H, in which H is
                        a hexadecimal number of 1 to 4 bits.";
        }
      }
    }
	
    container global-control {
      description
        "Set global control parameters, which are independent of interface.";
        leaf enable-learning {
          type boolean;
		  default "true";
          description
            "Enables or disables global dynamic ARP learning.
			If 'true', then enforcement is enabled.
			If 'false', then enforcement is disabled.";
        }
        leaf enable-proxy {
          type boolean;
          default "true";
          description
            "Enables or disables global proxy.
			If 'true', then proxy is enabled.
			If 'false', then proxy is disabled.";
        }
    }	
	
   augment "/if:interfaces/if:interface" {
    description
      "Augment interface configuration with parameters of ARP.";
    container arp-dynamic-learning {
      description
        "Support for ARP configuration on interfaces.";
      leaf expire-time {
        type timeticks {
          range "60..86400";
        }
        units "second";
        description
          "Aging time of a dynamic ARP entry.";
      }
      leaf learn-disable {
        type boolean;
        default "false";
        description
          "Whether dynamic ARP learning is disabled on an interface.
		  If the value is True, dynamic ARP learning is disabled.
		  If the value is False, dynamic ARP learning is enabled.";
      }
	  
      container proxy {
        description
          "Configuration parameters for proxy ARP";
		leaf mode {
		  type enumeration {
			enum DISABLE {
			  description
				"The system should not respond to ARP requests that
				do not specify an IP address configured on the local
				subinterface as the target address.";
			}
			enum REMOTE_ONLY {
			  description
				"The system responds to ARP requests only when the
				sender and target IP addresses are in different
				subnets.";
			}
			enum ALL {
			  description
				"The system responds to ARP requests where the sender
				and target IP addresses are in different subnets, as well
				as those where they are in the same subnet.";
			}
		  }
		  default "DISABLE";
		  description
			"When set to a value other than DISABLE, the local system should
			respond to ARP requests that are for target addresses other than
			those that are configured on the local subinterface using its own
			MAC address as the target hardware address. If the REMOTE_ONLY
			value is specified, replies are only sent when the target address
			falls outside the locally configured subnets on the interface,
			whereas with the ALL value, all requests, regardless of their
			target address are replied to.";
		  reference "RFC1027: Using ARP to Implement Transparent Subnet Gateways";
       }	  
      }	  
 
      container probe {
        description
          "Common configuration parameters for all ARP probe.";
        leaf interval {
          type uint8 {
            range "1..5";
          }
          units "second";
          description
            "Interval for detecting dynamic ARP entries.";
        }
        leaf times {
          type uint8 {
            range "0..10";
          }
          description
            "Number of aging probe attempts for a dynamic ARP entry.
             If a device does not receive an ARP reply message after
             the number of aging probe attempts reaches a specified
             number,thedynamic ARP entry is deleted.";
        }
        leaf unicast {
          type boolean;
          default "false";
          description
            "Send unicast ARP aging probe messages for a dynamic ARP
             entry.";
        }
      }
	  
      container gratuitous {
        description
          "Configure gratuitous ARP.";
        leaf enable {
          type boolean;
          default "false";
          description
            "Enable or disable sending gratuitous-arp packet on
             interface.";
        }
        leaf interval {
          type uint32 {
            range "1..86400";
          }
          units "second";
          description
            "The interval of sending gratuitous-arp packet on the
             interface.";
        }
        leaf drop {
          type boolean;
          default "false";
          description
            "Drop the receipt of gratuitous ARP packets on the interface.";
        }
      }
	  
      container statistics {
        config false;
        description
          "IP ARP Statistics information on interfaces";
        leaf in-requests-pkts {
          type uint16;
          description
            "Total ARP requests received";
        }
        leaf in-replies-pkts {
          type uint16;
          description
            "Total ARP replies received";
        }
        leaf in-gratuitous-pkts {
          type uint16;
          description
            "Total gratuitous ARP received";
        }
        leaf out-requests-pkts {
          type uint16;
          description
            "Total ARP requests sent";
        }
        leaf out-replies-pkts {
          type uint16;
          description
            "Total ARP replies sent";
        }
        leaf out-gratuitous-pkts {
          type uint16;
          description
            "Total gratuitous ARP sent";
        }
      }
    }
  }		  
			
	
  augment "/if:interfaces/if:interface/ip:ipv4/ip:neighbor" {
    description
      "Augment neighbor list with parameters of ARP,
       eg., support for remaining expire time query on interfaces.";
    leaf remaining-expire-time {
      type uint32;
      config false;
      description
        "Remaining expire time of a dynamic ARP entry. ";
    }
   }
  }
  
}	
	
]]></artwork>
      </figure>

    </section>

    <!---->

    <section anchor="datamodel" title="Data Model Examples">
      <t>This section presents a simple but complete example of configuring
      static ARP entries and dynamic learning, based on the YANG modules
      specified in Section 4.</t>

      <section title="Static ARP Entries">
        <figure>
          <artwork>  
Requirement:
Enable static ARP entry global configuration (not rely on interface).
   &lt;config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;arp xmlns="urn:ietf:params:xml:ns:yang:ietf-arp"&gt;
         &lt;static-tables&gt;      
    &lt;ip-address&gt; 10.2.2.3 &lt;/ip-address&gt;
    &lt;mac-address&gt; 00e0-fc01-0000 &lt;/mac-address&gt;
     &lt;/static-tables&gt;
      &lt;/arp&gt;
 
      </artwork>
        </figure>

        <figure>
          <artwork>  
Requirement:
Enable static ARP entry configuration on interface (defined in 
draft [I-D.ietf-netmod-rfc7277bis]).
   &lt;config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"&gt;
         &lt;neighbor&gt;
    &lt;ip-address&gt; 10.2.2.3 &lt;/ip-address&gt;
    &lt;mac-address&gt; 00e0-fc01-0000 &lt;/mac-address&gt;
    &lt;if-name&gt; GE1/0/1 &lt;/if-name&gt;
     &lt;/neighbor&gt;
      &lt;/ipv4&gt;
  
      </artwork>
        </figure>
      </section>

      <section title="ARP Dynamic Learning">
        <figure>
          <artwork>  
Requirement:
Enable ARP dynamic learning configuration.

   &lt;config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;arp-dynamic-learning xmlns="urn:ietf:params:xml:ns:yang:ietf-arp-dynamic-learning"&gt;
         &lt;if-name&gt; GE1/0/1 &lt;/if-name&gt; 
         &lt;expire-time&gt;1200&lt;/expire-time&gt;
      &lt;learn-disable&gt;false&lt;/learn-disable&gt;
         &lt;proxy-enable&gt;false&lt;/proxy-enable&gt;
   &lt;probe&gt;
   &lt;interval&gt;5&lt;/interval&gt;
   &lt;times&gt;3&lt;/times&gt;
   &lt;unicast&gt;false&lt;/unicast&gt;
   &lt;/probe&gt;
   &lt;gratuitous&gt;
   &lt;gratuitous-enable&gt;false&lt;gratuitous-enable&gt;
   &lt;interval&gt;60&lt;/interval&gt;
   &lt;drop&gt;false&lt;/drop&gt;
            &lt;gratuitous&gt;
      &lt;/arp-dynamic-learning&gt;
 
           </artwork>
        </figure>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>The YANG module defined in this document is designed to be accessed
      via YANG based management protocols, such as NETCONF [RFC6241] and
      RESTCONF [RFC8040]. Both of these protocols have mandatory-to- implement
      secure transport layers (e.g., SSH, TLS) with mutual authentication.</t>

      <t>The NETCONF access control model (NACM) [RFC6536] provides the means
      to restrict access for particular users to a pre-configured subset of
      all available protocol operations and content.</t>

      <t>These are the subtrees and data nodes and their
      sensitivity/vulnerability:</t>

      <t>There are a number of data nodes defined in this YANG module that 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.</t>
    </section>

    <section anchor="ack" title="Acknowledgments">
      <t>The authors wish to thank Alex Campbell and Reshad Rahman, Qin Wu,
      many others for their helpful comments.</t>
    </section>

    <!---->
  </middle>

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

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

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

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

      <?rfc include='reference.I-D.ietf-netmod-rfc7223bis'?>

      <?rfc include='reference.I-D.ietf-netmod-rfc7277bis'?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.0826.xml"?>

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

      <?rfc include="reference.RFC.8040.xml"?>
	  
	  <?rfc include="reference.RFC.8340.xml"?>
    </references>
  </back>
</rfc>
