Skip to main content

YANG Data Model for L3VPN Service Delivery
RFC 8299

Document Type RFC - Proposed Standard (January 2018) Errata
Obsoletes RFC 8049
Was draft-wu-l3sm-rfc8049bis (individual in ops area)
Authors Qin Wu , Stephane Litkowski , Luis Tomotaki , Kenichi Ogaki
Last updated 2019-05-14
RFC stream Internet Engineering Task Force (IETF)
Formats
IESG Responsible AD Alissa Cooper
Send notices to (None)
RFC 8299
lt;/class-id>
           <latency>
            <latency-boundary>200</latency-boundary>
           </latency>
           <bandwidth>
            <guaranteed-bw-percent>5</guaranteed-bw-percent>
            <end-to-end/>
           </bandwidth>
          </class>
         </classes>
        </qos-profile>
       </qos>
      </service>
     </site-network-access>
    </site-network-accesses>
   </site>
  </sites>
 </l3vpn-svc>

   The custom QoS profile for Site1 defines a REAL_TIME class with a
   latency constraint expressed as the lowest possible latency.  It also
   defines two data classes -- DATA1 and DATA2.  The two classes express
   a latency boundary constraint as well as a bandwidth reservation, as
   the REAL_TIME class is rate-limited to 10% of the service bandwidth
   (10% of 100 Mbps = 10 Mbps).  In cases where congestion occurs, the
   REAL_TIME traffic can go up to 10 Mbps (let's assume that only 5 Mbps

Wu, et al.                   Standards Track                  [Page 102]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   are consumed).  DATA1 and DATA2 will share the remaining bandwidth
   (95 Mbps) according to their percentage.  So, the DATA1 class will be
   served with at least 76 Mbps of bandwidth, while the DATA2 class will
   be served with at least 4.75 Mbps.  The latency boundary information
   of the data class may help the SP define a specific buffer tuning or
   a specific routing within the network.  The maximum percentage to be
   used is not limited by this model but MUST be limited by the
   management system according to the policies authorized by the SP.

6.12.4.  Multicast

   The "multicast" container defines the type of site in the customer
   multicast service topology: source, receiver, or both.  These
   parameters will help the management system optimize the multicast
   service.  Users can also define the type of multicast relationship
   with the customer: router (requires a protocol such as PIM), host
   (IGMP or MLD), or both.  An address family (IPv4, IPv6, or both) can
   also be defined.

Wu, et al.                   Standards Track                  [Page 103]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

6.13.  Enhanced VPN Features

6.13.1.  Carriers' Carriers

   In the case of CsC [RFC4364], a customer may want to build an MPLS
   service using an IP VPN to carry its traffic.

                  LAN customer1
                      |
                      |
                     CE1
                      |
                      | -------------
                   (vrf_cust1)
                    CE1_ISP1
                      |                 ISP1 POP
                      | MPLS link
                      | -------------
                      |
                   (vrf ISP1)
                     PE1

                    (...)               Provider backbone

                     PE2
                    (vrf ISP1)
                      |
                      | ------------
                      |
                      | MPLS link
                      |                 ISP1 POP
                     CE2_ISP1
                     (vrf_cust1)
                      | ------------
                      |
                     CE2
                      |
                   LAN customer1

   In the figure above, ISP1 resells an IP VPN service but has no core
   network infrastructure between its POPs.  ISP1 uses an IP VPN as the
   core network infrastructure (belonging to another provider) between
   its POPs.

Wu, et al.                   Standards Track                  [Page 104]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   In order to support CsC, the VPN service must indicate MPLS support
   by setting the "carrierscarrier" leaf to true in the vpn-service
   list.  The link between CE1_ISP1/PE1 and CE2_ISP1/PE2 must also run
   an MPLS signalling protocol.  This configuration is done at the site
   level.

   In the proposed model, LDP or BGP can be used as the MPLS signalling
   protocol.  In the case of LDP, an IGP routing protocol MUST also be
   activated.  In the case of BGP signalling, BGP MUST also be
   configured as the routing protocol.

   If CsC is enabled, the requested "svc-mtu" leaf will refer to the
   MPLS MTU and not to the IP MTU.

6.14.  External ID References

   The service model sometimes refers to external information through
   identifiers.  As an example, to order a cloud-access to a particular
   cloud service provider (CSP), the model uses an identifier to refer
   to the targeted CSP.  If a customer is directly using this service
   model as an API (through REST or NETCONF, for example) to order a
   particular service, the SP should provide a list of authorized
   identifiers.  In the case of cloud-access, the SP will provide the
   associated identifiers for each available CSP.  The same applies to
   other identifiers, such as std-qos-profile, OAM profile-name, and
   provider-profile for encryption.

   How an SP provides the meanings of those identifiers to the customer
   is out of scope for this document.

6.15.  Defining NNIs

   An autonomous system (AS) is a single network or group of networks
   that is controlled by a common system administration group and that
   uses a single, clearly defined routing protocol.  In some cases, VPNs
   need to span different ASes in different geographic areas or span
   different SPs.  The connection between ASes is established by the SPs
   and is seamless to the customer.  Examples include

   o  a partnership between SPs (e.g., carrier, cloud) to extend their
      VPN service seamlessly.

   o  an internal administrative boundary within a single SP (e.g.,
      backhaul versus core versus data center).

   NNIs (network-to-network interfaces) have to be defined to extend the
   VPNs across multiple ASes.

Wu, et al.                   Standards Track                  [Page 105]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   [RFC4364] defines multiple flavors of VPN NNI implementations.  Each
   implementation has pros and cons; this topic is outside the scope of
   this document.  For example, in an Inter-AS option A, autonomous
   system border router (ASBR) peers are connected by multiple
   interfaces with at least one of those interfaces spanning the two
   ASes while being present in the same VPN.  In order for these ASBRs
   to signal unlabeled IP prefixes, they associate each interface with a
   VPN routing and forwarding (VRF) instance and a Border Gateway
   Protocol (BGP) session.  As a result, traffic between the back-to-
   back VRFs is IP.  In this scenario, the VPNs are isolated from each
   other, and because the traffic is IP, QoS mechanisms that operate on
   IP traffic can be applied to achieve customer service level
   agreements (SLAs).

     --------                 --------------              -----------
    /        \               /              \            /           \
   | Cloud    |             |                |          |             |
   | Provider |-----NNI-----|                |----NNI---| Data Center |
   |  #1      |             |                |          |             |
    \        /              |                |           \           /
     --------               |                |            -----------
                            |                |
     --------               |   My network   |           -----------
    /        \              |                |          /           \
   | Cloud    |             |                |         |             |
   | Provider |-----NNI-----|                |---NNI---|  L3VPN      |
   |  #2      |             |                |         |  Partner    |
    \        /              |                |         |             |
     --------               |                |         |             |
                             \              /          |             |
                              --------------            \           /
                                    |                    -----------
                                    |
                                   NNI
                                    |
                                    |
                            -------------------
                           /                   \
                          |                     |
                          |                     |
                          |                     |
                          |     L3VPN Partner   |
                          |                     |
                           \                   /
                            -------------------

Wu, et al.                   Standards Track                  [Page 106]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   The figure above describes an SP network called "My network" that has
   several NNIs.  This network uses NNIs to:

   o  increase its footprint by relying on L3VPN partners.

   o  connect its own data center services to the customer IP VPN.

   o  enable the customer to access its private resources located in a
      private cloud owned by some CSPs.

6.15.1.  Defining an NNI with the Option A Flavor

             AS A                                          AS B
      -------------------                         -------------------
     /                   \                       /                   \
    |                     |                     |                     |
    |                 ++++++++ Inter-AS link ++++++++                 |
    |                 +      +_______________+      +                 |
    |                 +  (VRF1)---(VPN1)----(VRF1)  +                 |
    |                 + ASBR +               + ASBR +                 |
    |                 +  (VRF2)---(VPN2)----(VRF2)  +                 |
    |                 +      +_______________+      +                 |
    |                 ++++++++               ++++++++                 |
    |                     |                     |                     |
    |                     |                     |                     |
    |                     |                     |                     |
    |                 ++++++++ Inter-AS link ++++++++                 |
    |                 +      +_______________+      +                 |
    |                 +  (VRF1)---(VPN1)----(VRF1)  +                 |
    |                 + ASBR +               + ASBR +                 |
    |                 +  (VRF2)---(VPN2)----(VRF2)  +                 |
    |                 +      +_______________+      +                 |
    |                 ++++++++               ++++++++                 |
    |                     |                     |                     |
    |                     |                     |                     |
     \                   /                       \                   /
      -------------------                         -------------------

   In option A, the two ASes are connected to each other with physical
   links on ASBRs.  For resiliency purposes, there may be multiple
   physical connections between the ASes.  A VPN connection -- physical
   or logical (on top of physical) -- is created for each VPN that needs
   to cross the AS boundary, thus providing a back-to-back VRF model.

   From a service model's perspective, this VPN connection can be seen
   as a site.  Let's say that AS B wants to extend some VPN connections
   for VPN C on AS A.  The administrator of AS B can use this service
   model to order a site on AS A.  All connection scenarios could be

Wu, et al.                   Standards Track                  [Page 107]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   realized using the features of the current model.  As an example, the
   figure above shows two physical connections that have logical
   connections per VPN overlaid on them.  This could be seen as a dual-
   homed subVPN scenario.  Also, the administrator of AS B will be able
   to choose the appropriate routing protocol (e.g., E-BGP) to
   dynamically exchange routes between ASes.

   This document assumes that the option A NNI flavor SHOULD reuse the
   existing VPN site modeling.

   Example: a customer wants its CSP A to attach its virtual network N
   to an existing IP VPN (VPN1) that he has from L3VPN SP B.

           CSP A                              L3VPN SP B

     -----------------                    -------------------
    /                 \                  /                   \
   |       |           |                |                     |
   |  VM --|       ++++++++  NNI    ++++++++                  |--- VPN1
   |       |       +      +_________+      +                  |   Site#1
   |       |--------(VRF1)---(VPN1)--(VRF1)+                  |
   |       |       + ASBR +         + ASBR +                  |
   |       |       +      +_________+      +                  |
   |       |       ++++++++         ++++++++                  |
   |  VM --|           |                |                     |--- VPN1
   |       |Virtual    |                |                     |   Site#2
   |       |Network    |                |                     |
   |  VM --|           |                |                     |--- VPN1
   |       |           |                |                     |   Site#3
    \                 /                  \                   /
     -----------------                    -------------------
                                                  |
                                                  |
                                                VPN1
                                               Site#4

   To create the VPN connectivity, the CSP or the customer may use the
   L3VPN service model that SP B exposes.  We could consider that, as
   the NNI is shared, the physical connection (bearer) between CSP A and
   SP B already exists.  CSP A may request through a service model the
   creation of a new site with a single site-network-access (single-
   homing is used in the figure).  As a placement constraint, CSP A may
   use the existing bearer reference it has from SP A to force the
   placement of the VPN NNI on the existing link.  The XML snippet below
   illustrates a possible configuration request to SP B:

Wu, et al.                   Standards Track                  [Page 108]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

<?xml version="1.0"?>
<l3vpn-svc xmlns="urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc">
 <vpn-profiles>
  <valid-provider-identifiers>
   <qos-profile-identifier>
    <id>GOLD</id>
   </qos-profile-identifier>
   <qos-profile-identifier>
    <id>PLATINUM</id>
   </qos-profile-identifier>
  </valid-provider-identifiers>
 </vpn-profiles>
 <vpn-services>
  <vpn-service>
   <vpn-id>VPN1</vpn-id>
  </vpn-service>
 </vpn-services>
 <sites>
  <site>
   <site-id>CSP_A_attachment</site-id>
   <security>
    <encryption>
     <layer>layer3</layer>
    </encryption>
   </security>
   <locations>
    <location>
     <location-id>L1</location-id>
    </location>
   </locations>
   <locations>
    <location>
     <location-id>1</location-id>
     <city>NY</city>
     <country-code>US</country-code>
    </location>
   </locations>
   <site-vpn-flavor>site-vpn-flavor-nni</site-vpn-flavor>
   <routing-protocols>
    <routing-protocol>
     <type>bgp</type>
     <bgp>
      <autonomous-system>500</autonomous-system>
      <address-family>ipv4</address-family>
     </bgp>
    </routing-protocol>
   </routing-protocols>
   <site-network-accesses>

Wu, et al.                   Standards Track                  [Page 109]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    <site-network-access>
     <site-network-access-id>CSP_A_VN1</site-network-access-id>
     <location-reference>L1</location-reference>
     <ip-connection>
      <ipv4>
       <address-allocation-type>provider-dhcp</address-allocation-type>
      </ipv4>
      <ipv6>
       <address-allocation-type>provider-dhcp</address-allocation-type>
      </ipv6>
     </ip-connection>
     <ip-connection>
      <ipv4>
       <address-allocation-type>static-address</address-allocation-type>
       <addresses>
        <provider-address>203.0.113.1</provider-address>
        <customer-address>203.0.113.2</customer-address>
        <prefix-length>30</prefix-length>
       </addresses>
      </ipv4>
     </ip-connection>
     <service>
      <svc-input-bandwidth>450000000</svc-input-bandwidth>
      <svc-output-bandwidth>450000000</svc-output-bandwidth>
      <svc-mtu>1514</svc-mtu>
     </service>
     <security>
      <encryption>
       <layer>layer3</layer>
      </encryption>
     </security>
     <vpn-attachment>
      <vpn-id>VPN1</vpn-id>
      <site-role>any-to-any-role</site-role>
     </vpn-attachment>
    </site-network-access>
   </site-network-accesses>
   <management>
    <type>customer-managed</type>
   </management>
  </site>
 </sites>
