<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc compact="yes"?>
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc strict="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<rfc category="info" docName="draft-sun-i2apm-address-pool-management-yang-02"
     ipr="trust200902">
  <front>
    <title abbrev="Yang Model for Address Pool Management">A YANG Data Model
    for Address Pool Management </title>

    <author fullname="Qiong Sun" initials="Q." surname="Sun">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>No.118 Xizhimennei street, Xicheng District</street>

          <city>Beijing</city>

          <code>100035</code>

          <country>P.R. China</country>
        </postal>

        <email>sunqiong@ctbri.com.cn</email>
      </address>
    </author>

    <author fullname="Chongfeng Xie" initials="C." surname="Xie">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>No.118 Xizhimennei street, Xicheng District</street>

          <city>Beijing</city>

          <code>100035</code>

          <country>P.R. China</country>
        </postal>

        <email>xiechf@ctbri.com.cn</email>
      </address>
    </author>

    <author fullname="Mohamed Boucadair" initials="M." surname="Boucadair">
      <organization>Orange</organization>

      <address>
        <postal>
          <street></street>

          <city>Rennes</city>

          <region></region>

          <code>35000</code>

          <country>France</country>
        </postal>

        <email>mohamed.boucadair@orange-ftgroup.com</email>
      </address>
    </author>

    <author fullname="Will(Shucheng) Liu" initials="W." surname="Liu">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Bantian, Longgang District</street>

          <city>Shenzhen</city>

          <code>518129</code>

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

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

    <author fullname="Yiu L. Lee" initials="Y" surname="Lee">
      <organization>Comcast</organization>

      <address>
        <postal>
          <street>One Comcast Center</street>

          <city>Philadelphia</city>

          <region>PA</region>

          <code>19103</code>

          <country>USA</country>
        </postal>

        <email>yiu_lee@cable.comcast.com</email>
      </address>
    </author>

    <date />

    <abstract>
      <t>This document specifies a YANG data model for IP address pool
      management. It can be used to automatically allocate, update and delete
      address pools in different devices of an underlying network.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>IP address pool management is one of the basic elements to configure
      in a network to offer connectivity services to connected devices.
      Concretely, pools can be provisioned to DHCP servers, IPv4 service
      continuity devices (e.g., DS-Lite AFTR, NAT64), Carrier Grade NAT (CGN),
      Broadband Network Gateway (BNG), etc. Automated means to rationalize the
      management of address resources and to make sure the underlying routing
      and forwarding capabilities are appropriately configured, are helpful
      for opertaors. This document specifies a YANG data model for that
      purpose.</t>

      <t>A device can be provisioned with a pool of addresses for various
      reasons: service requesting hosts with addresses or prefixes (e.g., DHCP
      server, Delegating router), inject appropriate routing entries (e.g.,
      PE, BNG) given that prefix assignments and routing actions must be
      correlated otherwise delivery of connectivity service will fail. This
      document does not elaborate the usage of pools provisioned to a network
      element.</t>

      <t>It is worth mentioning that: (1) current practices rely on static
      configuration which is prone to errors, (2) the level of route
      aggregation cannot be driven by PE routers without any hint(s) from an
      entity that has the visibility on aggregation policies and the status of
      prefixes, etc., and (3) relying on proprietary means to trigger the
      injection of routing entries may lead to undesired behavior such as to
      increase the size of routing table and forwarding table due to injecting
      very specific routes.</t>

      <t>Within this document, an address pool usually contains the address
      pool type, start-address, end-address, its corresponding lifetime and
      the identification of the usage. Each address pool is represented by an
      Address Pool Entry (APE).</t>

      <t>Pools may be specific to a service offered by a network or be valid
      for all services.</t>

      <t>Pools can be added and/or withdrawn.</t>
    </section>

    <section title="Terminology">
      <t>The terminology for describing YANG data models is defined in <xref
      target="RFC6020"></xref>.</t>

      <t>The meaning of the symbols in the tree diagrams is as follows: <list>
          <t>Brackets "[" and "]" enclose list keys.</t>

          <t>Curly braces "{" and "}" contain names of optional features that
          make the corresponding node conditional.</t>

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

          <t>Symbols after data node names: "?" means an optional node, "!" a
          container with presence, and "*" denotes a "list" or
          "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>
    </section>

    <section title="AddressPoolManagement Data Model">
      <t>Two YANG modules are defined (<xref target="fig1"></xref>). The first
      module, "ietf- address-pool", defines generic address pool aspects which
      is common to all use cases. The second module,
      "ietf-address-pool-status", defines the status of the address pool.</t>

      <t><figure anchor="fig1"
          title="Interface to Address Pool Management (APM)">
          <artwork><![CDATA[
module: ietf-address-pool 
   +--rw address-pools 
   |  +--rw address-pool* [address-pool-name] 
   |     +--rw address-pool-name       string 
   |     +--rw device-id?              string           
   |     +--rw address-pool-service* [service-name] 
   |     |  +--rw service-name    string 
   |     +--rw address-pool-entries 
   |        +--rw ipv4-address-range* [ipv4-address-range-name] 
   |        |  +--rw ipv4-address-range-name   string 
   |        |  +--rw ip-lower-address?         inet:ipv4-address-no-zone 
   |        |  +--rw ip-upper-address?         inet:ipv4-address-no-zone 
   |        |  +--rw usergateway?              inet:ipv4-address-no-zone 
   |        |  +--rw gwnetmask?                yang:dotted-quad 
   |        |  +--rw type?                     address-pool-type 
   |        |  +--rw lifetime?                 yang:date-and-time 
   |        |  +--rw instance?                 instance-type 
   |        +--rw warning-threshold-v4?   percent 
   |        +--rw ipv6-prefix* [ipv6-prefix-name] 
   |        |  +--rw ipv6-prefix-name          string 
   |        |  +--rw ipv6-prefix?              inet:ipv6-prefix 
   |        |  +--rw usergateway?              inet:ipv6-address-no-zone 
   |        |  +--rw type?                     address-pool-type 
   |        |  +--rw lifetime?                 yang:date-and-time 
   |        |  +--rw instance?                 instance-type 
   |        +--rw warning-threshold-v6?  percent 
   +--ro address-pool-status 
      +--ro address-pool* [address-pool-name] 
         +--ro address-pool-name       string 
         +--ro address-pool-service* [service-name] 
         |  +--ro service-name    string 
         +--ro status?                 enumeration 
         +--ro address-pool-entries 
            +--ro ipv4-address-range* [ipv4-address-range-name] 
            |  +--ro ipv4-address-range-name    string 
            |  +--ro peak-address-usage-ratio?  percent 
            |  +--ro average-address-usage-ratio? percent 
            +--ro ipv6-prefix* [ipv6-prefix-name] 
            |  +--ro ipv6-prefix-name        string 
            |  +--ro peak-prefix-usage-ratio?     percent 
            |  +--ro average-prefix-usage-ratio?  percent 
            +--ro port-range* [port-range-name] 
               +--ro port-range-name              string 
               +--ro peak-address-usage-ratio?    percent 
               +--ro average-address-usage-ratio? percent 
]]></artwork>
        </figure></t>

      <t></t>
    </section>

    <section title="AddressPoolManagement YANG Module">
      <t>This module imports typedefs from <xref target="RFC6991"></xref> and
      <xref target="RFC7223"></xref>. </t>

      <t><figure anchor="fig2"
          title="Interface to Address Pool Management (APM)">
          <artwork><![CDATA[
<CODE BEGINS> file "ietf-address-pool@2015-10-14.yang" 
module ietf-address-pool { 
  namespace "urn:ietf:params:xml:ns:yang:ietf-address-pool"; 
  prefix address-pool; 
  import ietf-inet-types { 
    prefix inet; 
  } 
  import ietf-yang-types { 
    prefix yang; 
  } 
  organization 
    "xxx Working Group"; 

  contact 
    "Editor:   Qiong Sun 
			 <mailto:sunqiong@ctbri.com.cn> 

    Editor:   Will(Shucheng) Liu 
			 <mailto:liushucheng@huawei.com>"; 

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

	Copyright (c) 2015 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 2015-10-14 { 
    description 
	 "Initial revision."; 
    reference 
	 "-00"; 
  } 

typedef percent { 
    type uint8 { 
		   range "0 .. 100"; 
    } 
    description 
	   "Percentage"; 
} 

  typedef address-pool-type{ 
    type enumeration{ 
	 enum usergateway { 
	   description 
		 "The address pool has a usergateway."; 
	 } 
	 enum import-route { 
	   description 
		 "The address pool need to import a route 
		 to external network."; 
	 } 
    } 
    description 
	 "Address pool type."; 
  } 

  typedef instance-type{ 
    type enumeration{ 
	  enum pppoe { 
	    description 
		"The address pool is used for pppoe access."; 
	  } 
	  enum dhcp { 
	    description 
		  "The address pool is used for dhcp access."; 
	  } 
	  enum vpn { 
	    description 
		  "The address pool is used for vpn access."; 
	  } 
	  enum ds-lite { 
	    description 
		  "The address pool is used for ds-lite access."; 
	  } 
	  enum lw4over6 { 
	    description 
		  "The address pool is used for lw4over6 access.";
      }
	  enum map { 
	    description 
	 	  "The address pool is used for map access."; 
	  } 
	  enum cgn { 
	    description 
	 	  "The address pool is used for cgn access."; 
	  } 
	  enum xlat { 
	    description 
		  "The address pool is used for xlat access."; 
	  } 
	  enum other { 
	    description 
		  "The address pool is used for others."; 
	  } 
	}
	description 
	  "Instance type."; 
  } 

  container address-pools { 
    description 
	  "This is a top level container for Address Pools. 
	  It can have one or more Address Pools. The pools may 
	  not be contiguous."; 
    list address-pool { 
	  key address-pool-name; 
	  description 
	    "An Address Pool is an ordered list of 
	    Address Pool Entries (APE). Each Access Pool Entry has a 
	    list of address ranges and its associated lifetime."; 
	  leaf address-pool-name { 
	    type string; 
	    description 
	 	  "The name of address pool"; 
	  } 
	  leaf device-id { 
	    type string; 
	    description 
		  "The identifier of device that using address pool"; 
	  }         
	  list address-pool-service { 
		key service-name; 
		description 
		  "The services that can use these pool."; 
		leaf service-name { 
		  type string; 
		  description 
		    "A service name: e.g., any, voip, iptv, internet, etc."; 
		} 
	  } 
	  
	  container address-pool-entries { 
	    description 
		  "The address-pool-entries container contains
	      a list of address-ranges and associated attributes."; 
	    list ipv4-address-range { 
		  key ipv4-address-range-name; 
		  description 
		    "IPv4 Address range."; 
		  leaf ipv4-address-range-name { 
		    type string; 
		    description 
			  "The name of IPv4 address range."; 
		  } 
		  leaf ip-lower-address { 
		    type inet:ipv4-address-no-zone; 
		    description 
			  "The lower IPv4 address of the address range."; 
		  } 
		  leaf ip-upper-address { 
		    type inet:ipv4-address-no-zone; 
		    description 
			  "The upper IPv4 address of the address range."; 
		  } 
		  leaf usergateway { 
		    type inet:ipv4-address-no-zone; 
		    description 
			  "It only exists when address pool are used for 
			  user addressing."; 
		  } 
		  leaf gwnetmask { 
		    type yang:dotted-quad; 
		    description 
			  "The netmask for usergateway."; 
		  } 
		  leaf type { 
		    type address-pool-type; 
		    description 
			  "The type of the address pool."; 
		  } 
		  leaf lifetime { 
		    type yang:date-and-time; 
		    description 
			  "The lifetime for the address pool. '0' means 
              withdrawal."; 
		  } 
		  leaf instance { 
			type instance-type; 
			description 
			  "The instance of the address pool."; 
		  } 
	    } 
	    leaf warning-threshold-v4{ 
		  type percent; 
		  description 
		    "The threshold of the ipv4 address pool."; 
	    } 

	    list ipv6-prefix { 
		  key ipv6-prefix-name; 
		  description 
		    "IPv6 prefix."; 
		  leaf ipv6-prefix-name { 
		    type string; 
		    description 
			  "The name of IPv6 prefix."; 
		  }
		  leaf ipv6-prefix { 
		    type inet:ipv6-prefix; 
		    description 
			  "The IPv6 prefix."; 
		  } 
 		  leaf usergateway { 
		    type inet:ipv6-address-no-zone; 
		    description 
			  "It only exists when address pool are used for 
			  user addressing."; 
		  } 
		  leaf type { 
		    type address-pool-type; 
		    description 
			  "The type of the address pool."; 
		  } 
		  leaf lifetime { 
		    type yang:date-and-time; 
		    description 
			  "The lifetime for the address pool. '0' means 
              withdrawal."; 
		  } 
		  leaf instance { 
			type instance-type; 
			description 
			  "The instance of the address pool."; 
		  } 
	    } 
	    leaf warning-threshold-v6{ 
		  type percent; 
		  description 
		    "The threshold of the ipv6 address pool."; 
	    } 
	  } 
    } 
  } 

/*
* Operational state data nodes
*/

  container address-pool-status { 
    config false; 
    description
	  "This is a top level container for Address Pool Status, 
	  which contains the status of address pool usage."; 
    list address-pool { 
	  key address-pool-name; 
	  description 
	    "An Address Pool is an ordered list of 
	    Address Pool Entries (APE). Each Access Pool Entry has a 
	    list of address ranges and its associated lifetime. "; 
	  leaf address-pool-name { 
	    type string; 
	    description 
		  "The name of address pool"; 
	  } 
	  list address-pool-service { 
		key service-name; 
		description 
		  "The services that can use these pool."; 
		leaf service-name { 
		  type string; 
		  description 
		    "A service name: e.g., any, voip, iptv, internet, etc."; 
		} 
	  } 
	  leaf status { 
	    type enumeration{ 
		  enum active { 
		    description 
			  "The address pool is in active status."; 
		  } 
		  enum idle { 
		    description 
			  "The address pool is in idle status."; 
		  } 
	    } 
	    description 
		  "The status of address pool"; 
	  } 
	  container address-pool-entries { 
	    description 
		  "The address-pool-entries container contains 
		  a list of address-ranges and associated attributes."; 
	    list ipv4-address-range { 
		  key ipv4-address-range-name; 
		  description 
		    "IPv4 Address range."; 
		  leaf ipv4-address-range-name { 
		    type string; 
		    description 
			  "The name of IPv4 address range."; 
		  } 
		  leaf peak-address-usage-ratio { 
		    type percent; 
		    description 
			  "The peak usage rate of the address range.";
		  } 
		  leaf average-address-usage-ratio { 
		    type percent; 
		    description
			  "The average usage rate of the address range."; 
		  } 
	    } 
	    list ipv6-prefix { 
		  key ipv6-prefix-name; 
		  description 
		    "IPv6 prefix."; 
		  leaf ipv6-prefix-name { 
		    type string; 
		    description 
			  "The name of IPv6 prefix."; 
		  } 
		  leaf peak-prefix-usage-ratio { 
		    type percent; 
		    description 
			  "The peak usage rate of the prefix."; 
		  } 
		  leaf average-prefix-usage-ratio { 
		    type percent; 
		    description 
			  "The average usage rate of the prefix."; 
		  } 
	    } 
	    list port-range { 
		  key port-range-name; 
		  description 
		    "port range."; 
		  leaf port-range-name { 
		    type string; 
		    description 
			  "The name of port range."; 
		  } 
		  leaf peak-address-usage-ratio { 
		    type percent; 
		    description 
			  "The peak usage rate of the port range."; 
		  } 
		  leaf average-address-usage-ratio { 
		    type percent; 
		    description 
			  "The average usage rate of the port range."; 
		  } 
	    } 
	  } 
    } 
  } 
}
<CODE ENDS> 
			  
]]></artwork>
        </figure></t>

      <t></t>
    </section>

    <section title="Security Considerations">
      <t>The YANG module defined in this memo is designed to be accessed via
      the NETCONF protocol [RFC6241]. The lowest NETCONF layer is the secure
      transport layer and the support of SSH is mandatory to implement secure
      transport [RFC6242]. The NETCONF access control model [RFC6536] provides
      means to restrict access for particular NETCONF users to a
      pre-configured subset of all available NETCONF protocol operations and
      contents.</t>

      <t>All data nodes defined in the YANG module which can be created,
      modified and deleted (i.e., config true, which is the default). These
      data nodes are considered sensitive. Write operations (e.g.,
      edit-config) applied to these data nodes without proper protection can
      negatively affect network operations.</t>
    </section>

    <section title="IANA Considerations">
      <t>This document requests IANA to register the following URI in the
      "IETF XML Registry" [RFC3688]:</t>

      <t><figure anchor="fig3" title="namespace">
          <artwork><![CDATA[
            URI: urn:ietf:params:xml:ns:yang:ietf-address-pool 
            Registrant Contact: The IESG. 
            XML: N/A; the requested URI is an XML namespace.  
        ]]></artwork>
        </figure></t>

      <t>This document requests IANA to register the following YANG module in
      the "YANG Module Names" registry [RFC6020].</t>

      <t><figure anchor="fig4" title="IANA register">
          <artwork><![CDATA[
            name: ietf-address-pool 
            namespace: urn:ietf:params:xml:ns:yang:ietf-address-pool 
            prefix: address-pool 
            reference: RFC XXXX 
        ]]></artwork>
        </figure></t>
    </section>

    <section title="Acknowledgements">
      <t>N/A.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119"?>

      <?rfc include='reference.RFC.6020'?>

      <?rfc include='reference.RFC.6991'?>

      <?rfc include='reference.RFC.7223'?>
    </references>

    <references title="Informative References">
      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6674"?>

      <?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.6888"?>
    </references>
  </back>
</rfc>
