<?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 RFC4271 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC2547 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2547.xml">
<!ENTITY RFC4364 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4364.xml">
<!ENTITY RFC4760 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4760.xml">
<!ENTITY RFC5492 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5492.xml">
<!ENTITY RFC6020 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY RFC6241 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC7224 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7224.xml">
<!ENTITY RFC7311 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7311.xml">
<!ENTITY RFC2519 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2519.xml">

<!ENTITY RFC2439 SYSTEM
  "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2439.xml">

<!ENTITY I-D.ietf-netmod-routing-cfg SYSTEM
  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-netmod-routing-cfg-15.xml">
<!ENTITY I-D.ietf-idr-bgp-model SYSTEM
  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-idr-bgp-model-01.xml">
<!--<!ENTITY I-D.draft-bierman-netconf-yang-api SYSTEM
  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-bierman-netconf-restconf-01.xml">
-->
<!--<!ENTITY I-D.draft-lhotka-netmod-yang-json SYSTEM
  "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-netmod-yang-json-00.xml">
-->  
]>

<?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"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-keyupate-idr-bgp-ext-yang-00.txt"
ipr="pre5378Trust200902">
  <!-- category values: std, bcp, info, exp, and historic
    ipr values: full3667, noModification3667, noDerivatives3667
    you can add the attributes updates="NNNN" and obsoletes="NNNN"
    they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>

    <title abbrev="Yang Data Model for BGP extended features">
    Yang Data Model for BGP extended features </title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Keyur Patel" initials="K.P."
            surname="Patel">
      <organization>Cisco</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

          <!-- Reorder these if your country does things differently -->

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

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

        <email>keyupate@cisco.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Dhanendra Jain" initials="D."
            surname="Jain">
      <organization>Cisco</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

          <!-- Reorder these if your country does things differently -->

          <city>San Jose</city>

          <region>CA</region>

          <code>95134</code>

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

        <email>dhjain@cisco.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <author fullname="Susan Hares" initials="S."
            surname="Hares">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>7453 Hickory Hill</street>

          <!-- Reorder these if your country does things differently -->

          <city>Saline</city>

          <region>MI</region>

          <code>48176</code>

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

        <email>shares@ndzh.com</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

    <date day="8" month="July" year="2016" />

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>IDR Working Group</workgroup>

    <keyword>IDR</keyword>

    <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

<abstract>
<t>
This document defines a YANG data model that can be used to configure and manage BGP features which are not covered 
in the base BGP YANG data model.
</t>
</abstract>

  </front>

  <middle>

<section anchor="introduction" title="Introduction">
<t>
YANG <xref target="RFC6020"/> is a data definition language that was 
introduced to define the contents of a 
conceptual data store that allows networked devices to be managed using 
NETCONF <xref target="RFC6241"/>.    
YANG is proving relevant beyond its 
initial confines, as bindings to other interfaces 
(e.g. ReST)  
<!--<xref target="I-D.draft-bierman-netconf-yang-api"/> -->
and encodings other 
than XML (e.g. JSON) 
<!-- <xref target="I-D.draft-lhotka-netmod-yang-json"/>-->
are being defined.   Furthermore, YANG data models 
can be used as the basis of implementation for other interfaces, such as CLI and 
programmatic APIs.  
</t>
<t>
This document defines a YANG data model that can be used to configure and manage 
BGP features which are not covered in the base model 
<xref target="I-D.ietf-idr-bgp-model"/>. This model is defined by augmenting 
the applicable containers from the base BGP model. 

</t>

 
      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>
      </section>
    </section> <!-- for Introductions section -->

      <section title="Definitions and Acronyms">
        <t>
          AF: Address Family  
        </t>
        <t>
          AIGP: Accumulated IGP 
        </t>
         <t>
          AS: Autonomous System
        </t>
        <t>
	  BGP: Border Gateway Protocol
        </t>
 	<t>
         DMZ: Demilitarized zone. Used in context of DMZ link bandwidth for a link that 
              connects two single hop eBGP peers.
        </t>
        <t> 
         IGP: Interior Gatewate Protocol
        </t>
        <t>
         MED(med): Multi Exit Discriminator
        </t>
        <t>
          NETCONF: Network Configuration Protocol        
        </t>
        <t>
          ReST: Representational State Transfer, a style of stateless interface and protocol 
          that is generally carried over HTTP        
        </t>
        <t>
          YANG: Data definition language for NETCONF
        </t>
      </section>

