huawei-loadbalance

Load balancing.

  • Version: 2021-05-26

    huawei-loadbalance@2021-05-26


    
      module huawei-loadbalance {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-loadbalance";
    
        prefix loadbalance;
    
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-devm {
          prefix devm;
        }
        import huawei-devm-vnf {
          prefix devm-vnf;
        }
    
        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 "Load balancing.";
    
        revision "2021-05-26" {
          description
            "Add hash-arithmetic-trunk-enhance node.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-04-01" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "forwarding";
    
        typedef trunk-ecmp {
          type enumeration {
            enum "invalid" {
              value 0;
              description "Invalid value.";
            }
            enum "ecmp" {
              value 4;
              description
                "IIP module load balancing.";
            }
            enum "ecmp1" {
              value 1;
              description
                "IIP module one-level load balancing.";
            }
            enum "ecmp2" {
              value 2;
              description
                "IIP module two-level load balancing.";
            }
            enum "trunk" {
              value 3;
              description "Trunk mode.";
            }
            enum "ip" {
              value 5;
              description "IP mode.";
            }
            enum "mac" {
              value 6;
              description "MAC mode.";
            }
            enum "vll" {
              value 7;
              description "VLL mode.";
            }
          }
          description
            "Load balancing trunk ecmp.";
        }
    
        typedef hash-material {
          type enumeration {
            enum "invalid" {
              value 0;
              description "Invalid value.";
            }
            enum "l2" {
              value 1;
              description
                "L2 (Hash based on the source MAC address and destination MAC address. If the source IP address and destination IP address of the uplink traffic on the interface board remain unchanged but the MAC address changes, L2 is recommended as the hash factor.).";
            }
            enum "l3" {
              value 2;
              description
                "L3 (Hash based on the source IP address and destination IP address. If the source IP address and destination IP address of the uplink traffic on the interface board are evenly distributed, L3 is recommended as the hash factor.).";
            }
            enum "l4" {
              value 3;
              description
                "L4 (Hash based on the source IP address, destination IP address, source port number, destination port number, and protocol number. If the source IP address and destination IP address of the uplink traffic on the interface board are not evenly distributed, L4 is recommended as the hash factor.).";
            }
          }
          description
            "Load balancing hash material.";
        }
    
        typedef cx-hash-arithmetic {
          type enumeration {
            enum "arithmetic1" {
              value 1;
              description "Arithmetic 1.";
            }
            enum "arithmetic2" {
              value 2;
              description "Arithmetic 2.";
            }
            enum "arithmetic3" {
              value 3;
              description "Arithmetic 3.";
            }
            enum "arithmetic4" {
              value 4;
              description "Arithmetic 4.";
            }
            enum "arithmetic5" {
              value 5;
              description "Arithmetic 5.";
            }
            enum "random" {
              value 6;
              description "Random algorithm.";
            }
          }
          description
            "CX load balancing arithmetic.";
        }
    
        typedef cx-trunk-ecmp {
          type enumeration {
            enum "ip" {
              value 5;
              description "IP mode.";
            }
            enum "mac" {
              value 6;
              description "MAC mode.";
            }
            enum "vll" {
              value 7;
              description "VLL mode.";
            }
            enum "tunnel-info" {
              value 8;
              description "Tunnel information.";
            }
            enum "tunnel-inner-ip" {
              value 9;
              description
                "Tunnel inner IP information.";
            }
            enum "gtp" {
              value 10;
              description "GTP tunnel.";
            }
            enum "fec" {
              value 11;
              description "FEC mode.";
            }
            enum "gtp-inner-ip" {
              value 12;
              description
                "GTP tunnel inner IP information.";
            }
          }
          description
            "CX load balancing trunk ecmp.";
        }
    
        typedef cx-hash-material {
          type enumeration {
            enum "l2" {
              value 1;
              description
                "L2 (Hash based on the source MAC address and destination MAC address. If the source IP address and destination IP address of the uplink traffic on the interface board remain unchanged but the MAC address changes, L2 is recommended as the hash factor.).";
            }
            enum "l3" {
              value 2;
              description
                "L3 (Hash based on the source IP address and destination IP address. If the source IP address and destination IP address of the uplink traffic on the interface board are evenly distributed, L3 is recommended as the hash factor.).";
            }
            enum "l4" {
              value 3;
              description
                "L4 (Hash based on the source IP address, destination IP address, source port number, destination port number, and protocol number. If the source IP address and destination IP address of the uplink traffic on the interface board are not evenly distributed, L4 is recommended as the hash factor.).";
            }
            enum "undo-disable" {
              value 4;
              description
                "Enable the tunnel information function for the hash factor when an IP tunnel's fragmented packets are balanced.";
            }
            enum "disable" {
              value 5;
              description
                "Disable the tunnel information function for the hash factor when an IP tunnel's fragmented packets are balanced.";
            }
            enum "label-ip" {
              value 6;
              description "Label-IP.";
            }
            enum "label" {
              value 7;
              description "Pw-label in VLL.";
            }
          }
          description
            "CX load balancing hash material.";
        }
    
        typedef cx-mulpe-flag {
          type enumeration {
            enum "enable" {
              value 0;
              description
                "Enable multi-path load balancing.";
            }
            enum "disable" {
              value 255;
              description
                "Disable multi-path load balancing.";
            }
          }
          description
            "CX load balancing multi-path.";
        }
    
        typedef hash-ip-type {
          type enumeration {
            enum "destination-ip" {
              value 4;
              description
                "Use destination IP addresses as hash key.";
            }
            enum "source-ip" {
              value 5;
              description
                "Use source IP addresses as hash key.";
            }
          }
          description "Hash key type.";
        }
    
        typedef cfg-type {
          type enumeration {
            enum "all" {
              value 0;
              description
                "Query load balancing hash information on all boards.";
            }
            enum "slot" {
              value 1;
              description
                "Query load balancing hash information on a board.";
            }
          }
          description "Query mode.";
        }
    
        container loadbalance {
          description
            "Load balancing configuration.";
          container global-attribute {
            description
              "Configure global attribute.";
            leaf ucmp-enable {
              type boolean;
              default "false";
              description
                "Enable/disable UCMP globally.";
            }
    
            leaf mpls-ucmp-enable {
              type boolean;
              default "false";
              description
                "Enable/disable MPLS UCMP.";
            }
    
            leaf vxlan-l2vni-enable {
              type boolean;
              default "false";
              description
                "Enable/disable L2VXLAN VNI-based load balancing.";
            }
    
            leaf vxlan-l3vni-enable {
              type boolean;
              default "false";
              description
                "Enable/disable L3VXLAN VNI-based load balancing.";
            }
    
            leaf vxlan-l2deep-hash-enable {
              type boolean;
              default "false";
              description
                "Enable/disable L2VXLAN DEEP HASH load balancing.";
            }
    
            leaf trunk-multicast-enable {
              type boolean;
              default "false";
              description
                "Enable/disable trunk multicast load balancing.";
            }
    
            leaf mpls-te-convergence-enable {
              type boolean;
              default "false";
              status obsolete;
              description
                "Enable/disable MPLS TE convergence separate.";
            }
    
            leaf mpls-loadblc-wtr {
              type uint32 {
                range "0|5..60";
              }
              units "s";
              default "0";
              description
                "Configures the delay time for MPLS equal-cost multiple path (ECMP) switchback.";
            }
    
            leaf tunnel-info-gtp-enable {
              type boolean;
              default "true";
              description
                "Enable/disable GTP deep hash load balancing.";
            }
    
            container hash-arithmetic-trunk-enhance {
              presence
                "Enable hash arithmetic trunk enhance";
              description
                "Enable/disable load balance hash-arithmetic trunk-enhance.";
            }  // container hash-arithmetic-trunk-enhance
          }  // container global-attribute
    
          container hash-key-ip {
            description
              "Configure a device to use source or destination IP addresses as hash key to balance all incoming IP packets on a specific or all interface boards.";
            leaf ip-type {
              type hash-ip-type;
              description "Set IP hash type.";
            }
          }  // container hash-key-ip
    
          container hash-key-ip-slots {
            description
              "List of configurations that enable a device to use source or destination IP addresses as hash key to balance all incoming IP packets on a specific or all interface boards.";
            list hash-key-ip-slot {
              key "slot-id";
              description
                "Configure a device to use source or destination IP addresses as hash key to balance all incoming IP packets on a specific or all interface boards.";
              leaf slot-id {
                type string {
                  length "1..32";
                }
                description
                  "Slot ID of an interface board. The value range varies according to router hardware. NULL is for all slot.";
              }
    
              leaf ip-type {
                type hash-ip-type;
                mandatory true;
                description "Set IP hash type.";
              }
            }  // list hash-key-ip-slot
          }  // container hash-key-ip-slots
    
          container hash-instructions {
            config false;
            description
              "List of load balancing hash information on a specified board or on all boards.";
            list hash-instruction {
              key "slot-id query-type";
              config false;
              description
                "Statistics of load balancing hash information on a specified board or on all boards.";
              leaf slot-id {
                type string {
                  length "0..32";
                }
                config false;
                description
                  "Slot ID of an interface board. The value range varies according to router hardware.";
              }
    
              leaf query-type {
                type cfg-type;
                config false;
                description
                  "Query mode of load balancing hash information.";
              }
    
              container infos {
                config false;
                description
                  "Statistics of load balancing hash-related configurations.";
                leaf info {
                  type string {
                    length "1..127";
                  }
                  config false;
                  status deprecated;
                  description
                    "Load balancing hash information. To check load balancing information, querying the load-balancing configuration node is recommended.";
                }
              }  // container infos
    
              leaf tunnel-gtp-enable {
                type boolean;
                config false;
                description
                  "This node displays whether tunnel information is used as a hash factor during hash calculation for GTP tunnel load balancing.";
              }
            }  // list hash-instruction
          }  // container hash-instructions
    
          container ecmp-stateful {
            must
              "maximum>minimum or not(maximum) or not(minimum)";
            presence
              "Configure ECMP stateful load balancing.";
            description
              "Configure ECMP stateful load balancing.";
            leaf minimum {
              type uint32 {
                range "1..63";
              }
              default "1";
              description
                "Minimum interface number.";
            }
    
            leaf maximum {
              type uint32 {
                range "2..64";
              }
              default "64";
              description
                "Maximum interface number.";
            }
    
            leaf accuracy {
              type uint32 {
                range "1..4";
              }
              default "1";
              description
                "Accuracy of ECMP load balancing.";
            }
          }  // container ecmp-stateful
        }  // container loadbalance
    
        augment /ifm:ifm/ifm:interfaces/ifm:interface {
          description
            "Load balancing configuration to the ifm module.";
          container loadbalance {
            description
              "Configure Load balancing.";
            container ucmp {
              when
                "../../ifm:type = 'GigabitEthernet' or ../../ifm:type = 'Pos' or ../../ifm:type = '40GE' or ../../ifm:type = '100GE' or ../../ifm:type = 'XGigabitEthernet' or ../../ifm:type = 'ATM' or ../../ifm:type = '50|100GE' or ../../ifm:type = '50GE' or ../../ifm:type = '400GE' or ../../ifm:type = '25GE' or ../../ifm:type = '200GE' or ../../ifm:type = '10GE' or ../../ifm:type = 'FlexE' or ../../ifm:type = '4x10GE' or ../../ifm:type = '10x10GE' or ../../ifm:type = '3x40GE' or ../../ifm:type = '4x25GE' or ../../ifm:type = 'Ethernet'";
              presence
                "Enable UCMP on the interface";
              description
                "Enable/disable UCMP on an interface. To implement UCMP on equal-cost links with different bandwidth values, you can configure this function on each interface. Enabling or disabling UCMP on a physical interface takes effect only after the interface is restarted. UCMP is only for equal-cost routes. UCMP applies only to equal-cost routes and is independent of routing protocols, such as an IGP or BGP.";
            }  // container ucmp
    
            container packet {
              when
                "../../ifm:type = 'Ethernet' or ../../ifm:type = '100GE' or ../../ifm:type = '400GE' or ../../ifm:type = '40GE' or ../../ifm:type = 'GigabitEthernet' or ../../ifm:type = 'XGigabitEthernet' or ../../ifm:type = 'Ip-Trunk' or ../../ifm:type = 'Eth-Trunk' or ../../ifm:type = '50|100GE' or ../../ifm:type = '50GE' or ../../ifm:type = '25GE' or ../../ifm:type = '200GE' or ../../ifm:type = '10GE' or ../../ifm:type = 'FlexE' or ../../ifm:type = '4x10GE' or ../../ifm:type = '10x10GE' or ../../ifm:type = '3x40GE' or ../../ifm:type = '4x25GE'";
              presence
                "Enable per-packet load balancing on an interface";
              description
                "Enable/disable per-packet load balancing on specified interfaces.";
            }  // container packet
          }  // container loadbalance
        }
    
        augment /devm:devm/devm:lpu-boards/devm:lpu-board {
          description
            "Load balancing configuration to the devm module.";
          container loadbalance {
            description
              "Configure load balancing.";
            container dynamic-adjust {
              description
                "Configure dynamic load balancing.";
              leaf enable {
                type boolean;
                default "false";
                description
                  "Enable/disable dynamic load balancing.";
              }
            }  // container dynamic-adjust
    
            container hash-arithmetic {
              description
                "Configure FE1 hash arithmetic on a specified board.";
              leaf arithmetic {
                type cx-hash-arithmetic;
                default "random";
                description
                  "Set hash algorithm.";
              }
    
              leaf second-hash-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable second hash flag.";
              }
            }  // container hash-arithmetic
    
            container hash-fields {
              description
                "List of FE1 hash fields configuration on a specified board.";
              list hash-field {
                ext:generated-by "system" {
                  description "The all instances are generated automatically.";
                }
                ext:operation-exclude "create" {
                  description "The all instances cannot be created.";
                }
                key "trunk-ecmp";
                description
                  "Configure hash mode, that is, the box attribute, indicating which load balancing mode is applicable to the box.";
                leaf trunk-ecmp {
                  type cx-trunk-ecmp;
                  description "Hash mode.";
                }
    
                leaf material {
                  ext:dynamic-default {
                    ext:default-value "l4" {
                      when "../trunk-ecmp='ip' or ../trunk-ecmp='mac' or ../trunk-ecmp='vll'";
                      description "The default value is l4 when trunk-ecmp is IP or MAC or VLL.";
                    }
                    ext:default-value "disable" {
                      when "../trunk-ecmp='tunnel-inner-ip' or ../trunk-ecmp='gtp-inner-ip'";
                      description "The default value is disable when trunk-ecmp is tunnel-inner-ip or gtp-inner-ip.";
                    }
                    ext:default-value "undo-disable" {
                      when "../trunk-ecmp='tunnel-info' or ../trunk-ecmp='gtp'";
                      description "The default value is enable when trunk-ecmp is tunnel-info or GTP.";
                    }
                  }
                  ext:support-filter "true";
                  type cx-hash-material;
                  must
                    "(../trunk-ecmp='ip' and (../material='l2' or ../material='l3' or ../material='l4') ) or (../trunk-ecmp='mac' and (../material='l2' or ../material='l3' or ../material='l4' or ../material='label-ip') ) or ( (../trunk-ecmp='tunnel-info'  or ../trunk-ecmp='tunnel-inner-ip' or ../trunk-ecmp='gtp' or ../trunk-ecmp='gtp-inner-ip') and (../material='undo-disable' or ../material='disable') ) or (../trunk-ecmp='vll' and (../material='l2' or ../material='l3' or ../material='l4' or ../material='label-ip' or ../material='label') )";
                  description
                    "Set hash material.";
                }
              }  // list hash-field
            }  // container hash-fields
    
            container hash-seed {
              presence
                "FE1 hash seed configuration on a specified board.";
              description
                "Enable/disable FE1 hash seed on a specified board.";
              leaf random-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable random flag.";
              }
    
              leaf custom-seed {
                type pub-type:hex-binary;
                must
                  "../custom-seed='0x0' or ../random-flag='false'";
                default "0x0";
                description
                  "User-defined hash seed random number.";
              }
            }  // container hash-seed
    
            container hash-multipe {
              description
                "Configure FE1 hash Multi-path on a specified board.";
              leaf multipe-flag {
                type cx-mulpe-flag;
                default "disable";
                description
                  "Enable multi-path load balancing.";
              }
            }  // container hash-multipe
          }  // container loadbalance
        }
    
        augment /devm:devm/devm:mpu-boards/devm:mpu-board {
          description
            "Load balancing configuration to the devm module.";
          container loadbalance {
            description
              "Configure load balancing.";
            container dynamic-adjust {
              description
                "Configure dynamic load balancing.";
              leaf enable {
                type boolean;
                default "false";
                description
                  "Enable/disable dynamic load balancing.";
              }
            }  // container dynamic-adjust
    
            container hash-arithmetic {
              description
                "Configure FE1 hash arithmetic on a specified board.";
              leaf arithmetic {
                type cx-hash-arithmetic;
                default "random";
                description "Arithmetic.";
              }
    
              leaf second-hash-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable second hash.";
              }
            }  // container hash-arithmetic
    
            container hash-fields {
              description
                "List of FE1 hash fields configuration on a specified board.";
              list hash-field {
                ext:generated-by "system" {
                  description "The all instances are generated automatically.";
                }
                ext:operation-exclude "create" {
                  description "The all instances cannot be created.";
                }
                key "trunk-ecmp";
                description
                  "Configure hash mode, that is, the box attribute, indicating which load balancing mode is applicable to the box.";
                leaf trunk-ecmp {
                  type cx-trunk-ecmp;
                  description "Hash mode.";
                }
    
                leaf material {
                  ext:dynamic-default {
                    ext:default-value "l4" {
                      when "../trunk-ecmp='ip' or ../trunk-ecmp='mac' or ../trunk-ecmp='vll'";
                      description "The default value is l4 when trunk-ecmp is IP or MAC or VLL.";
                    }
                    ext:default-value "disable" {
                      when "../trunk-ecmp='tunnel-inner-ip' or ../trunk-ecmp='gtp-inner-ip'";
                      description "The default value is disable when trunk-ecmp is tunnel-inner-ip or gtp-inner-ip.";
                    }
                    ext:default-value "undo-disable" {
                      when "../trunk-ecmp='tunnel-info' or ../trunk-ecmp='gtp'";
                      description "The default value is enable when trunk-ecmp is tunnel-info or GTP.";
                    }
                  }
                  ext:support-filter "true";
                  type cx-hash-material;
                  must
                    "(../trunk-ecmp='ip' and (../material='l2' or ../material='l3' or ../material='l4') ) or (../trunk-ecmp='mac' and (../material='l2' or ../material='l3' or ../material='l4' or ../material='label-ip') ) or ( (../trunk-ecmp='tunnel-info'  or ../trunk-ecmp='tunnel-inner-ip' or ../trunk-ecmp='gtp' or ../trunk-ecmp='gtp-inner-ip') and (../material='undo-disable' or ../material='disable') ) or (../trunk-ecmp='vll' and (../material='l2' or ../material='l3' or ../material='l4' or ../material='label-ip' or ../material='label') )";
                  description
                    "Set hash material.";
                }
              }  // list hash-field
            }  // container hash-fields
    
            container hash-seed {
              presence
                "FE1 hash seed configuration on a specified board.";
              description
                "Enable/disable FE1 hash seed on a specified board.";
              leaf random-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable random flag.";
              }
    
              leaf custom-seed {
                type pub-type:hex-binary;
                must
                  "../custom-seed='0x0' or ../random-flag='false'";
                default "0x0";
                description
                  "User-defined hash seed random number.";
              }
            }  // container hash-seed
    
            container hash-multipe {
              description
                "Configure FE1 hash Multi-PE on a specified board.";
              leaf multipe-flag {
                type cx-mulpe-flag;
                default "disable";
                description
                  "Multi-path load balancing.";
              }
            }  // container hash-multipe
          }  // container loadbalance
        }
    
        augment /devm-vnf:devm-vnf/devm-vnf:vnf-boards/devm-vnf:vnf-board {
          description
            "Load balancing configuration to the devm module.";
          container loadbalance {
            description
              "Configure load balance.";
            container hash-arithmetic {
              description
                "Configure FE1 hash arithmetic on a specified board.";
              leaf arithmetic {
                type cx-hash-arithmetic;
                default "random";
                description
                  "Set hash algorithm.";
              }
    
              leaf second-hash-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable second hash.";
              }
            }  // container hash-arithmetic
    
            container hash-fields {
              description
                "List of FE1 hash fields configuration on a specified board.";
              list hash-field {
                ext:generated-by "system" {
                  description "The all instances are generated automatically.";
                }
                ext:operation-exclude "create" {
                  description "The all instances cannot be created.";
                }
                key "trunk-ecmp";
                description
                  "Configure hash mode, that is, the box attribute, indicating which load balancing mode is applicable to the box.";
                leaf trunk-ecmp {
                  type cx-trunk-ecmp;
                  description "Hash mode.";
                }
    
                leaf material {
                  ext:dynamic-default {
                    ext:default-value "l4" {
                      when "../trunk-ecmp='ip'";
                      description "The default value is l4 when trunk-ecmp is IP or MAC or VLL.";
                    }
                    ext:default-value "undo-disable" {
                      when "../trunk-ecmp='tunnel-info' or ../trunk-ecmp='gtp'";
                      description "The default value is enable when trunk-ecmp is tunnel-info or GTP.";
                    }
                  }
                  ext:support-filter "true";
                  type cx-hash-material;
                  must
                    "(../trunk-ecmp='ip' and (../material='l2' or ../material='l3' or ../material='l4') ) or ( (../trunk-ecmp='tunnel-info' or ../trunk-ecmp='gtp') and (../material='undo-disable' or ../material='disable') )";
                  description
                    "Set hash material.";
                }
              }  // list hash-field
            }  // container hash-fields
    
            container hash-seed {
              presence
                "FE1 hash seed configuration on a specified board.";
              description
                "Enable/disable FE1 hash seed on a specified board.";
              leaf random-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable random flag.";
              }
    
              leaf custom-seed {
                type pub-type:hex-binary;
                must
                  "../custom-seed='0x0' or ../random-flag='false'";
                default "0x0";
                description
                  "User-defined hash seed random number.";
              }
            }  // container hash-seed
          }  // container loadbalance
        }
      }  // module huawei-loadbalance
    

© 2023 YumaWorks, Inc. All rights reserved.