huawei-mac-flapping

MAC flapping-based loop detection.

  • Version: 2020-03-09

    huawei-mac-flapping@2020-03-09


    
      module huawei-mac-flapping {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-mac-flapping";
    
        prefix mac-flapping;
    
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-ethernet {
          prefix ethernet;
        }
        import huawei-bd {
          prefix bd;
        }
        import huawei-vlan {
          prefix vlan;
        }
        import huawei-l2vpn {
          prefix l2vpn;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-inet-types {
          prefix inet;
        }
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
         Bantian, Longgang
         Shenzhen 518129
         People's Republic of China
         Website: http://www.huawei.com
         Email: support@huawei.com";
    
        description
          "MAC flapping-based loop detection.";
    
        revision "2020-03-09" {
          description "Modify description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-04-23" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "mflp";
    
        typedef alarm-enable {
          type enumeration {
            enum "block" {
              value 1;
              description
                "Disable the loop detection alarm function.";
            }
            enum "alarm" {
              value 2;
              description
                "Enable the loop detection alarm function.";
            }
          }
          description "Alarm enable.";
        }
    
        typedef mflp-enable {
          type enumeration {
            enum "disable" {
              value 1;
              description "Disable type.";
            }
            enum "enable" {
              value 2;
              description "Enable type.";
            }
          }
          description "MFLP enable type.";
        }
    
        typedef block-state-type {
          type enumeration {
            enum "temporary" {
              value 1;
              description "Temporary block.";
            }
            enum "permanent" {
              value 2;
              description "Permanent block.";
            }
          }
          description "MFLP block state type.";
        }
    
        typedef block-trust-type {
          type enumeration {
            enum "precise" {
              value 1;
              description "Precise.";
            }
            enum "imprecise" {
              value 2;
              description "Imprecise.";
            }
          }
          description "MFLP block trust type.";
        }
    
        grouping group-mac-flapping {
          description
            "Configuration of MAC flapping.";
          container mac-flapping {
            description
              "Configure MAC flapping.";
            container loop-detect {
              presence
                "Loop detect configuration.";
              description
                "Configure VSI MAC flapping entry.";
              leaf loop-times {
                type uint32 {
                  range "3..1000";
                }
                mandatory true;
                description
                  "Number of MAC address flappings.";
              }
    
              leaf detect-cycle {
                type uint32 {
                  range "3..30";
                }
                units "s";
                mandatory true;
                description "Detection cycle.";
              }
    
              leaf cycles {
                type uint32 {
                  range "1..15";
                }
                mandatory true;
                description "Number of cycles.";
              }
    
              leaf action {
                type alarm-enable;
                mandatory true;
                description
                  "Action taken after a loop occurs. The action can be reporting an alarm or blocking an interface.";
              }
    
              leaf retry-times {
                when "../action='block'";
                type uint32 {
                  range "0..5";
                }
                must
                  "(../retry-times and ../block-time) or (not(../retry-times) and not(../block-time))";
                description "Retry times.";
              }
    
              leaf block-time {
                when "../action='block'";
                type uint32 {
                  range "10..65535";
                }
                units "s";
                must
                  "(../retry-times and ../block-time) or (not(../retry-times) and not(../block-time))";
                description "Blocking time.";
              }
            }  // container loop-detect
    
            container precise-block {
              presence "precise-block";
              description
                "Configure precise blocking policy table.";
            }  // container precise-block
          }  // container mac-flapping
        }  // grouping group-mac-flapping
    
        container mac-flapping {
          description
            "MAC flapping-based loop detection.";
          container global-attribute {
            description
              "Configure global attribute of MFLP.";
            leaf precise-block-policy {
              type mflp-enable;
              default "disable";
              description
                "Global blocking policy.";
            }
    
            leaf generate-time {
              type uint32 {
                range "60..2000000";
              }
              units "s";
              default "600";
              description
                "Trust interface generation time.";
            }
    
            leaf assist-stp {
              type mflp-enable;
              default "disable";
              description
                "MAC flapping assist flag.";
            }
    
            leaf traffic-suppression {
              type mflp-enable;
              default "enable";
              description
                "Global traffic suppress state.";
            }
    
            leaf traffic-suppression-threshold {
              type uint16 {
                range "10..50";
              }
              units "%";
              default "10";
              description
                "Traffic suppress threshold.";
            }
          }  // container global-attribute
    
          container vsi-blocks {
            config false;
            description
              "List of displayed VSI blocked interface entry.";
            list vsi-block {
              key "vsi-name interface-name pw-id peer-ip";
              description
                "Statistics of VSI blocked interface entry.";
              leaf vsi-name {
                type leafref {
                  path "/l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:name";
                }
                description "VSI name.";
              }
    
              leaf interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked interface name.";
              }
    
              leaf pw-id {
                type uint32;
                description "Remote PW ID.";
              }
    
              leaf peer-ip {
                type inet:ipv4-address;
                description "Peer IP address.";
              }
    
              leaf state {
                type block-state-type;
                description "Blocking state.";
              }
    
              leaf linked-interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked associated interface name.";
              }
    
              leaf detect-mac {
                type pub-type:mac-address;
                description
                  "Detect MAC address.";
              }
    
              leaf trust-type {
                type block-trust-type;
                description "Blocking type.";
              }
    
              leaf vlanif-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked VLANIF name.";
              }
    
              leaf mapping-vlan-id {
                type uint16 {
                  range "0..4094";
                }
                description "Mapping VLAN ID.";
              }
            }  // list vsi-block
          }  // container vsi-blocks
    
          container bd-blocks {
            config false;
            description
              "List of displayed BD blocked interface entry.";
            list bd-block {
              key "bd-id interface-name pw-id peer-ip";
              description
                "Statistics of displayed BD blocked interface entry.";
              leaf bd-id {
                type leafref {
                  path "/bd:bd/bd:instances/bd:instance/bd:id";
                }
                description "BD ID.";
              }
    
              leaf interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked interface name.";
              }
    
              leaf pw-id {
                type uint32;
                description "Remote PW ID.";
              }
    
              leaf peer-ip {
                type inet:ipv4-address;
                description "Peer IP address.";
              }
    
              leaf state {
                type block-state-type;
                description "Blocking state.";
              }
    
              leaf linked-interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked associated interface name.";
              }
    
              leaf detect-mac {
                type pub-type:mac-address;
                description
                  "Detect MAC address.";
              }
    
              leaf trust-type {
                type block-trust-type;
                description "Blocking type.";
              }
    
              leaf is-blackhole {
                type boolean;
                default "false";
                description
                  "Is blackhole MAC block.";
              }
            }  // list bd-block
          }  // container bd-blocks
    
          container vlan-blocks {
            config false;
            description
              "List of displayed VLAN blocked interface entry.";
            list vlan-block {
              key "vlan-id interface-name";
              description
                "Statistics of displayed VLAN blocked interface entry.";
              leaf vlan-id {
                type uint16 {
                  range "1..4094";
                }
                description "VLAN ID.";
              }
    
              leaf interface-name {
                type leafref {
                  path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                }
                description
                  "Blocked interface name.";
              }
    
              leaf state {
                type block-state-type;
                description "Blocking state.";
              }
    
              leaf detect-mac {
                type pub-type:mac-address;
                description
                  "Detect MAC address.";
              }
    
              leaf trust-type {
                type block-trust-type;
                description "Blocking type.";
              }
            }  // list vlan-block
          }  // container vlan-blocks
        }  // container mac-flapping
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls {
          description
            "MAC flapping patameters on VSI.";
          uses group-mac-flapping {
            refine mac-flapping/precise-block {
              must
                "../../l2vpn:work-mode='normal'";
            }
          }
        }
    
        augment /bd:bd/bd:instances/bd:instance {
          description
            "MAC flapping patameters on BD.";
          uses group-mac-flapping {
            refine mac-flapping/loop-detect {
              description
                "Configure BD MAC flapping entry.";
            }
          }
        }
    
        augment /vlan:vlan/vlan:vlans/vlan:vlan {
          description
            "MAC flapping patameters on VLAN.";
          uses group-mac-flapping {
            refine mac-flapping/loop-detect {
              description
                "Configure VLAN MAC flapping entry.";
            }
          }
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet/ethernet:main-interface {
          description
            "MAC flapping patameters on the interface.";
          container mflp-mac-shift {
            presence "mflp mac shift";
            description
              "Configure MAC flapping-based loop detection association on an interface.";
          }  // container mflp-mac-shift
        }
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface/ethernet:ethernet {
          description
            "MAC flapping patameters on the interface.";
          container mac-flapping {
            description
              "Configure MAC flapping table.";
            container block-priority {
              presence
                "Blocking priority configuration.";
              description
                "Configure blocking priority.";
              leaf priority {
                type uint32 {
                  range "1..4";
                }
                mandatory true;
                description "Priority value.";
              }
            }  // container block-priority
          }  // container mac-flapping
        }
    
        augment /l2vpn:l2vpn/l2vpn:instances/l2vpn:instance/l2vpn:vpls/l2vpn:ldp-signaling/l2vpn:pws/l2vpn:pw {
          description
            "MAC flapping patameters on LDP-PW.";
          container mac-flapping {
            when "../l2vpn:name";
            description
              "Configure MAC flapping attribute.";
            container block-priority {
              must
                "../../../../../l2vpn:work-mode!='i-vsi-b-evpn-interworking'";
              presence
                "Blocking priority configuration.";
              description
                "Configure Blocking priority.";
              leaf priority {
                type uint32 {
                  range "1..4";
                }
                mandatory true;
                description "Priority value.";
              }
            }  // container block-priority
          }  // container mac-flapping
        }
      }  // module huawei-mac-flapping
    

© 2023 YumaWorks, Inc. All rights reserved.