Internet DRAFT - draft-hu-bess-l2vpn-service-yang

draft-hu-bess-l2vpn-service-yang







BESS WG                                                      Fangwei. Hu
Internet-Draft                                                 Ran. Chen
Intended status: Standards Track                                Jie. Yao
Expires: September 18, 2016                              ZTE Corporation
                                                          March 17, 2016


                        L2VPN Service YANG Model
                draft-hu-bess-l2vpn-service-yang-00.txt

Abstract

   This document defines a YANG data model that can be used to deliver a
   Layer 2 Provider Provisioned VPN service.  These services include
   Virtual Private Wire Service (VPWS) and Virtual Private LAN service
   (VPLS).  This model is intended to be instantiated at management
   system to deliver the L2VPN service, and is not a configuration model
   to be used directly on network elements.

   This model provides an abstracted view of the Layer 2 VPN service
   configuration components.  It will be up to a management
   system(orchestrator) to take this as an input and use specific
   configurations models to configure the different network elements to
   deliver the service.  It is called as north bound L2VPN Service YANG
   data model.  How configuration of network elements is out of scope of
   the document, and is defined in document[I-D.shah-bess-l2vpn-yang].

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on September 18, 2016.








Hu, et al.             Expires September 18, 2016               [Page 1]

Internet-Draft                 L2VPN YANG                     March 2016


Copyright Notice

   Copyright (c) 2016 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Typical Scenario  . . . . . . . . . . . . . . . . . . . . . .   3
   4.  L2VPN Service Common  . . . . . . . . . . . . . . . . . . . .   4
     4.1.  PW-Template . . . . . . . . . . . . . . . . . . . . . . .   4
   5.  VPWS and VPLS Instance  . . . . . . . . . . . . . . . . . . .   4
     5.1.  PW List . . . . . . . . . . . . . . . . . . . . . . . . .   5
     5.2.  AC List . . . . . . . . . . . . . . . . . . . . . . . . .   5
     5.3.  Service Policy  . . . . . . . . . . . . . . . . . . . . .   6
     5.4.  Tunnel Policy . . . . . . . . . . . . . . . . . . . . . .   7
     5.5.  Tree Design for VPWS Instance YANG Data Model . . . . . .   7
     5.6.  Tree Design for VPLS Instance YANG Data Model . . . . . .   9
   6.  L2VPN Service YANG Data Model . . . . . . . . . . . . . . . .  11
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .  31
   8.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  31
   9.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  31
   10. Normative References  . . . . . . . . . . . . . . . . . . . .  31
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  32

1.  Introduction

   YANG[RFC6020]is a data definition language that was introduced to
   define the contents of a conceptual data store that allows networked
   devices to be managed using NETCONF [RFC6241].  YANG [RFC6020] is a
   modular language that represents data structures in an XML or JSON
   tree format, and is used as a data modeling language for the NETCONF.

   This document defines a YANG data model for Layer 2 Provider
   Provisioned VPN service configuration.  These services include
   Virtual Private Wire Service (VPWS) and Virtual Private LAN service
   (VPLS).



Hu, et al.             Expires September 18, 2016               [Page 2]

Internet-Draft                 L2VPN YANG                     March 2016


2.  Terminology

3.  Typical Scenario

   The idea of the Lay 2 VPN service model is to propose an abstracted
   interface to manage configuration of components of a Lay 2 VPN
   service.  A typical usage is to use this model as an input for an
   orchestration layer who will be responsible to translate it to
   orchestrated configuration of network elements which will be part of
   the service.

   Figure 1 is the typical scenario for the SDN based layer 2 VPN
   Service.  The Layer 2 service YANG data model is used between the
   orchestration and controller 1 and controller2 and as the input for
   the orchestrator which is responsible to translate the application
   service to configure the network elements.  The interfaces between
   controller and orchestration are called north bound interfaces, so
   the YANG data model defined in this document is also called north
   bound YANG service data model for Lay 2 VPN.  The interfaces between
   controller and element networks are called south bound interfaces,
   and the YANG data model as the input of controller to configure the
   network elements is defined in document [I-D.shah-bess-l2vpn-yang].

   There are two network element domains in the figure: domain A and
   domain C.  The network elements in domain A are A11, A12, A21, A22,
   and A31 and A32.  A31 and A32 are ASBRs, which are the edge routers
   connect to the other domains.  Network elements C11, C12, C21, C22,
   C31, and C32 are in the domain C, and C31 and C32 are ASBRs in domain
   C.






















Hu, et al.             Expires September 18, 2016               [Page 3]

Internet-Draft                 L2VPN YANG                     March 2016


                             +----------+
                             |    APP   |
                             +-----+----+
                                   |
                        +----------+-------------+
                        |      Orchestration     |
                        +------------------------+
                             /                \
                            /                  \
                 +-------------+          +---------------+
                 | Controller1 |          |  Controller2  |
                 +-------------+          +---------------+
                        /                          \
                       /                            \
          +------------------------+   +------------------------+
          |   Domain A       ASBR  |   |  ASBR    Domain C      |
          | +----+ +----+   +----+ |   | +----+   +----+ +----+ |
          | |A11 |-| A21|---| A31| |   | | C31|---| C21|-| C21| |
          | +----+ +----+   +----+ |   | +----+   +----+ +----+ |
          |   |       |      ASBR  |   |  ASBR       |      |   |
          | +----+ +----+   +----+ |   | +----+   +----+ +----+ |
          | |A12 |-| A22|---| A32| |   | | C32|---| C22|-| C22| |
          | +----+ +----+   +----+ |   | +----+   +----+ +----+ |
          +------------------------+   +------------------------+
           Figure 1 Typical Scenario for SDN based L2VPN Service