</l3vpn-svc>

   The case described above is different from a scenario using the
   cloud-accesses container, as the cloud-access provides a public cloud
   access while this example enables access to private resources located
   in a CSP network.

Wu, et al.                   Standards Track                  [Page 110]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

6.15.2.  Defining an NNI with the Option B Flavor

            AS A                                          AS B
      -------------------                         -------------------
     /                   \                       /                   \
    |                     |                     |                     |
    |                 ++++++++ Inter-AS link ++++++++                 |
    |                 +      +_______________+      +                 |
    |                 +      +               +      +                 |
    |                 + ASBR +<---MP-BGP---->+ ASBR +                 |
    |                 +      +               +      +                 |
    |                 +      +_______________+      +                 |
    |                 ++++++++               ++++++++                 |
    |                     |                     |                     |
    |                     |                     |                     |
    |                     |                     |                     |
    |                 ++++++++ Inter-AS link ++++++++                 |
    |                 +      +_______________+      +                 |
    |                 +      +               +      +                 |
    |                 + ASBR +<---MP-BGP---->+ ASBR +                 |
    |                 +      +               +      +                 |
    |                 +      +_______________+      +                 |
    |                 ++++++++               ++++++++                 |
    |                     |                     |                     |
    |                     |                     |                     |
     \                   /                       \                   /
      -------------------                         -------------------

   In option B, the two ASes are connected to each other with physical
   links on ASBRs.  For resiliency purposes, there may be multiple
   physical connections between the ASes.  The VPN "connection" between
   ASes is done by exchanging VPN routes through MP-BGP [RFC4760].

   There are multiple flavors of implementations of such an NNI.  For
   example:

   1.  The NNI is internal to the provider and is situated between a
       backbone and a data center.  There is enough trust between the
       domains to not filter the VPN routes.  So, all the VPN routes are
       exchanged.  RT filtering may be implemented to save some
       unnecessary route states.

   2.  The NNI is used between providers that agreed to exchange VPN
       routes for specific RTs only.  Each provider is authorized to use
       the RT values from the other provider.

Wu, et al.                   Standards Track                  [Page 111]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   3.  The NNI is used between providers that agreed to exchange VPN
       routes for specific RTs only.  Each provider has its own RT
       scheme.  So, a customer spanning the two networks will have
       different RTs in each network for a particular VPN.

   Case 1 does not require any service modeling, as the protocol enables
   the dynamic exchange of necessary VPN routes.

   Case 2 requires that an RT-filtering policy on ASBRs be maintained.
   From a service modeling point of view, it is necessary to agree on
   the list of RTs to authorize.

   In Case 3, both ASes need to agree on the VPN RT to exchange, as well
   as how to map a VPN RT from AS A to the corresponding RT in AS B (and
   vice versa).

   Those modelings are currently out of scope for this document.

          CSP A                               L3VPN SP B

     -----------------                    ------------------
    /                 \                  /                  \
   |       |           |                |                    |
   |  VM --|       ++++++++   NNI    ++++++++                |--- VPN1
   |       |       +      +__________+      +                |   Site#1
   |       |-------+      +          +      +                |
   |       |       + ASBR +<-MP-BGP->+ ASBR +                |
   |       |       +      +__________+      +                |
   |       |       ++++++++          ++++++++                |
   |  VM --|           |                |                    |--- VPN1
   |       |Virtual    |                |                    |   Site#2
   |       |Network    |                |                    |
   |  VM --|           |                |                    |--- VPN1
   |       |           |                |                    |   Site#3
    \                 /                 |                    |
     -----------------                  |                    |
                                         \                  /
                                          ------------------
                                                   |
                                                   |
                                                  VPN1
                                                 Site#4

   The example above describes an NNI connection between CSP A and SP
   network B.  Both SPs do not trust themselves and use a different RT
   allocation policy.  So, in terms of implementation, the customer VPN
   has a different RT in each network (RT A in CSP A and RT B in SP
   network B).  In order to connect the customer virtual network in CSP

Wu, et al.                   Standards Track                  [Page 112]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   A to the customer IP VPN (VPN1) in SP network B, CSP A should request
   that SP network B open the customer VPN on the NNI (accept the
   appropriate RT).  Who does the RT translation depends on the
   agreement between the two SPs: SP B may permit CSP A to request VPN
   (RT) translation.

6.15.3.  Defining an NNI with the Option C Flavor

            AS A                                           AS B
     -------------------                          -------------------
    /                   \                        /                   \
   |                     |                      |                     |
   |                     |                      |                     |
   |                     |                      |                     |
   |                 ++++++++ Multihop E-BGP ++++++++                 |
   |                 +      +                +      +                 |
   |                 +      +                +      +                 |
   |                 + RGW  +<----MP-BGP---->+ RGW  +                 |
   |                 +      +                +      +                 |
   |                 +      +                +      +                 |
   |                 ++++++++                ++++++++                 |
   |                     |                      |                     |
   |                     |                      |                     |
   |                     |                      |                     |
   |                     |                      |                     |
   |                     |                      |                     |
   |                 ++++++++ Inter-AS link ++++++++                  |
   |                 +      +_______________+      +                  |
   |                 +      +               +      +                  |
   |                 + ASBR +               + ASBR +                  |
   |                 +      +               +      +                  |
   |                 +      +_______________+      +                  |
   |                 ++++++++               ++++++++                  |
   |                     |                      |                     |
   |                     |                      |                     |
   |                     |                      |                     |
   |                 ++++++++ Inter-AS link ++++++++                  |
   |                 +      +_______________+      +                  |
   |                 +      +               +      +                  |
   |                 + ASBR +               + ASBR +                  |
   |                 +      +               +      +                  |
   |                 +      +_______________+      +                  |
   |                 ++++++++               ++++++++                  |
   |                     |                      |                     |
   |                     |                      |                     |
    \                   /                        \                   /
     -------------------                          -------------------

Wu, et al.                   Standards Track                  [Page 113]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   From a VPN service's perspective, the option C NNI is very similar to
   option B, as an MP-BGP session is used to exchange VPN routes between
   the ASes.  The difference is that the forwarding plane and the
   control plane are on different nodes, so the MP-BGP session is
   multihop between routing gateway (RGW) nodes.

   From a VPN service's point of view, modeling options B and C will be
   identical.

7.  Service Model Usage Example

   As explained in Section 5, this service model is intended to be
   instantiated at a management layer and is not intended to be used
   directly on network elements.  The management system serves as a
   central point of configuration of the overall service.

   This section provides an example of how a management system can use
   this model to configure an IP VPN service on network elements.

   In this example, we want to achieve the provisioning of a VPN service
   for three sites using a Hub-and-Spoke VPN service topology.  One of
   the sites will be dual-homed, and load-sharing is expected.

      +-------------------------------------------------------------+
      |   Hub_Site  ------ PE1               PE2 ------ Spoke_Site1 |
      |      |                   +----------------------------------+
      |      |                   |
      |      |                   +----------------------------------+
      |   Hub_Site  ------ PE3               PE4 ------ Spoke_Site2 |
      +-------------------------------------------------------------+

   The following XML snippet describes the overall simplified service
   configuration of this VPN.

Wu, et al.                   Standards Track                  [Page 114]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      <?xml version="1.0"?>
      <l3vpn-svc xmlns="urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc">
        <vpn-profiles>
          <valid-provider-identifiers>
            <qos-profile-identifier>
              <id>GOLD</id>
            </qos-profile-identifier>
            <qos-profile-identifier>
              <id>PLATINUM</id>
            </qos-profile-identifier>
          </valid-provider-identifiers>
        </vpn-profiles>
        <vpn-services>
          <vpn-service>
            <vpn-id>12456487</vpn-id>
            <vpn-service-topology>hub-spoke</vpn-service-topology>
          </vpn-service>
        </vpn-services>
      </l3vpn-svc>

   When receiving the request for provisioning the VPN service, the
   management system will internally (or through communication with
   another OSS component) allocate VPN RTs.  In this specific case, two
   RTs will be allocated (100:1 for Hub and 100:2 for Spoke).  The
   output of corresponding XML snippet below describes the configuration
   of Spoke_Site1.

<?xml version="1.0"?>
<l3vpn-svc xmlns="urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc">
 <vpn-profiles>
  <valid-provider-identifiers>
   <qos-profile-identifier>
    <id>GOLD</id>
   </qos-profile-identifier>
   <qos-profile-identifier>
    <id>PLATINUM</id>
   </qos-profile-identifier>
  </valid-provider-identifiers>
 </vpn-profiles>
 <vpn-services>
  <vpn-service>
   <vpn-id>12456487</vpn-id>
   <vpn-service-topology>hub-spoke</vpn-service-topology>
  </vpn-service>
 </vpn-services>
 <sites>
  <site>
   <site-id>Spoke_Site1</site-id>

Wu, et al.                   Standards Track                  [Page 115]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   <devices>
    <device>
     <device-id>D1</device-id>
    </device>
   </devices>
   <locations>
    <location>
     <location-id>1</location-id>
     <city>NY</city>
     <country-code>US</country-code>
    </location>
   </locations>
   <security>
    <encryption>
     <layer>layer3</layer>
    </encryption>
   </security>
   <routing-protocols>
    <routing-protocol>
     <type>bgp</type>
     <bgp>
      <autonomous-system>500</autonomous-system>
      <address-family>ipv4</address-family>
      <address-family>ipv6</address-family>
     </bgp>
    </routing-protocol>
   </routing-protocols>
   <site-network-accesses>
    <site-network-access>
     <site-network-access-id>Spoke_Site1</site-network-access-id>
     <device-reference>D1</device-reference>
     <access-diversity>
      <groups>
       <group>
        <group-id>20</group-id>
       </group>
      </groups>
      <constraints>
       <constraint>
        <constraint-type>pe-diverse</constraint-type>
        <target>
         <group>
          <group-id>10</group-id>
         </group>
        </target>
       </constraint>
      </constraints>
     </access-diversity>

Wu, et al.                   Standards Track                  [Page 116]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     <ip-connection>
      <ipv4>
       <address-allocation-type>static-address</address-allocation-type>
       <addresses>
        <provider-address>203.0.113.254</provider-address>
        <customer-address>203.0.113.2</customer-address>
        <prefix-length>24</prefix-length>
       </addresses>
      </ipv4>
      <ipv6>
       <address-allocation-type>static-address</address-allocation-type>
       <addresses>
        <provider-address>2001:db8::1</provider-address>
        <customer-address>2001:db8::2</customer-address>
        <prefix-length>64</prefix-length>
       </addresses>
      </ipv6>
     </ip-connection>
     <service>
      <svc-input-bandwidth>450000000</svc-input-bandwidth>
      <svc-output-bandwidth>450000000</svc-output-bandwidth>
      <svc-mtu>1514</svc-mtu>
     </service>
     <security>
      <encryption>
       <layer>layer3</layer>
      </encryption>
     </security>
     <vpn-attachment>
      <vpn-id>12456487</vpn-id>
      <site-role>spoke-role</site-role>
     </vpn-attachment>
    </site-network-access>
   </site-network-accesses>
   <management>
    <type>provider-managed</type>
   </management>
  </site>
 </sites>
</l3vpn-svc>

   When receiving the request for provisioning Spoke_Site1, the
   management system MUST allocate network resources for this site.  It
   MUST first determine the target network elements to provision the
   access, particularly the PE router (and perhaps also an aggregation
   switch).  As described in Section 6.6, the management system SHOULD
   use the location information and MUST use the access-diversity
   constraint to find the appropriate PE.  In this case, we consider

Wu, et al.                   Standards Track                  [Page 117]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   that Spoke_Site1 requires PE diversity with the Hub and that the
   management system allocates PEs based on the least distance.  Based
   on the location information, the management system finds the
   available PEs in the area nearest the customer and picks one that
   fits the access-diversity constraint.

   When the PE is chosen, the management system needs to allocate
   interface resources on the node.  One interface is selected from the
   pool of available PEs.  The management system can start provisioning
   the chosen PE node via whatever means the management system prefers
   (e.g., NETCONF, CLI).  The management system will check to see if a
   VRF that fits its needs is already present.  If not, it will
   provision the VRF: the RD will be derived from the internal
   allocation policy model, and the RTs will be derived from the VPN
   policy configuration of the site (the management system allocated
   some RTs for the VPN).  As the site is a Spoke site (site-role), the
   management system knows which RTs must be imported and exported.  As
   the site is provider-managed, some management RTs may also be added
   (100:5000).  Standard provider VPN policies MAY also be added in the
   configuration.

   Example of generated PE configuration:

   ip vrf Customer1
    export-map STD-CUSTOMER-EXPORT      <---- Standard SP configuration
    route-distinguisher 100:3123234324
    route-target import 100:1
    route-target import 100:5000        <---- Standard SP configuration
    route-target export 100:2                    for provider-managed CE
   !

   When the VRF has been provisioned, the management system can start
   configuring the access on the PE using the allocated interface
   information.  IP addressing is chosen by the management system.  One
   address will be picked from an allocated subnet for the PE, and
   another will be used for the CE configuration.  Routing protocols
   will also be configured between the PE and CE; because this model is
   provider-managed, the choices are left to the SP.  BGP was chosen for
   this example.  This choice is independent of the routing protocol
   chosen by the customer.  BGP will be used to configure the CE-to-LAN
   connection as requested in the service model.  Peering addresses will
   be derived from those of the connection.  As the CE is provider-
   managed, the CE's AS number can be automatically allocated by the
   management system.  Standard configuration templates provided by the
   SP may also be added.

