netconfcentral logo

ietf-l2vpn-svc@2018-04-03



  module ietf-l2vpn-svc {

    yang-version 1.1;

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

    prefix l2vpn-svc;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
    import ietf-netconf-acm {
      prefix nacm;
    }

    organization "IETF L2SM Working Group.";

    contact
      "WG List: l2sm@ietf.org
     Editor: giuseppe.fioccola@telecomitalia.it";

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

    revision "2018-04-03" {
      description "Initial revision";
      reference
        "RFC xxxx: A YANG Data Model for L2VPN Service
        Delivery.";

    }


    feature carrierscarrier {
      description "Enables support of CsC.";
    }

    feature ethernet-oam {
      description
        "Enables support of ethernet OAM.";
    }

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

    feature l2cp-control {
      description
        "Enable the Support of L2CP control.";
    }

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

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

    feature uni-list {
      description
        "Enable the support of UNI list in a VPN.";
    }

    feature cloud-access {
      description
        "Allow VPN to connect to a Cloud Service
       provider or an internet service provider.";
    }

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

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

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

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

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

    feature encryption {
      description
        "Enables support of encryption.";
    }

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

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

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

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

    feature qos-custom {
      description
        "Enables support of custom qos profile.";
    }

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

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

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

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

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

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

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

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

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

    feature bum {
      description
        "Enables broadcast,unknown-unicast,multicast
       capabilities in a VPN.";
    }

    feature mac-loop-prevention {
      description
        "Enables MAC Loop prevention capability in a VPN.";
    }

    feature lacp {
      description
        " Enables LACP capability in a VPN. ";
    }

    feature mac-addr-limit {
      description
        "Enables MAC Address Limit capability in a VPN.";
    }

    feature acl {
      description
        "Enables ACL capability in a VPN. ";
    }

    feature cfm {
      description
        "Enables cfm 802.1 ag capability in a VPN.";
    }

    feature y-1731 {
      description
        "Enable Y.1731 capability in a VPN.";
    }

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

    typedef ccm-priority-type {
      type uint8 {
        range "0..7";
      }
      description
        "A 3 bits 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 site-network-access-type {
      base 
      description
        "Base identity for site-network-access type.";
    }

    identity point-to-point {
      base site-network-access-type;
      description
        "Identity for point-to-point connection.";
    }

    identity multipoint {
      base site-network-access-type;
      description
        "Identity for multipoint connection.
       Example: Ethernet broadcast segment.";
    }

    identity tag-type {
      base 
      description
        "Base identity from which all tag types
       are derived from";
    }

    identity c-vlan {
      base tag-type;
      description
        "A Customer-VLAN tag, normally using the 0x8100
       Ethertype";
    }

    identity s-vlan {
      base tag-type;
      description "A Service-VLAN tag.";
    }

    identity c-s-vlan {
      base tag-type;
      description
        "Using both Customer-VLAN tag and Service-VLAN tag.";
    }

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

    identity ssm-tree-type {
      base multicast-tree-type;
      description
        "Identity for SSM tree type.";
    }

    identity asm-tree-type {
      base multicast-tree-type;
      description
        "Identity for ASM tree type.";
    }

    identity bidir-tree-type {
      base multicast-tree-type;
      description
        "Identity for bidirectional tree type.";
    }

    identity mapping-type {
      base 
      description "Identity mapping-type";
    }

    identity static-mapping {
      base mapping-type;
      description
        "Identity for static mapping, i.e.,attach the interface
       to the Multicast group as static member";
    }

    identity dynamic-mapping {
      base mapping-type;
      description
        "Identity for dynamic mapping, i.e.,interface was added
       to the Multicast group as a result of snooping";
    }

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

    identity multicast-traffic {
      base tf-type;
      description
        "Identity for multicast traffic";
    }

    identity broadcast-traffic {
      base tf-type;
      description
        "Identity for broadcast traffic";
    }

    identity unknown-unicast-traffic {
      base tf-type;
      description
        "Identity for unknown unicast traffic";
    }

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

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

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

    identity carrierscarrier-type {
      base 
      description
        "Identity of carrierscarrier";
    }

    identity ldp {
      base carrierscarrier-type;
      description
        "Use LDP as the signalling protocol
       between the PE and the CE.";
    }

    identity bgp {
      base carrierscarrier-type;
      description
        "Use BGP (as per RFC 3107) as the signalling protocol
       between the PE and the CE.
       In this case, BGP must also be configured as
       the routing protocol.";
    }

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

    identity tagged {
      base eth-inf-type;
      description
        "Identity of tagged Interface type.";
    }

    identity untagged {
      base eth-inf-type;
      description
        "Identity of untagged Interface type.";
    }

    identity lag {
      base eth-inf-type;
      description
        "Identity of LAG Interface type";
    }

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

    identity bw-per-cos {
      base bw-type;
      description "Bandwidth is per cos";
    }

    identity bw-per-port {
      base bw-type;
      description
        "Bandwidth is per site network access";
    }

    identity bw-per-site {
      base bw-type;
      description
        "Bandwidth is per site. It is applicable to
       all the site network accesses within the site.";
    }

    identity bw-per-svc {
      base bw-type;
      description
        "Bandwidth is per VPN service";
    }

    identity site-vpn-flavor {
      base 
      description
        "Base identity for the site VPN service flavor.";
    }

    identity site-vpn-flavor-single {
      base site-vpn-flavor;
      description
        "Identity for the site VPN service flavor.
       Used when the site belongs to only one VPN.";
    }

    identity site-vpn-flavor-multi {
      base site-vpn-flavor;
      description
        "Identity for the site VPN service flavor.
       Used when a logical connection of a site
       belongs to multiple VPNs.";
    }

    identity site-vpn-flavor-nni {
      base site-vpn-flavor;
      description
        "Identity for the site VPN service flavor.
       Used to describe an NNI option A connection.";
    }

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

    identity vpws {
      base service-type;
      description
        "point-to-point Virtual Private Wire Services(VPWS) type.";
    }

    identity pwe3 {
      base service-type;
      description
        "Pseudo-Wire Emulation Edge to
       Edge(PWE3)Service type. .";
    }

    identity ldp-l2tp-vpls {
      base service-type;
      description
        "LDP based or L2TP based multipoint Virtual Private LAN
       services (VPLS) Service Type.This VPLS uses LDP-signaled
       Pseudowires or L2TP signaled Pseudowires.";
    }

    identity bgp-vpls {
      base service-type;
      description
        "BGP based multipoint Virtual Private LAN services (VPLS)
       Service Type. This VPLS uses a Border Gateway Protocol
       (BGP) control plane as described in RFC4761 and RFC6624.";
    }

    identity vpws-evpn {
      base service-type;
      description
        "VPWS Service Type using Ethernet VPN(EVPN)
      specified in RFC 7432.";
    }

    identity pbb-evpn {
      base service-type;
      description
        "PBB Service Type using Ethernet VPN(EVPN)
      specified in RFC 7432.";
    }

    identity bundling-type {
      base 
      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 multi-svc-bundling {
      base bundling-type;
      description
        "Identity for multiple service bundling,i.e.,
       multiple CE-VLAN IDs can be associated with an
       L2VPN Service at site.";
    }

    identity one2one-bundling {
      base bundling-type;
      description
        "Identity for one to one service bundling,i.e.,
       Each L2VPN can be associated with only one CE-VLAN IDs
       at site.";
    }

    identity all2one-bundling {
      base bundling-type;
      description
        "Identity for all to one bundling,i.e.,all CE-VLAN IDs
       are mapped to one L2VPN Service";
    }

    identity color-id {
      base 
      description
        "base identity of color id";
    }

    identity color-id-cvlan {
      base color-id;
      description
        "Identity of color id base on  CVLAN ";
    }

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

    identity cos-id-pcp {
      base cos-id;
      description
        "Identity of cos id based on  PCP";
    }

    identity cos-id-dscp {
      base cos-id;
      description
        "Identity of cos id based on  DSCP";
    }

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

    identity green {
      base color-type;
      description "Identity of green type";
    }

    identity yellow {
      base color-type;
      description "Identity of yellow type";
    }

    identity red {
      base color-type;
      description "Identity of red type";
    }

    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 
      description "Identity of BUM type.";
    }

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

    identity unicast {
      base bum-type;
      description "Identity of unicast";
    }

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

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

    identity shut {
      base loop-prevention-type;
      description
        "Identity of shut protection.";
    }

    identity trap {
      base loop-prevention-type;
      description
        "Identity of trap protection.";
    }

    identity lacp-state {
      base 
      description "Identity of LACP state.";
    }

    identity lacp-on {
      base lacp-state;
      description "Identity of LCAP on.";
    }

    identity lacp-off {
      base lacp-state;
      description "Identity of LACP off";
    }

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

    identity lacp-passive {
      base lacp-mode;
      description "Identity of LACP passive";
    }

    identity lacp-active {
      base lacp-mode;
      description "Identity of LACP active";
    }

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

    identity lacp-fast {
      base lacp-speed;
      description "Identity of LACP fast";
    }

    identity lacp-slow {
      base lacp-speed;
      description "Identity of LACP slow";
    }

    identity bw-direction {
      base 
      description
        "Identity for bandwidth direction";
    }

    identity input-bw {
      base bw-direction;
      description
        "Identity for input bandwidth";
    }

    identity output-bw {
      base bw-direction;
      description
        "Identity for output bandwidth";
    }

    identity management {
      base 
      description
        "Base identity for site management scheme.";
    }

    identity co-managed {
      base management;
      description
        "Identity for co-managed site.";
    }

    identity customer-managed {
      base management;
      description
        "Identity for customer managed site.";
    }

    identity provider-managed {
      base management;
      description
        "Identity for provider managed site.";
    }

    identity address-family {
      base 
      description
        "Identity for an address family.";
    }

    identity ipv4 {
      base address-family;
      description
        "Identity for IPv4 address family.";
    }

    identity ipv6 {
      base address-family;
      description
        "Identity for IPv6 address family.";
    }

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

    identity any-to-any {
      base vpn-topology;
      description
        "Identity for any to any VPN topology.";
    }

    identity hub-spoke {
      base vpn-topology;
      description
        "Identity for Hub'n'Spoke VPN topology.";
    }

    identity hub-spoke-disjoint {
      base vpn-topology;
      description
        "Identity for Hub'n'Spoke VPN topology
       where Hubs cannot talk between each other.";
    }

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

    identity any-to-any-role {
      base site-role;
      description
        "Site in an any to any L2VPN.";
    }

    identity spoke-role {
      base site-role;
      description
        "Spoke Site in a Hub-and-Spoke L2VPN.";
    }

    identity hub-role {
      base site-role;
      description
        "Hub Site in a Hub-and-Spoke L2VPN.";
    }

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

    identity loss {
      base pm-type;
      description "Loss measurement";
    }

    identity delay {
      base pm-type;
      description "Delay measurement";
    }

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

    identity remote-rdi {
      base fault-alarm-defect-type;
      description
        "Indicates the aggregate health
       of the remote MEPs.";
    }

    identity remote-mac-error {
      base fault-alarm-defect-type;
      description
        "Indicates that one or more of the remote MEPs is
       reporting a failure in its Port Status TLV or
       Interface Status TLV.";
    }

    identity remote-invalid-ccm {
      base fault-alarm-defect-type;
      description
        "Indicates that at least one of the Remote MEP
       state machines is not receiving valid CCMs
       from its remote MEP.";
    }

    identity invalid-ccm {
      base fault-alarm-defect-type;
      description
        "Indicates that one or more invalid CCMs has been
       received and that 3.5 times that CCMs transmission
       interval has not yet expired.";
    }

    identity cross-connect-ccm {
      base fault-alarm-defect-type;
      description
        "Indicates that one or more cross connect CCMs has been
       received and that 3.5 times of at least one of those
       CCMs transmission interval has not yet expired.";
    }

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

    identity discard {
      base frame-delivery-mode;
      description
        "Service Frames are discarded.";
    }

    identity unconditional {
      base frame-delivery-mode;
      description
        "Service Frames are unconditionally
       delivered to the destination.";
    }

    identity unknown-discard {
      base frame-delivery-mode;
      description
        "Service Frame are conditionally
       delivered to the destination site and
       the packet with unknown destination address
       will be discarded.";
    }

    identity placement-diversity {
      base 
      description
        "Base identity for site placement
       constraints.";
    }

    identity bearer-diverse {
      base placement-diversity;
      description
        "Identity for bearer diversity.
       The bearers should not use common elements.";
    }

    identity pe-diverse {
      base placement-diversity;
      description
        "Identity for PE diversity";
    }

    identity pop-diverse {
      base placement-diversity;
      description
        "Identity for POP diversity";
    }

    identity linecard-diverse {
      base placement-diversity;
      description
        "Identity for linecard diversity";
    }

    identity same-pe {
      base placement-diversity;
      description
        "Identity for having sites connected
       on the same PE";
    }

    identity same-bearer {
      base placement-diversity;
      description
        "Identity for having sites connected
       using the same bearer";
    }

    identity tagged-inf-type {
      base 
      description
        "Identity for the tagged
       interface type.";
    }

    identity priority-tagged {
      base tagged-inf-type;
      description
        "This identity the priority-tagged interface.";
    }

    identity qinq {
      base tagged-inf-type;
      description
        "Identity for the qinq tagged interface.";
    }

    identity dot1q {
      base tagged-inf-type;
      description
        "Identity for dot1q vlan tagged interface.";
    }

    identity qinany {
      base tagged-inf-type;
      description
        "Identity for qinany tagged inteface.";
    }

    identity vxlan {
      base tagged-inf-type;
      description
        "Identity for vxlan tagged inteface.";
    }

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

    identity single-side-provision {
      base 
      description
        "Identity for single side provisioning with discovery.";
    }

    identity doubled-side-provision {
      base 
      description
        "Identity for double side provisioning.";
    }

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

    identity data-plane {
      base mac-learning-mode;
      description
        "User MAC addresses are learned through ARP broadcast.";
    }

    identity control-plane {
      base mac-learning-mode;
      description
        "User MAC addresses are advertised through EVPN-BGP";
    }

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

    identity lan {
      base vpn-policy-filter-type;
      description
        "Identity for lan tag filter type.";
    }

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

    identity drop {
      base mac-action;
      description
        "Identity for packet drop.";
    }

    identity flood {
      base mac-action;
      description
        "Identity for packet flooding.";
    }

    identity warning {
      base mac-action;
      description
        "Identity for sending a warning log message.";
    }

    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 
      description
        "Base identity for qos profile direction.";
    }

    identity site-to-wan {
      base qos-profile-direction;
      description
        "Identity for Site to WAN direction.";
    }

    identity wan-to-site {
      base qos-profile-direction;
      description
        "Identity for WAN to Site direction.";
    }

    identity bidirectional {
      base qos-profile-direction;
      description
        "Identity for both WAN to Site direction
       and Site to WAN direction.";
    }

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

    identity static-mode {
      base vxlan-peer-mode;
      description
        "Identity for the vxlan access in static mode.";
    }

    identity bgp-mode {
      base vxlan-peer-mode;
      description
        "Identity for the vxlan access by bgp evpn learning.";
    }

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

    identity web {
      base customer-application;
      description
        "Identity for Web application (e.g., HTTP, HTTPS).";
    }

    identity mail {
      base customer-application;
      description
        "Identity for mail application.";
    }

    identity file-transfer {
      base customer-application;
      description
        "Identity for file transfer application
      (e.g., FTP, SFTP).";
    }

    identity database {
      base customer-application;
      description
        "Identity for database application.";
    }

    identity social {
      base customer-application;
      description
        "Identity for social-network application.";
    }

    identity games {
      base customer-application;
      description
        "Identity for gaming application.";
    }

    identity p2p {
      base customer-application;
      description
        "Identity for peer-to-peer application.";
    }

    identity network-management {
      base customer-application;
      description
        "Identity for management application
       (e.g., Telnet, syslog, SNMP).";
    }

    identity voice {
      base customer-application;
      description
        "Identity for voice application.";
    }

    identity video {
      base customer-application;
      description
        "Identity for video conference application.";
    }

    identity embb {
      base customer-application;
      description
        "Identity for enhanced Mobile Broadband(eMBB)
       application. Note that eMBB application demands
       the network performance with wide variety of
       characteristics such as data rate, latency,
       loss rate, reliability and many other parameters.";
    }

    identity urllc {
      base customer-application;
      description
        "Identity for Ultra-Reliable and Low Latency
       Communications (URLLC) application. Note that
       URLLC application demands the network performance
       with wide variety of characteristics such as latency,
       reliability and many other parameters.";
    }

    identity mmtc {
      base customer-application;
      description
        "Identity for massive Machine Type
       Communications (mMTC) application. Note that
       mMTC application demands the network performance
       with wide variety of characteristics such as data
       rate, latency, loss rate, reliability and many
       other parameters.";
    }

    grouping site-acl {
      description
        "This grouping defines Access Control List.";
      container access-control-list {
        if-feature acl;
        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 site-acl

    grouping site-bum {
      description
        "Grouping for broadcast, unknown unicast, and multicast.";
      container broadcast-unknown-unicast-multicast {
        if-feature bum;
        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 uint16 {
              range "0..1024";
            }
            mandatory true;
            description
              "The VLAN ID of the Multicast group.
             The range of 12 bit VLAN ID is 0 to 1024.";
          }

          leaf mac-gp-address {
            type yang:mac-address;
            mandatory true;
            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;
          units "bps";
          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;
            units "bps";
            description "rate for BUM.";
          }
        }  // list bum-rate-per-type
      }  // container broadcast-unknown-unicast-multicast
    }  // grouping site-bum

    grouping site-mac-loop-prevention {
      description
        "Grouping for MAC loop prevention.";
      container mac-loop-prevention {
        if-feature mac-loop-prevention;
        description
          "Container of MAC loop prevention.";
        leaf protection-type {
          type identityref {
            base loop-prevention-type;
          }
          default "trap";
          description
            "Protection type. By default, the protection
           type is trap protection type.";
        }

        leaf frequency {
          type uint32;
          default "5";
          description
            "The number of times to detect MAC duplication.
           When duplicate-MAC situation has occurred and the
           duplicated MAC is added into to a duplicate-MAC
           list. By default, the number of times is 5.";
        }

        leaf retry-timer {
          type uint32;
          units "seconds";
          description
            "The retry timer. When retry timer expires,
           the duplicated MAC will be flushed from
           the MAC-VRF. ";
        }
      }  // container mac-loop-prevention
    }  // grouping site-mac-loop-prevention

    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.";
                }

                leaf src-mac {
                  type yang:mac-address;
                  description "Source MAC";
                }

                leaf dst-mac {
                  type yang:mac-address;
                  description
                    "Destination MAC.";
                }

                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.";
          choice qos-profile {
            description
              "Choice for QoS profile.
             Can be standard profile or customized profile.";
            case standard {
              description
                "Standard QoS profile.";
              leaf profile {
                type leafref {
                  path
                    "/l2vpn-svc/vpn-profiles/"
                      + "valid-provider-identifiers"
                      + "/qos-profile-identifier";
                }
                description
                  "QoS Profile to be used.";
              }
            }  // case standard

            case custom {
              description
                "Customized QoS profile.";
              container classes {
                if-feature qos-custom;
                description
                  "Container for list of class of services.";
                list class {
                  key "class-id";
                  description
                    "List of class of services.";
                  leaf class-id {
                    type string;
                    description
                      "Identification of the class of
                     service. This identifier is internal
                     to the administration.";
                  }

                  leaf direction {
                    type identityref {
                      base qos-profile-direction;
                    }
                    default "bidirectional";
                    description
                      "The direction which QoS profile is applied to.
                     By default,the direction is bidirectional.";
                  }

                  leaf policing {
                    type identityref {
                      base policing;
                    }
                    default
                      "one-rate-two-color";
                    description
                      "The policing can be either one-rate,
                     two-color (1R2C) or two-rate, three-color
                     (2R3C). By default, the policing is on rate
                     two color.";
                  }

                  leaf byte-offset {
                    type uint16;
                    description
                      "For not including extra VLAN tags in the QoS
                     calculation.";
                  }

                  container frame-delay {
                    description
                      "Delay constraint on the traffic
                     class.";
                    choice flavor {
                      description
                        "Delay constraint on the traffic
                       class.";
                      leaf use-lowest-latency {
                        type empty;
                        description
                          "The traffic class should use
                           the lowest delay path.";
                      }
                      leaf delay-bound {
                        type uint16;
                        units "msec";
                        description
                          "The traffic class should use
                           a path with a defined maximum
                           delay.";
                      }
                    }  // choice flavor
                  }  // container frame-delay

                  container frame-jitter {
                    description
                      "Jitter constraint on the traffic
                     class.";
                    choice flavor {
                      description
                        "Jitter constraint on the traffic
                       class.";
                      leaf use-lowest-jitter {
                        type empty;
                        description
                          "The traffic class should use
                           the lowest jitter path.";
                      }
                      leaf delay-bound {
                        type uint32;
                        units "usec";
                        description
                          "The traffic class should use
                           a path with a defined maximum
                           jitter.";
                      }
                    }  // choice flavor
                  }  // container frame-jitter

                  container frame-loss {
                    description
                      "Container for frame loss rate.";
                    leaf rate {
                      type decimal64 {
                        fraction-digits 2;
                        range "0..100";
                      }
                      units "percent";
                      description
                        "Frame Loss rate constraint on the traffic
                      class.";
                    }
                  }  // container frame-loss

                  container bandwidth {
                    description
                      "Bandwidth constraint on the traffic class.";
                    leaf guaranteed-bw-percent {
                      type decimal64 {
                        fraction-digits 5;
                        range "0..100";
                      }
                      units "percent";
                      mandatory true;
                      description
                        "To be used to define the guaranteed bandwidth
                       as a percentage of the available service
                       bandwidth.";
                    }

                    leaf end-to-end {
                      type empty;
                      description
                        "Used if the bandwidth reservation
                       must be done on the MPLS network too.";
                    }
                  }  // container bandwidth
                }  // list class
              }  // container classes
            }  // case custom
          }  // choice qos-profile
        }  // container qos-profile
      }  // container qos
    }  // grouping site-service-qos-profile

    grouping site-service-mpls {
      description
        "Grouping for carrierscarrier";
      container carrierscarrier {
        if-feature carrierscarrier;
        description
          "Container for carrierscarrier";
        leaf signaling-type {
          type identityref {
            base carrierscarrier-type;
          }
          default "bgp";
          description
            "Carrierscarrier. By default,the signaling type is bgp.";
        }
      }  // container carrierscarrier
    }  // grouping site-service-mpls

    container l2vpn-svc {
      description
        "Container for L2VPN service.";
      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 VPN services.";
        list vpn-service {
          key "vpn-id";
          description
            "List of vpn services.";
          leaf vpn-id {
            type svc-id;
            description
              "Defining a service id.";
          }

          leaf vpn-svc-type {
            type identityref {
              base service-type;
            }
            default "vpws";
            description
              "Service type. By default, the service type is VPWS.";
          }

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

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

          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 leafref {
                  path "/l2vpn-svc/vpn-profiles/valid-provider-identifiers/cloud-identifier";
                }
                description
                  "Identification of cloud service.
             Local administration meaning.";
              }

              choice list-flavor {
                description
                  "Choice for cloud access policy.
             By default, all sites in the L2VPN
             MUST be authorized to access the cloud.";
                leaf permit-any {
                  type empty;
                  description
                    "Allow all sites.";
                }
                leaf-list permit-site {
                  type leafref {
                    path "/l2vpn-svc/sites/site/site-id";
                  }
                  description
                    "Site ID to be authorized.";
                }
                leaf-list deny-site {
                  type leafref {
                    path "/l2vpn-svc/sites/site/site-id";
                  }
                  description
                    "Site ID to be denied.";
                }
              }  // choice list-flavor
            }  // list cloud-access
          }  // container cloud-accesses

          container frame-delivery {
            if-feature bum;
            description
              "Multicast global parameters for the VPN service.";
            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

            container bum-deliveries {
              description
                "Define frame delivery type and mode.";
              list bum-delivery {
                key "frame-type";
                description
                  "List of frame delivery type and mode.";
                leaf frame-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;
                  }
                  default "unconditional";
                  description
                    "Define Frame Delivery Mode
             (unconditional[default],
            conditional, or discard).
            By default, Service Frames
            are unconditionally delivered
            to the destination. ";
                }
              }  // list bum-delivery
            }  // container bum-deliveries

            leaf multicast-gp-port-mapping {
              type identityref {
                base mapping-type;
              }
              mandatory true;
              description
                "Describe the way in which each interface is
           associated with the Multicast group";
            }
          }  // container frame-delivery

          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 the local VPN want to access.";
              }

              leaf local-sites-role {
                type identityref {
                  base site-role;
                }
                default "any-to-any-role";
                description
                  "This describes the role of the local sites in the target
             VPN topology. In the any-to-any VPN service topology,
             the local sites must have the same role, which will be
             'any-to-any-role '. In the Hub-and-Spoke VPN service
             topology or the Hub and Spoke disjoint VPN service
             topology, the local sites must have a Hub role or a
              Spoke role";
              }
            }  // list extranet-vpn
          }  // container extranet-vpns

          leaf ce-vlan-preservation {
            type boolean;
            mandatory true;
            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;
            mandatory true;
            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.";
          }

          leaf carrierscarrier {
            if-feature carrierscarrier;
            type boolean;
            default "false";
            description
              "The VPN is using CsC, and so MPLS
             is required.";
          }
        }  // list vpn-service
      }  // container vpn-services

      container sites {
        description
          "Container of site configurations.";
        list site {
          key "site-id";
          description "List of sites.";
          leaf site-id {
            type string;
            description
              "Identifier of the site.";
          }

          leaf site-vpn-flavor {
            type identityref {
              base site-vpn-flavor;
            }
            default "site-vpn-flavor-single";
            description
              "Defines the way the VPN multiplexing is
         done ,e.g.,whether the site belongs to
         a single VPN site or a multiVPN; By
         default, the site belongs to a single VPN.";
          }

          container devices {
            when
              "derived-from-or-self(../management/type, "
                + "'l2vpn-svc:provider-managed') or "
                + "derived-from-or-self(../management/type, "
                + "'l2vpn-svc:co-managed')" {
              description
                "Applicable only for provider-managed or
           co-managed device.";
            }
            description
              "Devices configuration";
            list device {
              key "device-id";
              description
                "List of devices requested by customer.";
              leaf device-id {
                type string;
                description
                  "Identifier for the device.";
              }

              leaf location {
                type leafref {
                  path "../../../locations/location/location-id";
                }
                mandatory true;
                description
                  "Location of the device.";
              }

              container management {
                when
                  "derived-from-or-self(../../../management/type,"
                    + "'l2vpn-svc:co-managed')" {
                  description
                    "Applicable only for co-managed device.";
                }
                description
                  "Management configuration. Applicable only for
              co-managed device.";
                leaf transport {
                  type identityref {
                    base address-family;
                  }
                  description
                    "Transport protocol or Address family
               used for management.";
                }

                leaf address {
                  when "(../ transport)" {
                    description
                      "If address-family is specified, then address should
                 also be specified. If the transport is not specified,
                 then address should also not be specified.";
                  }
                  type inet:ip-address;
                  description
                    "Management address.";
                }
              }  // container management
            }  // list device
          }  // container devices

          container management {
            description
              "Management configuration.";
            leaf type {
              type identityref {
                base management;
              }
              mandatory true;
              description
                "Management type of the connection.";
            }
          }  // container management

          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

          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

          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.";
                    }

                    leaf-list lan-tag {
                      when
                        "derived-from-or-self(../type, 'l2vpn-svc:lan')" {
                        description
                          "Only applies when VPN Policy filter is
                     LAN Tag filter.";
                      }
                      if-feature lan-tag;
                      type uint32;
                      description
                        "List of Ethernet LAN Tag to be matched. Ethernet
                   LAN Tag identifies a particular broadcast domain
                   in a VPN. ";
                    }
                  }  // 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-svc/vpn-services/vpn-service/vpn-id";
                    }
                    description
                      "Reference to L2VPN.";
                  }

                  leaf site-role {
                    type identityref {
                      base site-role;
                    }
                    default
                      "any-to-any-role";
                    description
                      "Role of the site in the L2VPN.";
                  }
                }  // list vpn
              }  // list entries
            }  // list vpn-policy
          }  // container vpn-policies

          container service {
            description
              "Service parameters on the attachment.";
            uses site-service-qos-profile;

            uses site-service-mpls;
          }  // container service

          uses site-bum;

          uses site-mac-loop-prevention;

          uses site-acl;

          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;
            }
            default "one2one-bundling";
            description
              "Bundling type. By default, Each L2VPN
         can be associated with only one
         CE-VLAN ,i.e., one to one bundling is used.";
          }

          leaf default-ce-vlan-id {
            type uint32;
            mandatory true;
            description
              "Default CE VLAN ID set at site level.";
          }

          container site-network-accesses {
            description
              "Container of port configurations.";
            list site-network-access {
              key "network-access-id";
              description
                "List of Site Network Accesses.";
              leaf network-access-id {
                type string;
                description
                  "Identifier of network access";
              }

              leaf remote-carrier-name {
                when
                  "derived-from-or-self(../../../site-vpn-flavor,"
                    + "'l2vpn-svc:site-vpn-flavor-nni')" {
                  description
                    "Relevant when Site vpn flavor is
                  site-vpn-flavor-nni.";
                }
                type leafref {
                  path "/l2vpn-svc/vpn-profiles/valid-provider-identifiers/remote-carrier-identifier";
                }
                description
                  "Remote carrier name. The remote-carrier-name
                 must be configured only when site-vpn-flavor
                 is set to site vpn-flavor-nni. If it is not
                 set,it indicates customer does not know remote
                 carrier name beforehand.";
              }

              leaf type {
                type identityref {
                  base site-network-access-type;
                }
                default "point-to-point";
                description
                  "Describes the type of connection, e.g.,
         point-to-point or multipoint.";
              }

              choice location-flavor {
                mandatory true;
                description
                  "Choice of how to describe the site's location.";
                case location {
                  when
                    "derived-from-or-self(../../management/type, "
                      + "'l2vpn-svc:customer-managed')" {
                    description
                      "Applicable only for customer-managed device.";
                  }
                  leaf location-reference {
                    type leafref {
                      path "../../../locations/location/location-id";
                    }
                    description
                      "Location of the site-network-access.";
                  }
                }  // case location

                case device {
                  when
                    "derived-from-or-self(../../management/type, "
                      + "'l2vpn-svc:provider-managed') or "
                      + "derived-from-or-self(../../management/type, "
                      + "'l2vpn-svc:co-managed')" {
                    description
                      "Applicable only for provider-managed
             or co-managed device.";
                  }
                  leaf device-reference {
                    type leafref {
                      path "../../../devices/device/device-id";
                    }
                    description
                      "Identifier of CE to use.";
                  }
                }  // case device
              }  // choice location-flavor

              container access-diversity {
                if-feature site-diversity;
                description
                  "Diversity parameters.";
                container groups {
                  description
                    "Groups the site or site-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

                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 {
                        default "id";
                        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

              container bearer {
                description
                  "Bearer specific parameters.
         To be augmented.";
                container requested-type {
                  if-feature requested-type;
                  description
                    "Container for requested type.";
                  leaf 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.
           For example.This could mean no Dial access type.";
                }

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

              container connection {
                description
                  "Container for bearer";
                leaf encapsulation-type {
                  type identityref {
                    base encapsulation-type;
                  }
                  default "ethernet";
                  description
                    "Encapsulation Type. By default,the
           encapsulation type is set as Ethernet.";
                }

                leaf eth-inf-type {
                  type identityref {
                    base eth-inf-type;
                  }
                  default "untagged";
                  description
                    "Ethernet Interface Type. By default,
          the Ethernet Interface Type is set as
          untagged interface.";
                }

                container tagged-interface {
                  description
                    "Container for tagged Interface.";
                  leaf type {
                    type identityref {
                      base tagged-inf-type;
                    }
                    default
                      "priority-tagged";
                    description
                      "Tagged interface type. By default,
           the Tagged interface type is priority
           tagged interface. ";
                  }

                  container dot1q-vlan-tagged {
                    when
                      "derived-from-or-self(../type, 'l2vpn-svc:dot1q')" {
                      description
                        "Only applies when Tagged interface type is dot1q.";
                    }
                    if-feature dot1q;
                    description
                      "Tagged interface.";
                    leaf tg-type {
                      type identityref {
                        base tag-type;
                      }
                      default "c-vlan";
                      description
                        "TAG type.By default, Tag type is Customer-VLAN tag.";
                    }

                    leaf cvlan-id {
                      type uint16;
                      mandatory true;
                      description
                        "VLAN identifier.";
                    }
                  }  // container dot1q-vlan-tagged

                  container priority-tagged {
                    when
                      "derived-from-or-self(../type, "
                        + "'l2vpn-svc:priority-tagged')" {
                      description
                        "Only applies when Tagged interface type
             is priority tagged interface.";
                    }
                    description
                      "Priority tagged.";
                    leaf tag-type {
                      type identityref {
                        base tag-type;
                      }
                      default "c-vlan";
                      description
                        "TAG type.By default, the TAG type is
             Customer-VLAN tag.";
                    }
                  }  // container priority-tagged

                  container qinq {
                    when
                      "derived-from-or-self(../type, 'l2vpn-svc:qinq')" {
                      description
                        "Only applies when Tagged interface type is qinq.";
                    }
                    if-feature qinq;
                    description "QinQ.";
                    leaf tag-type {
                      type identityref {
                        base tag-type;
                      }
                      default "c-s-vlan";
                      description
                        "Tag type. By default, the Tag type is c-s-vlan.";
                    }

                    leaf svlan-id {
                      type uint16;
                      mandatory true;
                      description
                        "S-VLAN Identifier.";
                    }

                    leaf cvlan-id {
                      type uint16;
                      mandatory true;
                      description
                        "C-VLAN Identifier";
                    }
                  }  // container qinq

                  container qinany {
                    when
                      "derived-from-or-self(../type, 'l2vpn-svc:qinany')" {
                      description
                        "Only applies when Tagged interface type is qinany.";
                    }
                    if-feature qinany;
                    description
                      "Container for Qin Any.";
                    leaf tag-type {
                      type identityref {
                        base tag-type;
                      }
                      default "s-vlan";
                      description
                        "Tag type.By default, the Tag type is Service-VLAN tag.";
                    }

                    leaf svlan-id {
                      type uint16;
                      mandatory true;
                      description
                        "S-Vlan ID.";
                    }
                  }  // container qinany

                  container vxlan {
                    when
                      "derived-from-or-self(../type, 'l2vpn-svc:vxlan')" {
                      description
                        "Only applies when Tagged interface type is vxlan.";
                    }
                    if-feature vxlan;
                    description "QinQ.";
                    leaf vni-id {
                      type uint32;
                      mandatory true;
                      description
                        "VNI Identifier.";
                    }

                    leaf peer-mode {
                      type identityref {
                        base vxlan-peer-mode;
                      }
                      default "static-mode";
                      description
                        "specify the vxlan access mode. By default
             the peer mode is Set as static 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 tagged-interface

                container untagged-interface {
                  description
                    "Container of Untagged Interface Attributes
         configurations.";
                  leaf speed {
                    type uint32;
                    units "mbps";
                    default "10";
                    description
                      "Port speed.";
                  }

                  leaf mode {
                    type neg-mode;
                    default "auto-neg";
                    description
                      "Negotiation mode.";
                  }

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

                  leaf lldp {
                    type boolean;
                    default "false";
                    description
                      "LLDP. Indicate LLDP is supported.";
                  }

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

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

                container lag-interfaces {
                  if-feature lag-interface;
                  description
                    "Container of LAG interface attributes configuration";
                  list lag-interface {
                    key "index";
                    description
                      "List of LAG interfaces.";
                    leaf index {
                      type string;
                      description
                        "LAG interface index.";
                    }

                    container lacp {
                      if-feature lacp;
                      description "LACP.";
                      leaf enable {
                        type boolean;
                        default "false";
                        description
                          "LACP on/off.By default, LACP is disabled.";
                      }

                      leaf mode {
                        type neg-mode;
                        description
                          "LACP mode. LACP modes have auto negotiation mode
           and passive mode (false). Auto negotiation mode
           means initiating the auto speed negotiation and
           trying to form Ethernet Channel with other end.
           Passive mode means not initiating the negotiation,
          but responding to LACP packets initiated by other
          end(e.g., full duplex or half duplex. ";
                      }

                      leaf speed {
                        type uint32;
                        units "mbps";
                        default "10";
                        description
                          "LACP speed. By default, the lacp speed is 10Mbps.";
                      }

                      leaf mini-link-num {
                        type uint32;
                        description
                          "Defines the minimum number of links that must be
           active before the aggregating link is put
           into service.";
                      }

                      leaf system-priority {
                        type uint16;
                        default "32768";
                        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 enable {
                          type enumeration {
                            enum "on" {
                              value 0;
                              description
                                "Micro-bfd on.";
                            }
                            enum "off" {
                              value 1;
                              description
                                "Micro-bfd off.";
                            }
                          }
                          default "off";
                          description
                            "Micro BFD ON/OFF. By default,
             the micro-bfd is set to off.";
                        }

                        leaf interval {
                          type uint32;
                          units "msec";
                          description
                            "BFD interval.";
                        }

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

                      container bfd {
                        if-feature bfd;
                        description
                          "Container for BFD.";
                        leaf enabled {
                          type boolean;
                          default "false";
                          description
                            "BFD activation. By default, BFD is not activated.";
                        }

                        choice holdtime {
                          default "fixed";
                          description
                            "Choice for hold time flavor.";
                          case profile {
                            description
                              "Service provider well known profile.";
                            leaf profile-name {
                              type leafref {
                                path "/l2vpn-svc/vpn-profiles/valid-provider-identifiers/bfd-profile-identifier";
                              }
                              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-links {
                        description
                          "Container of Member link list";
                        list member-link {
                          key "name";
                          description
                            "Member link";
                          leaf name {
                            type string;
                            description
                              "Member link name.";
                          }

                          leaf speed {
                            type uint32;
                            units "mbps";
                            default "10";
                            description
                              "Port speed.";
                          }

                          leaf mode {
                            type neg-mode;
                            default
                              "auto-neg";
                            description
                              "Negotiation mode.";
                          }

                          leaf link-mtu {
                            type uint32;
                            units "bytes";
                            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;
                              default
                                "false";
                              description
                                "Indicate whether oam 802.3 ah link is supported.";
                            }
                          }  // container oam-802.3ah-link
                        }  // list member-link
                      }  // container member-links

                      leaf flow-control {
                        type boolean;
                        default "false";
                        description
                          "Flow control. Indicate whether flow control is supported.";
                      }

                      leaf lldp {
                        type boolean;
                        default "false";
                        description
                          "LLDP. Indicate whether lldp is supported.";
                      }
                    }  // container lacp
                  }  // list lag-interface
                }  // container lag-interfaces

                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-svc/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 uint16;
                      description "CVLAN ID";
                    }
                  }  // list cvlan-id
                }  // list cvlan-id-to-svc-map

                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 Sites.";
                  }

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

                  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
                      "IEEE 802.x.";
                  }

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

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

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

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

                container oam {
                  if-feature ethernet-oam;
                  description
                    "Container for Ethernet service OAM.";
                  leaf md-name {
                    type string;
                    mandatory true;
                    description
                      "Maintenance domain name.";
                  }

                  leaf md-level {
                    type uint16 {
                      range "0..255";
                    }
                    mandatory true;
                    description
                      "Maintenance domain level. The level may be
           restricted in certain protocols (e.g.,
           protocol in layer 0 to layer 7).";
                  }

                  list cfm-8021-ag {
                    if-feature cfm;
                    key "maid";
                    description
                      "List of 802.1ag CFM attributes";
                    leaf maid {
                      type string;
                      mandatory true;
                      description
                        "Identify an Maintenance Association (MA).";
                    }

                    leaf mep-id {
                      type uint32;
                      description
                        "Local Maintenance End Point (MEP) ID.
         The non-existence of this leaf means
          that no defects are to be reported.";
                    }

                    leaf mep-level {
                      type uint32;
                      description
                        "Define Maintenance End Point (MEP) level.
         The non-existence of this leaf means that
         no defects are to be reported.";
                    }

                    leaf mep-up-down {
                      type enumeration {
                        enum "up" {
                          value 0;
                          description
                            "MEP up.";
                        }
                        enum "down" {
                          value 1;
                          description
                            "MEP down.";
                        }
                      }
                      default "up";
                      description
                        "MEP up/down. By default, MEP up is used.
         The non-existence of this leaf means that
         no defects are to be reported.";
                    }

                    leaf remote-mep-id {
                      type uint32;
                      description
                        "Remote MEP ID. The non-existence of this leaf means
         that no defects are to be reported.";
                    }

                    leaf cos-for-cfm-pdus {
                      type uint32;
                      description
                        "COS for CFM PDUs. The non-existence of this leaf means
         that no defects are to be reported.";
                    }

                    leaf ccm-interval {
                      type uint32;
                      units "msec";
                      default "10000";
                      description
                        "Continuity Check Message(CCM) interval.
         By default, ccm-interval is 10 seconds.";
                    }

                    leaf ccm-holdtime {
                      type uint32;
                      units "msec";
                      default "35000";
                      description
                        "CCM hold time. By default ccm hold time
         is 3.5 times of ccm interval.";
                    }

                    leaf alarm-priority-defect {
                      type identityref {
                        base fault-alarm-defect-type;
                      }
                      default
                        "remote-invalid-ccm";
                      description
                        "The lowest priority defect that is
         allowed to generate a Fault Alarm.By default,
         fault-alarm-defect-type is set to remote-invalid-ccm.
          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.
         The non-existence of this leaf means
         that no defects are to be reported.";
                    }
                  }  // list cfm-8021-ag

                  list y-1731 {
                    if-feature y-1731;
                    key "maid";
                    description
                      "List for y-1731.";
                    leaf maid {
                      type string;
                      mandatory true;
                      description
                        "Identify an Maintenance Association (MA).";
                    }

                    leaf mep-id {
                      type uint32;
                      description
                        "Local Maintenance End Point(MEP) ID.
           The non-existence of this leaf means
           that no measurements are to be reported.";
                    }

                    leaf type {
                      type identityref {
                        base pm-type;
                      }
                      default "delay";
                      description
                        "Performance monitor types. By default, the
           performance monitoring type is set to delay.
           The non-existence of this leaf means that no
            measurements are to be reported.";
                    }

                    leaf remote-mep-id {
                      type uint32;
                      description
                        "Remote MEP ID. The non-existence of this
           leaf means that no measurements are to be
           reported.";
                    }

                    leaf message-period {
                      type uint32;
                      units "msec";
                      default "10000";
                      description
                        "Defines the interval between Y.1731
           performance monitoring messages. The message
           period is expressed in milliseconds.";
                    }

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

                    leaf cos {
                      type uint32;
                      description
                        "Class of service. The non-existence
           of this leaf means that no measurements
           are to be reported.";
                    }

                    leaf loss-measurement {
                      type boolean;
                      default "false";
                      description
                        "Whether enable loss measurement.
           By default, loss measurement is not
           enabled.";
                    }

                    leaf synthethic-loss-measurement {
                      type boolean;
                      default "false";
                      description
                        "Indicate whether enable synthetic loss
           measurement.By default, synthethic loss
           measurement is not enabled.";
                    }

                    container delay-measurement {
                      description
                        "Container for delay measurement.";
                      leaf enable-dm {
                        type boolean;
                        default "false";
                        description
                          "Whether to enable delay measurement.
            By defaut, the delay measurement is
             not enabled.";
                      }

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

                    leaf frame-size {
                      type uint32;
                      units "bytes";
                      description
                        "Frame size. The non-existence of this leaf means
          that no measurements are to be reported.";
                    }

                    leaf session-type {
                      type enumeration {
                        enum "proactive" {
                          value 0;
                          description
                            "Proactive mode.";
                        }
                        enum "on-demand" {
                          value 1;
                          description
                            "On demand mode.";
                        }
                      }
                      default "on-demand";
                      description
                        "Session type. By default, the session type is on demand mode.
           The non-existence of this leaf means that no measurements
           are to be reported.";
                    }
                  }  // list y-1731
                }  // container oam
              }  // container connection

              container availability {
                description
                  "Container of availability optional configurations.";
                leaf access-priority {
                  type uint32;
                  default "100";
                  description
                    "Access priority. The higher the access-priority value,
           the higher the preference of the access will be.";
                }

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

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

              container vpn-attachment {
                description
                  "Defines VPN attachment of a site.";
                choice attachment-flavor {
                  mandatory true;
                  description
                    "Choice for VPN attachment flavor.";
                  case vpn-id {
                    leaf vpn-id {
                      type leafref {
                        path "/l2vpn-svc/vpn-services/vpn-service/vpn-id";
                      }
                      description
                        "Reference to a L2VPN. Referencing a vpn-id provides
               an easy way to attach a particular logical access to
               a VPN. In this case, vpn-id must be configured.";
                    }

                    leaf site-role {
                      type identityref {
                        base site-role;
                      }
                      default
                        "any-to-any-role";
                      description
                        "Role of the site in the L2VPN. When referencing a vpn-id,
               the site-role setting must be added to express the role
               of the site in the target VPN service topology.";
                    }
                  }  // case vpn-id
                  leaf vpn-policy-id {
                    type leafref {
                      path "../../../../vpn-policies/vpn-policy/vpn-policy-id";
                    }
                    description
                      "Reference to a vpn policy.";
                  }
                }  // choice attachment-flavor
              }  // container vpn-attachment

              container service {
                description
                  "Container for service";
                container svc-bandwidth {
                  if-feature input-bw;
                  description
                    "From the customer site's perspective, the service
         input/out bandwidth of the connection or download/upload
         bandwidth from the SP/site to the site/SP.";
                  list bandwidth {
                    key "direction type";
                    description
                      "List for bandwidth.";
                    leaf direction {
                      type identityref {
                        base bw-direction;
                      }
                      description
                        "Indicate the bandwidth direction. It can be bandwidth
             download direction from the SP to the site or
             bandwidth upload direction from the site to the SP.";
                    }

                    leaf type {
                      type identityref {
                        base bw-type;
                      }
                      description
                        "Bandwidth Type. By default, the bandwidth type is set
             as bandwidth per cos.";
                    }

                    leaf cos-id {
                      when
                        "derived-from-or-self(../type, 'l2vpn-svc:bw-per-cos')" {
                        description
                          "Relevant when the bandwidth type is set as bandwidth
               per cos.";
                      }
                      type uint8;
                      description
                        "Identifier of Class of Service
             , indicated by DSCP or a CE-CLAN
             CoS(802.1p)value in the service frame.
            If bandwidth type is set as bandwidth
            per cos, cos-id MUST be specified.";
                    }

                    leaf vpn-id {
                      when
                        "derived-from-or-self(../type, "
                          + "'l2vpn-svc:bw-per-svc')" {
                        description
                          "Relevant when the bandwidth type is
               set as bandwidth per VPN service.";
                      }
                      type svc-id;
                      description
                        "Identifies the target VPN. If bandwidth
             type is set as bandwidth per VPN service,
             vpn-id MUST be specified.";
                    }

                    leaf cir {
                      type uint64;
                      units "bps";
                      mandatory true;
                      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;
                      units "bps";
                      mandatory true;
                      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;
                      units "bps";
                      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;
                      units "bps";
                      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;
                      units "bps";
                      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;
                      units "bps";
                      description
                        "Peak Burst Size. It is measured in bytes per second.";
                    }
                  }  // list bandwidth
                }  // container svc-bandwidth

                leaf svc-mtu {
                  type uint16;
                  units "bytes";
                  mandatory true;
                  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. If CsC is
         enabled,the requested svc-mtu leaf will refer to the
         MPLS MTU and not to the link MTU. ";
                }

                uses site-service-qos-profile;

                uses site-service-mpls;
              }  // container service

              uses site-bum;

              uses site-mac-loop-prevention;

              uses site-acl;

              container mac-addr-limit {
                if-feature mac-addr-limit;
                description
                  "Container of MAC-Addr limit configurations";
                leaf limit-number {
                  type uint16;
                  default "2";
                  description
                    "maximum number of MAC addresses learned from
           the subscriber for a single service instance.
           The default allowed maximum number of MAC

           addresses is 2.";
                }

                leaf time-interval {
                  type uint32;
                  units "sec";
                  default "300";
                  description
                    "The aging time of the mac address. By default,
           the aging time is set 300 seconds.";
                }

                leaf action {
                  type identityref {
                    base mac-action;
                  }
                  default "warning";
                  description
                    "specify the action when the upper limit is
           exceeded: drop the packet, flood the
           packet, or simply send a warning log message. By default,
           action is set to warning.";
                }
              }  // container mac-addr-limit
            }  // list site-network-access
          }  // container site-network-accesses
        }  // list site
      }  // container sites
    }  // container l2vpn-svc
  }  // module ietf-l2vpn-svc