4.  L2VPN Service Common

4.1.  PW-Template

   The pw-templates container contains a list of pw-template.  Each pw-
   template defines a list of common pseudowire attributes such as PW
   MTU, control word negotiation, cc, cv etc.

                  +--rw pw-template* [name]
                     +--rw name              string
                     +--rw mtu?              uint32
                     +--rw cw-negotiation?   cw-negotiation-type
                     +--rw cc                cc-type
                     +--rw cv                cv-type

5.  VPWS and VPLS Instance








Hu, et al.             Expires September 18, 2016               [Page 4]

Internet-Draft                 L2VPN YANG                     March 2016


5.1.  PW List

   If the L2VPN Service(VPWS service or VPLS service) needs to cross the
   AS domain, the PW container is configured as the following tree
   structure.  If the L2VPN service is established in one domain, it is
   no need to configure PW container.

   The asbr-id leaf is used to configure the edge ASBR of the domain.
   As the figure 1 shows, there are two ASBRs in the domain A, so it is
   required to indicate which exit ASBR it is when the controller
   establishes the cross PW.

   If the L2VPN service is VPLS service, it is necessary to configure
   the split-horizon-group for the PW list.


                    +--rw pw* [name]
                       +--rw name              string
                       +--rw asbr-id?          string
                       +--rw peer?             inet:ip-address
                       +--rw vcid?             uint32
                       +--rw type?             pw-type
                       +--rw tunnel-policy?    string
                       +--rw request-vlanid?   uint16
                       +--rw vlan-tpid?        string
                       +--ro cw-negotiation?   cw-negotiation-type
                       +--ro cc?               cc-type
                       +--ro cv?               cv-type


5.2.  AC List

   Each VPWS and VPLS instances define a list of AC that are
   participating members of the given service instance.  The leaf ne-id
   is used to configure the ingress and egress ac of the end to end
   L2VPN service tunnel.  The access type of ac could be port, dot1q,
   qinq, etc.

   The QoS policy is defined in the AC list of the VPWS and VPLS
   instance.  QoS dscp2exp mapping, cos2exp mapping, and QoS CAR
   parameters are defined.










Hu, et al.             Expires September 18, 2016               [Page 5]

Internet-Draft                 L2VPN YANG                     March 2016


                    +--rw qos-policy
                       +--rw qos-dscp2exp      dscp2exp template
                       +--rw qos-cos2exp       cos2exp template
                       +--rw qos-if-trust
                          +--rw trust-type?    enumeration
                          +--rw direct-type?   enumeration
                          +--rw ds-name?       string
                       +--rw qos-if-cars
                          +--rw direction    enumeration
                          +--rw cir?         int32
                          +--rw pir?         int32
                          +--rw cbs?         int32
                          +--rw pbs?         int32


5.3.  Service Policy

   Service policy is only used in a single AS domain.  The PW type,
   redundancy tunnel for a Layer 2 VPN service is defined in the service
   policy container.  If the L2VPN service is VPLS,there is no leaf node
   communicate-unit, it has split-horizon-group leaf node instead.  The
   tree structure of service policy is designed as following:





























Hu, et al.             Expires September 18, 2016               [Page 6]

Internet-Draft                 L2VPN YANG                     March 2016


                  +--rw service-policy* [id]
                  |  +--rw id                  uint8
                  |  +--rw communicate-unit?   int32
                  |  +--rw ne-id?              string
                  |  +--rw (primary)
                  |  |  +--:(primary-pw)
                  |  |  |  +--rw primary-pw* [name]
                  |  |  |     +--rw name    -> ../../../pw/name
                  |  |  +--:(primary-ac)
                  |  |     +--rw primary-ac?         -> ../../ac/name
                  |  +--rw (backup)?
                  |  |  +--:(backup-pw)
                  |  |  |  +--rw backup-pw* [name]
                  |  |  |     +--rw name          -> ../../../pw/name
                  |  |  |     +--rw precedence?   uint32
                  |  |  +--:(backup-ac)
                  |  |     +--rw backup-ac?          -> ../../ac/name
                  |  +--rw protect-type?       protect-type
                  |  +--rw receive-mode?       receive-mode
                  |  +--rw (revertive-type)?
                  |     +--:(never)
                  |     +--:(wtr)
                  |        +--rw revert-delay?       uint16



5.4.  Tunnel Policy

   The tunnel policy is used to configured the L2VPN underlay network's
   parameters.  The signal type, tunnel mode and protect policy is
   defined in the container.

5.5.  Tree Design for VPWS Instance YANG Data Model

   The tree design for VPWS instance is as following:


      +--rw vpws-instances
         +--rw vpws-instance* [name]
            +--rw name                              string
            +--rw description?                      string
            +--rw service-type?                     l2vpn-service-type
            +--rw signaling-type                    l2vpn-signaling-type
            +--rw pw* [name]
            |  +--rw name                           string
            |  +--rw asbr-id?                       string
            |  +--rw peer?                          inet:ip-address
            |  +--rw vcid?                          uint32