Wu, et al.                   Standards Track                  [Page 118]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   Example of generated PE configuration:

   interface Ethernet1/1/0.10
    encapsulation dot1q 10
    ip vrf forwarding Customer1
    ip address 198.51.100.1 255.255.255.252 <---- Comes from
                                                   automated allocation
    ipv6 address 2001:db8::10:1/64
    ip access-group STD-PROTECT-IN     <---- Standard SP config
   !
   router bgp 100
    address-family ipv4 vrf Customer1
     neighbor 198.51.100.2 remote-as 65000   <---- Comes from
                                                    automated allocation
     neighbor 198.51.100.2 route-map STD in  <---- Standard SP config
     neighbor 198.51.100.2 filter-list 10 in <---- Standard SP config
   !
    address-family ipv6 vrf Customer1
     neighbor 2001:db8::0a10:2 remote-as 65000   <---- Comes from
                                                    automated allocation
     neighbor 2001:db8::0a10:2 route-map STD in  <---- Standard SP
                                                          config
     neighbor 2001:db8::0a10:2 filter-list 10 in <---- Standard SP
                                                          config
   !
   ip route vrf Customer1 192.0.2.1 255.255.255.255 198.51.100.2
   ! Static route for provider administration of CE
   !

   As the CE router is not reachable at this stage, the management
   system can produce a complete CE configuration that can be manually
   uploaded to the node before sending the CE configuration to the
   customer premises.  The CE configuration will be built in the same
   way as the PE would be configured.  Based on the CE type (vendor/
   model) allocated to the customer as well as the bearer information,
   the management system knows which interface must be configured on the
   CE.  PE-CE link configuration is expected to be handled automatically
   using the SP OSS, as both resources are managed internally.  CE-to-
   LAN-interface parameters such as IP addressing are derived from the
   ip-connection container, taking into account how the management
   system distributes addresses between the PE and CE within the subnet.
   This will allow a plug-and-play configuration for the CE to be
   created.

Wu, et al.                   Standards Track                  [Page 119]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   Example of generated CE configuration:

   interface Loopback10
    description "Administration"
    ip address 192.0.2.1 255.255.255.255
   !
   interface FastEthernet10
    description "WAN"
    ip address 198.51.100.2 255.255.255.252 <---- Comes from
                                                   automated allocation
    ipv6 address 2001:db8::0a10:2/64
   !
   interface FastEthernet11
    description "LAN"
    ip address 203.0.113.254 255.255.255.0 <---- Comes from the
                                               ip-connection container
    ipv6 address 2001:db8::1/64
   !
   router bgp 65000
    address-family ipv4
     redistribute static route-map STATIC2BGP <---- Standard SP
                                                       configuration
     neighbor 198.51.100.1 remote-as 100     <---- Comes from
                                                 automated allocation
     neighbor 203.0.113.2 remote-as 500     <---- Comes from the
                                                 ip-connection container
    address-family ipv6
     redistribute static route-map STATIC2BGP <---- Standard SP
                                                       configuration
     neighbor 2001:db8::0a10:1 remote-as 100     <---- Comes from
                                                 automated allocation
     neighbor 2001:db8::2 remote-as 500     <---- Comes from the
                                                 ip-connection container
   !
   route-map STATIC2BGP permit 10
    match tag 10
   !

8.  Interaction with Other YANG Models

   As expressed in Section 5, this service model is intended to be
   instantiated in a management system and not directly on network
   elements.

