3.17. Configuring Hash Load-balance

Configuring Linkagg Hash

Overview

Linkagg can aggregate several physical interface to be a logical channel to enhance proformance and redundancy. When use linkagg transmit packets, it could be cause the same data stream transmitting on different physical interfaces. Because of that, the opposite equipment can receive packet disordering. In order to avoid this phennomenon, linkagg can accrod packets property to get a hash value, then it chooses appropriate physical interface to transmit packets. Besides this, it also can improve linkagg load balancing result.

Configuring Linkagg Hash Globally

The follow steps show how to set unicast and non-unicast linkagg hash on packets output interface globally and the configurations has the lowest priority.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value global

Switch(config)# hash-value global
Switch(config-hash-value-global)# port-channel select user
Switch(config-hash-value-global)# end

step 4 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
----------------------------------------------------------------------
ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------------------
hash field select
Packet HashField
---------------------------------------------------------------------
l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value global:

Switch# show hash-value global
LBT:load balance type LBM :load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value global
LBT LBM PT HF HA
---------------------------------------------------------------
port-channel - all user xor
ecmp - all ecmp xor
ecmp flow id all ecmp xor
entropy - all ecmp xor
---------------------------------------------------------------
Efd hash field select:
macsa macda
ipsa ipda
sourceport destport
ip-protocol

Configuring Linkagg Hash Input

The follow steps show how to set unicast linkagg hash on input interface and the configuration priority is higher than output. When the hash value is applied to in the input of linkagg port, the hash value will apply to the member port of linkagg port.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value aaa
Switch(config-hash-value)# port-channel unicast select user
Switch(config-hash-value)# exit

step 4 Set hash value to interface

Switch(config)# interface range eth-0-1 - 2
Switch(config-if-range)# no shutdown
Switch(config-if-range)# static-channel-group 1
Switch(config-if-range)# exit
Switch(config)# interface agg 1
Switch(config-if)# load-balance hash-value aaa input
Switch(config-if)# exit
Switch(config)# interface eth-0-3
Switch(config-if)# load-balance hash-value aaa input
Switch(config-if)# end

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------
ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------
hash field select
Packet HashField
--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value aaa
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: aaa
LBT LBM PT HF HA
--------------------------------------------
port-channel unicast all user xor
port-channel non-unicast all NOCFG NOCFG
ecmp - all NOCFG NOCFG
ecmp flow id all NOCFG NOCFG

Use the following command to display the application of hash value on port:

Switch# show hash-value interface-applied
eth-0-3
hash-value aaa input
agg1
hash-value aaa input

Configuring Linkagg Hash output

The follow steps show how to set unicast linkagg hash on output interface and the configuration priority is lower than input. It only can be applied on linkagg port.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value aaa
Switch(config-hash-value)# port-channel unicast select user
Switch(config-hash-value)# exit

step 4 Set hash value to interface

Switch(config)# interface range eth-0-1 - 2
Switch(config-if-range)# no shutdown
Switch(config-if-range)# static-channel-group 1
Switch(config-if-range)# exit
Switch(config)# interface agg 1
Switch(config-if)# load-balance hash-value aaa output
Switch(config-if)# exit

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------
ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------

hash field select
Packet HashField
--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value aaa
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: aaa
LBT LBM PT HF HA
--------------------------------------------------------

port-channel unicast all user xor
port-channel non-unicast all NOCFG NOCFG
ecmp - all NOCFG NOCFG
ecmp flow id all NOCFG NOCFG

Use the following command to display the application of hash value on port:

Switch# show hash-value interface-applied
agg1 hash-value aaa output

Configuring Linkagg Hash ACL

The follow steps show how to make linkagg hash configurations to be an ACL action and the configurations have the highest priority.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value aaa
Switch(config-hash-value)# port-channel unicast select user
Switch(config-hash-value)# exit

step 4 Add acl action to interface and set hash value to interface