Hu, et al.             Expires September 18, 2016               [Page 7]

Internet-Draft                 L2VPN YANG                     March 2016


            |  +--rw type?                          pw-type
            |  +--rw tunnel-policy?                 string
            |  +--rw request-vlanid?                uint16
            |  +--rw vlan-tpid?                     string
            |  +--ro cw-negotiation?                cw-negotiation-type
            |  +--ro cc?                            cc-type
            |  +--ro cv?                            cv-type
            +--rw ac* [name]
            |  +--rw name                           string
            |  +--rw ac-nodeid?                     string
            |  +--rw link-discovery-protocol-type?  link-discovery-protocol-type
            |  +--rw (access-type)?
            |  |  +--:(port)
            |  |  +--:(dot1q)
            |  |  |  +--rw dot1q-vlan-bitmap?       int32
            |  |  +--:(qinq)
            |  |     +--rw qinq-svlan-bitmap?       int32
            |  |     +--rw qinq-cvlan-bitmap?       int32
            |  +--rw (access-action)?
            |  |  +--:(keep)
            |  |  +--:(push)
            |  |  |  +--rw push-vlan-id?            int32
            |  |  +--:(pop)
            |  |  +--:(swap)
            |  |     +--rw swap-vlan-id?            int32
            |  +--rw qos-policy
            |  |  +--rw qos-dscp2exp?               dscp2exp
            |  |  +--rw qos-cos2exp?                cos2exp
            |  |  +--rw qos-if-cars
            |  |     +--rw direction?               uint32
            |  |     +--rw cir?                     uint32
            |  |     +--rw pir?                     uint32
            |  |     +--rw cbs?                     uint32
            |  |     +--rw pbs?                     uint32
            |  +--rw pipe-type?                     pipe-mode
            +--rw service-policy* [id]
            |  +--rw id                  uint8
            |  +--rw communicate-unit?   int32
            |  +--rw ne-id?              string
            |  +--rw (primary)
            |  |  +--:(primary-pw)
            |  |  |  +--rw primary-pw* [name]
            |  |  |     +--rw name    -> ../../../pw/name
            |  |  +--:(primary-ac)
            |  |     +--rw primary-ac?         -> ../../ac/name
            |  +--rw (backup)?
            |  |  +--:(backup-pw)
            |  |  |  +--rw backup-pw* [name]



Hu, et al.             Expires September 18, 2016               [Page 8]

Internet-Draft                 L2VPN YANG                     March 2016


            |  |  |     +--rw name          -> ../../../pw/name
            |  |  |     +--rw precedence?   uint32
            |  |  +--:(backup-ac)
            |  |     +--rw backup-ac?          -> ../../ac/name
            |  +--rw protect-type?       protect-type
            |  +--rw receive-mode?       receive-mode
            |  +--rw (revertive-type)?
            |     +--:(never)
            |     +--:(wtr)
            |        +--rw revert-delay?       uint16
            +--rw tunnel-policy
            |  +--rw tunnel-signaling-type?         tunnel-signaling-type
            |  +--rw tunnel-mode?                   tunnel-mode
            |  +--rw protect-type?                  protect-type
            |  +--rw receive-mode?                  receive-mode
            |  +--rw (revertive-type)?
            |     +--:(never)
            |     +--:(wtr)
            |        +--rw revert-delay?            uint16
            +--rw master-multi-segment-nodes* [multi-segment-node]
            |  +--rw multi-segment-node             string
            |  +--rw designated-node?               boolean
            +--rw slave-multi-segment-nodes* [multi-segment-node]
               +--rw multi-segment-node             string
              +--rw designated-node?                boolean




5.6.  Tree Design for VPLS Instance YANG Data Model

   The tree design for VPLS instance is as following:

      +--rw vpls-instances
         +--rw vpls-instance* [name]
            +--rw name                               string
            +--rw description?                       string
            +--rw mac-withdraw?                      boolean
            +--rw bgp-parameters
            |  +--rw route-distinguisher?            string
            |  +--rw vpn-targets* [rt-value]
            |  |  +--rw rt-value                     string
            |  |  +--rw rt-type                      bgp-rt-type
            |  +--rw discovery
            |     +--rw vpn-id?                      string
            +--rw service-type?                      l2vpn-service-type
            +--rw signaling-type                     l2vpn-signaling-type
            +--rw pw* [name]



Hu, et al.             Expires September 18, 2016               [Page 9]