<section title="BGP extended features">

   <t>
   This yang model covers a number of BGP extended features by augmenting BGP base model defiend 
   in <xref target="I-D.ietf-idr-bgp-model"/>. These features are described below. 
   This model is expected to grow with more such features in future.
   </t>

   <section title="AIGP">
    <t>

     The  Accumulated IGP Metric Attribute for BGP is an optional non-transitive BGP path 
     attribute and is specified in <xref target="RFC7311"/>. Configuration to enable and 
     set the parameters for AIGP are applicable per address family per neighbor granularity. 
     These are defined by agumenting AF containers under neighbor and peer-group 
     from base BGP model <xref target="I-D.ietf-idr-bgp-model"/>.
    </t>
   </section>

   <section title="Aggregate routes">
     <t> 
      This refers to the BGP specific configuration for enabling mechanisms for route 
      aggregation as per <xref target="RFC4271"/> <xref target="RFC2519"/> . These parameters 
      are modeled as new leafs augmenting global address family containers from the BGP base 
      yang model <xref target="I-D.ietf-idr-bgp-model"/>.
     </t>
     </section>

    <section title="DMZ link bandwidth">
     <t>
       The BGP link bandwidth  feature is used to advertise the bandwidth of an autonomous 
       system exit  link as an extended community [TODO: reference]. Configuration to  
       enable DMZ link bandwidth extended community is modeled by augmenting BGP neighbor 
       and peer-group containers defined in <xref target="I-D.ietf-idr-bgp-model"/>.
     </t>
     </section>

     <section title="Network">
      <t>
      Leafs to add network in BGP routing table. BGP global address family container 
      from the base BGP model <xref target="I-D.ietf-idr-bgp-model"/> is agumented
       for this purpose.
     </t>
     </section>
    <section title="Dampening">
      <t> 
      Configration parameters for BGP dampening behavior as defined in <xref target="RFC2439"/>. 
      These parameters are defined under BGP global address family mode.
      </t>
    </section>
   </section>

    <section title="Yang model">
      <t>

      <figure align="center">
         <artwork align="left">

       module: ietf-bgp-extensions
augment /bgp:bgp/bgp:global:
augment /bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi:
   +--rw aggregate-addr
   |  +--rw aggregate-address?   inet:ip-address
   |  +--rw summary-only?        boolean
   |  +--rw as-set?              boolean
   |  +--rw as-confed-set?       boolean
   |  +--rw route-policy?        string
   +--rw aggregate-timer
   |  +--rw enable?      boolean
   |  +--rw threshold?   uint16
   +--rw network
   |  +--rw network?   inet:ip-address
   |  +--rw policy?    string
   +--rw bgp-dampening
   |  +--rw half-time?          uint8
   |  +--rw reuse-limit?         uint16
   |  +--rw supresss-limit?      uint16
   |  +--rw max-supress-time?   uint8
   |  +--rw policy?             string
   |  ...

   +--rw auto-summary?              boolean
   +--rw advertise-best-external?   boolean

augment /bgp:bgp/bgp:neighbors/bgp:neighbor:
   +--rw propagate-dmzlink-bw?   boolean

augment /bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:afi-safis/bgp:afi-safi:
   +--rw aigp
   |  +--rw enable?                boolean
   |  +--rw send-med?              boolean
   |  +--rw send-cost-community
   |     +--rw id?                    uint32
   |     +--rw igp-cost-transitive?   boolean
   |     +--rw point-of-insertion?    enumeration
   +--rw soft-reconfig?   enumeration

augment /bgp:bgp/bgp:peer-groups/bgp:peer-group:
   +--rw propagate-dmzlink-bw?   boolean

augment /bgp:bgp/bgp:peer-groups/bgp:peer-group/bgp:afi-safis/bgp:afi-safi:
   +--rw aigp
   |  +--rw enable?                boolean
   |  +--rw send-med?              boolean
   |  +--rw send-cost-community
   |     +--rw id?                    uint32
   |     +--rw igp-cost-transitive?   boolean
   |     +--rw point-of-insertion?    enumeration
   +--rw soft-reconfig?   enumeration
    
   
   </artwork>
   </figure>

  </t>

  <figure>
  <artwork>

 
&lt;CODE BEGINS&gt; file "ietf-bgp-extensions@2016-07-08.yang"

module ietf-bgp-extensions {
  namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-extensions";
  // replace with IANA namespace when assigned

  prefix bgp-ext;

  import ietf-inet-types {
    prefix inet;
  }


  import ietf-bgp {
    prefix bgp;
    revision-date 2016-01-06;
  }

  organization
    "Cisco Systems
     170 West Tasman Drive
     San Jose, CA 95134-1706
     USA";
  contact
     "Keyur Patel keyupate@cisco.com
      Dhanendra Jain   dhjain@cisco.com
      Susan Hares shares@ndzh.com";

  description
    "This YANG module defines the extensions to the base BGP yang 
     model common across all of the vendor implementations of the 
     protocol. It is intended that the model will be extended by 
     vendors to define vendor-specific models.


     Terms and Acronyms