Switch(config)# mac access-list mac
Switch(config-mac-acl)# permit src-mac host 0.0.1 dest-mac any
Switch(config-mac-acl)# exit
Switch(config)# class-map cmap1
Switch(config-cmap)# match access-group mac
Switch(config-cmap)# exit
Switch(config)# policy-map pmap1
Switch(config-pmap)# class cmap1
Switch(config-pmap-c)# load-balance hash-value aaa
Switch(config-pmap-c)# port-channel load-balance round-robin disable
Switch(config-pmap-c)# exit
Switch(config-pmap)# exit
Switch(config)# interface eth-0-3
Switch(config-if)# no shutdown
Switch(config-if)# service-policy input pmap1
Switch(config-if)# end

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------

ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------

hash field select
Packet HashField

--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value aaa
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: aaa
LBT LBM PT HF HA
--------------------------------------------------------

port-channel unicast all user xor
port-channel non-unicast all NOCFG NOCFG
ecmp - all NOCFG NOCFG
ecmp flow id all NOCFG NOCFG

Use the following command to display the information of ACL:

Switch# show running-config
mac access-list mac
10 permit src-mac host 0000.0000.0001 dest-mac any
 !
hash-field user
l2 macsa
ip ipsa
 !
hash-value aaa
port-channel unicast select user
 !
class-map match-any cmap1
match access-group mac
 !
policy-map pmap1
class cmap1
port-channel load-balance round-robin disable
load-balance hash-value aaa
 !
interface eth-0-3
service-policy input pmap1
 !
interface null0
 !

Configuring Non-unicast Linkagg Hash

The follow steps show how to set non-unicast linkagg hash on input interface and the configuration does not support on output. When the hash value is applied to in the input of linkagg port, the hash value will apply to the member port of linkagg port.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value aaa
Switch(config-hash-value)# port-channel non-unicast select user
Switch(config-hash-value)# exit

step 4 Set hash value to interface

Switch(config)# interface range eth-0-1 - 2
Switch(config-if-range)# no shutdown
Switch(config-if-range)# static-channel-group 1
Switch(config-if-range)# exit
Switch(config)# interface agg 1
Switch(config-if)# load-balance hash-value aaa input
Switch(config-if)# exit
Switch(config)# interface eth-0-3
Switch(config-if)# load-balance hash-value aaa input
Switch(config-if)# end

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------

ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------

hash field select
Packet HashField
--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value aaa
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: aaa
LBT LBM PT HF HA
--------------------------------------------------------

port-channel unicast all NOCFG NOCFG
port-channel non-unicast all user xor
ecmp - all NOCFG NOCFG
ecmp flow id all NOCFG NOCFG

Use the following command to display the application of hash value on port:

Switch# show hash-value interface-applied
eth-0-3
hash-value aaa input agg1
hash-value aaa input

Configuring ECMP Hash

Overview

Equal-cost multi-path routing is a routing strategy where next-hop packet forwarding to a single destination can occur over multiple “best paths” which tie for top place in routing metric calculations.Multi-path routing cam be used in conjunction with most routing protocols,because it is a per-hop decision limited to a single router.It can substantially increase bandwidth by load-balancing traffic over multiple paths.Ecmp hash is used to do load balance.

Configuring ECMP Hash Globally

The follow steps show how to set ecmp hash globally and the configurations has the lowest priority.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value global

Switch(config)# hash-value global
Switch(config-hash-value-global)# ecmp select user
Switch(config-hash-value-global)# end

step 4 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------

ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable

--------------------------------------------------------

hash field select
Packet HashField

--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value global:

Switch# show hash-value global
LBT:load balance type LBM :load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value global
LBT LBM PT HF HA
--------------------------------------------------------

port-channel - all port-channel xor
ecmp - all user xor
ecmp flow id all user xor
entropy - all ecmp xor
--------------------------------------------------------

Efd hash field select:
macsa macda
ipsa ipda
sourceport destport
ip-protocol

Configuring ECMP Hash Input

The follow steps show how to set ECMP hash on input interface and the configuration priority is higher than global configuration.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value bbb
Switch(config-hash-value)# ecmp select user
Switch(config-hash-value)# exit

step 4 Set hash value to interface

Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# load-balance hash-value bbb input
Switch(config-if)# end

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------

ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------

hash field select
Packet HashField
--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value bbb
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: bbb
LBT LBM PT HF HA
-------------------------------------------------------

port-channel unicast all NOCFG NOCFG
port-channel non-unicast all NOCFG NOCFG
ecmp - all user xor
ecmp flow id all NOCFG NOCFG