Internet-Draft                 L2VPN YANG                     March 2016


            |  +--rw name                            string
            |  +--rw asbr-id?                        string
            |  +--rw peer?                           inet:ip-address
            |  +--rw vcid?                           uint32
            |  +--rw type?                           pw-type
            |  +--rw tunnel-policy?                  string
            |  +--rw request-vlanid?                 uint16
            |  +--rw vlan-tpid?                      string
            |  +--ro cw-negotiation?                 cw-negotiation-type
            |  +--ro cc?                             cc-type
            |  +--ro cv?                             cv-type
            |  +--rw hub-spoken?                     hub-spoken
            +--rw ac* [name]
            |  +--rw name                            string
            |  +--rw ac-nodeid?                      string
            |  +--rw link-discovery-protocol-type?   link-discovery-protocol-type
            |  +--rw (access-type)?
            |  |  +--:(port)
            |  |  +--:(dot1q)
            |  |  |  +--rw dot1q-vlan-bitmap?        int32
            |  |  +--:(qinq)
            |  |     +--rw qinq-svlan-bitmap?        int32
            |  |     +--rw qinq-cvlan-bitmap?        int32
            |  +--rw (access-action)?
            |  |  +--:(keep)
            |  |  +--:(push)
            |  |  |  +--rw push-vlan-id?             int32
            |  |  +--:(pop)
            |  |  +--:(swap)
            |  |     +--rw swap-vlan-id?             int32
            |  +--rw qos-policy
            |  |  +--rw qos-dscp2exp?                dscp2exp
            |  |  +--rw qos-cos2exp?                 cos2exp
            |  |  +--rw qos-if-cars
            |  |     +--rw direction?                uint32
            |  |     +--rw cir?                      uint32
            |  |     +--rw pir?                      uint32
            |  |     +--rw cbs?                      uint32
            |  |     +--rw pbs?                      uint32
            |  +--rw split-horizon-group?            string
            +--rw service-policy* [id]
            |  +--rw id                              uint8
            |  +--rw split-horizon-group?            string
            |  +--rw pw-type?                        pw-type
            |  +--rw ne-id?                          string
            |  +--rw (primary)
            |  |  +--:(primary-pw)
            |  |  |  +--rw primary-pw* [name]



Hu, et al.             Expires September 18, 2016              [Page 10]

Internet-Draft                 L2VPN YANG                     March 2016


            |  |  |     +--rw name    -> ../../../pw/name
            |  |  +--:(primary-ac)
            |  |     +--rw primary-ac?            -> ../../ac/name
            |  +--rw (backup)?
            |  |  +--:(backup-pw)
            |  |  |  +--rw backup-pw* [name]
            |  |  |     +--rw name          -> ../../../pw/name
            |  |  |     +--rw precedence?             uint32
            |  |  +--:(backup-ac)
            |  |     +--rw backup-ac?             -> ../../ac/name
            |  +--rw protect-type?                    protect-type
            |  +--rw receive-mode?                    receive-mode
            |  +--rw (revertive-type)?
            |     +--:(never)
            |     +--:(wtr)
            |        +--rw revert-delay?              uint16
            +--rw tunnel-policy
            |  +--rw tunnel-signaling-type?           tunnel-signaling-type
            |  +--rw tunnel-mode?                     tunnel-mode
            |  +--rw protect-type?                    protect-type
            |  +--rw receive-mode?                    receive-mode
            |  +--rw (revertive-type)?
            |     +--:(never)
            |     +--:(wtr)
            |        +--rw revert-delay?              uint16
            +--rw master-multi-segment-nodes* [multi-segment-node]
            |  +--rw multi-segment-node               string
            |  +--rw designated-node?                 boolean
            +--rw slave-multi-segment-nodes* [multi-segment-node]
               +--rw multi-segment-node               string
               +--rw designated-node?                 boolean



6.  L2VPN Service YANG Data Model


 <CODE BEGINS> file "ietf-mpls-l2vpn-svc@2016-03-17.yang"
module ietf-mpls-l2vpn-svc {
    namespace "urn:ietf:params:xml:ns:yang:ietf-mpls-l2vpn-svc";
    prefix "mpls-l2vpn-svc";

    import ietf-inet-types
    {
        prefix inet;
    }

    organization "ietf";



Hu, et al.             Expires September 18, 2016              [Page 11]

Internet-Draft                 L2VPN YANG                     March 2016


    contact "ietf";
    description "mpls-l2vpn-svc";

    revision "2016-03-17" {
        description "Initial revision of mpls-l2vpn-service model.";
        reference "draft-hu-bess-l2vpn-service-yang-00.txt";
    }

    /* identities */

    identity link-discovery-protocol {
        description "Base identiy from which identities describing link discovery protocols are derived.";
    }

    identity lacp {
         base "link-discovery-protocol";
         description "This identity represents LACP";
    }

    identity lldp {
        base "link-discovery-protocol";
        description "This identity represents LLDP";
    }

    identity bpdu {
        base "link-discovery-protocol";
        description "This identity represens BPDU";
    }

    identity cpd {
        base "link-discovery-protocol";
        description "This identity represents CPD";
    }

    identity udld {
        base "link-discovery-protocol";
        description "This identity represens UDLD";
    }

    /* typedefs */
    typedef l2vpn-service-type {
        type enumeration {
            enum ethernet {
                description "Ethernet service";
            }
            enum ATM {
                description "Asynchronous Transfer Mode";
            }



Hu, et al.             Expires September 18, 2016              [Page 12]

Internet-Draft                 L2VPN YANG                     March 2016


            enum FR {
                description "Frame-Relay";
            }
            enum TDM {
                description "Time Division Multiplexing";
            }
        }
        description "L2VPN service type";
    }