     AIGP (aigp): Accumulated IGP

     BGP (bgp): Border Gateway Protocol

     IGP (igp): Interior Gateway Protocol

     IP (ip): Internet Protocol

     IPv4 (ipv4):Internet Protocol Version 4

     IPv6 (ipv6): Internet Protocol Version 6

     MED(med): Multi Exit Discriminator

     MTU (mtu) Maximum Transmission Unit

    ";

  revision 2016-07-08 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: A YANG Data Model for BGP extended features";
  }

  //
  // AIGP parameters used in global mode and neighbor AF mode.
  //
  grouping bgp-aigp {
    description 
      "A set of configuration parameters applicable for AIGP configuration";
    container aigp {
      description "AIGP configuration parameters";
      leaf enable {
         type boolean;
         description "Enable AIGP";
      }
      leaf send-med {
         type boolean;
         description "Send AIGP value in MED";
      }
      container send-cost-community {
        description "Send AIGP value in Cost Community";
        leaf id {
          type uint32;
          description "Cost Community ID"; 
        }    
        leaf igp-cost-transitive {
          type boolean;
          description "Enable transitive cost community";
        }
        leaf point-of-insertion {
          type enumeration {
            enum igp-cost {
              description "Cost community is used after IGP distance to next-hop";
            }
            enum pre-bestpath {
              description "Cost community is first step in best-path calculation";
            }       
          }
          description "Point of insertion for best-path calculation"; 
        }
      }
    }
  }    

  //
  // DMZ link bandwidth params
  //
  grouping bgp-dmz-link-bw {
    description
      "A set of configuration parameters for DMZ link bandwidth";
    leaf propagate-dmzlink-bw {
      type boolean;
      description
        "Propagate the DMZ link bandwidth.";
    }
  }

  //
  // BGP dampening params
  //
  grouping bgp-dampening-params {
    description "BGP dampening parameters";
    container bgp-dampening {
      description
      "BGP Route Flap Dampening.";

       leaf half-time {
         type uint8 {
           range "1..45";
         }
         description
          "Half Time (in minutes) to reduce the penalty 
           assigned to a route by half.";
       }

       leaf reuse-limit {
         type uint16 {
           range "1..20000";
         }
         description
         "A configurable numeric value that is compared with the penalty. 
          If the penalty is less than the reuse limit, a suppressed route 
          that is up will no longer be suppressed. ";
       }

       leaf supresss-limit {
         type uint16 {
           range "1..20000";
         }
         description
         "A configurable numeric value that is compared with the penalty.
          If the penalty is greater than the suppress limit, 
          the route is suppressed";
       }

       leaf max-supress-time {
         type uint8 {
           range "1..255";
         }
         description
         "The longest amount of time, in minutes, that a route can be suppressed.";
       }
       leaf policy {
         type string ; //TBD leafref to policy model
         description 
          "Policy to specify criteria for dampening";
      }
    }
  }
 
  //
  // Grouping for Aggregate address
  //
  grouping bgp-aggregate-addr {
    description "BGP aggregate address parameters grouping";
    container aggregate-addr {
      description "Aggregate address configuration";
      leaf aggregate-address {
        type inet:ip-address;
        description
          "Configure BGP aggregate address.";
      }
      leaf summary-only {
        type boolean;
        description "Filter more specific routes from updates";
      }
      leaf as-set {
        type boolean;
        description "Generate AS set path information";
      }
      leaf as-confed-set {
        type boolean;
        description "Generate AS confed set path information";
      }
      leaf route-policy {
        type string;
        description "Policy to filter routes and specify conditions";
      }
    }
  }
 
  //
  // Grouping for soft reconfig 
  //
  grouping soft-reconfig {
    description "Soft reconfig parameters. Configuring this enables storing 
                 of routes as received by this node, prior to applying 
                 inbound route-policy";
    leaf soft-reconfig {
      type enumeration {
        enum "always" {
          description "Use soft reconfig database upon neighbor reset even 
                       if route refresh is configured";
        }
        enum "backup" {
          description "Use soft reconfig database as backup to route refresh";
        }
      }
      description "Enable storing of unprocessed routes as received by this node";
    }
  }
 
  //
  // Grouping for all AF extensions.
  //
  grouping bgp-af-extension-cfg { 
    description
      "Grouping for configuration parameters which are applicable 
       to all address families of the BGP router.";
    
    // Aggregate related
    uses bgp-aggregate-addr;

    // Aggregate Timer
    container aggregate-timer {
      description
        "Configure aggregation timer to specify time interval at which BGP routes 
         will be aggregated for route aggregation.";
      leaf enable {
        type boolean;
        default "true";
        description "Enable aggregate timer";
      }
      leaf threshold {
        type uint16 {
          range "6..60";
        }
        description "Threshold value in seconds";
      }
    }
  
    //Network
    container network {
      description "Add networks to BGP table";
      leaf network {
         type inet:ip-address;
         description
           "Specify a network to announce via BGP.";
      }
      leaf policy {
         type string; //TBD leaf to policy model.
         description "Modify route attribute as per policy";
      }
    }

    // Dampening
    uses bgp-dampening-params;

    //Other leafs
    leaf auto-summary {
      type boolean;
      description
       "Enable automatic network number summarization";
    }
    // Best external
    leaf advertise-best-external {
      type boolean;
      description
        "Advertise best external path to the internal peers.";
    }
  }


  // Global mode extensions can go here.
  grouping bgp-gbl-extension-cfg {
     description "BGP process global extensions grouping";
     // BGP process global extensions here.
  }

  // Global address family specific extensions.
  grouping bgp-gbl-af-extension-cfg {
    description "BGP global address family specific extensions";

    //AF extensions common to all AFs
    uses bgp-af-extension-cfg;  
  }

  // Neighbor mode extensions.
  grouping bgp-nbr-extension-cfg {
    description "BGP neighbor specific extensions";
    //NBR extensions go here
    uses bgp-dmz-link-bw;
  }

  // Neighbor address family specific extensions.
  grouping bgp-nbr-af-extension-cfg {
    description "BGP neighbor address-family specific extensions";
    // NBR-AF extensions go here
    uses bgp-aigp ;
    uses soft-reconfig;
  }

  //-----------------------------------
  // Augment BGP model in various places.
  //------------------------------------

  // BGP Global parameters
  augment "/bgp:bgp/bgp:global" {
     description "BGP global mode specific extensions";
     //add BGP global extensions here
     uses bgp-gbl-extension-cfg;
  }

  // BGP Global Address Family Specific
  augment "/bgp:bgp/bgp:global/bgp:afi-safis/bgp:afi-safi" {
     description "BGP global address family mode specific extensions";
      //add BGP global AF extensions here 
      uses bgp-gbl-af-extension-cfg;
  }      

  
  //BGP Neighbor Specific
  augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" {
     description "BGP neighbor mode specific extensions";
      // add nbr specific extensions here
      uses bgp-nbr-extension-cfg;
  }

  //BGP Neighbor address-family Specific
  augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:afi-safis/bgp:afi-safi" {
     description "BGP neighbor address family mode specific extensions";
      // add nbr AFI-SAFI specific extensions here.
      uses bgp-nbr-af-extension-cfg;
  }

  // BGP Neighbor Groups specific
  augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" {
     description "BGP peer-group mode specific extensions";
     // add nbr specific extensions here
      uses bgp-nbr-extension-cfg;
  }

  // BGP Neighbor Group address-family Specific.
  augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group/bgp:afi-safis/bgp:afi-safi" {
     description "BGP peer-group address family mode specific extensions";
      // add nbr AFI-SAFI specific extensions here.
      uses bgp-nbr-af-extension-cfg;
  }
}



