netconfcentral logo

ietf-l2vpn

HTML

ietf-l2vpn@2019-05-28



  module ietf-l2vpn {

    yang-version 1;

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

    prefix l2vpn;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
    import ietf-routing-types {
      prefix rt-types;
    }
    import ietf-interfaces {
      prefix if;
    }
    import ietf-network-instance {
      prefix ni;
    }
    import ietf-pseudowires {
      prefix pw;
    }

    organization "ietf";

    contact "ietf";

    description "l2vpn";

    revision "2019-05-28" {
      description
        "Nineth revision "
          + "  - Used bgp parameters hierarchy common to L2VPN and EVPN "
          + "";
      reference
        "";

    }

    revision "2018-02-06" {
      description
        "Eighth revision "
          + "  - Incorporated ietf-network-instance model "
          + "  - change the type of attachment circuit to "
          + "    if:interface-ref "
          + "";
      reference
        "";

    }

    revision "2017-09-21" {
      description
        "Seventh revision "
          + "  - Fixed yangdump errors "
          + "";
      reference
        "";

    }

    revision "2017-06-26" {
      description
        "Sixth revision "
          + "  - Removed unused module mpls "
          + "  - Renamed l2vpn-instances-state to l2vpn-instances "
          + "  - Added pseudowire status as defined in RFC4446 and "
          + "    IANA Pseudowire Status Codes Register "
          + "  - Added notifications "
          + "  - Moved PW definition out of L2VPN "
          + "  - Moved model to NMDA style specified in "
          + "    draft-dsdt-nmda-guidelines-01.txt "
          + "  - Renamed l2vpn-instances and l2vpn-instance to "
          + "    instances and instance to shorten xpaths "
          + "";
      reference
        "";

    }

    revision "2017-03-06" {
      description
        "Sixth revision "
          + "  - Removed the 'common' container and move pw-templates "
          + "    and redundancy-group-templates up a level "
          + "  - Consolidated the endpoint configuration such that "
          + "    all L2VPN instances has a list of endpoint.  For "
          + "    certain types of L2VPN instances such as VPWS where "
          + "    each L2VPN instance is limited to at most two "
          + "    endpoint, additional augment statements were included "
          + "    to add necessary constraints "
          + "  - Removed discovery-type and signaling-type operational "
          + "    state from VPLS pseudowires, as these two parameters "
          + "    are configured as L2VPN parameters rather than "
          + "    pseudowire paramteres "
          + "  - Renamed l2vpn-instances to l2vpn-instances-state "
          + "    in the operational state branch "
          + "  - Removed BGP parameter groupings and reused "
          + "    ietf-routing-types.yang module instead "
          + "";
      reference
        "";

    }

    revision "2016-10-24" {
      description
        "Fifth revision "
          + "  - Edits based on Giles's comments "
          + "    5) Remove relative leafrefs in groupings, "
          + "       and the resulting new groupings are: "
          + "       (a) bgp-auto-discovery-parameters-grp "
          + "       (b) bgp-signaling-parameters-grp "
          + "       (c) endpoint-grp "
          + "    11) Merge VPLS and VPWS into one single list "
          + "       and use augment statements to handle "
          + "       differences between VPLS and VPWS "
          + "  - Add a new grouping l2vpn-common-parameters-grp "
          + "    to make VPLS and VPWS more consistent";
      reference
        "";

    }

    revision "2016-05-31" {
      description
        "Fourth revision "
          + "  - Edits based on Giles's comments "
          + "    1) Change enumeration to identityref type for: "
          + "       (a) l2vpn-service-type "
          + "       (b) l2vpn-discovery-type "
          + "       (c) l2vpn-signaling-type "
          + "       bgp-rt-type, cw-negotiation, and "
          + "       pbb-component remain enumerations "
          + "    2) Define i-sid-type for leaf 'i-sid' "
          + "       (which is renamed from 'i-tag') "
          + "    3) Rename 'vpn-targets' to 'vpn-target' "
          + "    4) Import ietf-mpls.yang and reuse the "
          + "       'mpls-label' type defined in ietf-mpls.yang "
          + "       transmit-label and receive-label "
          + "    8) Change endpoint list's key to name "
          + "    9) Changed MTU to type uint16 "
          + "";
      reference
        "";

    }

    revision "2016-03-07" {
      description
        "Third revision "
          + "  - Changed the module name to ietf-l2vpn "
          + "  - Merged EVPN into L2VPN "
          + "  - Eliminated the definitions of attachment "
          + "    circuit with the intention to reuse other "
          + "    layer-2 definitions "
          + "  - Added state branch";
      reference
        "";

    }

    revision "2015-10-08" {
      description
        "Second revision "
          + "  - Added container vpls-instances "
          + "  - Rearranged groupings and typedefs to be "
          + "    reused across vpls-instance and vpws-instances";
      reference
        "";

    }

    revision "2015-06-30" {
      description "Initial revision";
      reference
        "";

    }


    identity l2vpn-instance-type {
      base 
      description
        "Base identity from which identities of "
          + "l2vpn service instance types are derived";
    }

    identity vpws-instance-type {
      base l2vpn-instance-type;
      description
        "This identity represents VPWS instance type";
    }

    identity vpls-instance-type {
      base l2vpn-instance-type;
      description
        "This identity represents VPLS instance type";
    }

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

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

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

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

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

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

    identity l2vpn-service {
      base 
      description
        "Base identity from which identities describing "
          + "L2VPN services are derived";
    }

    identity Ethernet {
      base l2vpn-service;
      description
        "This identity represents Ethernet service";
    }

    identity ATM {
      base l2vpn-service;
      description
        "This identity represents Asynchronous Transfer "
          + "Mode service";
    }

    identity FR {
      base l2vpn-service;
      description
        "This identity represent Frame-Relay service";
    }

    identity TDM {
      base l2vpn-service;
      description
        "This identity represent Time Devision "
          + "Multiplexing service";
    }

    identity l2vpn-discovery {
      base 
      description
        "Base identity from which identities describing "
          + "L2VPN discovery protocols are derived";
    }

    identity manual-discovery {
      base l2vpn-discovery;
      description
        "Manual configuration of l2vpn service";
    }

    identity bgp-auto-discovery {
      base l2vpn-discovery;
      description
        "Border Gateway Protocol (BGP) auto-discovery of "
          + "l2vpn service";
    }

    identity ldp-discovery {
      base l2vpn-discovery;
      description
        "Label Distribution Protocol (LDP) discovery of "
          + "l2vpn service";
    }

    identity mixed-discovery {
      base l2vpn-discovery;
      description
        "Mixed discovery methods of l2vpn service";
    }

    identity l2vpn-signaling {
      base 
      description
        "Base identity from which identities describing "
          + "L2VPN signaling protocols are derived";
    }

    identity static-configuration {
      base l2vpn-signaling;
      description
        "Static configuration of labels (no signaling)";
    }

    identity ldp-signaling {
      base l2vpn-signaling;
      description
        "Label Distribution Protocol (LDP) signaling";
    }

    identity bgp-signaling {
      base l2vpn-signaling;
      description
        "Border Gateway Protocol (BGP) signaling";
    }

    identity mixed-signaling {
      base l2vpn-signaling;
      description "Mixed signaling methods";
    }

    identity l2vpn-notification-state {
      base 
      description
        "The base identity on which notification states "
          + "are based";
    }

    identity MAC-limit-reached {
      base l2vpn-notification-state;
      description "MAC limit is reached";
    }

    identity MAC-limit-cleared {
      base l2vpn-notification-state;
      description "MAC limit is cleared";
    }

    identity MTU-mismatched {
      base l2vpn-notification-state;
      description "MAC is mismatched";
    }

    identity MTU-mismatched-cleared {
      base l2vpn-notification-state;
      description
        "MAC is mismatch is cleared";
    }

    identity state-changed-to-up {
      base l2vpn-notification-state;
      description "State is changed to UP";
    }

    identity state-changed-to-down {
      base l2vpn-notification-state;
      description "State is changed to down";
    }

    identity MAC-move-limit-exceeded {
      base l2vpn-notification-state;
      description
        "MAC move limit is exceeded";
    }

    identity MAC-move-limit-exceeded-cleared {
      base l2vpn-notification-state;
      description
        "MAC move limit exceeded is cleared";
    }

    identity MAC-flap-detected {
      base l2vpn-notification-state;
      description "MAC flap detected";
    }

    identity port-disabled-due-to-MAC-flap {
      base l2vpn-notification-state;
      description
        "Port disabled due to MAC flap";
    }

    typedef l2vpn-service-type {
      type identityref {
        base l2vpn-service;
      }
      description "L2VPN service type";
    }

    typedef l2vpn-discovery-type {
      type identityref {
        base l2vpn-discovery;
      }
      description "L2VPN discovery type";
    }

    typedef l2vpn-signaling-type {
      type identityref {
        base l2vpn-signaling;
      }
      description "L2VPN signaling type";
    }

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

    typedef pbb-component-type {
      type enumeration {
        enum "b-component" {
          value 0;
          description
            "Identifies as a b-component";
        }
        enum "i-component" {
          value 1;
          description
            "Identifies as an i-component";
        }
      }
      description
        "This type is used to identify "
          + "the type of PBB component";
    }

    typedef redundancy-group-template-ref {
      type leafref {
        path "/l2vpn:l2vpn/l2vpn:redundancy-group-templates/l2vpn:redundancy-group-template/l2vpn:name";
      }
      description
        "redundancy-group-template-ref";
    }

    typedef l2vpn-instance-name-ref {
      type leafref {
        path "/ni:network-instances/ni:network-instance/ni:name";
      }
      description "l2vpn-instance-name-ref";
    }

    typedef l2vpn-instance-type-ref {
      type leafref {
        path "/ni:network-instances/ni:network-instance/l2vpn:type";
      }
      description "l2vpn-instance-type-ref";
    }

    typedef operational-state-type {
      type enumeration {
        enum "up" {
          value 0;
          description
            "Operational state is up";
        }
        enum "down" {
          value 1;
          description
            "Operational state is down";
        }
      }
      description "operational-state-type";
    }

    typedef i-sid-type {
      type uint32 {
        range "0..16777216";
      }
      description
        "I-SID type that is 24-bits. "
          + "This should be moved to ieee-types.yang at "
          + "http://www.ieee802.org/1/files/public/docs2015"
          + "/new-mholness-ieee-types-yang-v01.yang";
    }

    grouping pbb-parameters-grp {
      description "PBB parameters grouping";
      container pbb-parameters {
        description "pbb-parameters";
        choice component-type {
          description "PBB component type";
          case i-component {
            leaf i-sid {
              type i-sid-type;
              description "I-SID";
            }

            leaf backbone-src-mac {
              type yang:mac-address;
              description "backbone-src-mac";
            }
          }  // case i-component

          case b-component {
            leaf bind-b-component-name {
              type l2vpn-instance-name-ref;
              must
                "/ni:network-instances"
                  + "/ni:network-instance[ni:name=current()]"
                  + "/l2vpn:type = 'l2vpn:vpls-instance-type'" {
                description
                  "A b-component must be an L2VPN instance "
                    + "of type vpls-instance-type";
              }
              description
                "Reference to the associated b-component";
            }

            leaf bind-b-component-type {
              type identityref {
                base l2vpn-instance-type;
              }
              must
                ". = 'l2vpn:vpls-instance-type'" {
                description
                  "The associated b-component must have "
                    + "type vpls-instance-type";
              }
              config false;
              description
                "Type of the associated b-component";
            }
          }  // case b-component
        }  // choice component-type
      }  // container pbb-parameters
    }  // grouping pbb-parameters-grp

    grouping pbb-parameters-state-grp {
      description "PBB parameters grouping";
      container pbb-parameters {
        description "pbb-parameters";
        choice component-type {
          description "PBB component type";
          case i-component {
            leaf i-sid {
              type i-sid-type;
              description "I-SID";
            }

            leaf backbone-src-mac {
              type yang:mac-address;
              description "backbone-src-mac";
            }
          }  // case i-component

          case b-component {
            leaf bind-b-component-name {
              type string;
              description
                "Name of the associated b-component";
            }

            leaf bind-b-component-type {
              type identityref {
                base l2vpn-instance-type;
              }
              must
                ". = 'l2vpn:vpls-instance-type'" {
                description
                  "The associated b-component must have "
                    + "type vpls-instance-type";
              }
              description
                "Type of the associated b-component";
            }
          }  // case b-component
        }  // choice component-type
      }  // container pbb-parameters
    }  // grouping pbb-parameters-state-grp

    grouping l2vpn-common-parameters-grp {
      description "L2VPN common parameters";
      leaf type {
        type identityref {
          base l2vpn-instance-type;
        }
        description
          "Type of L2VPN service instance";
      }

      leaf mtu {
        type uint16;
        description "MTU of L2VPN service";
      }

      leaf mac-aging-timer {
        type uint32;
        description
          "mac-aging-timer, the duration after which"
            + "a MAC entry is considered aged out";
      }

      leaf service-type {
        type l2vpn-service-type;
        default 'Ethernet';
        description "L2VPN service type";
      }

      leaf discovery-type {
        type l2vpn-discovery-type;
        default 'manual-discovery';
        description
          "L2VPN service discovery type";
      }

      leaf signaling-type {
        type l2vpn-signaling-type;
        mandatory true;
        description "L2VPN signaling type";
      }
    }  // grouping l2vpn-common-parameters-grp

    grouping bgp-signaling-parameters-grp {
      description
        "BGP parameters for signaling";
      leaf site-id {
        type uint16;
        description "Site ID";
      }

      leaf site-range {
        type uint16;
        description "Site Range";
      }
    }  // grouping bgp-signaling-parameters-grp

    grouping redundancy-group-properties-grp {
      description
        "redundancy-group-properties-grp";
      leaf protection-mode {
        type enumeration {
          enum "frr" {
            value 0;
            description "fast reroute";
          }
          enum "master-slave" {
            value 1;
            description "master-slave";
          }
          enum "independent" {
            value 2;
            description "independent";
          }
        }
        description "protection-mode";
      }

      leaf reroute-mode {
        type enumeration {
          enum "immediate" {
            value 0;
            description "immediate reroute";
          }
          enum "delayed" {
            value 1;
            description "delayed reroute";
          }
          enum "never" {
            value 2;
            description "never reroute";
          }
        }
        description "reroute-mode";
      }

      leaf dual-receive {
        type boolean;
        description
          "allow extra traffic to be carried by backup";
      }

      leaf revert {
        type boolean;
        description
          "allow forwarding to revert to primary "
            + "after restoring primary";
      }

      leaf reroute-delay {
        when "../reroute-mode = 'delayed'" {
          description
            "Specify amount of time to "
              + "delay reroute only when "
              + "delayed route is configured";
        }
        type uint16;
        description
          "amount of time to delay reroute";
      }

      leaf revert-delay {
        when "../revert = 'true'" {
          description
            "Specify the amount of time to "
              + "wait to revert to primary "
              + "only if reversion is configured";
        }
        type uint16;
        description
          "amount ot time to wait to revert to primary";
      }
    }  // grouping redundancy-group-properties-grp

    grouping endpoint-grp {
      description
        "A grouping that defines the structure of "
          + "an endpoint";
      choice ac-or-pw-or-redundancy-grp {
        description
          "A choice ofattachment circuit or "
            + "pseudowire or redundancy group";
        case ac {
          description
            "Attachment circuit(s) as an endpoint";
        }  // case ac

        case pw {
          description
            "Pseudowire(s) as an endpoint";
        }  // case pw

        case redundancy-grp {
          description
            "Redundancy group as an endpoint";
          choice primary {
            mandatory true;
            description "primary options";
            case primary-ac {
              description "primary-ac";
            }  // case primary-ac

            case primary-pw {
              description "primary-pw";
            }  // case primary-pw
          }  // choice primary

          choice backup {
            description "backup options";
            case backup-ac {
              description "backup-ac";
            }  // case backup-ac

            case backup-pw {
              description "backup-pw";
            }  // case backup-pw
          }  // choice backup
        }  // case redundancy-grp
      }  // choice ac-or-pw-or-redundancy-grp
    }  // grouping endpoint-grp

    container l2vpn {
      description "L2VPN specific data";
      container redundancy-group-templates {
        description
          "redundancy group templates";
        list redundancy-group-template {
          key "name";
          description
            "redundancy-group-template";
          leaf name {
            type string;
            description "name";
          }

          uses redundancy-group-properties-grp;
        }  // list redundancy-group-template
      }  // container redundancy-group-templates
    }  // container l2vpn

    augment /ni:network-instances/ni:network-instance/ni:ni-type {
      description
        "Augmentation for L2VPN instance";
      case l2vpn {
        description
          "An L2VPN service instance";
        uses l2vpn-common-parameters-grp;

        container bgp-parameters {
          when
            "../discovery-type = 'l2vpn:bgp-auto-discovery'" {
            description
              "Parameters used when discovery type is "
                + "bgp-auto-discovery";
          }
          description
            "BGP auto-discovery parameters";
          leaf vpn-id {
            type string;
            description "VPN ID";
          }

          container rd-rt {
            description
              "Route distiguisher and "
                + "corresponding VPN route targets";
            leaf route-distinguisher {
              type rt-types:route-distinguisher;
              description
                "BGP route distinguisher";
            }

            uses rt-types:vpn-route-targets;
          }  // container rd-rt
        }  // container bgp-parameters

        container bgp-signaling {
          when
            "../signaling-type = 'l2vpn:bgp-signaling'" {
            description
              "Check signaling type: "
                + "Can only configure BGP signaling if "
                + "signaling type is BGP";
          }
          description
            "BGP signaling parameters";
          uses bgp-signaling-parameters-grp;
        }  // container bgp-signaling

        list endpoint {
          key "name";
          description "An endpoint";
          leaf name {
            type string;
            description "endpoint name";
          }

          uses endpoint-grp {
            augment ac-or-pw-or-redundancy-grp/ac {
              description
                "Augment for attachment circuit(s) "
                  + "as an endpoint";
              list ac {
                key "name";
                description
                  "An L2VPN instance's "
                    + "attachment circuit list";
                leaf name {
                  type if:interface-ref;
                  description
                    "Name of attachment circuit";
                }

                leaf state {
                  type operational-state-type;
                  config false;
                  description
                    "attachment circuit up/down state";
                }
              }  // list ac
            }

            augment ac-or-pw-or-redundancy-grp/pw {
              description
                "Augment for pseudowire(s) as an endpoint";
              list pw {
                key "name";
                description
                  "An L2VPN instance's pseudowire list";
                leaf name {
                  type pw:pseudowire-ref;
                  must
                    "(../../../type = "
                      + " 'l2vpn:vpws-instance-type') or "
                      + "(not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vccv-ability)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /request-vlanid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vlan-tpid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /ttl)))" {
                    description
                      "Only a VPWS PW has parameters "
                        + "vccv-ability, request-vlanid, "
                        + "vlan-tpid, and ttl";
                  }
                  description
                    "Pseudowire name";
                }

                leaf state {
                  type leafref {
                    path "/pw:pseudowires/pw:pseudowire[pw:name=current()/../name]/pw:state";
                  }
                  config false;
                  description
                    "Pseudowire state";
                }
              }  // list pw
            }

            augment ac-or-pw-or-redundancy-grp/redundancy-grp/primary/primary-ac {
              description
                "Augment for primary-ac";
              container primary-ac {
                description "Primary AC";
                leaf name {
                  type if:interface-ref;
                  description
                    "Name of attachment circuit";
                }

                leaf state {
                  type operational-state-type;
                  config false;
                  description
                    "attachment circuit up/down state";
                }
              }  // container primary-ac
            }

            augment ac-or-pw-or-redundancy-grp/redundancy-grp/primary/primary-pw {
              description
                "Augment for primary-pw";
              list primary-pw {
                key "name";
                description
                  "An L2VPN instance's pseudowire list";
                leaf name {
                  type pw:pseudowire-ref;
                  must
                    "(../../../type = "
                      + " 'l2vpn:vpws-instance-type') or "
                      + "(not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vccv-ability)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /request-vlanid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vlan-tpid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /ttl)))" {
                    description
                      "Only a VPWS PW has parameters "
                        + "vccv-ability, request-vlanid, "
                        + "vlan-tpid, and ttl";
                  }
                  description
                    "Pseudowire name";
                }

                leaf state {
                  type leafref {
                    path "/pw:pseudowires/pw:pseudowire[pw:name=current()/../name]/pw:state";
                  }
                  config false;
                  description
                    "Pseudowire state";
                }
              }  // list primary-pw
            }

            augment ac-or-pw-or-redundancy-grp/redundancy-grp/backup/backup-ac {
              description
                "Augment for backup-ac";
              container backup-ac {
                description "Backup AC";
                leaf name {
                  type if:interface-ref;
                  description
                    "Name of attachment circuit";
                }

                leaf state {
                  type operational-state-type;
                  config false;
                  description
                    "attachment circuit up/down state";
                }
              }  // container backup-ac
            }

            augment ac-or-pw-or-redundancy-grp/redundancy-grp/backup/backup-pw {
              description
                "Augment for backup-pw";
              list backup-pw {
                key "name";
                description
                  "A list of backup pseudowires";
                leaf name {
                  type pw:pseudowire-ref;
                  must
                    "(../../../type = "
                      + " 'l2vpn:vpws-instance-type') or "
                      + "(not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vccv-ability)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /request-vlanid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /vlan-tpid)) and "
                      + " not(boolean(/pw:pseudowires"
                      + "     /pw:pseudowire[pw:name = current()]"
                      + "     /ttl)))" {
                    description
                      "Only a VPWS PW has parameters "
                        + "vccv-ability, request-vlanid, "
                        + "vlan-tpid, and ttl";
                  }
                  description
                    "Pseudowire name";
                }

                leaf state {
                  type leafref {
                    path "/pw:pseudowires/pw:pseudowire[pw:name=current()/../name]/pw:state";
                  }
                  config false;
                  description
                    "Pseudowire state";
                }
              }  // list backup-pw
            }

            augment ac-or-pw-or-redundancy-grp/redundancy-grp {
              description
                "Augment for redundancy group properties";
              leaf template {
                type redundancy-group-template-ref;
                description
                  "Reference a redundancy group "
                    + "properties template";
              }

              uses redundancy-group-properties-grp;
            }
          }
        }  // list endpoint
      }  // case l2vpn
    }

    augment /pw:pseudowires/pw:pseudowire {
      description
        "Augment for peudowire parameters for "
          + "VPWS pseudowires";
      leaf vccv-ability {
        type boolean;
        description "vccvability";
      }

      leaf request-vlanid {
        type uint16;
        description "request vlanid";
      }

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

      leaf ttl {
        type uint8;
        description "time-to-live";
      }
    }

    augment /pw:pseudowires/pw:pseudowire/pw:pw-type {
      description
        "Additional pseudowire types";
      container bgp-pw {
        description "BGP pseudowire";
        leaf remote-pe-id {
          type inet:ip-address;
          description "remote pe id";
        }
      }  // container bgp-pw
      container bgp-ad-pw {
        description
          "BGP auto-discovery pseudowire";
        leaf remote-ve-id {
          type uint16;
          description "remote ve id";
        }
      }  // container bgp-ad-pw
    }

    augment /ni:network-instances/ni:network-instance/ni:ni-type/l2vpn:l2vpn {
      when
        "l2vpn:type = 'l2vpn:vpws-instance-type'" {
        description
          "Constraints only for VPWS pseudowires";
      }
      description
        "Augment for VPWS instance";
      container vpws-constraints {
        must
          "(count(../endpoint) <= 2) and "
            + "(count(../endpoint/pw) <= 1) and "
            + "(count(../endpoint/ac)  <= 1) and "
            + "(count(../endpoint/primary-pw)  <= 1) and "
            + "(count(../endpoint/backup-pw)  <= 1) " {
          description
            "A VPWS L2VPN instance has at most 2 endpoints "
              + "and each endpoint has at most 1 pseudowire or "
              + "1 attachment circuit";
        }
        description "VPWS constraints";
      }  // container vpws-constraints
    }

    augment /ni:network-instances/ni:network-instance/ni:ni-type/l2vpn:l2vpn {
      when
        "l2vpn:type = 'l2vpn:vpls-instance-type'" {
        description
          "Parameters specifically for a VPLS instance";
      }
      description
        "Augment for parameters for a VPLS instance";
      uses pbb-parameters-grp;
    }

    augment /ni:network-instances/ni:network-instance/ni:ni-type/l2vpn:l2vpn/l2vpn:endpoint {
      when
        "../l2vpn:type = 'l2vpn:vpls-instance-type'" {
        description
          "Endpoint parameter specifically for "
            + "a VPLS instance";
      }
      description
        "Augment for endpoint parameters for a VPLS instance";
      leaf split-horizon-group {
        type string;
        description
          "Identify a split horizon group";
      }
    }

    augment /ni:network-instances/ni:network-instance/ni:ni-type/l2vpn:l2vpn/l2vpn:endpoint/l2vpn:ac-or-pw-or-redundancy-grp/l2vpn:redundancy-grp/l2vpn:backup/l2vpn:backup-pw/l2vpn:backup-pw {
      when
        "../../l2vpn:type = 'l2vpn:vpls-instance-type'" {
        description
          "Backup pseudowire parameter specifically for "
            + "a VPLS instance";
      }
      description
        "Augment for backup pseudowire paramters for "
          + "a VPLS instance";
      leaf precedence {
        type uint32;
        description
          "precedence of the pseudowire";
      }
    }

    notification l2vpn-state-change-notification {
      description
        "L2VPN and constituents state change notification";
      leaf l2vpn-instance-name {
        type l2vpn-instance-name-ref;
        description
          "The L2VPN instance name";
      }

      leaf l2vpn-instance-type {
        type leafref {
          path "/ni:network-instances/ni:network-instance[ni:name=current()/../l2vpn-instance-name]/l2vpn:type";
        }
        description
          "The L2VPN instance type";
      }

      leaf endpoint {
        type leafref {
          path "/ni:network-instances/ni:network-instance[ni:name=current()/../l2vpn-instance-name]/l2vpn:endpoint/l2vpn:name";
        }
        description "The endpoint";
      }

      uses endpoint-grp {
        augment ac-or-pw-or-redundancy-grp/ac {
          description
            "Augment for attachment circuit(s) "
              + "as an endpoint";
          leaf ac {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint"
                  + "[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:ac/l2vpn:name";
            }
            description
              "Related attachment circuit";
          }
        }

        augment ac-or-pw-or-redundancy-grp/pw {
          description
            "Augment for pseudowire(s) as an endpoint";
          leaf pw {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:pw/l2vpn:name";
            }
            description "Related pseudowire";
          }
        }

        augment ac-or-pw-or-redundancy-grp/redundancy-grp/primary/primary-ac {
          description
            "Augment for primary-ac";
          leaf primary-ac {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint"
                  + "[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:primary-ac/l2vpn:name";
            }
            description
              "Related primary attachment circuit";
          }
        }

        augment ac-or-pw-or-redundancy-grp/redundancy-grp/primary/primary-pw {
          description
            "Augment for primary-pw";
          leaf primary-pw {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint"
                  + "[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:primary-pw/l2vpn:name";
            }
            description
              "Related primary pseudowire";
          }
        }

        augment ac-or-pw-or-redundancy-grp/redundancy-grp/backup/backup-ac {
          description
            "Augment for backup-ac";
          leaf backup-ac {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint"
                  + "[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:backup-ac/l2vpn:name";
            }
            description
              "Related backup attachment circuit";
          }
        }

        augment ac-or-pw-or-redundancy-grp/redundancy-grp/backup/backup-pw {
          description
            "Augment for backup-pw";
          leaf backup-pw {
            type leafref {
              path
                "/ni:network-instances"
                  + "/ni:network-instance"
                  + "[ni:name=current()/../l2vpn-instance-name]"
                  + "/l2vpn:endpoint"
                  + "[l2vpn:name=current()/../endpoint]"
                  + "/l2vpn:backup-pw/l2vpn:name";
            }
            description
              "Related backup pseudowire";
          }
        }
      }

      leaf state {
        type identityref {
          base l2vpn-notification-state;
        }
        description
          "State change notification";
      }
    }  // notification l2vpn-state-change-notification
  }  // module ietf-l2vpn