Wu, et al.                   Standards Track                  [Page 120]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   The management system's role will be to configure the network
   elements.  The management system may be modular, so the component
   instantiating the service model (let's call it "service component")
   and the component responsible for network element configuration
   (let's call it "configuration component") may be different.

             l3vpn-svc         |
               Model           |
                               |
                    +---------------------+
                    |  Service component  | Service datastore
                    +---------------------+
                               |
                               |
                    +---------------------+
               +----|  Config component   |------+
              /     +---------------------+       \   Network
             /            /            \           \  Configuration
            /            /              \           \ models
           /            /                \           \
   ++++++++         ++++++++           ++++++++       ++++++++
   + CE A + ------- + PE A +           + PE B + ----- + CE B + Config
   ++++++++         ++++++++           ++++++++       ++++++++ datastore

            Site A                              Site B

   In the previous sections, we provided some examples of the
   translation of service provisioning requests to router configuration
   lines.  In the NETCONF/YANG ecosystem, we expect NETCONF/YANG to be
   used between the configuration component and network elements to
   configure the requested services on those elements.

   In this framework, specifications are expected to provide specific
   YANG modeling of service components on network elements.  There will
   be a strong relationship between the abstracted view provided by this
   service model and the detailed configuration view that will be
   provided by specific configuration models for network elements.

   The authors of this document anticipate definitions of YANG modules
   for the network elements listed below.  Note that this list is not
   exhaustive:

   o  VRF definition, including VPN policy expression.

   o  Physical interface.

   o  IP layer (IPv4, IPv6).

Wu, et al.                   Standards Track                  [Page 121]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   o  QoS: classification, profiles, etc.

   o  Routing protocols: support of configuration of all protocols
      listed in the document, as well as routing policies associated
      with those protocols.

   o  Multicast VPN.

   o  Network address translation.

   Example of a corresponding XML snippet with a VPN site request at the
   service level, using this model:

<?xml version="1.0"?>
<l3vpn-svc xmlns="urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc">
 <vpn-profiles>
  <valid-provider-identifiers>
   <qos-profile-identifier>
    <id>GOLD</id>
   </qos-profile-identifier>
   <qos-profile-identifier>
    <id>PLATINUM</id>
   </qos-profile-identifier>
  </valid-provider-identifiers>
 </vpn-profiles>
 <vpn-services>
  <vpn-service>
   <vpn-id>VPN1</vpn-id>
   <vpn-service-topology>hub-spoke</vpn-service-topology>
  </vpn-service>
 </vpn-services>
 <sites>
  <site>
   <site-id>Site A</site-id>
   <security>
    <encryption>
     <layer>layer3</layer>
    </encryption>
   </security>
   <locations>
    <location>
     <location-id>L1</location-id>
    </location>
   </locations>
   <site-network-accesses>
    <site-network-access>
     <site-network-access-id>1</site-network-access-id>
     <ip-connection>

Wu, et al.                   Standards Track                  [Page 122]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      <ipv4>
       <address-allocation-type>static-address</address-allocation-type>
       <addresses>
        <provider-address>203.0.113.254</provider-address>
        <customer-address>203.0.113.2</customer-address>
        <prefix-length>24</prefix-length>
       </addresses>
      </ipv4>
      <ipv6>
       <address-allocation-type>provider-dhcp</address-allocation-type>
      </ipv6>
     </ip-connection>
     <service>
      <svc-mtu>1514</svc-mtu>
      <svc-input-bandwidth>10000000</svc-input-bandwidth>
      <svc-output-bandwidth>10000000</svc-output-bandwidth>
     </service>
     <location-reference>L1</location-reference>
     <vpn-attachment>
      <vpn-policy-id>VPNPOL1</vpn-policy-id>
     </vpn-attachment>
    </site-network-access>
   </site-network-accesses>
   <routing-protocols>
    <routing-protocol>
     <type>static</type>
     <static>
      <cascaded-lan-prefixes>
       <ipv4-lan-prefixes>
        <lan>198.51.100.0/30</lan>
        <next-hop>203.0.113.2</next-hop>
       </ipv4-lan-prefixes>
      </cascaded-lan-prefixes>
     </static>
    </routing-protocol>
   </routing-protocols>
   <management>
    <type>customer-managed</type>
   </management>
   <vpn-policies>
    <vpn-policy>
     <vpn-policy-id>VPNPOL1</vpn-policy-id>
     <entries>
      <id>1</id>
      <vpn>
       <vpn-id>VPN1</vpn-id>
       <site-role>any-to-any-role</site-role>
      </vpn>

Wu, et al.                   Standards Track                  [Page 123]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     </entries>
    </vpn-policy>
   </vpn-policies>
  </site>
 </sites>
</l3vpn-svc>

   In the service example above, the service component is expected to
   request that the configuration component of the management system
   provide the configuration of the service elements.  If we consider
   that the service component selected a PE (PE A) as the target PE for
   the site, the configuration component will need to push the
   configuration to PE A.  The configuration component will use several
   YANG data models to define the configuration to be applied to PE A.
   The XML snippet configuration of PE A might look like this:

<if:interfaces>
 <if:interface>
  <if:name>eth0</if:name>
  <if:type>ianaift:ethernetCsmacd</if:type>
  <if:description>
   Link to CE A.
  </if:description>
  <ip:ipv4>
   <ip:address>
    <ip:ip>203.0.113.254</ip:ip>
    <ip:prefix-length>24</ip:prefix-length>
   </ip:address>
   <ip:forwarding>true</ip:forwarding>
  </ip:ipv4>
 </if:interface>
</if:interfaces>
<rt:routing>
 <rt:routing-instance>
  <rt:name>VRF_CustA</rt:name>
  <rt:type>l3vpn-network:vrf</rt:type>
  <rt:description>VRF for Customer A</rt:description>
  <l3vpn-network:rd>100:1546542343</l3vpn-network:rd>
  <l3vpn-network:import-rt>100:1</l3vpn-network:import-rt>
  <l3vpn-network:export-rt>100:1</l3vpn-network:export-rt>
  <rt:interfaces>
   <rt:interface>
    <rt:name>eth0</rt:name>
   </rt:interface>
  </rt:interfaces>
  <rt:routing-protocols>
   <rt:routing-protocol>
    <rt:type>rt:static</rt:type>

Wu, et al.                   Standards Track                  [Page 124]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    <rt:name>st0</rt:name>
    <rt:static-routes>
     <v4ur:ipv4>
      <v4ur:route>
      <v4ur:destination-prefix>198.51.100.0/30</v4ur:destination-prefix>
       <v4ur:next-hop>
        <v4ur:next-hop-address>203.0.113.2</v4ur:next-hop-address>
       </v4ur:next-hop>
      </v4ur:route>
     </v4ur:ipv4>
    </rt:static-routes>
   </rt:routing-protocol>
  </rt:routing-protocols>
 </rt:routing-instance>
</rt:routing>

9.  YANG Module

 <CODE BEGINS>file "ietf-l3vpn-svc@2018-01-19.yang"
 module ietf-l3vpn-svc {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc";
  prefix l3vpn-svc;
  import ietf-inet-types {
   prefix inet;
  }
  import ietf-yang-types {
   prefix yang;
  }
  import ietf-netconf-acm {
   prefix nacm;
  }
  organization
   "IETF L3SM Working Group";
  contact
   "WG List: <mailto:l3sm@ietf.org>
    Editor:
     L3SM WG
    Chairs:
     Adrian Farrel, Qin Wu
   ";
  description
  "This YANG module defines a generic service configuration
  model for Layer 3 VPNs. This model is common across all
  vendor implementations.

Wu, et al.                   Standards Track                  [Page 125]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  Copyright (c) 2018 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
  (https://trustee.ietf.org/license-info).

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

  revision 2018-01-19 {
   description
    "Revision of RFC 8049 to fix implementation issues.";
   reference
    "RFC 8299";
   }
  revision 2017-01-27 {
   description
   "Initial document.";
   reference
     "RFC 8049.";
   }
  /* Features */
  feature cloud-access {
   description
   "Allows the VPN to connect to a CSP.";
  }
  feature multicast {
   description
   "Enables multicast capabilities in a VPN.";
  }
  feature ipv4 {
   description
   "Enables IPv4 support in a VPN.";
  }
  feature ipv6 {
   description
   "Enables IPv6 support in a VPN.";
  }
  feature lan-tag {
   description
   "Enables LAN Tag support in a VPN Policy filter.";
  }
  feature carrierscarrier {
   description

Wu, et al.                   Standards Track                  [Page 126]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   "Enables support of CsC.";
  }
  feature extranet-vpn {
   description
   "Enables support of extranet VPNs.";
  }
  feature site-diversity {
   description
   "Enables support of site diversity constraints.";
  }
  feature encryption {
   description
   "Enables support of encryption.";
  }
  feature qos {
   description
   "Enables support of classes of services.";
  }
  feature qos-custom {
   description
   "Enables support of the custom QoS profile.";
  }
  feature rtg-bgp {
   description
   "Enables support of the BGP routing protocol.";
  }
  feature rtg-rip {
   description
   "Enables support of the RIP routing protocol.";
  }
  feature rtg-ospf {
   description
   "Enables support of the OSPF routing protocol.";
  }
  feature rtg-ospf-sham-link {
   description
   "Enables support of OSPF sham links.";
  }
  feature rtg-vrrp {
   description
   "Enables support of the VRRP routing protocol.";
  }
  feature fast-reroute {
   description
   "Enables support of Fast Reroute.";
  }
  feature bfd {
   description

Wu, et al.                   Standards Track                  [Page 127]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   "Enables support of BFD.";
  }
  feature always-on {
   description
   "Enables support of the 'always-on' access constraint.";
  }
  feature requested-type {
   description
   "Enables support of the 'requested-type' access constraint.";
  }
  feature bearer-reference {
   description
   "Enables support of the 'bearer-reference' access constraint.";
  }
  feature target-sites {
   description
   "Enables support of the 'target-sites' match flow parameter.";
  }
  /* Typedefs */
  typedef svc-id {
   type string;
   description
   "Defines a type of service component identifier.";
  }
  typedef template-id {
   type string;
   description
   "Defines a type of service template identifier.";
  }
  typedef address-family {
   type enumeration {
    enum ipv4 {
     description
     "IPv4 address family.";
    }
    enum ipv6 {
     description
     "IPv6 address family.";
    }
   }
   description
   "Defines a type for the address family.";
  }
  /* Identities */
  identity site-network-access-type {
   description
   "Base identity for site-network-access type.";
  }

Wu, et al.                   Standards Track                  [Page 128]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  identity point-to-point {
   base site-network-access-type;
   description
   "Identity for point-to-point connection.";
  }
  identity multipoint {
   base site-network-access-type;
   description
   "Identity for multipoint connection.
   Example: Ethernet broadcast segment.";
  }
  identity placement-diversity {
   description
   "Base identity for site placement constraints.";
  }
  identity bearer-diverse {
   base placement-diversity;
   description
   "Identity for bearer diversity.
   The bearers should not use common elements.";
  }
  identity pe-diverse {
   base placement-diversity;
   description
   "Identity for PE diversity.";
  }
  identity pop-diverse {
   base placement-diversity;
   description
   "Identity for POP diversity.";
  }
  identity linecard-diverse {
   base placement-diversity;
   description
   "Identity for linecard diversity.";
  }
  identity same-pe {
   base placement-diversity;
   description
   "Identity for having sites connected on the same PE.";
  }
  identity same-bearer {
   base placement-diversity;
   description
   "Identity for having sites connected using the same bearer.";
  }
  identity customer-application {
   description

Wu, et al.                   Standards Track                  [Page 129]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   "Base identity for customer application.";
  }
  identity web {
   base customer-application;
   description
   "Identity for Web application (e.g., HTTP, HTTPS).";
  }
  identity mail {
   base customer-application;
   description
   "Identity for mail application.";
  }
  identity file-transfer {
   base customer-application;
   description
   "Identity for file transfer application (e.g., FTP, SFTP).";
  }
  identity database {
   base customer-application;
   description
   "Identity for database application.";
  }
  identity social {
   base customer-application;
   description
   "Identity for social-network application.";
  }
  identity games {
   base customer-application;
   description
   "Identity for gaming application.";
  }
  identity p2p {
   base customer-application;
   description
   "Identity for peer-to-peer application.";
  }
  identity network-management {
   base customer-application;
   description
   "Identity for management application
   (e.g., Telnet, syslog, SNMP).";
  }
  identity voice {
   base customer-application;
   description
   "Identity for voice application.";
  }

Wu, et al.                   Standards Track                  [Page 130]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  identity video {
   base customer-application;
   description
   "Identity for video conference application.";
  }
  identity embb {
   base customer-application;
   description
   "Identity for an enhanced Mobile Broadband (eMBB)
   application.  Note that an eMBB application demands
   network performance with a wide variety of
   characteristics, such as data rate, latency,
   loss rate, reliability, and many other parameters.";
 }
 identity urllc {
   base customer-application;
   description
   "Identity for an Ultra-Reliable and Low Latency
   Communications (URLLC) application.  Note that a
   URLLC application demands network performance
   with a wide variety of characteristics, such as latency,
   reliability, and many other parameters.";
  }
  identity mmtc {
    base customer-application;
    description
    "Identity for a massive Machine Type
    Communications (mMTC) application.  Note that an
    mMTC application demands network performance
    with a wide variety of characteristics, such as data
    rate, latency, loss rate, reliability, and many
    other parameters.";
  }
  identity site-vpn-flavor {
   description
   "Base identity for the site VPN service flavor.";
  }
  identity site-vpn-flavor-single {
   base site-vpn-flavor;
   description
   "Base identity for the site VPN service flavor.
   Used when the site belongs to only one VPN.";
  }
  identity site-vpn-flavor-multi {
   base site-vpn-flavor;
   description
   "Base identity for the site VPN service flavor.
   Used when a logical connection of a site

Wu, et al.                   Standards Track                  [Page 131]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   belongs to multiple VPNs.";
  }
  identity site-vpn-flavor-sub {
   base site-vpn-flavor;
   description
   "Base identity for the site VPN service flavor.
   Used when a site has multiple logical connections.
   Each connection may belong to different multiple VPNs.";
  }
  identity site-vpn-flavor-nni {
   base site-vpn-flavor;
   description
   "Base identity for the site VPN service flavor.
   Used to describe an NNI option A connection.";
  }
  identity management {
   description
   "Base identity for site management scheme.";
  }
  identity co-managed {
   base management;
   description
   "Base identity for co-managed site.";
  }
  identity customer-managed {
   base management;
   description
   "Base identity for customer-managed site.";
  }
  identity provider-managed {
   base management;
   description
   "Base identity for provider-managed site.";
  }
  identity address-allocation-type {
   description
   "Base identity for address-allocation-type for PE-CE link.";
  }
  identity provider-dhcp {
   base address-allocation-type;
   description
   "Provider network provides DHCP service to customer.";
  }
  identity provider-dhcp-relay {
   base address-allocation-type;
   description
   "Provider network provides DHCP relay service to customer.";
  }

Wu, et al.                   Standards Track                  [Page 132]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  identity provider-dhcp-slaac {
   base address-allocation-type;
   description
   "Provider network provides DHCP service to customer,
   as well as SLAAC.";
  }
  identity static-address {
   base address-allocation-type;
   description
   "Provider-to-customer addressing is static.";
  }
  identity slaac {
   base address-allocation-type;
   description
   "Use IPv6 SLAAC.";
  }
  identity site-role {
   description
   "Base identity for site type.";
  }
  identity any-to-any-role {
   base site-role;
   description
   "Site in an any-to-any IP VPN.";
  }
  identity spoke-role {
   base site-role;
   description
   "Spoke site in a Hub-and-Spoke IP VPN.";
  }
  identity hub-role {
   base site-role;
   description
   "Hub site in a Hub-and-Spoke IP VPN.";
  }
  identity vpn-topology {
   description
   "Base identity for VPN topology.";
  }
  identity any-to-any {
   base vpn-topology;
   description
   "Identity for any-to-any VPN topology.";
  }
  identity hub-spoke {
   base vpn-topology;
   description
   "Identity for Hub-and-Spoke VPN topology.";

Wu, et al.                   Standards Track                  [Page 133]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  }
  identity hub-spoke-disjoint {
   base vpn-topology;
   description
   "Identity for Hub-and-Spoke VPN topology
   where Hubs cannot communicate with each other.";
  }
  identity multicast-tree-type {
   description
   "Base identity for multicast tree type.";
  }
  identity ssm-tree-type {
   base multicast-tree-type;
   description
   "Identity for SSM tree type.";
  }
  identity asm-tree-type {
   base multicast-tree-type;
   description
   "Identity for ASM tree type.";
  }
  identity bidir-tree-type {
   base multicast-tree-type;
   description
   "Identity for bidirectional tree type.";
  }
  identity multicast-rp-discovery-type {
   description
   "Base identity for RP discovery type.";
  }
  identity auto-rp {
   base multicast-rp-discovery-type;
   description
   "Base identity for Auto-RP discovery type.";
  }
  identity static-rp {
   base multicast-rp-discovery-type;
   description
   "Base identity for static type.";
  }
  identity bsr-rp {
   base multicast-rp-discovery-type;
   description
   "Base identity for BSR discovery type.";
  }
  identity routing-protocol-type {
   description
   "Base identity for routing protocol type.";

Wu, et al.                   Standards Track                  [Page 134]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  }
  identity ospf {
   base routing-protocol-type;
   description
   "Identity for OSPF protocol type.";
  }
  identity bgp {
   base routing-protocol-type;
   description
   "Identity for BGP protocol type.";
  }
  identity static {
   base routing-protocol-type;
   description
   "Identity for static routing protocol type.";
  }
  identity rip {
   base routing-protocol-type;
   description
   "Identity for RIP protocol type.";
  }
  identity vrrp {
   base routing-protocol-type;
   description
   "Identity for VRRP protocol type.
   This is to be used when LANs are directly connected
   to PE routers.";
  }
  identity direct {
   base routing-protocol-type;
   description
   "Identity for direct protocol type.";
  }
  identity protocol-type {
   description
   "Base identity for protocol field type.";
  }
  identity tcp {
   base protocol-type;
   description
   "TCP protocol type.";
  }
  identity udp {
   base protocol-type;
   description
   "UDP protocol type.";
  }

Wu, et al.                   Standards Track                  [Page 135]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  identity icmp {
   base protocol-type;
   description
   "ICMP protocol type.";
  }
  identity icmp6 {
   base protocol-type;
   description
   "ICMPv6 protocol type.";
  }
  identity gre {
   base protocol-type;
   description
   "GRE protocol type.";
  }
  identity ipip {
   base protocol-type;
   description
   "IP-in-IP protocol type.";
  }
  identity hop-by-hop {
   base protocol-type;
   description
   "Hop-by-Hop IPv6 header type.";
  }
  identity routing {
   base protocol-type;
   description
   "Routing IPv6 header type.";
  }
  identity esp {
   base protocol-type;
   description
   "ESP header type.";
  }
  identity ah {
   base protocol-type;
   description
   "AH header type.";
  }
  identity vpn-policy-filter-type {
   description
   "Base identity for VPN Policy filter type.";
  }
  identity ipv4 {
    base vpn-policy-filter-type;
    description
    "Identity for IPv4 Prefix filter type.";

Wu, et al.                   Standards Track                  [Page 136]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  }
  identity ipv6 {
    base vpn-policy-filter-type;
    description
    "Identity for IPv6 Prefix filter type.";
 }
  identity lan {
    base vpn-policy-filter-type;
    description
    "Identity for LAN Tag filter type.";
 }

  identity qos-profile-direction {
   description
   "Base identity for QoS profile direction.";
  }

  identity site-to-wan {
    base qos-profile-direction;
    description
    "Identity for Site-to-WAN direction.";
  }
  identity wan-to-site {
    base qos-profile-direction;
    description
    "Identity for WAN-to-Site direction.";
  }
  identity both {
    base qos-profile-direction;
    description
    "Identity for both WAN-to-Site direction
    and Site-to-WAN direction.";
  }
  /* Groupings */
  grouping vpn-service-cloud-access {
   container cloud-accesses {
    if-feature cloud-access;
    list cloud-access {
     key cloud-identifier;
     leaf cloud-identifier {
      type leafref {
       path "/l3vpn-svc/vpn-profiles/"+
       "valid-provider-identifiers/cloud-identifier/id";
      }
      description
      "Identification of cloud service.
      Local administration meaning.";
     }

Wu, et al.                   Standards Track                  [Page 137]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     choice list-flavor {
      case permit-any {
       leaf permit-any {
        type empty;
        description
        "Allows all sites.";
       }
      }
      case deny-any-except {
       leaf-list permit-site {
        type leafref {
         path "/l3vpn-svc/sites/site/site-id";
        }
        description
        "Site ID to be authorized.";
       }
      }
      case permit-any-except {
       leaf-list deny-site {
        type leafref {
        path "/l3vpn-svc/sites/site/site-id";
       }
       description
       "Site ID to be denied.";
       }
      }
      description
      "Choice for cloud access policy.  By
      default, all sites in the IP VPN MUST
      be authorized to access the cloud.";
     }
     container address-translation {
      container nat44 {
       leaf enabled {
        type boolean;
         default false;
         description
         "Controls whether or not Network address
         translation from IPv4 to IPv4 (NAT44)
         [RFC3022] is required.";
       }
       leaf nat44-customer-address {
        type inet:ipv4-address;
         description
         "Address to be used for network address
         translation from IPv4 to IPv4.  This is
         to be used if the customer is providing
         the IPv4 address.  If the customer address

Wu, et al.                   Standards Track                  [Page 138]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

         is not set, the model assumes that the
         provider will allocate the address.";
       }
       description
       "IPv4-to-IPv4 translation.";
      }
      description
      "Container for NAT.";
     }
     description
     "Cloud access configuration.";
    }
    description
    "Container for cloud access configurations.";
   }
   description
   "Grouping for VPN cloud definition.";
  }
  grouping multicast-rp-group-cfg {
   choice group-format {
    mandatory true;
    case singleaddress {
     leaf group-address {
      type inet:ip-address;
      description
      "A single multicast group address.";
     }
    }
    case startend {
     leaf group-start {
      type inet:ip-address;
      description
      "The first multicast group address in
      the multicast group address range.";
     }
     leaf group-end {
      type inet:ip-address;
      description
      "The last multicast group address in
      the multicast group address range.";
     }
    }
    description
    "Choice for multicast group format.";
   }
   description
   "This grouping defines multicast group or
   multicast groups for RP-to-group mapping.";

Wu, et al.                   Standards Track                  [Page 139]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  }
  grouping vpn-service-multicast {
   container multicast {
    if-feature multicast;
    leaf enabled {
     type boolean;
     default false;
     description
     "Enables multicast.";
    }
    container customer-tree-flavors {
     leaf-list tree-flavor {
      type identityref {
       base multicast-tree-type;
      }
      description
       "Type of tree to be used.";
     }
     description
     "Type of trees used by customer.";
    }
    container rp {
     container rp-group-mappings {
      list rp-group-mapping {
       key id;
       leaf id {
        type uint16;
        description
        "Unique identifier for the mapping.";
       }
       container provider-managed {
        leaf enabled {
         type boolean;
         default false;
         description
         "Set to true if the Rendezvous Point (RP)
         must be a provider-managed node.  Set to false
         if it is a customer-managed node.";
        }
        leaf rp-redundancy {
         type boolean;
         default false;
         description
         "If true, a redundancy mechanism for the RP
         is required.";
        }
        leaf optimal-traffic-delivery {
         type boolean;

Wu, et al.                   Standards Track                  [Page 140]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

         default false;
         description
         "If true, the SP must ensure that
         traffic uses an optimal path.  An SP may use
         Anycast RP or RP-tree-to-SPT switchover
         architectures.";
        }
        description
        "Parameters for a provider-managed RP.";
       }
       leaf rp-address {
        when "../provider-managed/enabled = 'false'" {
         description
         "Relevant when the RP is not provider-managed.";
        }
        type inet:ip-address;
          mandatory true;
        description
        "Defines the address of the RP.
        Used if the RP is customer-managed.";
       }
       container groups {
        list group {
         key id;
         leaf id {
          type uint16;
          description
          "Identifier for the group.";
         }
         uses multicast-rp-group-cfg;
         description
         "List of multicast groups.";
        }
        description
        "Multicast groups associated with the RP.";
       }
       description
       "List of RP-to-group mappings.";
      }
      description
      "RP-to-group mappings parameters.";
     }
     container rp-discovery {
      leaf rp-discovery-type {
       type identityref {
        base multicast-rp-discovery-type;
        }
       default static-rp;

Wu, et al.                   Standards Track                  [Page 141]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

       description
       "Type of RP discovery used.";
      }
      container bsr-candidates {
        when "derived-from-or-self(../rp-discovery-type, "+
            "'l3vpn-svc:bsr-rp')" {
        description
        "Only applicable if discovery type
        is BSR-RP.";
       }
       leaf-list bsr-candidate-address {
        type inet:ip-address;
         description
         "Address of BSR candidate.";
       }
       description
       "Container for List of Customer
       BSR candidate's addresses.";
      }
      description
      "RP discovery parameters.";
     }
     description
     "RP parameters.";
    }
    description
    "Multicast global parameters for the VPN service.";
   }
   description
   "Grouping for multicast VPN definition.";
  }
  grouping vpn-service-mpls {
   leaf carrierscarrier {
    if-feature carrierscarrier;
     type boolean;
     default false;
     description
     "The VPN is using CsC, and so MPLS is required.";
   }
   description
   "Grouping for MPLS CsC definition.";
  }
  grouping customer-location-info {
   container locations {
    list location {
     key location-id;
     leaf location-id {
      type svc-id;

Wu, et al.                   Standards Track                  [Page 142]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      description
      "Identifier for a particular location.";
     }
     leaf address {
      type string;
      description
      "Address (number and street) of the site.";
     }
     leaf postal-code {
      type string;
      description
      "Postal code of the site.";
     }
     leaf state {
      type string;
      description
      "State of the site.  This leaf can also be
      used to describe a region for a country that
      does not have states.";
     }
     leaf city {
      type string;
      description
      "City of the site.";
     }
     leaf country-code {
      type string {
       pattern '[A-Z]{2}';
      }
      description
      "Country of the site.
      Expressed as ISO ALPHA-2 code.";
     }
     description
     "Location of the site.";
    }
    description
    "List of locations for the site.";
   }
   description
   "This grouping defines customer location parameters.";
  }
  grouping site-group {
   container groups {
    list group {
     key group-id;
     leaf group-id {
      type string;

Wu, et al.                   Standards Track                  [Page 143]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      description
      "Group-id the site belongs to.";
     }
     description
     "List of group-ids.";
    }
    description
    "Groups the site or site-network-access belongs to.";
   }
   description
   "Grouping definition to assign
   group-ids to site or site-network-access.";
  }
  grouping site-diversity {
   container site-diversity {
    if-feature site-diversity;
    uses site-group;
    description
    "Diversity constraint type.  All
    site-network-accesses will inherit
    the group values defined here.";
   }
   description
   "This grouping defines site
   diversity parameters.";
  }
  grouping access-diversity {
   container access-diversity {
    if-feature site-diversity;
    uses site-group;
    container constraints {
     list constraint {
      key constraint-type;
      leaf constraint-type {
       type identityref {
        base placement-diversity;
       }
       description
       "Diversity constraint type.";
      }
      container target {
       choice target-flavor {
        default id;
        case id {
         list group {
          key group-id;
          leaf group-id {
           type string;

Wu, et al.                   Standards Track                  [Page 144]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

           description
           "The constraint will be applied against
           this particular group-id for this site
           network access level.";
          }
          description
          "List of group-ids associated with one specific
          constraint for this site network access level.";
         }
        }
        case all-accesses {
         leaf all-other-accesses {
          type empty;
          description
          "The constraint will be applied against
          all other site network accesses of this site.";
         }
        }
        case all-groups {
         leaf all-other-groups {
          type empty;
          description
          "The constraint will be applied against
          all other groups managed by the customer.";
         }
        }
        description
        "Choice for the target flavor definition.";
       }
       description
       "The constraint will be applied against a
       Specific target, and the target can be a list
       of group-ids,all other site network accesses of
       this site, or all other groups managed by the
       customer.";
      }
      description
      "List of constraints.";
     }
     description
     "Placement constraints for this site network access.";
    }
    description
    "Diversity parameters.";
   }
   description
   "This grouping defines access diversity parameters.";
  }

Wu, et al.                   Standards Track                  [Page 145]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  grouping operational-requirements {
    leaf requested-site-start {
     type yang:date-and-time;
      description
      "Optional leaf indicating requested date and
      time when the service at a particular site is
      expected to start.";
   }

   leaf requested-site-stop {
     type yang:date-and-time;
      description
      "Optional leaf indicating requested date and
      time when the service at a particular site is
      expected to stop.";
   }
   description
   "This grouping defines some operational
   parameters.";
  }
  grouping operational-requirements-ops {
    leaf actual-site-start {
     type yang:date-and-time;
     config false;
      description
      "Optional leaf indicating actual date and
      time when the service at a particular site
      actually started.";
   }
   leaf actual-site-stop {
    type yang:date-and-time;
    config false;
      description
      "Optional leaf indicating actual date and
      time when the service at a particular site
      actually stopped.";
   }
   description
   "This grouping defines some operational
   parameters.";
  }
  grouping flow-definition {
   container match-flow {
    leaf dscp {
     type inet:dscp;
      description
      "DSCP value.";
    }

Wu, et al.                   Standards Track                  [Page 146]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    leaf dot1p {
     type uint8 {
      range "0..7";
     }
     description
     "802.1p matching.";
    }
    leaf ipv4-src-prefix {
     type inet:ipv4-prefix;
      description
      "Match on IPv4 src address.";
    }
    leaf ipv6-src-prefix {
     type inet:ipv6-prefix;
      description
      "Match on IPv6 src address.";
    }
    leaf ipv4-dst-prefix {
     type inet:ipv4-prefix;
      description
      "Match on IPv4 dst address.";
    }
    leaf ipv6-dst-prefix {
     type inet:ipv6-prefix;
     description
     "Match on IPv6 dst address.";
    }
    leaf l4-src-port {
     type inet:port-number;
         must "current() < ../l4-src-port-range/lower-port or "+
         "current() > ../l4-src-port-range/upper-port" {
      description
      "If l4-src-port and l4-src-port-range/lower-port and
      upper-port are set at the same time, l4-src-port
      should not overlap with l4-src-port-range.";
      }
      description
      "Match on Layer 4 src port.";
    }
    leaf-list target-sites {
      if-feature target-sites;
      type svc-id;
      description
      "Identify a site as traffic destination.";
    }
    container l4-src-port-range {
      leaf lower-port {
      type inet:port-number;

Wu, et al.                   Standards Track                  [Page 147]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      description
      "Lower boundary for port.";
     }
     leaf upper-port {
      type inet:port-number;
      must ". >= ../lower-port" {
       description
       "Upper boundary for port.  If it
       exists, the upper boundary must be
       higher than the lower boundary.";
      }
      description
      "Upper boundary for port.";
     }
      description
      "Match on Layer 4 src port range.  When
      only the lower-port is present, it represents
      a single port.  When both the lower-port and
      upper-port are specified, it implies
      a range inclusive of both values.";
    }
    leaf l4-dst-port {
     type inet:port-number;
          must "current() < ../l4-dst-port-range/lower-port or "+
          "current() > ../l4-dst-port-range/upper-port" {
      description
      "If l4-dst-port and l4-dst-port-range/lower-port
      and upper-port are set at the same time,
      l4-dst-port should not overlap with
      l4-src-port-range.";
      }
      description
      "Match on Layer 4 dst port.";
    }
    container l4-dst-port-range {
     leaf lower-port {
      type inet:port-number;
      description
      "Lower boundary for port.";
     }
     leaf upper-port {
      type inet:port-number;
      must ". >= ../lower-port" {
      description
      "Upper boundary must be
      higher than lower boundary.";
      }
      description

Wu, et al.                   Standards Track                  [Page 148]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      "Upper boundary for port.  If it exists,
      upper boundary must be higher than lower
      boundary.";
     }
     description
     "Match on Layer 4 dst port range.  When only
     lower-port is present, it represents a single
     port.  When both lower-port and upper-port are
     specified, it implies a range inclusive of both
     values.";
    }
    leaf protocol-field {
     type union {
      type uint8;
      type identityref {
       base protocol-type;
      }
     }
     description
     "Match on IPv4 protocol or IPv6 Next Header field.";
    }
    description
    "Describes flow-matching criteria.";
   }
   description
   "Flow definition based on criteria.";
  }
  grouping site-service-basic {
   leaf svc-input-bandwidth {
     type uint64;
     units bps;
     mandatory true;
      description
      "From the customer site's perspective, the service
      input bandwidth of the connection or download
      bandwidth from the SP to the site.";
   }
   leaf svc-output-bandwidth {
    type uint64;
    units bps;
    mandatory true;
      description
      "From the customer site's perspective, the service
      output bandwidth of the connection or upload
      bandwidth from the site to the SP.";
   }
   leaf svc-mtu {
    type uint16;

Wu, et al.                   Standards Track                  [Page 149]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    units bytes;
    mandatory true;
     description
     "MTU at service level.  If the service is IP,
     it refers to the IP MTU.  If CsC is enabled,
     the requested 'svc-mtu' leaf will refer to the
     MPLS MTU and not to the IP MTU.";
   }
   description
   "Defines basic service parameters for a site.";
  }
  grouping site-protection {
   container traffic-protection {
    if-feature fast-reroute;
    leaf enabled {
     type boolean;
     default false;
      description
      "Enables traffic protection of access link.";
    }
    description
    "Fast Reroute service parameters for the site.";
   }
   description
   "Defines protection service parameters for a site.";
  }
  grouping site-service-mpls {
   container carrierscarrier {
    if-feature carrierscarrier;
    leaf signalling-type {
     type enumeration {
     enum ldp {
      description
      "Use LDP as the signalling protocol
      between the PE and the CE.  In this case,
      an IGP routing protocol must also be activated.";
      }
     enum bgp {
      description
      "Use BGP (as per RFC 8277) as the signalling protocol
      between the PE and the CE.
      In this case, BGP must also be configured as
      the routing protocol.";
      }
     }
     default bgp;
     description
     "MPLS signalling type.";

Wu, et al.                   Standards Track                  [Page 150]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    }
      description
      "This container is used when the customer provides
      MPLS-based services.  This is only used in the case
      of CsC (i.e., a customer builds an MPLS service using
      an IP VPN to carry its traffic).";
   }
      description
      "Defines MPLS service parameters for a site.";
  }
  grouping site-service-qos-profile {
   container qos {
    if-feature qos;
    container qos-classification-policy {
     list rule {
      key id;
      ordered-by user;
      leaf id {
       type string;
       description
       "A description identifying the
        qos-classification-policy rule.";
      }
      choice match-type {
       default match-flow;
       case match-flow {
       uses flow-definition;
       }
       case match-application {
        leaf match-application {
         type identityref {
          base customer-application;
         }
          description
          "Defines the application to match.";
        }
       }
       description
       "Choice for classification.";
      }
      leaf target-class-id {
       type string;
       description
       "Identification of the class of service.
       This identifier is internal to the administration.";
      }
      description
      "List of marking rules.";

Wu, et al.                   Standards Track                  [Page 151]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     }
     description
     "Configuration of the traffic classification policy.";
    }
    container qos-profile {
     choice qos-profile {
      description
      "Choice for QoS profile.
      Can be standard profile or customized profile.";
      case standard {
       description
       "Standard QoS profile.";
       leaf profile {
        type leafref {
        path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers"+
            "/qos-profile-identifier/id";
        }
        description
        "QoS profile to be used.";
       }
      }
      case custom {
       description
       "Customized QoS profile.";
        container classes {
         if-feature qos-custom;
         list class {
          key class-id;
          leaf class-id {
          type string;
                   description
                   "Identification of the class of service.
                   This identifier is internal to the
                   administration.";
          }
          leaf direction {
                   type identityref {
                    base qos-profile-direction;
                    }
                   default both;
                    description
                    "The direction to which the QoS profile
                    is applied.";
                 }
                  leaf rate-limit {
                   type decimal64 {
                    fraction-digits 5;
                    range "0..100";

Wu, et al.                   Standards Track                  [Page 152]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

           }
                   units percent;
                    description
                    "To be used if the class must be rate-limited.
                    Expressed as percentage of the service
                    bandwidth.";
         }
         container latency {
          choice flavor {
           case lowest {
            leaf use-lowest-latency {
             type empty;
              description
              "The traffic class should use the path with the
              lowest latency.";
            }
           }
           case boundary {
            leaf latency-boundary {
             type uint16;
             units msec;
             default 400;
              description
              "The traffic class should use a path with a
              defined maximum latency.";
            }
           }
           description
           "Latency constraint on the traffic class.";
          }
          description
          "Latency constraint on the traffic class.";
         }
         container jitter {
          choice flavor {
           case lowest {
            leaf use-lowest-jitter {
             type empty;
              description
              "The traffic class should use the path with the
              lowest jitter.";
            }
           }
           case boundary {
            leaf latency-boundary {
             type uint32;
             units usec;
             default 40000;

Wu, et al.                   Standards Track                  [Page 153]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

              description
              "The traffic class should use a path with a
              defined maximum jitter.";
            }
           }
           description
           "Jitter constraint on the traffic class.";
          }
          description
          "Jitter constraint on the traffic class.";
         }
         container bandwidth {
          leaf guaranteed-bw-percent {
           type decimal64 {
                   fraction-digits 5;
                   range "0..100";
           }
           units percent;
           mandatory true;
            description
            "To be used to define the guaranteed bandwidth
            as a percentage of the available service bandwidth.";
          }
          leaf end-to-end {
           type empty;
            description
            "Used if the bandwidth reservation
            must be done on the MPLS network too.";
          }
          description
          "Bandwidth constraint on the traffic class.";
         }
         description
         "List of classes of services.";
        }
        description
        "Container for list of classes of services.";
       }
      }
     }
     description
     "QoS profile configuration.";
    }
    description
    "QoS configuration.";
   }
   description
   "This grouping defines QoS parameters for a site.";

Wu, et al.                   Standards Track                  [Page 154]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  }
  grouping site-security-authentication {
   container authentication {
      description
      "Authentication parameters.";
   }
   description
   "This grouping defines authentication parameters for a site.";
  }
  grouping site-security-encryption {
   container encryption {
    if-feature encryption;
    leaf enabled {
     type boolean;
     default false;
      description
      "If true, traffic encryption on the connection is required.";
    }
    leaf layer {
       when "../enabled = 'true'" {
          description
          "Require a value for layer when enabled is true.";
        }
     type enumeration {
      enum layer2 {
       description
       "Encryption will occur at Layer 2.";
      }
      enum layer3 {
       description
       "Encryption will occur at Layer 3.
       For example, IPsec may be used when
       a customer requests Layer 3 encryption.";
      }
     }
     description
      "Layer on which encryption is applied.";
    }
    container encryption-profile {
     choice profile {
      case provider-profile {
       leaf profile-name {
        type leafref {
         path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers"+
                 "/encryption-profile-identifier/id";
        }
          description
          "Name of the SP profile to be applied.";

Wu, et al.                   Standards Track                  [Page 155]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

       }
      }
      case customer-profile {
       leaf algorithm {
        type string;
          description
          "Encryption algorithm to be used.";
       }
       choice key-type {
        default psk;
        case psk {
         leaf preshared-key {
          type string;
          description
          "Pre-Shared Key (PSK) coming from the customer.";
         }
        }
        description
        "Type of keys to be used.";
       }
      }
      description
      "Choice of encryption profile.  The encryption
      profile can be the provider profile or customer profile.";
     }
     description
     "Profile of encryption to be applied.";
    }
    description
    "Encryption parameters.";
   }
   description
   "This grouping defines encryption parameters for a site.";
  }
  grouping site-attachment-bearer {
   container bearer {
    container requested-type {
     if-feature requested-type;
     leaf requested-type {
      type string;
      description
      "Type of requested bearer: Ethernet, DSL,
      Wireless, etc. Operator specific.";
     }
     leaf strict {
      type boolean;
      default false;
      description

Wu, et al.                   Standards Track                  [Page 156]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      "Defines whether requested-type is a preference
      or a strict requirement.";
     }
      description
      "Container for requested-type.";
    }
    leaf always-on {
     if-feature always-on;
     type boolean;
     default true;
      description
      "Request for an always-on access type.
      For example, this could mean no dial access type.";
    }
    leaf bearer-reference {
     if-feature bearer-reference;
     type string;
      description
      "This is an internal reference for the SP.";
    }
      description
      "Bearer-specific parameters.
      To be augmented.";
   }
   description
   "Defines physical properties of a site attachment.";
  }
  grouping site-routing {
   container routing-protocols {
    list routing-protocol {
     key type;
     leaf type {
      type identityref {
       base routing-protocol-type;
      }
      description
      "Type of routing protocol.";
     }
     container ospf {
      when "derived-from-or-self(../type, 'l3vpn-svc:ospf')" {
      description
      "Only applies when protocol is OSPF.";
      }
      if-feature rtg-ospf;
      leaf-list address-family {
       type address-family;
           min-elements "1";
          description

Wu, et al.                   Standards Track                  [Page 157]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

          "If OSPF is used on this site, this node
          contains a configured value.  This node
          contains at least one address family
          to be activated.";
      }
      leaf area-address {
       type yang:dotted-quad;
       mandatory true;
          description
          "Area address.";
      }
      leaf metric {
       type uint16;
       default 1;
          description
          "Metric of the PE-CE link.  It is used
          in the routing state calculation and
          path selection.";
      }
      container sham-links {
       if-feature rtg-ospf-sham-link;
       list sham-link {
        key target-site;
        leaf target-site {
         type svc-id;
          description
          "Target site for the sham link connection.
          The site is referred to by its ID.";
        }
        leaf metric {
         type uint16;
         default 1;
          description
          "Metric of the sham link.  It is used in
          the routing state calculation and path
          selection.  The default value is set
          to 1.";
        }
          description
          "Creates a sham link with another site.";
       }
       description
       "List of sham links.";
      }
      description
      "OSPF-specific configuration.";
     }
     container bgp {

Wu, et al.                   Standards Track                  [Page 158]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      when "derived-from-or-self(../type, 'l3vpn-svc:bgp')" {
       description
       "Only applies when protocol is BGP.";
      }
      if-feature rtg-bgp;
      leaf autonomous-system {
       type uint32;
       mandatory true;
          description
          "Customer AS number in case the customer
          requests BGP routing.";
      }
      leaf-list address-family {
       type address-family;
           min-elements "1";
          description
          "If BGP is used on this site, this node
          contains a configured value.  This node
          contains at least one address family
          to be activated.";
      }
      description
      "BGP-specific configuration.";
     }
     container static {
      when "derived-from-or-self(../type, 'l3vpn-svc:static')" {
        description
        "Only applies when protocol is static.
        BGP activation requires the SP to know
        the address of the customer peer.  When
        BGP is enabled, the 'static-address'
        allocation type for the IP connection
        MUST be used.";
      }
      container cascaded-lan-prefixes {
       list ipv4-lan-prefixes {
        if-feature ipv4;
        key "lan next-hop";
        leaf lan {
         type inet:ipv4-prefix;
         description
         "LAN prefixes.";
        }
        leaf lan-tag {
         type string;
          description
          "Internal tag to be used in VPN policies.";
        }

Wu, et al.                   Standards Track                  [Page 159]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

        leaf next-hop {
         type inet:ipv4-address;
          description
          "Next-hop address to use on the customer side.";
        }
        description
        "List of LAN prefixes for the site.";
       }
       list ipv6-lan-prefixes {
        if-feature ipv6;
        key "lan next-hop";
        leaf lan {
         type inet:ipv6-prefix;
          description
          "LAN prefixes.";
        }
        leaf lan-tag {
         type string;
         description
         "Internal tag to be used in VPN policies.";
        }
        leaf next-hop {
         type inet:ipv6-address;
          description
          "Next-hop address to use on the customer side.";
        }
        description
        "List of LAN prefixes for the site.";
       }
       description
       "LAN prefixes from the customer.";
      }
      description
      "Configuration specific to static routing.";
     }
     container rip {
      when "derived-from-or-self(../type, 'l3vpn-svc:rip')" {
       description
       "Only applies when the protocol is RIP.  For IPv4,
       the model assumes that RIP version 2 is used.";
      }
      if-feature rtg-rip;
      leaf-list address-family {
       type address-family;
           min-elements "1";
          description
          "If RIP is used on this site, this node
          contains a configured value.  This node

Wu, et al.                   Standards Track                  [Page 160]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

          contains at least one address family
          to be activated.";
      }
      description
      "Configuration specific to RIP routing.";
     }
     container vrrp {
      when "derived-from-or-self(../type, 'l3vpn-svc:vrrp')" {
       description
       "Only applies when protocol is VRRP.";
      }
      if-feature rtg-vrrp;
      leaf-list address-family {
       type address-family;
           min-elements "1";
          description
          "If VRRP is used on this site, this node
          contains a configured value.  This node contains
          at least one address family to be activated.";
      }
      description
      "Configuration specific to VRRP routing.";
     }
     description
     "List of routing protocols used on
     the site.  This list can be augmented.";
    }
    description
    "Defines routing protocols.";
   }
   description
   "Grouping for routing protocols.";
  }
  grouping site-attachment-ip-connection {
    container ip-connection {
      container ipv4 {
      if-feature ipv4;
       leaf address-allocation-type {
       type identityref {
        base address-allocation-type;
      }
      must "not(derived-from-or-self(current(), 'l3vpn-svc:slaac') or "+
          "derived-from-or-self(current(), "+
          "'l3vpn-svc:provider-dhcp-slaac'))" {
      error-message "SLAAC is only applicable to IPv6";
      }
      description
      "Defines how addresses are allocated.

Wu, et al.                   Standards Track                  [Page 161]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      If there is no value for the address
      allocation type, then IPv4 is not enabled.";
     }
    container provider-dhcp {
      when "derived-from-or-self(../address-allocation-type, "+
      "'l3vpn-svc:provider-dhcp')" {
      description
      "Only applies when addresses are allocated by DHCP.";
    }
      leaf provider-address {
       type inet:ipv4-address;
          description
          "Address of provider side.  If provider-address is not
          specified, then prefix length should not be specified
          either.  It also implies provider-dhcp allocation is
          not enabled.  If provider-address is specified, then
          the prefix length may or may not be specified.";
      }
      leaf prefix-length {
       type uint8 {
       range "0..32";
       }
          must "(../provider-address)" {
           error-message
           "If the prefix length is specified, provider-address
           must also be specified.";
              description
              "If the prefix length is specified, provider-address
              must also be specified.";
         }
      description
      "Subnet prefix length expressed in bits.
      If not specified, or specified as zero,
      this means the customer leaves the actual
      prefix length value to the provider.";
      }
      choice address-assign {
       default number;
       case number {
        leaf number-of-dynamic-address {
         type uint16;
         default 1;
          description
          "Describes the number of IP addresses
          the customer requires.";
        }
       }
       case explicit {

Wu, et al.                   Standards Track                  [Page 162]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

        container customer-addresses {
         list address-group {
          key "group-id";
          leaf group-id {
          type string;
          description
          "Group-id for the address range from
          start-address to end-address.";
          }
         leaf start-address {
          type inet:ipv4-address;
           description
           "First address.";
          }
         leaf end-address {
          type inet:ipv4-address;
          description
          "Last address.";
          }
          description
          "Describes IP addresses allocated by DHCP.
          When only start-address or only end-address
          is present, it represents a single address.
          When both start-address and end-address are
          specified, it implies a range inclusive of both
          addresses.  If no address is specified, it implies
          customer addresses group is not supported.";
         }
          description
          "Container for customer addresses is allocated by DHCP.";
        }
      }
          description
          "Choice for the way to assign addresses.";
      }
          description
          "DHCP allocated addresses related parameters.";
     }
  container dhcp-relay {
    when "derived-from-or-self(../address-allocation-type, "+
    "'l3vpn-svc:provider-dhcp-relay')" {
      description
      "Only applies when provider is required to implement
      DHCP relay function.";
   }
  leaf provider-address {
   type inet:ipv4-address;
      description

Wu, et al.                   Standards Track                  [Page 163]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      "Address of provider side.  If provider-address is not
      specified, then prefix length should not be specified
      either.  It also implies provider-dhcp allocation is
      not enabled.  If provider-address is specified, then
      prefix length may or may not be specified.";
  }
  leaf prefix-length {
   type uint8 {
   range "0..32";
   }
  must "(../provider-address)" {
   error-message
      "If prefix length is specified, provider-address
       must also be specified.";
      description
      "If prefix length is specified, provider-address
      must also be specified.";
 }
      description
      "Subnet prefix length expressed in bits.  If not
      specified, or specified as zero, this means the
      customer leaves the actual prefix length value
      to the provider.";
  }
  container customer-dhcp-servers {
   leaf-list server-ip-address {
   type inet:ipv4-address;
      description
      "IP address of customer DHCP server.";
  }
  description
  "Container for list of customer DHCP servers.";
  }
  description
  "DHCP relay provided by operator.";
 }
  container addresses {
    when "derived-from-or-self(../address-allocation-type, "+
    "'l3vpn-svc:static-address')" {
    description
    "Only applies when protocol allocation type is static.";
     }
      leaf provider-address {
       type inet:ipv4-address;
          description
          "IPv4 Address List of the provider side.
          When the protocol allocation type is static,
          the provider address must be configured.";

Wu, et al.                   Standards Track                  [Page 164]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      }
      leaf customer-address {
       type inet:ipv4-address;
          description
          "IPv4 Address of customer side.";
      }
      leaf prefix-length {
       type uint8 {
        range "0..32";
       }
      description
      "Subnet prefix length expressed in bits.
      It is applied to both provider-address
      and customer-address.";
      }
      description
      "Describes IPv4 addresses used.";
     }
     description
     "IPv4-specific parameters.";
    }
    container ipv6 {
     if-feature ipv6;
     leaf address-allocation-type {
      type identityref {
       base address-allocation-type;
      }
      description
      "Defines how addresses are allocated.
      If there is no value for the address
      allocation type, then IPv6 is
      not enabled.";
     }

    container provider-dhcp {
       when "derived-from-or-self(../address-allocation-type, "+
       "'l3vpn-svc:provider-dhcp') "+
       "or derived-from-or-self(../address-allocation-type, "+
       "'l3vpn-svc:provider-dhcp-slaac')" {
       description
       "Only applies when addresses are allocated by DHCP.";
        }
           leaf provider-address {
            type inet:ipv6-address;
            description
            "Address of the provider side.  If provider-address
            is not specified, then prefix length should not be
            specified either.  It also implies provider-dhcp

Wu, et al.                   Standards Track                  [Page 165]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

            allocation is not enabled.  If provider-address is
            specified, then prefix length may or may
            not be specified.";
          }
       leaf prefix-length {
        type uint8 {
        range "0..128";
        }
            must "(../provider-address)" {
              error-message
              "If prefix length is specified, provider-address
              must also be specified.";
              description
              "If prefix length is specified, provider-address
              must also be specified.";
             }
        description
        "Subnet prefix length expressed in bits.  If not
        specified, or specified as zero, this means the
        customer leaves the actual prefix length value
        to the provider.";
      }
         choice address-assign {
          default number;
          case number {
           leaf number-of-dynamic-address {
            type uint16;
            default 1;
            description
            "Describes the number of IP addresses the customer
            requires.";
           }
          }
          case explicit {
           container customer-addresses {
            list address-group {
                  key "group-id";
                  leaf group-id {
                  type string;
                  description
                  "Group-id for the address range from
                  start-address to end-address.";
              }
                  leaf start-address {
                   type inet:ipv6-address;
                   description
                   "First address.";
                   }

Wu, et al.                   Standards Track                  [Page 166]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

                  leaf end-address {
                   type inet:ipv6-address;
                   description
                   "Last address.";
                   }
                  description
                  "Describes IP addresses allocated by DHCP.  When only
                  start-address or only end-address is present, it
                  represents a single address.  When both start-address
                  and end-address are specified, it implies a range
                  inclusive of both addresses.  If no address is
                  specified, it implies customer addresses group is
                  not supported.";
           }
            description
            "Container for customer addresses allocated by DHCP.";
          }
         }
          description
          "Choice for the way to assign addresses.";
         }
          description
          "DHCP allocated addresses related parameters.";
         }
    container dhcp-relay {
     when "derived-from-or-self(../address-allocation-type, "+
          "'l3vpn-svc:provider-dhcp-relay')" {
       description
       "Only applies when the provider is required
       to implement DHCP relay function.";
       }
         leaf provider-address {
          type inet:ipv6-address;
           description
           "Address of the provider side.  If provider-address is
           not specified, then prefix length should not be
           specified either.  It also implies provider-dhcp
           allocation is not enabled.  If provider address
           is specified, then prefix length may or may
           not be specified.";
           }
         leaf prefix-length {
          type uint8 {
           range "0..128";
           }
          must "(../provider-address)" {
           error-message
            "If prefix length is specified, provider-address

Wu, et al.                   Standards Track                  [Page 167]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

            must also be specified.";
           description
           "If prefix length is specified, provider-address
           must also be specified.";
            }
          description
          "Subnet prefix length expressed in bits.  If not
          specified, or specified as zero, this means the
          customer leaves the actual prefix length value
          to the provider.";
          }
     container customer-dhcp-servers {
      leaf-list server-ip-address {
       type inet:ipv6-address;
        description
        "This node contains the IP address of
        the customer DHCP server.  If the DHCP relay
        function is implemented by the
        provider, this node contains the
        configured value.";
      }
       description
       "Container for list of customer DHCP servers.";
      }
     description
     "DHCP relay provided by operator.";
     }
    container addresses {
     when "derived-from-or-self(../address-allocation-type, "+
         "'l3vpn-svc:static-address')" {
      description
      "Only applies when protocol allocation type is static.";
      }
     leaf provider-address {
      type inet:ipv6-address;
       description
       "IPv6 Address of the provider side.  When the protocol
       allocation type is static, the provider address
       must be configured.";
      }
     leaf customer-address {
      type inet:ipv6-address;
       description
       "The IPv6 Address of the customer side.";
      }
     leaf prefix-length {
      type uint8 {
       range "0..128";

Wu, et al.                   Standards Track                  [Page 168]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      }
      description
      "Subnet prefix length expressed in bits.
      It is applied to both provider-address and
      customer-address.";
     }
     description
     "Describes IPv6 addresses used.";
     }
     description
     "IPv6-specific parameters.";
    }
    container oam {
     container bfd {
      if-feature bfd;
      leaf enabled {
       type boolean;
       default false;
       description
       "If true, BFD activation is required.";
      }
      choice holdtime {
       default fixed;
       case fixed {
        leaf fixed-value {
         type uint32;
         units msec;
          description
          "Expected BFD holdtime expressed in msec.  The customer
          may impose some fixed values for the holdtime period
          if the provider allows the customer use this function.
          If the provider doesn't allow the customer to use this
          function, the fixed-value will not be set.";
        }
       }
       case profile {
        leaf profile-name {
         type leafref {
          path "/l3vpn-svc/vpn-profiles/valid-provider-identifiers/"+
                  "bfd-profile-identifier/id";
         }
         description
         "Well-known SP profile name.  The provider can propose
         some profiles to the customer, depending on the service
         level the customer wants to achieve.  Profile names
         must be communicated to the customer.";
        }
        description

Wu, et al.                   Standards Track                  [Page 169]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

        "Well-known SP profile.";
       }
       description
       "Choice for holdtime flavor.";
      }
      description
      "Container for BFD.";
     }
     description
     "Defines the Operations, Administration, and Maintenance (OAM)
     mechanisms used on the connection.  BFD is set as a fault
     detection mechanism, but the 'oam' container can easily
     be augmented by other mechanisms";
    }
    description
    "Defines connection parameters.";
   }
   description
   "This grouping defines IP connection parameters.";
  }
  grouping site-service-multicast {
   container multicast {
    if-feature multicast;
    leaf multicast-site-type {
     type enumeration {
      enum receiver-only {
       description
       "The site only has receivers.";
      }
      enum source-only {
       description
       "The site only has sources.";
      }
      enum source-receiver {
       description
       "The site has both sources and receivers.";
      }
     }
     default source-receiver;
     description
     "Type of multicast site.";
    }
    container multicast-address-family {
     leaf ipv4 {
      if-feature ipv4;
      type boolean;
      default false;
      description

Wu, et al.                   Standards Track                  [Page 170]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

      "Enables IPv4 multicast.";
     }
     leaf ipv6 {
      if-feature ipv6;
      type boolean;
      default false;
      description
      "Enables IPv6 multicast.";
     }
     description
     "Defines protocol to carry multicast.";
     }
    leaf protocol-type {
     type enumeration {
      enum host {
       description
       "Hosts are directly connected to the provider network.
       Host protocols such as IGMP or MLD are required.";
      }
      enum router {
       description
       "Hosts are behind a customer router.
       PIM will be implemented.";
      }
      enum both {
       description
       "Some hosts are behind a customer router, and
       some others are directly connected to the
       provider network.  Both host and routing protocols
       must be used.  Typically, IGMP and PIM will be
       implemented.";
      }
     }
     default "both";
     description
     "Multicast protocol type to be used with the customer site.";
    }
    description
    "Multicast parameters for the site.";
   }
   description
   "Multicast parameters for the site.";
  }
  grouping site-management {
   container management {
    leaf type {
     type identityref {
      base management;

Wu, et al.                   Standards Track                  [Page 171]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     }
     mandatory true;
     description
     "Management type of the connection.";
    }
    description
    "Management configuration.";
   }
   description
   "Management parameters for the site.";
  }
  grouping site-devices {
   container devices {
    when "derived-from-or-self(../management/type, "+
    "'l3vpn-svc:provider-managed') or "+
    "derived-from-or-self(../management/type, 'l3vpn-svc:co-managed')" {
    description
    "Applicable only for provider-managed or
    co-managed device.";
   }
   list device {
    key device-id;
    leaf device-id {
     type svc-id;
     description
     "Identifier for the device.";
    }
    leaf location {
     type leafref {
      path "../../../locations/"+
      "location/location-id";
     }
     mandatory true;
     description
      "Location of the device.";
     }
    container management {
     when "derived-from-or-self(../../../management/type,"+
       "'l3vpn-svc:co-managed')" {
       description
        "Applicable only for co-managed device.";
      }
     leaf address-family {
      type address-family;
      description
      "Address family used for management.";
     }
     leaf address {

Wu, et al.                   Standards Track                  [Page 172]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

          when "(../address-family)" {
            description
            "If address-family is specified, then address should
            also be specified.  If address-family is not specified,
            then address should also not be specified.";
            }
          type inet:ip-address;
          mandatory true;
      description
      "Management address.";
      }
     description
      "Management configuration.  Applicable only for
       co-managed device.";
     }
     description
     "List of devices requested by customer.";
    }
    description
    "Device configuration.";
   }
   description
   "Grouping for device allocation.";
  }
  grouping site-vpn-flavor {
   leaf site-vpn-flavor {
    type identityref {
     base site-vpn-flavor;
    }
    default site-vpn-flavor-single;
    description
    "Defines the way the VPN multiplexing is done, e.g., whether
    the site belongs to a single VPN site or a multiVPN; or, in the case
    of a multiVPN, whether the logical accesses of the sites belong
    to the same set of VPNs or each logical access maps to
    different VPNs.";
   }
   description
   "Grouping for site VPN flavor.";
  }
  grouping site-vpn-policy {
   container vpn-policies {
    list vpn-policy {
     key vpn-policy-id;
     leaf vpn-policy-id {
      type svc-id;
      description
      "Unique identifier for the VPN policy.";

Wu, et al.                   Standards Track                  [Page 173]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     }
     list entries {
      key id;
      leaf id {
       type svc-id;
       description
       "Unique identifier for the policy entry.";
      }
      container filters {
       list filter {
        key type;
        ordered-by user;
        leaf type {
         type identityref {
          base vpn-policy-filter-type;
          }
         description
         "Type of VPN Policy filter.";
         }
         leaf-list lan-tag {
         when "derived-from-or-self(../type, 'l3vpn-svc:lan')" {
          description
          "Only applies when the VPN Policy filter is a
          LAN Tag filter.";
         }
          if-feature lan-tag;
          type string;
          description
          "List of 'lan-tag' items to be matched.  LAN Tag
          is an Internal tag to be used in VPN policies ";
         }
         leaf-list ipv4-lan-prefix {
         when "derived-from-or-self(../type, 'l3vpn-svc:ipv4')" {
           description
           "Only applies when VPN Policy filter is IPv4 Prefix filter.";
          }
          if-feature ipv4;
          type inet:ipv4-prefix;
          description
          "List of IPv4 prefixes as LAN Prefixes to be matched.";
         }
         leaf-list ipv6-lan-prefix {
         when "derived-from-or-self(../type, 'l3vpn-svc:ipv6')" {
         description
         "Only applies when VPN Policy filter is IPv6 Prefix filter.";
          }
          if-feature ipv6;
          type inet:ipv6-prefix;

Wu, et al.                   Standards Track                  [Page 174]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

          description
          "List of IPv6 prefixes as LAN prefixes to be matched.";
         }
          description
          "List of filters used on the site.  This list can
          be augmented.";
       }
       description
       "If a more-granular VPN attachment is necessary, filtering can
       be used.  If used, it permits the splitting of site LANs among
       multiple VPNs.  The Site LAN can be split based on either LAN
       Tag or LAN prefix.  If no filter is used, all the LANs will be
       part of the same VPNs with the same role.";
      }
      list vpn {
       key vpn-id;
       leaf vpn-id {
        type leafref {
         path "/l3vpn-svc/vpn-services/"+
          "vpn-service/vpn-id";
        }
        mandatory true;
        description
        "Reference to an IP VPN.";
       }
       leaf site-role {
        type identityref {
         base site-role;
        }
        default any-to-any-role;
        description
        "Role of the site in the IP VPN.";
       }
       description
       "List of VPNs the LAN is associated with.";
      }
      description
      "List of entries for export policy.";
     }
     description
     "List of VPN policies.";
    }
    description
    "VPN policy.";
   }
   description
   "VPN policy parameters for the site.";
  }

Wu, et al.                   Standards Track                  [Page 175]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

  grouping site-maximum-routes {
   container maximum-routes {
    list address-family {
     key af;
     leaf af {
      type address-family;
      description
      "Address family.";
     }
     leaf maximum-routes {
      type uint32;
      description
      "Maximum prefixes the VRF can accept
      for this address family.";
     }
     description
     "List of address families.";
    }
    description
    "Defines 'maximum-routes' for the VRF.";
   }
   description
   "Defines 'maximum-routes' for the site.";
  }
  grouping site-security {
   container security {
    uses site-security-authentication;
    uses site-security-encryption;
    description
    "Site-specific security parameters.";
   }
   description
   "Grouping for security parameters.";
  }
  grouping site-service {
   container service {
    uses site-service-qos-profile;
    uses site-service-mpls;
    uses site-service-multicast;
    description
    "Service parameters on the attachment.";
   }
   description
   "Grouping for service parameters.";
  }
  grouping site-network-access-service {
   container service {
    uses site-service-basic;

Wu, et al.                   Standards Track                  [Page 176]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    uses site-service-qos-profile;
    uses site-service-mpls;
    uses site-service-multicast;
    description
    "Service parameters on the attachment.";
   }
   description
   "Grouping for service parameters.";
  }
  grouping vpn-extranet {
   container extranet-vpns {
    if-feature extranet-vpn;
    list extranet-vpn {
     key vpn-id;
     leaf vpn-id {
      type svc-id;
      description
      "Identifies the target VPN the local VPN want to access.";
     }
     leaf local-sites-role {
      type identityref {
       base site-role;
      }
      default any-to-any-role;
      description
      "This describes the role of the
      local sites in the target VPN topology.  In the any-to-any VPN
      service topology, the local sites must have the same role, which
      will be 'any-to-any-role'.  In the Hub-and-Spoke VPN service
      topology or the Hub-and-Spoke disjoint VPN service topology,
      the local sites must have a Hub role or a Spoke role.";
     }
     description
     "List of extranet VPNs or target VPNs the local VPN is
     attached to.";
    }
    description
    "Container for extranet VPN configuration.";
   }
   description
   "Grouping for extranet VPN configuration.
   This provides an easy way to interconnect
   all sites from two VPNs.";
  }
  grouping site-attachment-availability {
   container availability {
    leaf access-priority {
     type uint32;

Wu, et al.                   Standards Track                  [Page 177]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     default 100;
     description
     "Defines the priority for the access.
     The higher the access-priority value,
     the higher the preference of the
     access will be.";
    }
    description
    "Availability parameters (used for multihoming).";
   }
   description
   "Defines availability parameters for a site.";
  }
  grouping access-vpn-policy {
   container vpn-attachment {
    choice attachment-flavor {
     case vpn-policy-id {
      leaf vpn-policy-id {
       type leafref {
        path "../../../../"+
         "vpn-policies/vpn-policy/"+
         "vpn-policy-id";
       }
       description
       "Reference to a VPN policy.  When referencing VPN
       policy for attachment, the vpn-policy-id must be
       configured.";
      }
     }
     case vpn-id {
      leaf vpn-id {
       type leafref {
        path "/l3vpn-svc/vpn-services"+
         "/vpn-service/vpn-id";
       }
       description
       "Reference to an IP VPN.  Referencing a vpn-id provides
       an easy way to attach a particular logical access to
       a VPN.  In this case, vpn-id must be configured.";
      }
      leaf site-role {
       type identityref {
        base site-role;
       }
       default any-to-any-role;
       description
       "Role of the site in the IP VPN.  When referencing a vpn-id,
       the site-role setting must be added to express the role of

Wu, et al.                   Standards Track                  [Page 178]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

       the site in the target VPN service topology.";
      }
     }
     mandatory true;
     description
     "Choice for VPN attachment flavor.  A choice is implemented
     to allow the user to choose the flavor that provides the
     best fit.";
    }
    description
    "Defines VPN attachment of a site.";
   }
   description
   "Defines the VPN attachment rules for
   a site's logical access.";
  }
  grouping vpn-profile-cfg {
   container valid-provider-identifiers {
    list cloud-identifier {
     if-feature cloud-access;
     key id;
     leaf id {
      type string;
      description
      "Identification of cloud service.
      Local administration meaning.";
     }
     description
     "List for Cloud Identifiers.";
    }
    list encryption-profile-identifier {
     key id;
     leaf id {
      type string;
      description
      "Identification of the SP encryption profile
      to be used.  Local administration meaning.";
     }
     description
     "List for encryption profile identifiers.";
    }
    list qos-profile-identifier {
     key id;
     leaf id {
      type string;
      description
      "Identification of the QoS Profile to be used.
      Local administration meaning.";

Wu, et al.                   Standards Track                  [Page 179]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     }
     description
     "List for QoS Profile Identifiers.";
    }
    list bfd-profile-identifier {
     key id;
     leaf id {
      type string;
      description
      "Identification of the SP BFD Profile to be used.
      Local administration meaning.";
     }
     description
     "List for BFD Profile identifiers.";
    }
      nacm:default-deny-write;
      description
      "Container for Valid Provider Identifies.";
   }
    description
    "Grouping for VPN Profile configuration.";
  }
  grouping vpn-svc-cfg {
   leaf vpn-id {
    type svc-id;
    description
    "VPN identifier.  Local administration meaning.";
   }
   leaf customer-name {
    type string;
    description
    "Name of the customer that actually uses the VPN service.
    In the case that any intermediary (e.g., Tier-2 provider
    or partner) sells the VPN service to their end user
    on behalf of the original service provider (e.g., Tier-1
    provider), the original service provider may require the
    customer name to provide smooth activation/commissioning
    and operation for the service.";
   }
   leaf vpn-service-topology {
    type identityref {
     base vpn-topology;
    }
    default any-to-any;
    description
    "VPN service topology.";
   }
   uses vpn-service-cloud-access;

Wu, et al.                   Standards Track                  [Page 180]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   uses vpn-service-multicast;
   uses vpn-service-mpls;
   uses vpn-extranet;
   description
   "Grouping for VPN service configuration.";
  }
  grouping site-top-level-cfg {
   uses operational-requirements;
   uses customer-location-info;
   uses site-devices;
   uses site-diversity;
   uses site-management;
   uses site-vpn-policy;
   uses site-vpn-flavor;
   uses site-maximum-routes;
   uses site-security;
   uses site-service;
   uses site-protection;
   uses site-routing;
   description
   "Grouping for site top-level configuration.";
  }
  grouping site-network-access-top-level-cfg {
   leaf site-network-access-type {
    type identityref {
     base site-network-access-type;
    }
    default point-to-point;
    description
    "Describes the type of connection, e.g.,
    point-to-point or multipoint.";
   }
   choice location-flavor {
    case location {
     when "derived-from-or-self(../../management/type, "+
      "'l3vpn-svc:customer-managed')" {
      description
      "Applicable only for customer-managed device.";
     }
     leaf location-reference {
      type leafref {
       path "../../../locations/location/location-id";
      }
      description
      "Location of the site-network-access.";
     }
    }
    case device {

Wu, et al.                   Standards Track                  [Page 181]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

     when "derived-from-or-self(../../management/type, "+
      "'l3vpn-svc:provider-managed') or "+
      "derived-from-or-self(../../management/type, "+
      "'l3vpn-svc:co-managed')" {
      description
      "Applicable only for provider-managed or co-managed device.";
     }
     leaf device-reference {
      type leafref {
       path "../../../devices/device/device-id";
      }
      description
      "Identifier of CE to use.";
     }
    }
    mandatory true;
    description
    "Choice of how to describe the site's location.";
   }
   uses access-diversity;
   uses site-attachment-bearer;
   uses site-attachment-ip-connection;
   uses site-security;
   uses site-network-access-service;
   uses site-routing;
   uses site-attachment-availability;
   uses access-vpn-policy;
   description
   "Grouping for site network access top-level configuration.";
  }
  /* Main blocks */
  container l3vpn-svc {
   container vpn-profiles {
    uses vpn-profile-cfg;
     description
     "Container for VPN Profiles.";
   }
   container vpn-services {
    list vpn-service {
     key vpn-id;
     uses vpn-svc-cfg;
     description
     "List of VPN services.";
    }
    description
    "Top-level container for the VPN services.";
   }
   container sites {

Wu, et al.                   Standards Track                  [Page 182]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

    list site {
     key site-id;
     leaf site-id {
      type svc-id;
      description
      "Identifier of the site.";
     }
     uses site-top-level-cfg;
     uses operational-requirements-ops;
     container site-network-accesses {
      list site-network-access {
       key site-network-access-id;
       leaf site-network-access-id {
        type svc-id;
        description
        "Identifier for the access.";
       }
       uses site-network-access-top-level-cfg;
       description
       "List of accesses for a site.";
      }
      description
      "List of accesses for a site.";
     }
     description
     "List of sites.";
    }
    description
    "Container for sites.";
   }
   description
   "Main container for L3VPN service configuration.";
  }
 }
 <CODE ENDS>

Wu, et al.                   Standards Track                  [Page 183]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

10.  Security Considerations

   The YANG module specified in this document defines a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC5246].

   The NETCONF access control model [RFC6536]provides the means to
   restrict access for particular NETCONF or RESTCONF users to a
   preconfigured subset of all available NETCONF or RESTCONF protocol
   operations and content.

   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.  These are the subtrees and data nodes
   and their sensitivity/vulnerability:

   o  /l3vpn-svc/vpn-services/vpn-service

      The entries in the list above include the whole vpn service
      configurations which the customer subscribes, and indirectly
      create or modify the PE and CE device configurations.  Unexpected
      changes to these entries could lead to service disruption and/or
      network misbehavior.

   o  /l3vpn-svc/sites/site

      The entries in the list above include the customer site
      configurations.  As above, unexpected changes to these entries
      could lead to service disruption and/or network misbehavior.

   Some of the readable data nodes in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control read access (e.g., via get, get-config, or
   notification) to these data nodes.  These are the subtrees and data
   nodes and their sensitivity/vulnerability:

   o  /l3vpn-svc/vpn-services/vpn-service

   o  /l3vpn-svc/sites/site

Wu, et al.                   Standards Track                  [Page 184]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   The entries in the lists above include customer-proprietary or
   confidential information, e.g., customer-name, site location, what
   service the customer subscribes.

   The data model defines some security parameters than can be extended
   via augmentation as part of the customer service request; those
   parameters are described in Section 6.9.

11.  IANA Considerations

   IANA has assigned a new URI from the "IETF XML Registry" [RFC3688].

             URI: urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc
             Registrant Contact: The IESG
             XML: N/A; the requested URI is an XML namespace.

   IANA has recorded a YANG module name in the "YANG Module Names"
   registry [RFC6020] as follows:

           Name: ietf-l3vpn-svc
           Namespace: urn:ietf:params:xml:ns:yang:ietf-l3vpn-svc
           Prefix: l3vpn-svc
           Reference: RFC 8299

   IANA previously assigned the URI and YANG module as described in
   [RFC8049].  IANA has updated the references for these entries to
   refer to this document.

12.  References

12.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC3022]  Srisuresh, P. and K. Egevang, "Traditional IP Network
              Address Translator (Traditional NAT)", RFC 3022,
              DOI 10.17487/RFC3022, January 2001,
              <https://www.rfc-editor.org/info/rfc3022>.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

Wu, et al.                   Standards Track                  [Page 185]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   [RFC4364]  Rosen, E. and Y. Rekhter, "BGP/MPLS IP Virtual Private
              Networks (VPNs)", RFC 4364, DOI 10.17487/RFC4364, February
              2006, <https://www.rfc-editor.org/info/rfc4364>.

   [RFC4577]  Rosen, E., Psenak, P., and P. Pillay-Esnault, "OSPF as the
              Provider/Customer Edge Protocol for BGP/MPLS IP Virtual
              Private Networks (VPNs)", RFC 4577, DOI 10.17487/RFC4577,
              June 2006, <https://www.rfc-editor.org/info/rfc4577>.

   [RFC4862]  Thomson, S., Narten, T., and T. Jinmei, "IPv6 Stateless
              Address Autoconfiguration", RFC 4862,
              DOI 10.17487/RFC4862, September 2007,
              <https://www.rfc-editor.org/info/rfc4862>.

   [RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.2", RFC 5246,
              DOI 10.17487/RFC5246, August 2008,
              <https://www.rfc-editor.org/info/rfc5246>.

   [RFC6020]  Bjorklund, M., Ed., "YANG - A Data Modeling Language for
              the Network Configuration Protocol (NETCONF)", RFC 6020,
              DOI 10.17487/RFC6020, October 2010,
              <https://www.rfc-editor.org/info/rfc6020>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC6513]  Rosen, E., Ed. and R. Aggarwal, Ed., "Multicast in MPLS/
              BGP IP VPNs", RFC 6513, DOI 10.17487/RFC6513, February
              2012, <https://www.rfc-editor.org/info/rfc6513>.

   [RFC6536]  Bierman, A. and M. Bjorklund, "Network Configuration
              Protocol (NETCONF) Access Control Model", RFC 6536,
              DOI 10.17487/RFC6536, March 2012,
              <https://www.rfc-editor.org/info/rfc6536>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

Wu, et al.                   Standards Track                  [Page 186]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8049]  Litkowski, S., Tomotaki, L., and K. Ogaki, "YANG Data
              Model for L3VPN Service Delivery", RFC 8049,
              DOI 10.17487/RFC8049, February 2017,
              <https://www.rfc-editor.org/info/rfc8049>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

12.2.  Informative References

   [ACL-YANG] Jethanandani, M., Huang, L., Agarwal, S., and D. Blair,
              "Network Access Control List (ACL) YANG Data Model", Work
              in Progress, draft-ietf-netmod-acl-model-14, October 2017.

   [RFC4026]  Andersson, L. and T. Madsen, "Provider Provisioned Virtual
              Private Network (VPN) Terminology", RFC 4026,
              DOI 10.17487/RFC4026, March 2005,
              <https://www.rfc-editor.org/info/rfc4026>.

   [RFC4110]  Callon, R. and M. Suzuki, "A Framework for Layer 3
              Provider-Provisioned Virtual Private Networks (PPVPNs)",
              RFC 4110, DOI 10.17487/RFC4110, July 2005,
              <https://www.rfc-editor.org/info/rfc4110>.

   [RFC4760]  Bates, T., Chandra, R., Katz, D., and Y. Rekhter,
              "Multiprotocol Extensions for BGP-4", RFC 4760,
              DOI 10.17487/RFC4760, January 2007,
              <https://www.rfc-editor.org/info/rfc4760>.

   [RFC8277]  Rosen, E., "Using BGP to Bind MPLS Labels to Address
              Prefixes", RFC 8277, DOI 10.17487/RFC8277, October 2017,
              <https://www.rfc-editor.org/info/rfc8277>.

Wu, et al.                   Standards Track                  [Page 187]
RFC 8299       YANG Data Model for L3VPN Service Delivery   January 2018

Acknowledgements

   Maxim Klyus, Luis Miguel Contreras, Gregory Mirsky, Zitao Wang, Jing
   Zhao, Kireeti Kompella, Eric Rosen, Aijun Wang, Michael Scharf,
   Xufeng Liu, David Ball, Lucy Yong, Jean-Philippe Landry, and Andrew
   Leu provided useful review to this document.

   Jan Lindblad reviewed RFC 8049 and found some bugs, and his thorough
   YANG Doctor review on the YANG Module is valuable input.  David Ball
   also provided a second review on RFC 8049.

   Many thanks to these people.

Contributors

   The authors would like to thank Rob Shakir for his major
   contributions to the initial modeling and use cases.

   Adrian Farrel prepared the editorial revisions for this document.

Authors' Addresses

   Qin Wu (editor)
   Huawei Technologies

   Email: bill.wu@huawei.com

   Stephane Litkowski
   Orange Business Services

   Email: stephane.litkowski@orange.com

   Luis Tomotaki
   Verizon

   Email: luis.tomotaki@verizon.com

   Kenichi Ogaki
   KDDI Corporation

   Email: ke-oogaki@kddi.com

Wu, et al.                   Standards Track                  [Page 188]