    typedef l2vpn-signaling-type {
        type enumeration {
            enum static {
                description "Static configuration of labels (no signaling)";
            }
            enum ldp {
                description "Label Distribution Protocol (LDP) signaling";
            }
            enum bgp {
                description "Border Gateway Protocol (BGP) signaling";
            }
            enum mixed {
                description "Mixed";
            }
        }
        description "L2VPN signaling type";
    }

    typedef tunnel-signaling-type {
        type enumeration {
             enum static {
               value 0 ;
               description "static" ;
             }
             enum RSVP-TE {
               value 1 ;
               description "RSVP-TE" ;
             }
            enum LDP {
                value 2 ;
                description "LDP" ;
            }
          }
        description "tunnel signaling type." ;
    }

    typedef bgp-rt-type {
        type enumeration {



Hu, et al.             Expires September 18, 2016              [Page 13]

Internet-Draft                 L2VPN YANG                     March 2016


            enum import {
                description "For import";
            }
            enum export {
                description "For export";
            }
            enum both {
                description "For both import and export";
            }
        }
        description "BGP route-target type. Import from BGP YANG";
    }

    typedef cw-negotiation-type {
        type enumeration {
            enum "non-preferred" {
                description "No preference for control-word";
            }
            enum "preferred" {
                description "Prefer to have control-word negotiation";
            }
        }
        description "control-word negotiation preference type";
    }

    typedef link-discovery-protocol-type {
        type identityref {
            base "link-discovery-protocol";
        }
        description "This type is used to identify link discovery protocol";
    }

    typedef cc-type {
        type enumeration {
            enum pw-ach {
                description "PWE3 Control Word with 0001b as first nibble (PW-ACH, see [RFC4385])";
            }
            enum alert-label {
                description "MPLS Router Alert Label";
            }
            enum ttl {
                description "MPLS PW Label with TTL == 1";
            }
        }
        description "The defined values for CC(Control Channel) Types for MPLS PWs.";
    }

    typedef cv-type {



Hu, et al.             Expires September 18, 2016              [Page 14]

Internet-Draft                 L2VPN YANG                     March 2016


        type enumeration {
            enum ICMP-ping {
                description "ICMP-ping.";
            }
            enum LSP-ping {
                description "LSP-ping";
            }
            enum BFD-basic-ip {
                description "BFD basic ip";
            }
            enum BFD-basic-raw {
                description "BFD basic raw ";
            }
            enum BFD-signalling-ip {
                description "BFD signalling ip";
            }
            enum BFD-signalling-raw {
                description "BFD signalling raw";
            }
        }
        description "The defined values for CV(Connectivity Verification) Types for MPLS PWs";
    }

    typedef pipe-mode{
        type enumeration {
            enum "pipe" {
                value 0;
                description "regular pipe mode";
            }
            enum "short-pipe" {
                value 1;
                description "short pipe mode";
            }
            enum "uniform" {
                value 2;
                description "uniform pipe mode";
            }
        }
        description " ";
    }

    typedef pw-type {
        type enumeration {
            enum unknown {
                value 0 ;
                description "The PW type is unknown";
            }
            enum dlciOld {



Hu, et al.             Expires September 18, 2016              [Page 15]

Internet-Draft                 L2VPN YANG                     March 2016


                value 1 ;
                description "The PW type is dlciOld";
            }
            enum atmSdu {
                value 2 ;
                description "The PW type is atmSdu";
            }
            enum atmCell {
                value 3 ;
                description "The PW type is atmCell";
            }
            enum vlan {
                value 4 ;
                description "The PW type is vlan";
            }
            enum ethernet {
                value 5 ;
                description "The PW type is ethernet";
            }
            enum hdlc {
                value 6 ;
                description "The PW type is hdlc";
            }
            enum ppp {
                value 7 ;
                description "The PW type is ppp";
            }
            enum sdhCESoM {
                value 8 ;
                description "The PW type is sdhCESoM";
            }
            enum atmVCCn {
                value 9 ;
                description "The PW type is atmVCCn";
            }
            enum atmVPCn {
                value 10 ;
                description "The PW type is atmVPCn";
            }
            enum ipL2 {
                value 11 ;
                description "The PW type is ipL2";
            }
            enum atmVCC1 {
                value 12 ;
                description "The PW type is atmVCC1";
            }
            enum atmVPC1 {



Hu, et al.             Expires September 18, 2016              [Page 16]

Internet-Draft                 L2VPN YANG                     March 2016


                value 13 ;
                description "The PW type is atmVPC1";
            }
            enum atmPDU {
                value 14 ;
                description "The PW type is atmPDU";
            }
            enum frPort {
                value 15 ;
                description "The PW type is frPort";
            }
            enum sdhCEoP {
                value 16 ;
                description "The PW type is sdhCEoP";
            }
            enum saTopE1 {
                value 17 ;
                description "The PW type is saTopE1";
            }
            enum saTopT1 {
                value 18 ;
                description "The PW type is saTopT1";
            }
            enum saTopE3 {
                value 19 ;
                description "The PW type is saTopE3";
            }
            enum saTopT3 {
                value 20 ;
                description "The PW type is saTopT3";
            }
            enum ceSoPSNB {
                value 21 ;
                description "The PW type is ceSoPSNB";
            }
            enum tdmAAL1 {
                value 22 ;
                description "The PW type is tdmAAL1";
            }
            enum ceSoPSNC {
                value 23 ;
                description "The PW type is ceSoPSNC";
            }
            enum tdmAAL2 {
                value 24 ;
                description "The PW type is tdmAAL2";
            }
            enum dlciNew {



Hu, et al.             Expires September 18, 2016              [Page 17]

Internet-Draft                 L2VPN YANG                     March 2016


                value 25 ;
                description "The PW type is dlciNew";
            }
        }
        description "The PW type of the PW.";
    }