Summary

  
  
Organization ietf
  
Module ietf-l2vpn
Version 2019-05-28
File ietf-l2vpn@2019-05-28.yang
  
Prefix l2vpn
Namespace urn:ietf:params:xml:ns:yang:ietf-l2vpn
  
Cooked /cookedmodules/ietf-l2vpn/2019-05-28
YANG /src/ietf-l2vpn@2019-05-28.yang
XSD /xsd/ietf-l2vpn@2019-05-28.xsd
  
Abstract l2vpn
  
Contact
ietf

Description

 
l2vpn

Typedefs

Typedef Base type Abstract
i-sid-type uint32 I-SID type that is 24-bits. This should be moved to ieee-types.yang at http://www.ieee802.org/1/files/public/docs2015/new-mholness-ieee-types-yang-v01.yang
l2vpn-discovery-type identityref L2VPN discovery type
l2vpn-instance-name-ref leafref l2vpn-instance-name-ref
l2vpn-instance-type-ref leafref l2vpn-instance-type-ref
l2vpn-service-type identityref L2VPN service type
l2vpn-signaling-type identityref L2VPN signaling type
link-discovery-protocol-type identityref This type is used to identify link discovery protocol
operational-state-type enumeration operational-state-type
pbb-component-type enumeration This type is used to identify the type of PBB component
redundancy-group-template-ref leafref redundancy-group-template-ref

Groupings

Grouping Objects Abstract
bgp-signaling-parameters-grp site-id site-range BGP parameters for signaling
endpoint-grp ac-or-pw-or-redundancy-grp A grouping that defines the structure of an endpoint
l2vpn-common-parameters-grp type mtu mac-aging-timer service-type discovery-type signaling-type L2VPN common parameters
pbb-parameters-grp pbb-parameters PBB parameters grouping
pbb-parameters-state-grp pbb-parameters PBB parameters grouping
redundancy-group-properties-grp protection-mode reroute-mode dual-receive revert reroute-delay revert-delay redundancy-group-properties-grp

Objects

Type Key
Mandatory config
Optional config
Not config
Object Type Abstract
l2vpn container L2VPN specific data
   redundancy-group-templates container redundancy group templates
      redundancy-group-template list redundancy-group-template
         dual-receive leaf allow extra traffic to be carried by backup
         name leaf name
         protection-mode leaf protection-mode
         reroute-delay leaf amount of time to delay reroute
         reroute-mode leaf reroute-mode
         revert leaf allow forwarding to revert to primary after restoring primary
         revert-delay leaf amount ot time to wait to revert to primary

Notifications

Notification Abstract
l2vpn-state-change-notification L2VPN and constituents state change notification