Use the following command to display the application of hash value on port:

Switch# show hash-value interface-applied
eth-0-1
hash-value bbb input

Configuring ECMP Hash input

The follow steps show how to make ECMP hash configurations to be a ACL action and the configurations have the highest priority.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash field

Switch(config)# hash-field user
Switch(config-hash-field)# l2 macsa
Switch(config-hash-field)# ip ipsa
Switch(config-hash-field)# exit

step 3 Set hash value

Switch(config)# hash-value bbb
Switch(config-hash-value)# ecmp select user
Switch(config-hash-value)# exit

step 4 Add acl action to interface and set hash value to interface

Switch(config)# mac access-list mac
Switch(config-mac-acl)# permit src-mac host 0.0.1 dest-mac any
Switch(config-mac-acl)# exit
Switch(config)# class-map cmap1
Switch(config-cmap)# match access-group mac
Switch(config-cmap)# exit
Switch(config)# policy-map pmap1
Switch(config-pmap)# class cmap1
Switch(config-pmap-c)# load-balance hash-value bbb
Switch(config-pmap-c)# ecmp load-balance round-robin disable
Switch(config-pmap-c)# exit
Switch(config-pmap)# exit
Switch(config)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# service-policy input pmap1
Switch(config-if)# end

step 5 Validation

Use the following command to display the information of hash field user:

Switch# show hash-field user
hash-field name: user
Option Control type
--------------------------------------------------------

ipv6 address compress xor
hash seed user set (0)
hash arithmetic xor
hash symmetry disable
ip enable
ipv6 enable
mpls enable
--------------------------------------------------------
hash field select
Packet HashField
--------------------------------------------------------

l2: macsa
ip: ipsa
ipv6: ipsa ipda
l4-sourceport l4-destport
ip-protocol
gre: ipsa ipda
gre-key
vxlan: vni outer-l4-sourceport
outer-ipda outer-ipsa
nvgre: vsid outer-ipda
outer-ipsa
mpls: top-label 2nd-label
vpws: top-label 2nd-label
vpls(inner-l2): inner-macda inner-macsa
vpls(inner-l3): inner-ipda inner-ipsa
l3vpn: inner-ipsa inner-ipda
inner-ip-protocol inner-l4-sourceport
inner-l4-destport

Use the following command to display the information of hash value:

Switch# show hash-value bbb
LBT:load balance type LBM:load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value name: bbb
LBT LBM PT HF HA
--------------------------------------------------------

port-channel unicast all NOCFG NOCFG
port-channel non-unicast all NOCFG NOCFG
ecmp - all user xor
ecmp flow id all NOCFG NOCFG

Use the following command to display the information of ACL:

mac access-list mac
10 permit src-mac host 0000.0000.0001 dest-mac any

 !

hash-field user
l2 macsa
ip ipsa

 !

hash-value bbb
ecmp select user

 !

class-map match-any cmap1
match access-group mac

 !

policy-map pmap1
class cmap1
ecmp load-balance round-robin disable
load-balance hash-value bbb

 !

interface eth-0-1
service-policy input pmap1

 !

interface null0
 !

Configuring ECMP Hash

Overview

Elephant Flow Detect(EFD). According to the academic institutions of the actual network of the study found that more than 80% of the bandwidth is occupied by elephant flow, the bandwidth and transmission cache of these flow is large, but not sensitive to delay, which is sensitive to delay The flow caused a great impact.EFD hash is used to detect elephant flow by recognising packet features.

Configuring EFD Hash Globally

The follow steps show how to select packet features for EFD hash globally.

step 1 Enter the configure mode

Switch# configure terminal

step 2 Set hash global

Switch(config)# hash-value global
Switch(config-hash-value-global)# efd select ipsa macsa
Switch(config-hash-value-global)# end

step 3 Validation

Use the following command to display the information of hash value global:

Switch# show hash-value global
LBT:load balance type LBM :load balance mode
PT :packet type HF :hash field
HA :hash arithmetic
hash-value global
LBT LBM PT HF HA
--------------------------------------------------------

port-channel - all port-channel xor
ecmp - all ecmp xor
ecmp flow id all ecmp xor
entropy - all ecmp xor
--------------------------------------------------------

Efd hash field select:
macsa ipsa