    typedef dscp2exp {
       type string;
       description "define the dscp to exp mapping";
       }

    typedef cos2exp {
       type string;
       description "define the cos to exp mapping";
      }

    typedef protect-type {
       type enumeration {
            enum unprotected {
                value 0 ;
                description "unprotected." ;
                }
            enum 1to1 {
                value 1 ;
                description "protect type is 1:1";
            }
            enum 1plus1 {
                value 2 ;
                description "protect type is 1+1";
            }
            enum dni-pw {
                value 3 ;
                description "protect type is dni-pw";
            }
            enum dni-ac {
                value 4 ;
                description "protect type is dni-ac";
            }

        }
        description "define the protect type";
    }

    typedef receive-mode {
       type enumeration {
            enum selective {
                value 0 ;



Hu, et al.             Expires September 18, 2016              [Page 18]

Internet-Draft                 L2VPN YANG                     March 2016


                description "receive mode is selective";
            }
            enum both {
                value 1 ;
                description "receive mode is both";
            }
        }
        description "define the receive mode";
    }

    typedef tunnel-mode {
      type enumeration {
           enum static {
              value 2 ;
              description "static tunnel" ;
             }
            enum RSVP-TE {
               value 0 ;
                description "RSVP-TE" ;
            }
            enum LDP {
                value 1 ;
            description "LDP" ;
            }


        }
        description "define the tunnel mode";
    }


    typedef hub-spoken {
       type enumeration {
           enum hub {
              value 0 ;
              description "the hub role in the network" ;
             }
            enum spoken {
               value 1 ;
                description "the spokend role in the network" ;
            }
        }
        description "define the hub spoken type";
    }
    grouping pw-template{
        description "pw-template";
        leaf name {
            type string;



Hu, et al.             Expires September 18, 2016              [Page 19]

Internet-Draft                 L2VPN YANG                     March 2016


            description "name";
        }

        leaf cw-negotiation {
            type cw-negotiation-type;
            default "preferred";
            description "control-word negotiation preference";
        }

        leaf cc {
            type cc-type;
            description "Control Channel Types";
        }

        leaf cv {
            type cv-type;
            description "Connectivity Verification Types";
        }
    }

    grouping qos-policy-grp {
       container qos-policy {
         leaf qos-dscp2exp {
                type dscp2exp;
                description "the dscp to exp mapping template";
              }
         leaf  qos-cos2exp {
                type cos2exp ;
                description "the cos to exp mapping template";
              }

         container qos-if-cars {
              leaf direction {
                type uint32;
                description "the direction of qos";
               }

              leaf cir {
                type uint32;
                description "the cir parameter for the car";
               }

              leaf pir {
                type uint32;
                description "the pir parameter for the car";
               }

              leaf cbs {



Hu, et al.             Expires September 18, 2016              [Page 20]

Internet-Draft                 L2VPN YANG                     March 2016


                type uint32;
                description "the cbs parameter for the car";
               }

              leaf pbs {
                 type uint32;
                 description "the pbs parameter for the car";
               }
            description "configuration the qos interface car parameters.";
           }
         description "qos policy container.";
       }
      description "qos policy template.";
    }

    grouping pseudowire{
        description "pseudowire";
        leaf name {
            type string;
            description "pseudowire name";
        }

        leaf asbr-id {
            type string;
            description "asbr name for the cross domain lsp";
        }
        leaf peer {
            type inet:ip-address;
            description "pw peer address, use IPv4";
        }

        leaf vcid {
            type uint32;
            description "pseudo-wire vcid";
        }

        leaf type {
            type pw-type;
            description "pseudo-wire type";
        }

        leaf tunnel-policy {
            type string;
            description "Used to override the tunnel policy name specified in the pseduowire template";
        }

        leaf request-vlanid {
            type uint16;



Hu, et al.             Expires September 18, 2016              [Page 21]

Internet-Draft                 L2VPN YANG                     March 2016


            description "request vlanid";
        }

        leaf vlan-tpid {
            type string;
            description "vlan tpid";
        }

        leaf cw-negotiation {
            type cw-negotiation-type;
            default "preferred";
            config false;
            description "control-word negotiation preference";
        }

        leaf cc {
            type cc-type;
            config false;
            description "Control Channel Types";
        }

        leaf cv {
            type cv-type;
            config false;
            description "Connectivity Verification Types";
        }
    }