&lt;CODE ENDS&gt;
    </artwork>
    </figure>
</section>


<section anchor="IANA" title="IANA Considerations">

</section>

<section anchor="Security" title="Security Considerations">
    <t>
       The transport protocol used for sending the BGP configuration data 
       MUST support authentication and SHOULD support encryption. 
       The data-model by itself does not create any security implications.
    </t>
    
    <t>
       This draft does not change any underlying security issues inherent in
       the base BGP model   
       <xref target="I-D.ietf-idr-bgp-model"></xref>, that it augments to
       define yang model for extented features.
    </t>
</section>

<section anchor="Acknowledgements" title="Acknowledgements">
<t>
   The authors would like to thank TBD for their detail reviews and comments.
</t>

</section>

    <!-- Possibly a 'Contributors' section ... -->

</middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629;
        here (as shown)
    2. simply use a PI
        "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds:
          include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included
    files in the same directory as the including file. You can also define
    the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be
    either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include=
      "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
      &RFC2119;

      &RFC2547;

      &RFC4364;

      &RFC4760;

      &RFC4271;
      
      &RFC6020;
      
      &RFC6241;

      &RFC7224;

      &RFC7311;
  
      &RFC2519;

      &RFC2439;
  

      &I-D.ietf-netmod-routing-cfg;

      &I-D.ietf-idr-bgp-model;


    </references>

    <references title="Informative References">
      &RFC5492;

    <!--  &I-D.draft-bierman-netconf-yang-api;-->

    <!--  &I-D.draft-lhotka-netmod-yang-json;-->
      
    <!-- &I-D.draft-ietf-netmod-interfaces-cfg; -->
    </references>
    <!-- Change Log

v00 2008-10-01  KP    Initial version
    -->
  </back>
</rfc>
