netconfcentral logo

ietf-l2vpn-ntw@2020-05-26



  module ietf-l2vpn-ntw {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-l2vpn-ntw";

    prefix l2vpn-ntw;

    import ietf-inet-types {
      prefix inet;
      reference
        "Section 4 of RFC 6991";


    }
    import ietf-yang-types {
      prefix yang;
      reference
        "Section 3 of RFC 6991";


    }
    import ietf-netconf-acm {
      prefix nacm;
      reference
        "RFC 8341: Network Configuration Access Control Model";


    }
    import ietf-l3vpn-ntw {
      prefix l3vpn-ntw;
      reference
        "RFC NNNN: A Layer 3 VPN Network YANG Model";


    }
    import ietf-l2vpn-svc {
      prefix l2vpn-svc;
      reference
        "RFC 8466: YANG Data Model for Layer 2 Virtual Private
         Network (L2VPN) Service Delivery";


    }
    import ietf-packet-fields {
      prefix pf;
      reference
        "RFC 8519 - YANG Data Model for Network Access Control
        	   Lists (ACLs).";


    }
    import ietf-routing-types {
      prefix rt-types;
      reference
        "RFC 8294: Common YANG Data Types for the Routing Area";


    }

    organization
      "IETF OPSA (Operations and Management Area) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/opsawg/>
        WG List:  <mailto:opsawg@ietf.org>
        Editor:    Samier Barguil
                  <mailto:samier.barguilgiraldo.ext@telefonica.com>
        Editor:    Oscar Gonzalez de Dios
                  <mailto:oscar.gonzalezdedios@telefonica.com>
        Author:    Mohamed Boucadair
                  <mailto:mohamed.boucadair@orange.com>
        Author:    Luis Angel Munoz
                  <mailto:luis-angel.munoz@vodafone.com>
        Author:    Luay Jalil
                  <mailto:luay.jalil@verizon.com>
        Author:    Jichun Ma
                  <mailto:majc16@chinaunicom.cn>
    ";

    description
      "The YANG module defines a generic network configuration
     model for Layer 2 VPN services common across all of the
     vendor implementations.

     Copyright (c) 2020 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 XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
     for full legal notices.";

    revision "2020-05-26" {
      description
        "Third revision -02 version";
      reference
        "RFC XXXX: A Layer 2 VPN Network YANG Model.";

    }


    feature multicast-like {
      description
        "Indicates the support of multicast-like capabilities
       in a L2VPN.";
    }

    feature extranet-vpn {
      description
        "Indicates the Support of Extranet VPN.";
    }

    feature target-sites {
      description
        "Indicates the support of 'target-sites' match flow
       parameter.";
    }

    feature l2cp-control {
      description
        "Indicates the support of L2CP control.";
    }

    feature input-bw {
      description
        "Indicates the suppport of Input Bandwidth
      in a VPN.";
    }

    feature output-bw {
      description
        "Indicates the support of Output Bandwidth in
       a VPN";
    }

    feature uni-list {
      description
        "Indicates thesupport of UNI list in a VPN.";
    }

    feature cloud-access {
      description
        "Indicates the support of a VPN to connect to a Cloud Service
       provider.";
    }

    feature oam-3ah {
      description
        "Indicates the support of OAM 802.3ah.";
    }

    feature micro-bfd {
      description
        "Indicates the support of Micro-BFD.";
    }

    feature bfd {
      description
        "Indicates the support of BFD.";
    }

    feature signaling-options {
      description
        "Indicates the support of signalling option.";
    }

    feature site-diversity {
      description
        "Indicates the support of site diversity constraints in
       a VPN.";
    }

    feature encryption {
      description
        "Indicates the support of encryption.";
    }

    feature always-on {
      description
        "Indicates the support for always-on access
       constraint.";
    }

    feature requested-type {
      description
        "Indicates the support for requested-type access
       constraint.";
    }

    feature bearer-reference {
      description
        "Indicates the support for bearer-reference access
       constraint.";
    }

    feature qos {
      description
        "Indicates the support of Class of Services.";
    }

    feature lag-interface {
      description "Enable lag-interface.";
    }

    feature vlan {
      description
        "Indicates the support of VLAN.";
    }

    feature dot1q {
      description
        "Indicates the support of Dot1Q.";
    }

    feature sub-inf {
      description
        "Indicates the support of Sub Interface.";
    }

    feature qinq {
      description
        "Indicates the support of QinQ.";
    }

    feature qinany {
      description
        "Indicates the support of QinAny.";
    }

    feature atm {
      description
        "Indicates the support of ATM.";
    }

    feature vxlan {
      description
        "Indicates the support of VxLAN.";
    }

    feature ipv4 {
      description
        "Indicates the support in a VPN.";
    }

    feature ipv6 {
      description
        "Indicates the support in a VPN.";
    }

    feature lan-tag {
      description
        "Indicates the LAN Tag support in a VPN.";
    }

    typedef protocol-type {
      type enumeration {
        enum "GRE" {
          value 0;
          description
            "Transport based on GRE.";
        }
        enum "LDP" {
          value 1;
          description
            "Transport based on LDP.";
          reference
            "RFC 5036: LDP Specification";

        }
        enum "BGP" {
          value 2;
          description
            "Transport based on BGP.";
          reference
            "RFC 4760: Multiprotocol Extensions for BGP-4";

        }
        enum "SR" {
          value 3;
          description
            "Transport based on Segment Routing";
          reference
            "RFC 8660: Segment Routing with the MPLS Data Plane";

        }
        enum "SR-TE" {
          value 4;
          description
            "Transport based on Segment Routing for Traffic
           Engineering";
        }
        enum "RSVP-TE" {
          value 5;
          description
            "Transport based on RSVP-TE signaled tunnels";
          reference
            "RFC 3209: RSVP-TE: Extensions to RSVP for LSP Tunnels";

        }
      }
      description
        "This are attributes used to identify underly
       transport protocols used to deliver the service.";
    }

    typedef operational-type {
      type enumeration {
        enum "up" {
          value 0;
          description
            "Operational status UP.";
        }
        enum "down" {
          value 1;
          description
            "Operational status DOWN";
        }
        enum "unknown" {
          value 2;
          description
            "Operational status UNKNOWN";
        }
      }
      description
        "This is an attribute used to determine the
       operational status of a particular element.";
    }

    typedef svc-id {
      type string;
      description
        "Indicates the type of service component identifier.";
    }

    typedef ccm-priority-type {
      type uint8 {
        range "0..7";
      }
      description
        "A 3 bit priority value to be used in the VLAN tag,
       if present in the transmitted frame.";
    }

    typedef control-mode {
      type enumeration {
        enum "peer" {
          value 0;
          description
            "Peer mode, i.e., participate in the protocol towards
           the CE. Peering is common for LACP  and E-LMI and
           occasionally for LLDP. For virtual private services
           the Subscriber can also request that the Service
           Provider peer spanning tree.";
        }
        enum "tunnel" {
          value 1;
          description
            "Tunnel mode,i.e.,pass to the egress or destination site.
           For EPL, the expectation is that L2CP frames are
           tunneled.";
        }
        enum "discard" {
          value 2;
          description
            "Discard mode,i.e.,discard the frame.";
        }
      }
      description
        "Defining a type of the control mode on L2CP protocols.";
    }

    typedef neg-mode {
      type enumeration {
        enum "full-duplex" {
          value 0;
          description
            "Defining Full duplex mode";
        }
        enum "auto-neg" {
          value 1;
          description
            "Defining Auto negotiation mode";
        }
      }
      description
        "Defining a type of the negotiation mode";
    }

    identity multicast-tree-type {
      base l2vpn-svc:multicast-tree-type;
      description
        "Base identity for multicast tree type.";
    }

    identity mapping-type {
      base l2vpn-svc:multicast-gp-address-mapping;
      description "Identity mapping-type.";
    }

    identity tf-type {
      base l2vpn-svc:tf-type;
      description "Identity traffic-type";
    }

    identity pwe-encapsulation-type {
      base l2vpn-svc:encapsulation-type;
      description
        "Identity pwe-encapsulation-type";
    }

    identity l2tp-pw-type {
      base 
      description
        "Identity for L2TP PW type";
    }

    identity encapsulation-type {
      base 
      description
        "Identity for encapsulation type";
    }

    identity ethernet-type {
      base encapsulation-type;
      description
        "Identity for encapsulation type";
    }

    identity vlan-type {
      base encapsulation-type;
      description
        "Identity for encapsulation type";
    }

    identity protection-mode {
      base 
      description
        "Identity of protection mode";
    }

    identity oneplusone {
      base protection-mode;
      description
        "In this scheme, the primary circuit will be
       protected by a backup circuit, typically meeting certain
       diverse path/fiber/site/node criteria.  Both primary and
       protection circuits are provisioned to be in the active
       forward ing state. The subscriber may choose to send the
       same service frames across both circuits simultaneously.";
    }

    identity one-to-one {
      base protection-mode;
      description
        "In this scheme, a backup circuit to the primary
       circuit is provisioned.  Depending on the implementation
       agreement, the protection circuits may either always be
       in active forwarding state, or may only become active when
       a faulty state is detected on the primary circuit.";
    }

    identity eth-inf-type {
      base l2vpn-svc:eth-inf-type;
      description
        "Identity of Ethernet Interface Type";
    }

    identity bw-type {
      base l2vpn-svc:bw-type;
      description "Identity of bandwidth";
    }

    identity site-type {
      base 
      description "Identity of site type.";
    }

    identity uni {
      base site-type;
      description
        "Identity of User Network Interface ";
    }

    identity enni {
      base site-type;
      description
        "Identity of External Network to Network Interface";
    }

    identity service-type {
      base l2vpn-svc:service-type;
      description
        "Base Identity of service type.";
    }

    identity bundling-type {
      base l2vpn-svc:bundling-type;
      description
        "This is base identity for Bundling type. It supports
       multiple CE-VLAN associated with L2VPN service or all
       CE-VLANs associated with L2VPN service.";
    }

    identity color-id {
      base l2vpn-svc:color-id;
      description
        "base identity of color id";
    }

    identity cos-id {
      base l2vpn-svc:cos-id;
      description
        "Identity of class of service id";
    }

    identity color-type {
      base l2vpn-svc:color-type;
      description "Identity of color types";
    }

    identity perf-tier-opt {
      base 
      description
        "Identity of performance tier option.";
    }

    identity metro {
      base perf-tier-opt;
      description "Identity of metro";
    }

    identity regional {
      base perf-tier-opt;
      description "Identity of regional";
    }

    identity continental {
      base perf-tier-opt;
      description "Identity of continental";
    }

    identity global {
      base perf-tier-opt;
      description "Identity of global";
    }

    identity policing {
      base 
      description
        "Identity of policing type";
    }

    identity one-rate-two-color {
      base policing;
      description
        "Identity of one-rate, two-color (1R2C)";
    }

    identity two-rate-three-color {
      base policing;
      description
        "Identity of two-rate, three-color (2R3C)";
    }

    identity bum-type {
      base l2vpn-svc:bum-type;
      description "Identity of BUM type";
    }

    identity loop-prevention-type {
      base l2vpn-svc:loop-prevention-type;
      description
        "Identity of loop prevention";
    }

    identity lacp-state {
      base l2vpn-svc:lacp-state;
      description "Identity of LACP state";
    }

    identity lacp-mode {
      base l2vpn-svc:lacp-mode;
      description "Identity of LACP mode";
    }

    identity lacp-speed {
      base l2vpn-svc:lacp-speed;
      description "Identity of LACP speed";
    }

    identity vpn-signaling-type {
      base 
      description
        "Identity of VPN signaling types";
    }

    identity l2vpn-bgp {
      base vpn-signaling-type;
      description "Identity of l2vpn-bgp";
    }

    identity evpn-bgp {
      base vpn-signaling-type;
      description "Identity of evpn-bgp";
    }

    identity t-ldp {
      base vpn-signaling-type;
      description "Identity of t-ldp.";
    }

    identity h-vpls {
      base vpn-signaling-type;
      description "Identity for h-vpls";
    }

    identity l2tp {
      base vpn-signaling-type;
      description "Identity of l2tp.";
    }

    identity t-ldp-pwe-type {
      base 
      description
        "Identity for t-ldp-pwe-type.";
    }

    identity vpws-type {
      base t-ldp-pwe-type;
      description "Identity for VPWS";
    }

    identity vpls-type {
      base t-ldp-pwe-type;
      description "Identity for vpls";
    }

    identity hvpls {
      base t-ldp-pwe-type;
      description "Identity for h-vpls";
    }

    identity l2vpn-type {
      base 
      description "Layer 2 VPN types";
    }

    identity l2vpn-vpws {
      base l2vpn-type;
      description "VPWS L2VPN type.";
    }

    identity l2vpn-vpls {
      base l2vpn-type;
      description "VPLS L2VPN type.";
    }

    identity distribute-vpls {
      base l2vpn-type;
      description
        "distribute VPLS L2VPN type.";
    }

    identity evpn-type {
      base 
      description "Ethernet VPN types";
    }

    identity evpn-vpws {
      base evpn-type;
      description "VPWS support in EVPN.";
    }

    identity evpn-pbb {
      base evpn-type;
      description
        " Provider Backbone Bridging Support in EVPN.";
    }

    identity management {
      base l2vpn-svc:management;
      description
        "Base identity for site management scheme.";
    }

    identity address-family {
      base l2vpn-svc:address-family;
      description
        "Base identity for an address family.";
    }

    identity vpn-topology {
      base l3vpn-ntw:vpn-topology;
      description
        "Base identity for VPN topology.";
    }

    identity site-role {
      base l2vpn-svc:site-role;
      description
        "Base identity for site type.";
    }

    identity any-to-any-role {
      base site-role;
      description
        "Any-to-any-role site type.";
    }

    identity pm-type {
      base l2vpn-svc:pm-type;
      description "Performance monitor type";
    }

    identity fault-alarm-defect-type {
      base l2vpn-svc:fault-alarm-defect-type;
      description
        "Indicating the alarm priority defect";
    }

    identity frame-delivery-mode {
      base l2vpn-svc:frame-delivery-mode;
      description "Delivery types";
    }

    identity pw-topo-type {
      base l2vpn-svc:site-network-access-type;
      description
        "base identity for pw topology Type";
    }

    identity placement-diversity {
      base l2vpn-svc:placement-diversity;
      description
        "Base identity for site placement
       constraints";
    }

    identity l2-access-type {
      base 
      description
        "This identify the access type
       of the vpn acccess interface";
    }

    identity untag {
      base l2-access-type;
      description "Untag";
    }

    identity port {
      base l2-access-type;
      description "Port";
    }

    identity dot1q {
      base l2-access-type;
      description "Qot1q";
    }

    identity qinq {
      base l2-access-type;
      description "QinQ";
    }

    identity sub-interface {
      base l2-access-type;
      description
        "Create a default sub-interface and keep vlan.";
    }

    identity atm {
      base l2-access-type;
      description "ATM Cell.";
    }

    identity vxlan {
      base l2-access-type;
      description
        "Vxlan access into the vpn";
    }

    identity provision-model {
      base l2vpn-svc:provision-model;
      description
        "base identity for provision model.";
    }

    identity mac-learning-mode {
      base l2vpn-svc:mac-learning-mode;
      description "MAC learning mode";
    }

    identity vpn-policy-filter-type {
      base l2vpn-svc:vpn-policy-filter-type;
      description
        "Base identity for filter type.";
    }

    identity mac-action {
      base l2vpn-svc:mac-action;
      description
        "Base identity for MAC action.";
    }

    identity load-balance-method {
      base 
      description
        "Base identity for load balance method.";
    }

    identity fat-pw {
      base load-balance-method;
      description
        "Identity for Fat PW. Fat label is
       applied to Pseudowires across MPLS
       network.";
    }

    identity entropy-label {
      base load-balance-method;
      description
        "Identity for entropy label.Entropy label
       is applied to IP forwarding,
       L2VPN or L3VPN across MPLS network";
    }

    identity vxlan-source-port {
      base load-balance-method;
      description
        "Identity for vxlan source port.VxLAN
       Source Port is one load balancing method.";
    }

    identity qos-profile-direction {
      base l2vpn-svc:qos-profile-direction;
      description
        "Base identity for qos profile direction.";
    }

    identity vxlan-peer-mode {
      base l2vpn-svc:vxlan-peer-mode;
      description
        "Base identity for vxlan peer mode.";
    }

    identity customer-application {
      base l2vpn-svc:customer-application;
      description
        "Base identity for customer application.";
    }

    identity precedence-type {
      base 
      description
        "Redundancy type. The service can be created
       with active and bakcup signalization.";
    }

    identity primary {
      base precedence-type;
      description
        "Identifies the Main L2VPN.";
    }

    identity backup {
      base precedence-type;
      description
        "Identifies the Backup L2VPN.";
    }

    grouping vpn-route-targets {
      description
        "A grouping that specifies Route Target import-export rules
       used in a BGP-enabled VPN.";
      reference
        "RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs)
         RFC4664: Framework for Layer 2 Virtual Private Networks
        (L2VPNs)";

      list vpn-target {
        key "id";
        description
          "l3vpn route targets. AND/OR Operations are available
         based on the RTs assigment";
        leaf id {
          type int8;
          description
            "Identifies each VPN Target";
        }

        list route-targets {
          key "route-target";
          description
            "List of Route Targets.";
          leaf route-target {
            type rt-types:route-target;
            description "Route Target value";
          }
        }  // list route-targets

        leaf route-target-type {
          type rt-types:route-target-type;
          mandatory true;
          description
            "Import/export type of the Route Target.";
        }
      }  // list vpn-target

      container vpn-policies {
        description "";
        leaf import-policy {
          type string;
          description
            "Reference to a VRF import policy.";
        }

        leaf export-policy {
          type string;
          description
            "Reference to a VRF export policy.";
        }
      }  // container vpn-policies
    }  // grouping vpn-route-targets

    grouping svc-transport-encapsulation {
      description
        "This grouping defines the type of underlay transport
    for VPN service.";
      container transport-encapsulation {
        description
          "Container for the Transport Underlay.";
        leaf-list protocol {
          type protocol-type;
          ordered-by user;
          description
            "Protocols used to support transport";
        }
      }  // container transport-encapsulation
    }  // grouping svc-transport-encapsulation

    grouping split-horizon-group {
      description
        "Configuration with split horizon enabled";
      container split-horizon {
        description
          "Configuration with split horizon enabled";
        leaf group-name {
          type string;
          description
            "group-name of the Split Horizon";
        }
      }  // container split-horizon
    }  // grouping split-horizon-group

    grouping svc-precedence {
      description
        "Transport netowrk precedence selector
       Primary or Secondary tunnel.";
      container svc-precedence {
        description
          "Transport netowrk precedence selector
         Primary or Secondary tunnel.";
        leaf precedence {
          type identityref {
            base precedence-type;
          }
          description
            "Defining service redundancy in transport
           network.";
        }
      }  // container svc-precedence
    }  // grouping svc-precedence

    grouping vpn-service-cloud-access {
      description
        "Grouping for vpn cloud definition";
      container cloud-accesses {
        if-feature cloud-access;
        description
          "Container for cloud access configurations";
        list cloud-access {
          key "cloud-identifier";
          description
            "Cloud access configuration.";
          leaf cloud-identifier {
            type string;
            description
              "Identification of cloud service. Local
             admin meaning.";
          }

          choice list-flavor {
            description
              "Choice for cloud access policy.";
            leaf permit-any {
              type empty;
              description "Allow all sites.";
            }
            leaf-list permit-site {
              type leafref {
                path
                  "/l2vpn-ntw/sites/site/site-id";
              }
              description
                "Site ID to be authorized.";
            }
            leaf-list deny-site {
              type leafref {
                path
                  "/l2vpn-ntw/sites/site/site-id";
              }
              description
                "Site ID to be denied.";
            }
          }  // choice list-flavor

          container authorized-sites {
            description
              "Configuration of authorized sites.";
            list authorized-site {
              key "site-id";
              description
                "List of authorized sites.";
              leaf site-id {
                type leafref {
                  path
                    "/l2vpn-ntw/sites/site/site-id";
                }
                description "Site ID.";
              }
            }  // list authorized-site
          }  // container authorized-sites

          container denied-sites {
            description
              "Configuration of denied sites.";
            list denied-site {
              key "site-id";
              description
                "List of denied sites.";
              leaf site-id {
                type leafref {
                  path
                    "/l2vpn-ntw/sites/site/site-id";
                }
                description "Site ID.";
              }
            }  // list denied-site
          }  // container denied-sites
        }  // list cloud-access
      }  // container cloud-accesses
    }  // grouping vpn-service-cloud-access

    grouping site-device {
      description
        "Device parameters for the site.";
      container device {
        description "Devices configuration";
        list devices {
          key "device-id";
          description "List of devices";
          leaf device-id {
            type string;
            description "Device ID";
          }

          leaf location {
            type leafref {
              path
                "/l2vpn-ntw/sites/site/locations/location/"
                  + "location-id";
            }
            description "Site name";
          }

          container management {
            description
              "Container for management";
            leaf address {
              type inet:ip-address;
              description "Address";
            }

            leaf management-transport {
              type identityref {
                base address-family;
              }
              description
                "Transport protocol used for management.";
            }
          }  // container management
        }  // list devices
      }  // container device
    }  // grouping site-device

    grouping site-management {
      description "Grouping for management";
      container management {
        description
          "Container for management";
        leaf type {
          type identityref {
            base management;
          }
          description
            "Management type of the connection.";
        }
      }  // container management
    }  // grouping site-management

    grouping site-vpn-policy {
      description
        "VPN policy parameters for the site.";
      container vpn-policies {
        description "VPN policy.";
        list vpn-policy {
          key "vpn-policy-id";
          description
            "List of VPN policies.";
          leaf vpn-policy-id {
            type string;
            description
              "Unique identifier for the VPN policy.";
          }

          list entries {
            key "id";
            description
              "List of entries for export policy.";
            leaf id {
              type string;
              description
                "Unique identifier for the policy entry.";
            }

            container filters {
              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 filter {
                key "type";
                ordered-by user;
                description
                  "List of filters used on the site. This list can
                 be augmented.";
                leaf type {
                  type identityref {
                    base vpn-policy-filter-type;
                  }
                  description
                    "Type of VPN Policy filter.";
                }
              }  // list filter
            }  // container filters

            list vpn {
              key "vpn-id";
              description
                "List of VPNs the LAN is associated with.";
              leaf vpn-id {
                type leafref {
                  path
                    "/l2vpn-ntw/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.";
              }
            }  // list vpn
          }  // list entries
        }  // list vpn-policy
      }  // container vpn-policies
    }  // grouping site-vpn-policy

    grouping bum-frame-delivery {
      description
        "Grouping for unicast, mulitcast, broadcast frame delivery";
      container bum-frame-delivery-modes {
        description
          "Define frame delivery type and mode.";
        list bum-frame-delivery {
          key "traffic-type";
          description
            "List of frame delivery type and mode.";
          leaf traffic-type {
            type identityref {
              base tf-type;
            }
            description
              "Type of frame delivery. It support unicast
             frame delivery, multicast frame delivery
             and broadcast frame delivery.";
          }

          leaf delivery-mode {
            type identityref {
              base frame-delivery-mode;
            }
            description
              " Define Frame Delivery Mode
             (unconditional[default], conditional, or discard).";
          }
        }  // list bum-frame-delivery
      }  // container bum-frame-delivery-modes
    }  // grouping bum-frame-delivery

    grouping cvlan-svc-map-grouping {
      description
        "Grouping for cvlan to L2VPN service mapping";
      list cvlan-id-to-svc-map {
        key "svc-id";
        description
          "List for cvlan-id to L2VPn Service map configurations";
        leaf svc-id {
          type leafref {
            path
              "/l2vpn-ntw/vpn-services/vpn-service/vpn-id";
          }
          description
            "VPN Service identifier";
        }

        list cvlan-id {
          key "vid";
          description
            "List of CVLAN-ID to SVC Map configurations";
          leaf vid {
            type uint32;
            description "CVLAN ID";
          }
        }  // list cvlan-id
      }  // list cvlan-id-to-svc-map
    }  // grouping cvlan-svc-map-grouping

    grouping customer-location-info {
      description
        "This grouping defines customer location parameters";
      container locations {
        description "Location of the site.";
        list location {
          key "location-id";
          description "List for location";
          leaf location-id {
            type string;
            description "Location ID";
          }

          leaf address {
            type string;
            description
              "Address (number and street) of the site.";
          }

          leaf zip-code {
            type string;
            description
              "ZIP code of the site.";
          }

          leaf state {
            type string;
            description
              "State of the site. This leaf can also be used to
             describe a region for country who does not have
             states.";
          }

          leaf city {
            type string;
            description "City of the site.";
          }

          leaf country-code {
            type string;
            description
              "Country of the site.";
          }
        }  // list location
      }  // container locations
    }  // grouping customer-location-info

    grouping site-diversity {
      description
        "This grouping defines site diversity parameters";
      container site-diversity {
        if-feature site-diversity;
        description
          "Diversity constraint type.";
        container groups {
          description
            "Groups the site is belonging to.
           All site network accesses will inherit those group
           values.";
          list group {
            key "group-id";
            description "List of group-id";
            leaf group-id {
              type string;
              description
                "Group-id the site is belonging to";
            }
          }  // list group
        }  // container groups
      }  // container site-diversity
    }  // grouping site-diversity

    grouping site-service {
      description
        "This grouping defines site service parameters";
    }  // grouping site-service

    grouping vpn-service-multicast {
      description
        "Grouping for multicast VPN definition.";
      container multicast-like {
        if-feature multicast-like;
        description
          "Multicast global parameters for the VPN service.";
        leaf enabled {
          type boolean;
          default "false";
          description "Enables multicast.";
        }

        container customer-tree-flavors {
          description
            "Type of trees used by customer.";
          leaf-list tree-flavor {
            type identityref {
              base multicast-tree-type;
            }
            description
              "Type of tree to be used.";
          }
        }  // container customer-tree-flavors

        uses bum-frame-delivery;

        leaf multicast-gp-port-mapping {
          type identityref {
            base mapping-type;
          }
          description
            "Describe the way in which each interface is associated
           with the Multicast group";
        }
      }  // container multicast-like
    }  // grouping vpn-service-multicast

    grouping vpn-extranet {
      description
        "Grouping for extranet VPN configuration.
       This provides an easy way to interconnect
       all sites from two VPNs.";
      container extranet-vpns {
        if-feature extranet-vpn;
        description
          "Container for extranet VPN configuration.";
        list extranet-vpn {
          key "vpn-id";
          description
            "List of extranet VPNs the local VPN is attached to.";
          leaf vpn-id {
            type svc-id;
            description
              "Identifies the target VPN.";
          }

          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.";
          }
        }  // list extranet-vpn
      }  // container extranet-vpns
    }  // grouping vpn-extranet

    grouping signaling-options-grouping {
      description
        "Grouping for signaling option";
      list signaling-options {
        key "type";
        description
          "List of VPN Signaling Option.";
        leaf type {
          type identityref {
            base vpn-signaling-type;
          }
          description "VPN signaling types";
        }

        container l2vpn-bgp {
          when
            "/l2vpn-ntw/vpn-services/vpn-service/vpn-nodes/vpn-node/signaling-options/type = 'l2vpn-ntw:l2vpn-bgp'" {
            description
              "Only applies when vpn signaling type is l2vpn
             BGP protocol.";
          }
          description
            "Container for MP BGP L2VPN";
          leaf vpn-id {
            type leafref {
              path
                "/l2vpn-ntw/vpn-services/vpn-service/vpn-id";
            }
            description
              "Identifies the target VPN";
          }

          leaf type {
            type identityref {
              base l2vpn-type;
            }
            description "L2VPN types";
          }

          leaf pwe-encapsulation-type {
            type identityref {
              base pwe-encapsulation-type;
            }
            description
              "PWE Encapsulation Type";
          }

          uses vpn-route-targets;

          container pwe-mtu {
            description
              "Container of PWE MTU configurations";
            leaf allow-mtu-mismatch {
              type boolean;
              description
                "Allow MTU mismatch";
            }
          }  // container pwe-mtu

          leaf address-family {
            type identityref {
              base address-family;
            }
            description
              "Address family used for management.";
          }
        }  // container l2vpn-bgp

        container evpn-bgp {
          when
            "/l2vpn-ntw/vpn-services/vpn-service/vpn-nodes/vpn-node/signaling-options/type = 'l2vpn-ntw:evpn-bgp'" {
            description
              "Only applies when vpn signaling type is EVPN
             BGP protocol.";
          }
          description
            "Container for MP BGP L2VPN";
          leaf vpn-id {
            type leafref {
              path
                "/l2vpn-ntw/vpn-services/vpn-service/vpn-id";
            }
            description
              "Identifies the target EVPN";
          }

          leaf type {
            type identityref {
              base evpn-type;
            }
            description "L2VPN types";
          }

          leaf address-family {
            type identityref {
              base address-family;
            }
            description
              "Address family used for management.";
          }

          leaf mac-learning-mode {
            type identityref {
              base mac-learning-mode;
            }
            description
              "Indicates through which plane MAC addresses are
             advertised.";
          }

          leaf arp-suppress {
            type boolean;
            default "false";
            description
              "Indicates whether to suppress ARP broadcast.";
          }
        }  // container evpn-bgp

        container t-ldp-pwe {
          when
            "/l2vpn-ntw/vpn-services/vpn-service/vpn-nodes/vpn-node/signaling-options/type = 'l2vpn-ntw:t-ldp'" {
            description
              "Only applies when vpn signaling type is Target LDP.";
          }
          description
            "Container of T-LDP PWE configurations";
          leaf type {
            type identityref {
              base t-ldp-pwe-type;
            }
            description "T-LDP PWE type";
          }

          leaf pwe-encapsulation-type {
            type identityref {
              base pwe-encapsulation-type;
            }
            description
              "PWE Encapsulation Type.";
          }

          leaf control-word {
            type boolean;
            description
              "Control word configurations";
          }

          container pwe-mtu {
            description
              "Container of PWE MTU configurations";
            leaf allow-mtu-mismatch {
              type boolean;
              description
                "Allow MTU mismatch";
            }
          }  // container pwe-mtu

          leaf provision-mode {
            type identityref {
              base provision-model;
            }
            description
              "provision-models. It support Double-Sided Provisioning
             model or single-side provisioning model.";
          }

          list ac-pw-list {
            key "peer-addr vc-id";
            description
              "List of AC and PW bindings.";
            leaf peer-addr {
              type inet:ip-address;
              description "Peer IP address.";
            }

            leaf vc-id {
              type string;
              description
                "VC lable used to identify PW.";
            }

            leaf pw-type {
              type identityref {
                base pw-topo-type;
              }
              description "PW topology type";
            }

            leaf pw-priority {
              type uint32;
              description
                "Defines the priority for the PW.
               The higher the pw-priority value,
               the higher the preference of the PW will be.";
            }
          }  // list ac-pw-list

          container qinq {
            when
              "/l2vpn-ntw/vpn-services/vpn-service/vpn-nodes/vpn-node/signaling-options/type = 'l2vpn-ntw:h-vpls'" {
              description
                "Only applies when t-ldp pwe type is h-vpls.";
            }
            description "Container for QinQ";
            leaf s-tag {
              type uint32;
              description "S-TAG";
            }

            leaf c-tag {
              type uint32;
              description "C-TAG";
            }
          }  // container qinq
        }  // container t-ldp-pwe

        container l2tp-pwe {
          when
            "/l2vpn-ntw/vpn-services/vpn-service/vpn-nodes/vpn-node/signaling-options/type = 'l2vpn-ntw:l2tp'" {
            description
              "Applies when vpn signaling type is L2TP protocol.";
          }
          description
            "Container for l2tp pw";
          leaf type {
            type identityref {
              base t-ldp-pwe-type;
            }
            description "T-LDP PWE type";
          }

          leaf encapsulation-type {
            type identityref {
              base encapsulation-type;
            }
            description "Encapsulation type";
          }

          leaf control-word {
            type boolean;
            description
              "Control word configurations";
          }

          list ac-pw-list {
            key "peer-addr vc-id";
            description
              "List of AC and PW bindings.";
            leaf peer-addr {
              type inet:ip-address;
              description "Peer IP address.";
            }

            leaf vc-id {
              type string;
              description
                "VC lable used to identify PW.";
            }

            leaf pw-type {
              type identityref {
                base pw-topo-type;
              }
              description "PW topology type";
            }

            leaf pw-priority {
              type uint32;
              description "PW priority";
            }
          }  // list ac-pw-list
        }  // container l2tp-pwe
      }  // list signaling-options
    }  // grouping signaling-options-grouping

    grouping operational-requirements-ops {
      description
        "This grouping defines some operational parameters
       parameters";
      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";
      }

      leaf bundling-type {
        type identityref {
          base bundling-type;
        }
        description "Bundling type";
      }

      leaf default-ce-vlan-id {
        type uint32;
        description
          "Default CE VLAN ID set at site level.";
      }
    }  // grouping operational-requirements-ops

    grouping cfm-802-grouping {
      description
        "Grouping for 802.1ag CFM attribute";
      leaf maid {
        type string;
        description "MA ID";
      }

      leaf mep-id {
        type uint32;
        description "Local MEP ID";
      }

      leaf mep-level {
        type uint32;
        description "MEP level";
      }

      leaf mep-up-down {
        type enumeration {
          enum "up" {
            value 0;
            description "MEP up";
          }
          enum "down" {
            value 1;
            description "MEP down";
          }
        }
        description "MEP up/down";
      }

      leaf remote-mep-id {
        type uint32;
        description "Remote MEP ID";
      }

      leaf cos-for-cfm-pdus {
        type uint32;
        description "COS for CFM PDUs";
      }

      leaf ccm-interval {
        type uint32;
        description "CCM interval";
      }

      leaf ccm-holdtime {
        type uint32;
        description "CCM hold time";
      }

      leaf alarm-priority-defect {
        type identityref {
          base fault-alarm-defect-type;
        }
        description
          "The lowest priority defect that is
         allowed to generate a Fault Alarm.
         The non-existence of this leaf means
         that no defects are to be reported";
      }

      leaf ccm-p-bits-pri {
        type ccm-priority-type;
        description
          "The priority parameter for CCMs transmitted by the MEP";
      }
    }  // grouping cfm-802-grouping

    grouping y-1731 {
      description "Grouping for y.1731";
      list y-1731 {
        key "maid";
        description "List for y-1731.";
        leaf maid {
          type string;
          description "MA ID ";
        }

        leaf mep-id {
          type uint32;
          description "Local MEP ID";
        }

        leaf type {
          type identityref {
            base pm-type;
          }
          description
            "Performance monitor types";
        }

        leaf remote-mep-id {
          type uint32;
          description "Remote MEP ID";
        }

        leaf message-period {
          type uint32;
          description
            "Defines the interval between OAM messages. The message
           period is expressed in milliseconds";
        }

        leaf measurement-interval {
          type uint32;
          description
            "Specifies the measurement interval for statistics. The
           measurement interval is expressed in seconds";
        }

        leaf cos {
          type uint32;
          description "Class of service";
        }

        leaf loss-measurement {
          type boolean;
          description
            "Whether enable loss measurement";
        }

        leaf synthethic-loss-measurement {
          type boolean;
          description
            "Indicate whether enable synthetic loss measurement";
        }

        container delay-measurement {
          description
            "Container for delay measurement";
          leaf enable-dm {
            type boolean;
            description
              "Whether to enable delay measurement";
          }

          leaf two-way {
            type boolean;
            description
              "Whether delay measurement is two-way (true) of one-
             way (false)";
          }
        }  // container delay-measurement

        leaf frame-size {
          type uint32;
          description "Frame size";
        }

        leaf session-type {
          type enumeration {
            enum "proactive" {
              value 0;
              description "Proactive mode";
            }
            enum "on-demand" {
              value 1;
              description "On demand mode";
            }
          }
          description "Session type";
        }
      }  // list y-1731
    }  // grouping y-1731

    grouping enni-site-info-grouping {
      description
        "Grouping for site information";
      container site-info {
        description
          "Container of site info configurations";
        leaf site-name {
          type string;
          description "Site name";
        }

        leaf address {
          type inet:ip-address;
          description "Address";
        }

        leaf Edge-Gateway-Device-Info {
          type string;
          description
            "Edge Gateway Device Info ";
        }
      }  // container site-info
    }  // grouping enni-site-info-grouping

    grouping acl-grouping {
      description
        "This grouping defines Access Control List.";
      container access-control-list {
        description
          "Container for access control List.";
        list mac {
          key "mac-address";
          description "List for MAC.";
          leaf mac-address {
            type yang:mac-address;
            description "MAC address.";
          }
        }  // list mac
      }  // container access-control-list
    }  // grouping acl-grouping

    grouping lacp-grouping {
      description "Grouping for lacp";
      container lacp {
        description "LACP";
        leaf lacp-state {
          type boolean;
          description "LACP on/off";
        }

        leaf lacp-mode {
          type boolean;
          description "LACP mode";
        }

        leaf lacp-speed {
          type boolean;
          description "LACP speed";
        }

        leaf mini-link {
          type uint32;
          description
            "The minimum aggregate bandwidth for a LAG";
        }

        leaf system-priority {
          type uint16;
          description
            "Indicates the LACP priority for the system.
           The range is from 0 to 65535.
           The default is 32768.";
        }

        container micro-bfd {
          if-feature micro-bfd;
          description
            "Container of Micro-BFD configurations";
          leaf micro-bfd-on-off {
            type enumeration {
              enum "on" {
                value 0;
                description "Micro-bfd on";
              }
              enum "off" {
                value 1;
                description "Micro-bfd off";
              }
            }
            description "Micro BFD ON/OFF";
          }

          leaf bfd-interval {
            type uint32;
            description "BFD interval";
          }

          leaf bfd-hold-timer {
            type uint32;
            description "BFD hold timer";
          }
        }  // container micro-bfd

        container bfd {
          if-feature bfd;
          description "Container for BFD.";
          leaf bfd-enabled {
            type boolean;
            description "BFD activation";
          }

          choice holdtime {
            description
              "Choice for hold time flavor.";
            case profile {
              description
                "Service provider well known profile.";
              leaf profile-name {
                type string;
                description
                  "Service provider well known profile.";
              }
            }  // case profile
            leaf fixed-value {
              type uint32;
              units "msec";
              description
                "Expected hold time expressed in msec.";
            }
          }  // choice holdtime
        }  // container bfd

        container member-link-list {
          description
            "Container of Member link list";
          list member-link {
            key "name";
            description "Member link";
            leaf name {
              type string;
              description "Member link name";
            }

            leaf port-speed {
              type uint32;
              description "Port speed";
            }

            leaf mode {
              type neg-mode;
              description "Negotiation mode";
            }

            leaf link-mtu {
              type uint32;
              description "Link MTU size.";
            }

            container oam-802.3ah-link {
              if-feature oam-3ah;
              description
                "Container for oam 802.3 ah link.";
              leaf enable {
                type boolean;
                description
                  "Indicate whether support oam 802.3 ah link";
              }
            }  // container oam-802.3ah-link
          }  // list member-link
        }  // container member-link-list

        leaf flow-control {
          type string;
          description "Flow control";
        }

        leaf lldp {
          type boolean;
          description "LLDP";
        }
      }  // container lacp
    }  // grouping lacp-grouping

    grouping phy-interface-grouping {
      description
        "Grouping for phy interface.";
      container phy-interface {
        description
          "Container of PHY Interface Attributes configurations";
        leaf port-number {
          type uint32;
          description "Port number";
        }

        leaf port-speed {
          type uint32;
          description "Port speed";
        }

        leaf mode {
          type neg-mode;
          description "Negotiation mode";
        }

        leaf phy-mtu {
          type uint32;
          description "PHY MTU";
        }

        leaf flow-control {
          type string;
          description "Flow control";
        }

        leaf physical-if {
          type string;
          description "Physical interface";
        }

        leaf circuit-id {
          type string;
          description "Circuit ID";
        }

        leaf lldp {
          type boolean;
          description "LLDP";
        }

        container oam-802.3ah-link {
          if-feature oam-3ah;
          description
            "Container for oam 802.3 ah link.";
          leaf enable {
            type boolean;
            description
              "Indicate whether support oam 802.3 ah link";
          }
        }  // container oam-802.3ah-link

        leaf uni-loop-prevention {
          type boolean;
          description
            "If this leaf set to truth that the port automatically
           goes down when a physical loopback is detect.";
        }
      }  // container phy-interface
    }  // grouping phy-interface-grouping

    grouping lag-interface-grouping {
      description
        "Grouping for LAG interface";
      container lag-interface {
        if-feature lag-interface;
        description
          "Container of LAG interface attributes configuration";
        list lag-interface {
          key "lag-interface-number";
          description
            "List of LAG interfaces";
          leaf lag-interface-number {
            type uint32;
            description
              "LAG interface number";
          }

          uses lacp-grouping;
        }  // list lag-interface
      }  // container lag-interface
    }  // grouping lag-interface-grouping

    grouping dot1q-interface-grouping {
      description
        "Grouping for Layer2 access";
      container dot1q-interface {
        description
          "Container for dot1Q Interface";
        leaf l2-access-type {
          type identityref {
            base l2-access-type;
          }
          description
            "L2 Access Encapsulation Type";
        }

        container dot1q {
          when "'../l2-access-type'='dot1q'";
          if-feature dot1q;
          description "Qot1q";
          leaf physical-inf {
            type string;
            description "Physical Interface";
          }

          leaf c-vlan-id {
            type uint32;
            description "VLAN identifier";
          }
        }  // container dot1q

        container sub-inf {
          when
            "'../l2-access-type'='sub-interface'";
          if-feature sub-inf;
          description "sub interface";
          leaf interface-description {
            type string;
            description
              "Interface description";
          }

          leaf sub-if-id {
            type uint32;
            description "Sub interface ID";
          }
        }  // container sub-inf

        container qinq {
          when "'../l2-access-type'='qinq'";
          if-feature qinq;
          description "QinQ";
          leaf s-vlan-id {
            type uint32;
            description "S-VLAN Identifier";
          }

          leaf c-vlan-id {
            type uint32;
            description "C-VLAN Identifier";
          }
        }  // container qinq

        container qinany {
          if-feature qinany;
          description
            "Container for Q in Any";
          leaf s-vlan-id {
            type uint32;
            description "S-Vlan ID";
          }
        }  // container qinany

        container atm {
          when "'../l2-access-type'='atm'";
          if-feature atm;
          description "ATM Cell.";
          leaf vpi {
            type uint32;
            description "VPI Identifier";
          }

          leaf vci {
            type uint32;
            description "VCI Identifier";
          }
        }  // container atm

        container vxlan {
          when "'../l2-access-type'='vxlan'";
          if-feature vxlan;
          description "QinQ";
          leaf vni-id {
            type uint32;
            description "VNI Identifier";
          }

          leaf peer-mode {
            type identityref {
              base vxlan-peer-mode;
            }
            description
              "specify the vxlan access mode";
          }

          list peer-list {
            key "peer-ip";
            description "List for peer IP";
            leaf peer-ip {
              type inet:ip-address;
              description "Peer IP";
            }
          }  // list peer-list
        }  // container vxlan
      }  // container dot1q-interface
    }  // grouping dot1q-interface-grouping

    grouping ethernet-connection-grouping {
      description "Grouping for bearer.";
      container connection {
        description "Container for bearer";
        leaf port-id {
          type string;
          description
            "Reference to the Port-id.
             The semantic of the Port-Id depends on the vendor's
             semantic. i.e ge-X/Y/Z , xe-X/Y/Z , et-X/Y/Z,AeXXX.YYY,
             aeXXX,GigabitEthernetX/Y/Z";
        }

        leaf encapsulation-type {
          type identityref {
            base encapsulation-type;
          }
          description "Encapsulation Type";
        }

        leaf-list eth-inf-type {
          type identityref {
            base eth-inf-type;
          }
          description
            "Ethernet Interface Type";
        }

        uses dot1q-interface-grouping;

        uses phy-interface-grouping;

        uses lag-interface-grouping;

        uses cvlan-svc-map-grouping;

        uses split-horizon-group;

        uses l2cp-grouping;
      }  // container connection
    }  // grouping ethernet-connection-grouping

    grouping svc-mtu-grouping {
      description
        "Grouping for service mtu.";
      leaf svc-mtu {
        type uint32;
        description
          "SVC MTU, it is also known as the maximum transmission unit
         or maximum frame size,When a frame is larger than the MTU,
         it is broken down, or fragmented, into smaller pieces by the
         network protocol to accommodate the MTU of the network";
      }
    }  // grouping svc-mtu-grouping

    grouping svc-preservation-grouping {
      description
        "Grouping for service preservation.";
      leaf ce-vlan-preservation {
        type boolean;
        description
          "Preserve the CE-VLAN ID from ingress to egress,i.e.,
         CE-VLAN tag of the egress frame are identical to
         those of the ingress frame that yielded this egress
         service frame. If All-to-One bundling within a site
         is Enabled, then preservation applies to all Ingress
         service frames. If All-to-One bundling is Disabled,
         then preservation applies to tagged Ingress service
         frames having CE-VLAN ID 1 through 4094.";
      }

      leaf ce-vlan-cos-perservation {
        type boolean;
        description
          "CE vlan CoS preservation. PCP bits in the CE-VLAN tag
         of the egress frame are identical to those of the ingress
         frame that yielded this egress service frame.";
      }
    }  // grouping svc-preservation-grouping

    grouping mac-addr-limit-grouping {
      description
        "Grouping for mac address limit";
      container mac-addr-limit {
        description
          "Container of MAC-Addr limit configurations";
        leaf mac-num-limit {
          type uint16;
          description
            "maximum number of MAC addresses learned from
           the subscriber for a single service instance.";
        }

        leaf time-interval {
          type uint32;
          units "milliseconds";
          description
            "The aging time of the mac address.";
        }

        leaf action {
          type identityref {
            base mac-action;
          }
          description
            "specify the action when the upper limit is
           exceeded: drop the packet, flood the
           packet, or simply send a warning log message.";
        }
      }  // container mac-addr-limit
    }  // grouping mac-addr-limit-grouping

    grouping availability-grouping {
      description
        "Grouping for availability";
      container availability {
        description
          "Container of availability optional configurations";
        leaf access-priority {
          type uint32;
          description "Access priority";
        }

        choice redundancy-mode {
          description
            "Redundancy mode choice";
          case single-active {
            description "Single active case";
            leaf single-active {
              type boolean;
              description "Single active";
            }
          }  // case single-active

          case all-active {
            description "All active case";
            leaf all-active {
              type boolean;
              description "All active";
            }
          }  // case all-active
        }  // choice redundancy-mode
      }  // container availability
    }  // grouping availability-grouping

    grouping l2cp-grouping {
      description
        "Grouping for l2cp control";
      container l2cp-control {
        if-feature l2cp-control;
        description
          "Container of L2CP control configurations";
        leaf stp-rstp-mstp {
          type control-mode;
          description
            "STP/RSTP/MSTP protocol type applicable to all UNIs";
        }

        leaf pause {
          type control-mode;
          description
            "Pause protocol type applicable to all UNIs";
        }

        leaf lacp-lamp {
          type control-mode;
          description "LACP/LAMP  ";
        }

        leaf link-oam {
          type control-mode;
          description "Link OAM";
        }

        leaf esmc {
          type control-mode;
          description "ESMC";
        }

        leaf l2cp-802.1x {
          type control-mode;
          description "802.x";
        }

        leaf e-lmi {
          type control-mode;
          description "E-LMI";
        }

        leaf lldp {
          type boolean;
          description
            "LLDP protocol type applicable to all UNIs";
        }

        leaf ptp-peer-delay {
          type control-mode;
          description "PTP peer delay";
        }

        leaf garp-mrp {
          type control-mode;
          description "GARP/MRP";
        }
      }  // container l2cp-control
    }  // grouping l2cp-grouping

    grouping B-U-M-grouping {
      description
        "Grouping for broadcast, unknown unicast, and multicast ";
      container broadcast-unknown-unicast-multicast {
        description
          "Container of broadcast, unknown unicast, and multicast
         configurations";
        leaf multicast-site-type {
          type enumeration {
            enum "receiver-only" {
              value 0;
              description
                "The site only has receivers.";
            }
            enum "source-only" {
              value 1;
              description
                "The site only has sources.";
            }
            enum "source-receiver" {
              value 2;
              description
                "The site has both sources and receivers.";
            }
          }
          default "source-receiver";
          description
            "Type of multicast site.";
        }

        list multicast-gp-address-mapping {
          key "id";
          description
            "List of Port to group mappings.";
          leaf id {
            type uint16;
            description
              "Unique identifier for the mapping.";
          }

          leaf vlan-id {
            type uint32;
            description
              "the VLAN ID of the Multicast group";
          }

          leaf mac-gp-address {
            type yang:mac-address;
            description
              "the MAC address of the Multicast group";
          }

          leaf port-lag-number {
            type uint32;
            description
              "the ports/LAGs belonging to the Multicast group";
          }
        }  // list multicast-gp-address-mapping

        leaf bum-overall-rate {
          type uint32;
          description "overall rate for BUM";
        }

        list bum-rate-per-type {
          key "type";
          description
            "List of rate per type";
          leaf type {
            type identityref {
              base bum-type;
            }
            description "BUM type";
          }

          leaf rate {
            type uint32;
            description "rate for BUM";
          }
        }  // list bum-rate-per-type
      }  // container broadcast-unknown-unicast-multicast
    }  // grouping B-U-M-grouping

    grouping mac-loop-prevention-grouping {
      description
        "Grouping for MAC loop prevention";
      container mac-loop-prevention {
        description
          "Container of MAC loop prevention.";
        leaf frequency {
          type uint32;
          description "Frequency";
        }

        leaf protection-type {
          type identityref {
            base loop-prevention-type;
          }
          description "Protection type";
        }

        leaf number-retries {
          type uint32;
          description "Number of retries";
        }
      }  // container mac-loop-prevention
    }  // grouping mac-loop-prevention-grouping

    grouping ethernet-svc-oam-grouping {
      description
        "Grouping for Ethernet service OAM.";
      container ethernet-service-oam {
        description
          "Container for Ethernet service OAM.";
        leaf md-name {
          type string;
          description
            "Maintenance domain name";
        }

        leaf md-level {
          type uint8;
          description
            "Maintenance domain level";
        }

        container cfm-802.1-ag {
          description
            "Container of 802.1ag CFM configurations.";
          list n2-uni-c {
            key "maid";
            description
              "List of UNI-N to UNI-C";
            uses cfm-802-grouping;
          }  // list n2-uni-c

          list n2-uni-n {
            key "maid";
            description
              "List of UNI-N to UNI-N";
            uses cfm-802-grouping;
          }  // list n2-uni-n
        }  // container cfm-802.1-ag

        uses y-1731;
      }  // container ethernet-service-oam
    }  // grouping ethernet-svc-oam-grouping

    grouping fate-sharing-group {
      description
        "Grouping for Fate sharing group.";
      container groups {
        description
          "Groups the fate sharing group member
         is belonging to";
        leaf fate-sharing-group-size {
          type uint16;
          description
            "Fate sharing group size.";
        }

        leaf group-color {
          type string;
          description
            "Group color associated with a particular VPN.";
        }

        list group {
          key "group-id";
          description "List of group-id";
          leaf group-id {
            type string;
            description
              "Group-id the site network access
             is belonging to";
          }
        }  // list group
      }  // container groups
    }  // grouping fate-sharing-group

    grouping site-group {
      description
        "Grouping definition to assign
       group-ids to site or vpn-network-access";
      container groups {
        description
          "Groups the site or vpn-network-access
         is belonging to.";
        list group {
          key "group-id";
          description "List of group-id";
          leaf group-id {
            type string;
            description
              "Group-id the site is belonging to";
          }
        }  // list group
      }  // container groups
    }  // grouping site-group

    grouping access-diversity {
      description
        "This grouping defines access diversity
       parameters";
      container access-diversity {
        if-feature site-diversity;
        description "Diversity parameters.";
        uses fate-sharing-group;

        container constraints {
          description
            "Constraints for placing this site
            network access";
          list constraint {
            key "constraint-type";
            description
              "List of constraints";
            leaf constraint-type {
              type identityref {
                base placement-diversity;
              }
              description
                "Diversity constraint type.";
            }

            container target {
              description
                "The constraint will apply against
               this list of groups";
              choice target-flavor {
                description
                  "Choice for the group definition";
                list group {
                  key "group-id";
                  description
                    "List of groups";
                  leaf group-id {
                    type string;
                    description
                      "The constraint will apply
                       against this particular
                       group-id";
                  }
                }  // list group
                leaf all-other-accesses {
                  type empty;
                  description
                    "The constraint will apply
                     against all other site network
                     access of this site";
                }
                leaf all-other-groups {
                  type empty;
                  description
                    "The constraint will apply
                     against all other groups the
                     customer is managing";
                }
              }  // choice target-flavor
            }  // container target
          }  // list constraint
        }  // container constraints
      }  // container access-diversity
    }  // grouping access-diversity

    grouping request-type-profile-grouping {
      description
        "Grouping for request type profile";
      container request-type-profile {
        description
          "Container for request type profile.";
        choice request-type-choice {
          description
            "Choice for request type";
          case dot1q-case {
            description "Case for dot1q";
            container dot1q {
              description
                "Container for dot1q.";
              leaf physical-if {
                type string;
                description
                  "Physical interface";
              }

              leaf vlan-id {
                type uint16;
                description "VLAN ID";
              }
            }  // container dot1q
          }  // case dot1q-case

          case physical-case {
            description "Physical case";
            leaf physical-if {
              type string;
              description
                "Physical interface";
            }

            leaf circuit-id {
              type string;
              description "Circuit ID";
            }
          }  // case physical-case
        }  // choice request-type-choice
      }  // container request-type-profile
    }  // grouping request-type-profile-grouping

    grouping site-attachment-bearer {
      description
        "Grouping to define physical properties of
       a site attachment.";
      container bearer {
        description
          "Bearer specific parameters.
         To be augmented.";
        container requested-type {
          if-feature requested-type;
          description
            "Container for requested type.";
          leaf requested-type {
            type string;
            description
              "Type of requested bearer Ethernet, ATM, Frame
             Relay, IP Layer 2 Transport, Frame Relay DLCI,
             SONET/SDH,PPP.";
          }

          leaf strict {
            type boolean;
            default "false";
            description
              "Define if the requested-type is a preference
             or a strict requirement.";
          }
        }  // container requested-type

        leaf always-on {
          if-feature always-on;
          type boolean;
          default "true";
          description
            "Request for an always on access type.
           This means no Dial access type for
           example.";
        }

        leaf bearer-reference {
          if-feature bearer-reference;
          type string;
          description
            "This is an internal reference for the
           service provider.";
        }
      }  // container bearer
    }  // grouping site-attachment-bearer

    grouping vpn-attachment-grouping {
      description
        "Grouping for access attachment";
      container vpn-attachment {
        description
          "Defines VPN attachment of a site.";
        leaf device-id {
          type string;
          description "Device ID";
        }

        container management {
          description
            "Management configuration..";
          leaf address-family {
            type identityref {
              base address-family;
            }
            description
              "Address family used for management.";
          }

          leaf address {
            type inet:ip-address;
            description "Management address";
          }
        }  // container management

        choice attachment-flavor {
          mandatory true;
          description
            "Choice for VPN attachment flavor.";
          list vpn-flavor {
            key "vpn-id";
            description
              "List of IPVPNs attached by the Site Network Access";
            leaf vpn-id {
              type leafref {
                path
                  "/l2vpn-ntw/vpn-services"
                    + "/vpn-service/vpn-id";
              }
              description
                "Reference to a VPN.";
            }

            leaf site-role {
              type identityref {
                base site-role;
              }
              default "any-to-any-role";
              description
                "Role of the site in the IPVPN.";
            }
          }  // list vpn-flavor
          leaf vpn-policy-id {
            type leafref {
              path
                "/l2vpn-ntw/sites/site/vpn-policies/vpn-policy/"
                  + "vpn-policy-id";
            }
            description
              "Reference to a vpn policy";
          }
        }  // choice attachment-flavor
      }  // container vpn-attachment
    }  // grouping vpn-attachment-grouping

    grouping site-service-basic {
      description
        "Grouping for site service";
      container svc-input-bandwidth {
        if-feature input-bw;
        description
          "From the PE perspective, the service input
         bandwidth of the connection.";
        list input-bandwidth {
          key "type";
          description
            "List for input bandwidth";
          leaf type {
            type identityref {
              base bw-type;
            }
            description "Bandwidth Type";
          }

          leaf cos-id {
            type uint8;
            description
              "Identifier of Class of Service
             , indicated by DSCP or a CE-CLAN
             CoS(802.1p)value in the service frame.";
          }

          leaf vpn-id {
            type svc-id;
            description
              "Identifies the target VPN.";
          }

          leaf cir {
            type uint64;
            description
              "Committed Information Rate. The maximum number of
             bits that a port can receive or send during
             one-second over an interface.";
          }

          leaf cbs {
            type uint64;
            description
              "Committed Burst Size.CBS controls the bursty nature
             of the traffic. Traffic that does not use the
             configured CIR accumulates credits until the credits
             reach the configured CBS.";
          }

          leaf eir {
            type uint64;
            description
              "Excess Information Rate,i.e.,Excess frame delivery
             allowed not subject to SLA.The traffic rate can be
             limited by eir.";
          }

          leaf ebs {
            type uint64;
            description
              "Excess Burst Size. The bandwidth available for burst
             traffic from the EBS is subject to the amount of
             bandwidth that is accumulated during periods when
             traffic allocated by the EIR policy is not used.";
          }

          leaf pir {
            type uint64;
            description
              "Peak Information Rate, i.e., maixmum frame delivery
             allowed. It is equal to or less than sum of cir and
             eir.";
          }

          leaf pbs {
            type uint64;
            description
              "Peak Burst Size. It is measured in bytes per second.";
          }
        }  // list input-bandwidth
      }  // container svc-input-bandwidth

      container svc-output-bandwidth {
        if-feature output-bw;
        description
          "From the PE perspective, the service output
         bandwidth of the connection.";
        list output-bandwidth {
          key "type";
          description
            "List for output bandwidth";
          leaf type {
            type identityref {
              base bw-type;
            }
            description "Bandwidth Type";
          }

          leaf cos-id {
            type uint8;
            description
              "Identifier of Class of Service
             , indicated by DSCP or a CE-CLAN
             CoS(802.1p)value in the service frame.";
          }

          leaf vpn-id {
            type svc-id;
            description
              "Identifies the target VPN.";
          }

          leaf cir {
            type uint64;
            description
              "Committed Information Rate. The maximum number of
             bits that a port can receive or send during
             one-second over an interface.";
          }

          leaf cbs {
            type uint64;
            description
              "Committed Burst Size.CBS controls the bursty nature
             of the traffic. Traffic that does not use the
             configured CIR accumulates credits until the credits
             reach the configured CBS.";
          }

          leaf eir {
            type uint64;
            description
              "Excess Information Rate,i.e.,Excess frame delivery
             allowed not subject to SLA.The traffic rate can be
             limited by eir.";
          }

          leaf ebs {
            type uint64;
            description
              "Excess Burst Size. The bandwidth available for burst
             traffic from the EBS is subject to the amount of
             bandwidth that is accumulated during periods when
             traffic allocated by the EIR policy is not used.";
          }

          leaf pir {
            type uint64;
            description
              "Peak Information Rate, i.e., maixmum frame delivery
             allowed. It is equal to or less than sum of cir and
             eir.";
          }

          leaf pbs {
            type uint64;
            description
              "Peak Burst Size. It is measured in bytes per second.";
          }
        }  // list output-bandwidth
      }  // container svc-output-bandwidth
    }  // grouping site-service-basic

    grouping flow-definition {
      description
        "Flow definition based on criteria.";
      container match-flow {
        description
          "Describe flow matching criteria.";
        leaf dscp {
          type inet:dscp;
          description "DSCP value.";
        }

        leaf dot1q {
          type uint32;
          description
            "802.1q matching. It is VLAN Tag added into frame.";
        }

        leaf pcp {
          type uint8 {
            range "0 .. 7";
          }
          description "PCP value";
        }

        uses pf:acl-eth-header-fields;

        leaf color-type {
          type identityref {
            base color-type;
          }
          description "Color Types";
        }

        leaf-list target-sites {
          type svc-id;
          description
            "Identify a site as traffic destination.";
        }

        leaf any {
          type empty;
          description "Allow all.";
        }

        leaf vpn-id {
          type svc-id;
          description
            "Reference to the target VPN.";
        }
      }  // container match-flow
    }  // grouping flow-definition

    grouping services-grouping {
      description "Grouping for Services";
      container service {
        description "Container for service";
        uses site-service-qos-profile;
      }  // container service
    }  // grouping services-grouping

    grouping service-grouping {
      description "Grouping for service.";
      container service {
        description "Container for service";
        uses site-service-basic;

        uses site-service-qos-profile;

        uses svc-precedence;
      }  // container service
    }  // grouping service-grouping

    grouping site-service-qos-profile {
      description
        "This grouping defines QoS parameters
       for a site";
      container qos {
        if-feature qos;
        description "QoS configuration.";
        container classification-policy {
          description
            "Configuration of the traffic classification policy.";
          list rule {
            key "id";
            ordered-by user;
            description
              "List of marking rules.";
            leaf id {
              type string;
              description
                "A description identifying qos classification
               policy rule.";
            }

            choice match-type {
              default "match-flow";
              description
                "Choice for classification";
              container match-flow {
                description
                  "Describe flow matching criteria.";
                leaf dscp {
                  type inet:dscp;
                  description "DSCP value.";
                }

                leaf dot1q {
                  type uint16;
                  description
                    "802.1q matching. It is VLAN Tag added into
                     frame.";
                }

                leaf pcp {
                  type uint8 {
                    range "0 .. 7";
                  }
                  description "PCP value.";
                }

                uses pf:acl-eth-header-fields;

                leaf color-type {
                  type identityref {
                    base color-type;
                  }
                  description "Color Types.";
                }

                leaf-list target-sites {
                  if-feature target-sites;
                  type svc-id;
                  description
                    "Identify a site as traffic destination.";
                }

                leaf any {
                  type empty;
                  description "Allow all.";
                }

                leaf vpn-id {
                  type svc-id;
                  description
                    "Reference to the target VPN.";
                }
              }  // container match-flow
              leaf match-application {
                type identityref {
                  base customer-application;
                }
                description
                  "Defines the application to match.";
              }
            }  // choice match-type

            leaf target-class-id {
              type string;
              description
                "Identification of the class of service.
               This identifier is internal to the
               administration.";
            }
          }  // list rule
        }  // container classification-policy

        container qos-profile {
          description
            "QoS profile configuration.";
          leaf profile {
            type leafref {
              path
                "/l2vpn-ntw/vpn-profiles/"
                  + "valid-provider-identifiers"
                  + "/qos-profile-identifier";
            }
            description
              "QoS profile configuration.";
          }
        }  // container qos-profile
      }  // container qos
    }  // grouping site-service-qos-profile

    container l2vpn-ntw {
      description
        "Container for VPN services.";
      container vpn-profiles {
        description
          "Container for VPN Profiles.";
        container valid-provider-identifiers {
          nacm:default-deny-write;
          description
            "Container for Valid Provider Identifies.";
          leaf-list cloud-identifier {
            if-feature cloud-access;
            type string;
            description
              "Identification of public cloud service
             or internet service. Local administration
             meaning.";
          }

          leaf-list qos-profile-identifier {
            type string;
            description
              "Identification of the QoS Profile to be used.
             Local administration meaning.";
          }

          leaf-list bfd-profile-identifier {
            type string;
            description
              "Identification of the SP BFD Profile to be used.
             Local administration meaning.";
          }

          leaf-list remote-carrier-identifier {
            type string;
            description
              "Identification of the remote carrier name to be used.
             It can be L2VPN partner, Data center service provider
             or private cloud service provider. Local administration
             meaning.";
          }
        }  // container valid-provider-identifiers
      }  // container vpn-profiles

      container vpn-services {
        description
          "Container for L2VPN service";
        list vpn-service {
          key "vpn-id";
          description
            "Container of port configurations";
          leaf vpn-id {
            type svc-id;
            description
              "Refers to unique identifier for the L2NM.";
          }

          leaf l2sm-vpn-id {
            type svc-id;
            description
              "Pointer to the L2SM service.";
          }

          leaf vpn-svc-type {
            type identityref {
              base service-type;
            }
            description "Service type";
          }

          leaf customer-name {
            type string;
            description "Customer name";
          }

          leaf svc-topo {
            type identityref {
              base vpn-topology;
            }
            description
              "Defining service topology, such as
             any-to-any,hub-spoke, etc.";
          }

          uses l3vpn-ntw:service-status;

          uses site-service;

          uses vpn-service-multicast;

          uses vpn-extranet;

          uses svc-mtu-grouping;

          uses svc-preservation-grouping;

          uses l3vpn-ntw:svc-transport-encapsulation;

          container vpn-nodes {
            description "List of vpn-svc";
            list vpn-node {
              key "vpn-node-id ne-id";
              description
                "Container of VPN Nodes.";
              leaf vpn-node-id {
                type string;
                description "";
              }

              leaf description {
                type string;
                description
                  "Textual description of a VPN node.";
              }

              leaf node-role {
                type identityref {
                  base site-role;
                }
                default "any-to-any-role";
                description
                  "Role of the vpn-node in the IP VPN.";
              }

              leaf ne-id {
                type string;
                description "NE IP address";
              }

              leaf port-id {
                type string;
                description "NE Port-id";
              }

              uses signaling-options-grouping;

              container vpn-network-accesses {
                description
                  "List of VPN Nodes.";
                list vpn-network-access {
                  key "network-access-id";
                  description
                    "List of VPN Network Accesses.";
                  leaf network-access-id {
                    type string;
                    description
                      "Identifier of network access";
                  }

                  leaf description {
                    type string;
                    description
                      "String to describe the element.";
                  }

                  leaf remote-carrier-name {
                    when
                      "'../site-type' = 'enni'" {
                      description
                        "Site type = enni";
                    }
                    type string;
                    description
                      "Remote carrier name";
                  }

                  leaf Interface-mtu {
                    type uint32;
                    description
                      "Interface MTU, it is also known as the maximum
                     transmission unit or maximum frame size. When a
                     frame is larger than the MTU, it is broken down,
                     or fragmented, into smaller pieces by the
                     network protocol to accommodate the MTU of the
                     network";
                  }

                  uses l3vpn-ntw:service-status;

                  uses access-diversity;

                  uses ethernet-connection-grouping;

                  uses availability-grouping;

                  uses service-grouping;

                  uses B-U-M-grouping;

                  uses ethernet-svc-oam-grouping;

                  uses mac-loop-prevention-grouping;

                  uses acl-grouping;

                  uses mac-addr-limit-grouping;
                }  // list vpn-network-access
              }  // container vpn-network-accesses
            }  // list vpn-node
          }  // container vpn-nodes
        }  // list vpn-service
      }  // container vpn-services
    }  // container l2vpn-ntw
  }  // module ietf-l2vpn-ntw