    grouping attachment-circuit{
        description "attachment circuit";
        leaf name {
            type string;
            description "name";
        }

        leaf ac-nodeid{
            type string;
            description "The nodeid of the AC.";
        }

        leaf link-discovery-protocol-type{
            type link-discovery-protocol-type;
            description "link discovery protocol";
        }

        choice access-type{
            description "access-type";
            case port{



Hu, et al.             Expires September 18, 2016              [Page 22]

Internet-Draft                 L2VPN YANG                     March 2016


                description "port.";
            }

            case dot1q {
                description "Dot1Q";
                leaf dot1q-vlan-bitmap {
                    type int32 {
                        range "1..4094";
                    }
                    description "Dot1Q Vlan Bitmap." ;
                }
            }

            case qinq {
                description "QinQ";
                leaf qinq-svlan-bitmap {
                    type int32 {
                        range "1..4094";
                    }
                    description "QinQ svlan Bitmap." ;
                }

                leaf qinq-cvlan-bitmap {
                    type int32 {
                        range "1..4094";
                    }
                    description "QinQ cvlan Bitmap." ;
                }
            }
        }

        choice access-action {
            description "access type." ;
            case keep {
                description "keep." ;
            }
            case push {
                description "push." ;
                leaf push-vlan-id {
                    type int32 {
                        range "1..4094";
                    }
                    description "action vlan id." ;
                }
            }
            case pop {
                description "pop." ;
            }



Hu, et al.             Expires September 18, 2016              [Page 23]

Internet-Draft                 L2VPN YANG                     March 2016


            case swap {
                description "swap." ;
                leaf swap-vlan-id {
                    type int32 {
                        range "1..4094";
                    }
                    description "action vlan id." ;
                }
            }
        }
        uses qos-policy-grp;
    }

    grouping protect-policy-grp {
        leaf protect-type {
               type protect-type;
               description "protection-type";
             }

        leaf receive-mode {
               type receive-mode;
               description "receive-mode";
            }

        choice revertive-type {
            description "revertive-type";
             case never {
              description "never type";
              }
             case wtr {
               leaf revert-delay {
                type uint16;
                description "the revertive type is wtr";
                }
             }
        }

     description "define the group of protect-policy.";
    }

    grouping redundancy-grp {
         leaf ne-id {
            type string;
            description "the name of ne";
           }
         choice primary {
           mandatory true;
           description "primary options";



Hu, et al.             Expires September 18, 2016              [Page 24]

Internet-Draft                 L2VPN YANG                     March 2016


           case primary-pw {
             list primary-pw {
               key "name";
               leaf name {
                 type leafref {
                   path "../../../pw/name";
                 }
                 description "Reference a pseudowire";
               }
               description "A list of primary pseudowires";
             }
             description "primary-pw";
           }

           case primary-ac {
             leaf primary-ac {
               type leafref {
                 path "../../ac/name";
               }
               description "Reference an attachment circuit";
             }
             description "primary-ac";
           }
         }

         choice backup {
           description "backup options";
           case backup-pw {
             list backup-pw {
               key "name";
               leaf name {
                 type leafref {
                   path "../../../pw/name";
                 }
                 description "Reference an attachment circuit";
               }
               leaf precedence {
                 type uint32;
                 description "precedence of the pseudowire";
               }
               description "list of backup pseudowires";
             }
           }
           case backup-ac {
             leaf backup-ac {
               type leafref {
                 path "../../ac/name";
               }



Hu, et al.             Expires September 18, 2016              [Page 25]

Internet-Draft                 L2VPN YANG                     March 2016


               description "Reference an attachment circuit";
             }
             description "backup-ac";
           }
         }
         uses protect-policy-grp;
        description "define the redundancy group";
       }

    grouping vpws-service-policy-grp {
        list service-policy {
         key "id";
         leaf id {
           type uint8;
           description "the id of service policy";
         }

         uses redundancy-grp;
         description "the service policy list";

         leaf communicate-unit {
             type int32;
             description "ICCP id for dni-pw";
            }
        }
        description "service policy list";
      }

    grouping vpls-service-policy-grp {
        list service-policy {
         key "id";
         leaf id {
           type uint8;
           description "the id of service policy";
         }

         leaf split-horizon-group {
            type string;
            description "split horizon group for the vpls instance";
          }

         leaf pw-type {
           type pw-type;
           description "the pseudowires type";
         }

         uses redundancy-grp;
         description "the service policy list";



Hu, et al.             Expires September 18, 2016              [Page 26]

Internet-Draft                 L2VPN YANG                     March 2016


        }
        description "service policy";
    }

    grouping tunnel-policy-grp {
        container tunnel-policy {
           leaf tunnel-signaling-type {
             type tunnel-signaling-type;
             description "signaling-type";
            }
          leaf tunnel-mode {
             type tunnel-mode;
             description "tunnel-mode";
          }
         uses protect-policy-grp;
         description "tunnel policy";
        }
        description "tunnel policy group";
       }

    grouping multi-segment{
        leaf multi-segment-node{
            type string;
            description "The multi-segment nodeid of the PW.";
        }

        leaf designated-node{
            type boolean;
            description "The multi-segment nodeid of the PW must select.";
        }
        description "multi-segment group.";
    }

