(可选)配置负载分担方式(CE12800)
背景信息
Eth-Trunk的负载分担是逐流进行的,逐流负载分担能保证包的顺序,保证了同一数据流的帧在同一条物理链路转发。而不同数据流的帧在不同的物理链路上转发从而实现分担负载。
由于负载分担只对出方向的流量有效,因此链路两端接口的负载分担模式可以不一致,两端互不影响。
不同报文的负载分担方式如表3-8所示:
报文(以入接口为准) |
默认负载分担模式 |
可配置的负载分担模式 |
---|---|---|
IPv4报文 |
src-ip、dst-ip、l4-src-port、l4-dst-port |
src-ip、dst-ip、l4-src-port、l4-dst-port、protocol |
IPv6报文 |
src-ip、dst-ip、l4-src-port、l4-dst-port |
src-ip、dst-ip、protocol、l4-src-port、l4-dst-port、flow-label 说明:
IPv6报文的l4-src-port、l4-dst-port负载分担方式受IPv4报文的l4-src-port、l4-dst-port字段控制,即配置IPv4报文的负载分担模式包含l4-src-port或l4-dst-port时,l4-src-port或l4-dst-port字段也会参与IPv6报文HASH。 |
MPLS报文 |
Ingress/Egress/Transit节点:top-label、2nd-label、内层IP头相关字段(IPv4:src-ip、dst-ip、l4-src-port和l4-dst-port或IPv6: src-ip、dst-ip、l4-src-port和l4-dst-port) |
Ingress/Egress/Transit节点:top-label、2nd-label、3rd-label、src-ip、dst-ip、l4-src-port、l4-dst-port 说明:
基于内层IP头相关字段(IPv4:src-ip、dst-ip、l4-src-port和l4-dst-port或IPv6: src-ip、dst-ip、l4-src-port和l4-dst-port)的负载分担模式不需要配置,但实际参与负载分担字段受IPv4报文与IPv6报文的负载分担方式配置影响。若配置负载分担方式携带l4-src-port和l4-dst-port字段参与Hash,则可能出现Hash乱序现象。若需要规避该现象,可以在IPv4报文的负载分担方式以及MPLS报文负载分担方式中取消l4-src-port和l4-dst-port配置。 |
VPLS报文 |
Ingress/Egress/Transit节点:top-label、2nd-label、内层ETH头相关字段(src-mac和dst-mac) |
P节点:inner-sip、inner-dip PE节点:inner-ip、inner-ipv6 说明:
对于VPLS报文,P节点基于内层ETH头相关字段(src-mac、dst-mac和eth-type)的负载分担模式不需要配置,但实际参与负载分担字段受命令l2 [ src-mac | dst-mac | vlan | eth-type ] *的负载分担方式配置影响。基于报文内层IP的负载分担模式,仅选择20bit参与Hash计算。 |
非以上类别的L2报文 |
src-mac、dst-mac、vlan |
src-mac、dst-mac、vlan、eth-type |
TRILL报文 |
Ingress节点:二层报文基于src-mac、dst-mac、vlan;三层报文基于src-ip、dst-ip、l4-src-port、l4-dst-port |
src-mac、dst-mac、src-ip、dst-ip、l4-src-port、l4-dst-port、protocol |
Transit节点:基于内层的src-mac、dst-mac、vlan、src-ip、dst-ip |
src-mac、dst-mac、vlan、src-ip、dst-ip |
|
Egress节点:基于内层的src-mac、dst-mac、vlan、src-ip、dst-ip |
src-mac、dst-mac、vlan、src-ip、dst-ip |
|
FCoE报文 |
dst-fcid、src-fcid |
dst-fcid、src-fcid |
VXLAN报文 |
Ingress/Egress/Transit节点:l4-src-port |
Ingress/Egress/Transit节点:inner-src-mac、inner-dst-mac、inner-src-ip、inner-dst-ip、inner-l4-src-port、inner-l4-dst-port、inner-protocol、l4-src-port |
操作步骤
- 执行命令system-view,进入系统视图。
- 执行命令load-balance profile profile-name,配置全局负载分担模板,并进入模板视图,其中profile-name是模板名称。
缺省情况下,负载分担模板的缺省值为default。
- 对于L2、IPv4、IPv6、MPLS、VPLS、TRILL、FCoE报文,可以分别配置负载分担模式,以下步骤可不选、选择其一或多选,请根据网络转发报文的实际情况选择。
- 执行命令l2 [ src-mac | dst-mac | vlan | eth-type ] *,配置指定负载分担模板中二层报文(非IP报文)的负载分担模式。
缺省情况下,二层报文(非IP报文)的负载分担模式为src-mac、dst-mac、vlan。
在二层转发中,只有IPv4、IPv6、802.1ah、ARP和CFM报文可以根据eth-type进行负载分担,其他类型的报文不能根据eth-type进行负载分担。
在二层转发中,配置了dot1q-tunnel、vlan-stacking、VLL和VPLS特性的Eth-Trunk接口根据vlan进行负载分担时不生效。
执行命令ip [ src-ip | dst-ip | l4-src-port | l4-dst-port | protocol ] *,配置指定负载分担模板中IPv4报文负载分担模式。
缺省情况下,IPv4报文负载分担模式为src-ip、dst-ip、l4-src-port、l4-dst-port。
执行命令ipv6 [ src-ip | dst-ip | protocol | flow-label ] *,配置指定负载分担模板中IPv6报文负载分担模式。
缺省情况下,IPv6报文负载分担模式为src-ip、dst-ip、l4-src-port、l4-dst-port。
配置IPv6报文按照传输层源端口和传输层目的端口负载分担和配置IPv4报文的一致,命令按照ip [ l4-src-port | l4-dst-port ] *进行配置。
- 执行命令mpls [ 2nd-label | 3rd-label | top-label ] *或者mpls [ src-ip | dst-ip | l4-src-port | l4-dst-port ] *,配置指定负载分担模板中的MPLS报文负载分担模式。
缺省情况下,MPLS报文负载分担模式为top-label、2nd-label、内层IP头相关字段(ipv4或ipv6:src-ip、dst-ip、l4-src-port和l4-dst-port)。
在Underlay网络为IPv6类型的情况下,设备使能IPv6 VXLAN功能且设备作为MPLS网络的Transit/Egress节点时,负载分担模板中原有相关MPLS报文内层Hash字段配置均不生效,且在该场景下无法通过执行mpls inner-type { ipv4 | ipv6 | l2 | any }命令来修改负载分担模板中MPLS报文的Hash方式,此时可执行mpls [ inner-ip | inner-ipv6 ] *命令来指定负载分担模板中MPLS报文内层源目的IP字段进行Hash。
- mpls [ inner-ip | inner-ipv6 ] *命令仅支持在使能IPv6 VXLAN功能后配置,且不支持对VPLS报文进行HASH。若去使能IPv6 VXLAN功能时,设备会联动删除mpls [ inner-ip | inner-ipv6 ] *相关配置。
- 对于CE12800系列交换机,如果设备收到包含4层或多于4层标签的MPLS报文,不支持根据内层IP头进行Eth-Trunk或ECMP的负载分担。配置assign forward segment-routing hash enhanced命令后,支持对标签栈最大深度为5的报文进行Eth-Trunk或ECMP的负载分担。
- 对于CE12800系列交换机,在隐式空标签去使能且外层标签弹出后使用内层标签转发场景下(如跨域VPN-OptionB和跨域VPN-OptionC的ASBR节点),基于MPLS报文内层字段的ECMP和Eth-Trunk负载分担会出现Hash乱序。
- mpls [ inner-ip | inner-ipv6 ] *命令仅对FD(仅CE-L16CQ-FD)/FD1/FG/FG1/SD系列单板生效。
- 执行命令user-defined ethernet-over-mpls [ dot1q-tag tag-number ] { inner-sip sip-offset sip-nybble-number | inner-dip dip-offset dip-nybble-number } *,在VPLS Transit节点设备上VPLS报文的出Eth-Trunk接口上,配置根据VPLS报文内层IP进行负载分担。
- 执行命令user-defined ethernet-over-mpls { inner-ip | inner-ipv6 },在VPLS PE节点设备上VPLS报文的出Eth-Trunk接口上,配置根据VPLS报文内层IP进行负载分担。
如果指定inner-ip参数,需同时配置ip [ src-ip | dst-ip ] *;如果指定inner-ipv6参数,需同时配置ipv6 [ src-ip | dst-ip ] *。否则user-defined ethernet-over-mpls { inner-ip | inner-ipv6 }不生效。
- 执行命令fcoe { dst-fcid | src-fcid } *,配置指定负载分担模板中FCoE报文负载分担模式。
缺省情况下,FCoE报文负载分担模式为dst-fcid、src-fcid。
- 执行命令trill egress mode { l2 | ipv4 | ipv6 },配置指定负载分担模板中对于TRILL网络Egress节点和Transit节点的Eth-Trunk负载分担模式。缺省情况下,TRILL网络Egress节点和Transit节点的Eth-Trunk负载分担模式为ipv4。
- l2:仅支持基于源MAC、目的MAC和VLAN进行负载分担,具体根据哪些元素进行负载分担取决于命令l2所配置的负载分担元素。
- ipv4:仅支持基于源MAC、目的MAC、源IPv4地址、目的IPv4地址和VLAN进行负载分担,具体根据哪些元素进行负载分担取决于命令l2和ip所配置的负载分担元素。
- ipv6:仅支持基于源MAC、目的MAC、源IPv6地址、目的IPv6地址和VLAN进行负载分担,具体根据哪些元素进行负载分担取决于命令l2和ipv6所配置的负载分担元素。
执行命令vxlan { inner-src-mac | inner-dst-mac | inner-src-ip | inner-dst-ip | inner-l4-src-port | inner-l4-dst-port | inner-protocol | l4-src-port | shift shift-data } *,配置指定负载分担模板中VXLAN报文的负载分担方式。
缺省情况下,按照VXLAN报文外层UDP源端口号l4-src-port做负载分担。
若VXLAN报文的内层报文为IPv6报文或者VXLAN报文的内层报文携带VLAN Tag,则该命令无法生效。
该命令对以下单板不支持:CE-L48GT-EA、CE-L48GT-EC、CE-L48GS-EA、CE-L48GS-EC、CE-L24XS-BA、CE-L24XS-EA、CE-L48XS-BA、CE-L48XS-EA和CE-L24LQ-EA。建议不要使用这些单板和其他支持该命令的单板混插,避免出现负载分担不均匀的情况。
该命令仅对Egress节点即VXLAN隧道解封装设备生效,且当单板为CE-L48GT-ED、CE-L48GS-ED、CE-L12XS-ED、CE-L24XS-EC、CE-L24XS-ED、CE-L48XT-EC、CE-L48XS-EC、CE-L48XS-ED、CE-L48XS-EF、CE-L02LQ-EC、CE-L06LQ-EC、CE-L12LQ-EF、CE-L24LQ-EC、CE-L24LQ-EC1、CE-L36LQ-EG、CE-L04CF-EC、CE-L04CF-EF、CE-L08CC-EC和CE-L12CF-EG类型单板,该命令仅在VXLAN的NVO3网关增强模式为三层非环回模式时生效。
如果设备上已配置了命令assign forward nvo3 ecmp hash enable、assign forward nvo3 eth-trunk hash disable、或者assign forward nvo3 eth-trunk hash enable,在执行vxlan命令用来设置负载分担模板中VXLAN报文的负载分担方式后,以上配置将失效。
- 执行命令eth-trunk { src-interface | seed seed-data | universal-id universal-id | hash-mode hash-mode-id } *,配置指定负载分担模板中Eth-Trunk的负载分担模式。
报文在三层转发时,不能基于目的MAC、源MAC、VLAN、以太类型进行负载分担。
设备的链路聚合LAG和ECMP共用同一负载分担模板,通过l2、ip、ipv6、mpls命令配置的负载分担方式对LAG和ECMP都生效,而通过命令eth-trunk(load-balance-profile视图)和ecmp(load-balance-profile视图)配置的负载分担方式则分别对LAG和ECMP生效。
当出现LAG和ECMP级联负载分担不均时,可以通过修改universal-id的值或Hash因子来调整。
- 执行命令mode symmetry,使能Eth-Trunk接口同源同宿功能。
缺省情况下,未使能Eth-Trunk接口同源同宿功能。
- 执行命令l2 [ src-mac | dst-mac | vlan | eth-type ] *,配置指定负载分担模板中二层报文(非IP报文)的负载分担模式。
- 执行命令commit,提交配置。
后续处理
模拟计算Eth-Trunk出接口
执行命令display load-balance forwarding-path unicast interface eth-trunk trunk-id src-interface interface-type interface-number { ethtype ethtype-number | vlan vlan-id | src-ip src-ip-data | dst-ip dst-ip-data[ [ src-ip src-ip-data | dst-ip dst-ip-data ] * | [ src-ipv6 src-ipv6-data | dst-ipv6 dst-ipv6-data | flow-label label-data ] * ] | src-mac src-mac-data | dst-mac dst-mac-data | protocol { protocol-number | icmp | igmp | ip | ospf | tcp [ l4-src-port src-port-data | l4-dst-port dst-port-data ] * | udp [ l4-src-port src-port-data | l4-dst-port dst-port-data ] * } } * slot slot-id,用来查看输入包含指定五元组信息以及源MAC地址、目的MAC地址的报文后,模拟计算报文的出接口。
检查配置结果
执行命令display port forwarding-path { src-ip src-ip-data | dst-ip dst-ip-data | src-mac src-mac-data | dst-mac dst-mac-data | protocol { protocol-number | gre | icmp | igmp | ip | ipinip | ospf | tcp [ l4-src-port src-port-data | l4-dst-port dst-port-data ] * | udp [ l4-src-port src-port-data | l4-dst-port dst-port-data ] * } } * [ enhanced ],查看包含指定五元组信息以及源MAC地址、目的MAC地址的报文的出接口。
执行命令display port forwarding-path mpls { { src-ip src-ip-data [ ip-mask-len | source-ip-mask ] | dst-ip dst-ip-data [ ip-mask-len | dst-ip-mask ] } * | { src-ipv6 src-ipv6-data [ ipv6-mask-len ] | dst-ipv6 dst-ipv6-data [ ipv6-mask-len ] } * }{ transit label-number labelnum | ingress | egress label-number labelnum },用来查看MPLS报文中包含指定内层源IP地址、目的IP地址、角色、标签层数等信息的报文的出接口。
对于MPLS报文,仅FD/FDA/FD1/FG/FG1/SD系列单板支持显示查询结果。