    container l2vpn {
        description "l2vpn";
        container common {
            description "common l2pn attributes";
            container pw-templates {
                description "pw-templates";
                list pw-template {
                    key "name";
                    uses pw-template;
                    description "pw-templates";
                }
            }
        }

        container vpws-instances {



Hu, et al.             Expires September 18, 2016              [Page 27]

Internet-Draft                 L2VPN YANG                     March 2016


            description "configure vpws-instances";
            list vpws-instance {
               key "name";
                leaf name {
                  type string;
                  description "the name of a vpws instance";
                }

               leaf description {
                 type string;
                 description "Description of the vpws instance";
                }

               leaf service-type {
                 type l2vpn-service-type;
                 default ethernet;
                 description "vpws service type";
                }

                leaf signaling-type {
                 type l2vpn-signaling-type;
                 mandatory true;
                 description "vpws signaling type";
                }

                list pw{
                 key "name";
                 uses pseudowire;
                 description "pseudowires";
                }

                list ac{
                 key "name";
                 uses attachment-circuit;
                 leaf pipe-type{
                   type pipe-mode;
                   description "pipe mode";
                }
                 description "attachment-circuit";

                }

                uses vpws-service-policy-grp;
                uses tunnel-policy-grp ;

                list master-multi-segment-nodes{
                  key "multi-segment-node";
                  uses multi-segment;



Hu, et al.             Expires September 18, 2016              [Page 28]

Internet-Draft                 L2VPN YANG                     March 2016


                  description "The master multi-segment nodeid of the PW.";
                }

                list slave-multi-segment-nodes{
                   key "multi-segment-node";
                   uses multi-segment;
                   description "The slave multi-segment nodeid of the PW.";
                }

                description "vpws service instance list";

            }
        }

        container vpls-instances {
            description "configure vpls-instances";
            list vpls-instance {
               key "name";
                leaf name {
                  type string;
                  description "the name of a vpls instance";
                }

               leaf description {
                 type string;
                 description "Description of the vpls instance";
                }

                leaf mac-withdraw {
                  type boolean;
                  description "Withdraw MAC";
                }

                container bgp-parameters {
                   leaf route-distinguisher {
                     type string;
                     description "BGP RD";
                   }

                   list vpn-targets {
                     key rt-value;
                     description "Route Targets";

                     leaf rt-value {
                        type string;
                        description "Route-Target value";
                    }




Hu, et al.             Expires September 18, 2016              [Page 29]

Internet-Draft                 L2VPN YANG                     March 2016


                     leaf rt-type {
                        type bgp-rt-type;
                        mandatory true;
                        description "Type of RT";
                     }
                   }

                   container discovery {
                      description "BGP parameters for discovery";
                      leaf vpn-id {
                        type string;
                        description "VPN ID";
                      }
                   }
                 description "Parameters for BGP";
                }

               leaf service-type {
                 type l2vpn-service-type;
                 default ethernet;
                 description "vpls service type";
                }

                leaf signaling-type {
                 type l2vpn-signaling-type;
                 mandatory true;
                 description "vpls signaling type";
                }

                list pw{
                 key "name";
                 uses pseudowire;
                 leaf hub-spoken {
                   type hub-spoken;
                   description "hub-spoken role";
                  }
                 description "pseudowires";
                }

                list ac{
                 key "name";
                 uses attachment-circuit;
                 leaf split-horizon-group {
                   type string;
                   description "split horizon group for the vpls instance";
                  }
                 description "attachment-circuit";




Hu, et al.             Expires September 18, 2016              [Page 30]

Internet-Draft                 L2VPN YANG                     March 2016


                }

                uses vpls-service-policy-grp;
                uses tunnel-policy-grp ;

                list master-multi-segment-nodes{
                  key "multi-segment-node";
                  uses multi-segment;
                  description "The master multi-segment nodeid of the PW.";
                }

                list slave-multi-segment-nodes{
                   key "multi-segment-node";
                   uses multi-segment;
                   description "The slave multi-segment nodeid of the PW.";
                }
                description "vpls service instance list";
            }
        }
    }
}
 <CODE ENDS>

7.  Security Considerations

8.  Acknowledgements

9.  IANA Considerations

   This document requires no IANA Actions.  Please remove this section
   before RFC publication.

10.  Normative References

   [I-D.shah-bess-l2vpn-yang]
              Shah, H., Brissette, P., Rahman, R., Raza, K., Li, Z.,
              Zhuang, S., Wang, H., Chen, I., Ahmed, S., Bocci, M.,
              Hardwick, J., Esale, S., Tiruveedhula, K., Singh, T.,
              Hussain, I., Wen, B., Walker, J., Delregno, N., Jalil, L.,
              and M. Joecylyn, "YANG Data Model for MPLS-based L2VPN",
              draft-shah-bess-l2vpn-yang-01 (work in progress), March
              2016.

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




Hu, et al.             Expires September 18, 2016              [Page 31]

Internet-Draft                 L2VPN YANG                     March 2016


   [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,
              <http://www.rfc-editor.org/info/rfc6241>.

Authors' Addresses

   Fangwei Hu
   ZTE Corporation
   No.889 Bibo Rd
   Shanghai  201203
   China

   Phone: +86 21 68896273
   Email: hu.fangwei@zte.com.cn


   Ran Chen
   ZTE Corporation
   No.50 Software Avenue,Yuhuatai District
   Nanjing, Jiangsu Province  210012
   China

   Phone: +86 025 88014636
   Email: chen.ran@zte.com.cn


   Jie Yao
   ZTE Corporation
   Zijinghua Rd. Yuhuatai District
   Nanjing, Jiangsu Province  210012
   China

   Email: yao.jie@zte.com.cn

















Hu, et al.             Expires September 18, 2016              [Page 32]