enhanced-hash-key
语法
enhanced-hash-key { family any { incoming-interface-index; no-tunnel-payload; } family inet { gtp-tunnel-endpoint-identifier; l2tp-tunnel-session-identifier; incoming-interface-index; no-destination-port; no-source-port; type-of-service; } family inet6 { gtp-tunnel-endpoint-identifier; incoming-interface-index; no-destination-port; no-source-port; traffic-class; } family mpls { ether-pseudowire { zero-control-word; } incoming-interface-index; label-1-exp; no-ether-pseudowire; no-labels; no-payload; } family multiservice { incoming-interface-index; no-mac-addresses; no-payload; outer-priority; source-mac; no-destination-mac; } services-loadbalancing { family inet { layer-3-services { destination-address; incoming-interface-index; source-address; } } family inet6 { layer-3-services { destination-address; incoming-interface-index; source-address; src-prefix-len; } } } symmetric; }
语法(EX 系列)
enhanced-hash-key { ecmp-dlb { assigned-flow; per-packet; flowlet inactivity-interval; ether-type (ipv4|ipv6|mpls); } ecmp-resilient-hash; fabric-load-balance { flowlet { inactivity-interval interval; } per-packet; } hash-mode { layer2-header; layer2-payload; } family inet { no-ipv4-destination-address; no-ipv4-source-address; no-l4-destination-port; no-l4-source-port; no-protocol; vlan-id; } family inet6 { no-ipv6-destination-address; no-ipv6-source-address; no-l4-destination-port; no-l4-source-port; no-next-header; vlan-id; } layer2 { no-destination-mac-address; no-ether-type; no-source-mac-address; vlan-id; } }
语法(QFX5000 系列交换机)
enhanced-hash-key { conditional-match name { offset1 { base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); matchdata1 matchdata1; matchdata1-mask matchdata1-mask; offset1-value offset1-value; } offset2 { base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); matchdata2 matchdata2; matchdata2-mask matchdata2-mask; offset2-value offset2-value; } offset3 { base-offset3 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); matchdata3 matchdata3; matchdata3-mask matchdata3-mask; offset3-value offset3-value; } offset4 { base-offset4 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); matchdata4 matchdata4; matchdata4-mask matchdata4-mask; offset4-value offset4-value; } } ecmp-dlb { assigned-flow; per-packet; flowlet inactivity-interval; ether-type (ipv4|ipv6|mpls); } ecmp-resilient-hash; fabric-load-balance { flowlet { inactivity-interval interval; } per-packet; } flex-hashing name { ethtype { inet { conditional-match conditional-match; hash-offset { offset1 { base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset1-mask offset1-mask; offset1-value offset1-value; offset2 { base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset2-mask offset2-mask; offset2-value offset2-value; } } } interface interface; } inet6 { conditional-match conditional-match; hash-offset { offset1 { base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset1-mask offset1-mask; offset1-value offset1-value; offset2 { base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset2-mask offset2-mask; offset2-value offset2-value; } } } interface interface; } mpls { conditional-match conditional-match; hash-offset { offset1 { base-offset1 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset1-mask offset1-mask; offset1-value offset1-value; offset2 { base-offset2 (start-of-L2Header | start-of-L3-InnerHeader | start-of-L3-OuterHeader | start-of-L4-Header); offset2-mask offset2-mask; offset2-value offset2-value; } } } interface interface; num-labels num-labels; } } } hash-mode { layer2-header; layer2-payload; gtp-header-offset offset-value; } hash-parameters { ecmp { function { (crc16-bisync | crc16-ccitt | crc32-hi | crc32-lo); } offset offset; preprocess; } lag { function { (crc16-bisync | crc16-ccitt | crc32-hi | crc32-lo); } offset offset; preprocess; } } family inet { gtp-tunnel-endpoint-identifier; no-incoming-port; no-ipv4-destination-address; no-ipv4-source-address; no-l4-destination-port; no-l4-source-port; no-protocol; vlan-id; } family inet6 { no-incoming-port; no-ipv6-destination-address; no-ipv6-source-address; no-l4-destination-port; no-l4-source-port; no-next-header; vlan-id; } layer2 { no-destination-mac-address; no-ether-type; no-source-mac-address; vlan-id; } symmetric-hash { inet; inet6; } } vxlan { no-inner-payload; }
语法(QFX10000 系列交换机)
enhanced-hash-key { hash-seed seed-value; family inet { gtp-tunnel-endpoint-identifier; no-ipv4-destination-address; no-ipv4-source-address; no-l4-destination-port; no-l4-source-port; no-incoming-port; } family inet6 { gtp-tunnel-endpoint-identifier; ipv6-flow-label; no-ipv6-destination-address; no-ipv6-source-address; no-l4-destination-port; no-l4-source-port; no-incoming-port; } layer2 { destination-mac-address inner-vlan-id; no-ether-type; no-vlan-id; source-mac-address; } no-mpls; gre { key; protocol; } vxlan-vnid } }
语法(SRX5000 系列路由器))
enhanced-hash-key { family inet { gtp-tunnel-endpoint-identifier; incoming-interface-index; l2tp-tunnel-session-identifier; session-id; type-of-service; } family inet6 { gtp-tunnel-endpoint-identifier; incoming-interface-index; no-flow-label; session-id; traffic-class; } layer2 { destination-mac-address inner-vlan-id; no-ether-type; no-vlan-id; source-mac-address; } no-mpls; gre { key; protocol; } vxlan-vnid } }
语法(Junos OS 演化版)
enhanced-hash-key { family any { incoming-interface-index; no-tunnel-payload; } family inet { gtp-tunnel-endpoint-identifier; no-destination-port; no-source-port; type-of-service; } family inet6 { gtp-tunnel-endpoint-identifier; no-destination-port; no-flow-label; no-source-port; traffic-class; } family mpls { label-1-exp; no-labels; no-payload; } family multiservice { no-payload; } hash-seed; } resilient-hash-seed; } }
语法 Junos OS 演化版(QFX5220 和 QFX5130)
enhanced-hash-key { ecmp-resilient-hash; family inet { no-incoming-device; no-incoming-port; no-ipv6-destination-address; no-ipv6-source-address; no-l4-destination-port; no-l4-source-port; no-protocol; vlan-id; } family inet6 { no-incoming-device; no-incoming-port; no-ipv6-destination-address; no-ipv6-source-address; no-l4-destination-port; no-l4-source-port; no-nxt-hdr; vlan-id; } hash-mode { layer2-header; layer2-payload; } layer2 { no-destination-mac-address; no-ether-type; no-incoming-device; no-incoming-device; no-smac-address; vlan-id; } hash-parameters { ecmp { function { (crc16-bisync | crc16-ccitt | crc32-hi | crc32-lo); } offset offset; preprocess; } lag { function { (crc16-bisync | crc16-ccitt | crc32-hi | crc32-lo); } offset offset; preprocess; } } }
语法 Junos OS 演化版 (QFX5240)
enhanced-hash-key { ecmp-dlb { flowlet { reassignment prob-threshold <value>; reassignment quality-delta <value>; } } }
层次结构级别
[edit forwarding-options], [edit logical-systems logical-system-name routing-instances instance-name forwarding-options], [edit routing-instances instance-name forwarding-options]
Junos OS 演化版使用命令而不是 set
edit
.
描述
配置用于对链路聚合组 (LAG) 和等价多路径 (ECMP) 流量进行哈希处理的哈希密钥,或在虚拟机箱交换矩阵 (VCF) 中启用自适应负载平衡 (ALB)。在QFX5240设备上,仅配置用于对链路聚合组 (LAG) 和等价多路径 (ECMP) 流量进行哈希处理的哈希密钥。
从 Junos OS 版本 14.1X53-D46、15.1R7、16.1R6、17.1R3、17.2R2、17.3R2 和 17.4R1 开始,ALB 功能已弃用。如果在 VCF 的配置中启用了,请在 fabric-load-balance
升级 Junos OS 时删除配置项。
散列算法用于在启用 ECMP 时,对进入 LAG 束的流量或退出交换机的流量做出流量转发决策。
对于 LAG 捆绑包,散列算法确定如何将进入 LAG 捆绑包的流量放置在捆绑包的成员链路上。散列算法尝试通过均衡捆绑包中成员链路上所有传入流量的负载来管理带宽。
启用 ECMP 后,散列算法将确定如何将传入流量转发到下一跃点设备。
计算出的哈希不仅用于选择 ECMP 路径,还用于负载平衡。从 Junos OS 18.3R1 版开始, flow-label field
IPv6、GRE 和 PPPoE 数据包的哈希计算中默认包含例如,当您让 MX 路由器作为指定路由器 (DR) 或集合点 (RP) 运行,并希望基于单个第 3 层或第 4 层流量对流量进行负载均衡时,这可能非常有用。您可以通过设置选项 no-flow-label
恢复到以前的哈希计算方法。
-
对于 GRE 数据包,如果外部 IP 数据包是非选项数据包,内部数据包是 IPv4 或 IPv6,则内部数据包中的源和目标 IP 地址将包含在哈希计算中。
如果内部 IP 数据包的协议是 TCP 或 UDP,并且内部 IP 数据包不是选项数据包,则第 4 层端口也将包含在哈希计算中。
如果外部 IP 数据包是非选项数据包,而内部数据包是 MPLS,则顶部内部标签将包含在哈希计算中。
-
对于 PPPoE 数据包,如果内部数据包是 IPv4 或 IPv6,则内部数据包中的源和目标 IP 地址将包含在哈希计算中。
如果内部 IP 数据包的协议是 TCP 或 UDP,而内部 IP 数据包是非选项数据包,则散列计算中包含第 4 层端口。
对于带 MPC 的 MX 系列路由器、带 5 类 FPC 的 T4000 路由器、EX9200 交换机和 PTX10008 路由器,请选择哈希密钥中使用的数据以增强型 IP 转发引擎。
默认情况下,MPC 使用以下参数进行哈希处理:
-
源 IP 地址
-
目标 IP 地址
-
第 3 层协议
-
源端口
-
目标端口
-
仅适用于 GRE 数据包的通用路由封装 (GRE)。
您可以通过在层次结构级别配置语句 [edit forwarding-options enhanced-hash-key]
来修改 MPC 和 5 类 FPC 上的默认散列机制。
-
在 QFX10000 系列交换机上,您可以配置哈希种子以实现负载平衡。默认情况下,QFX10000 系列交换机使用系统 MAC 地址生成散列种子值。您可以在 [
edit forwarding-options enhanced-hash-key
] 层次结构级别使用该语句配置hash-seed哈希种子值。设置一个介于 0 和 4294967295 之间的值。如果未配置哈希种子值,系统将根据系统 MAC 地址生成哈希种子值。 -
从 Junos OS 18.4R1 版开始,QFX10000 系列交换机支持对称散列。您可以在 [编辑转发选项增强哈希键] 层次结构下配置该
no-incoming-port
选项。默认情况下,目标 IP (DIP)、SIP、第 4 层源端口和目标端口以及传入端口用于散列。只能在全局级别配置对称哈希。
在 QFX5000 系列交换机上,当配置中包含enhanced-hash-key
组播数据包时vlan-id
,组播数据包将被复制或丢弃。因此,在配置 enhanced-hash-key
时,您必须在不配置 vlan-id
的情况下配置 layer2-payload
和 layer2-header
选项。此行为仅在组播流量中可见。
-
从 Junos OS 19.4R1 版开始,QFX5120-32C 和 QFX5120-48Y 交换机支持 ECMP 上的动态负载平衡 (DLB)。您可以在 [编辑转发选项增强哈希键] 层次结构下配置该
ecmp-dlb
选项。有关更多详细信息 ,请参阅动态负载平衡 。 -
要在交换机QFX5000线上启用对称散列,请配置该
symmetric-hash
选项。
通过为配置的设置实施控制路径以到达服务处理卡 (SPC2) 和 SPC3,SRX5000路由器上支持增强型哈希密钥。您可以配置该 session-id
选项以启用已配置设置的控制路径以到达服务处理单元 (SPU)。
有关更多详细信息,请参阅 CLI 资源管理器。
默认
在 PTX 中,与 MX(类似于 QFX)相比,用于哈希计算的源和目标 mac 地址选项不同。QFX 排除了哈希计算的默认 MAC 地址字段,而 PTX 包含目标 MAC,但不包括源 MAC。
选项
services-loadbalancing
— 当安装了指向多个服务 PIC 的路由时,根据源 IP 地址在 PIC 之间分配流量。
symmetric
— 在聚合以太网接口之间启用对称负载平衡。仅在基于 Trio 的 MPC 上需要此选项。
数据 services-loadbalancing
选择 :
-
inet
—IPv4 寻址协议。 -
inet6
— IPv6 寻址协议。 -
layer-3-services
— 在哈希密钥中包含第 3 层 IP 数据。 -
incoming-interface-index
— 在哈希键中包含传入接口索引。 -
source-address
- 在哈希键中包含源地址。 -
destination-address
- 在哈希键中包含目标地址。 -
src-prefix-len
- 在哈希键中包含源前缀长度。
系列 any
的数据选择:
-
incoming-interface-index
—(仅限PTX10008)在哈希键中包含传入接口索引。 -
no-tunnel-payload
—(PTX10001-36MR、仅限PTX10004、PTX10008和PTX10016)从哈希键中省略隧道有效负载数据。
系列 inet
的数据选择:
-
gtp-tunnel-endpoint-identifer— 在 GPRS 隧道协议 (GTP) 流量的哈希密钥中包含隧道端点标识符 (TEID) 字段。
注意:此选项仅在带有 MPC 的 MX 系列路由器和 MX80 路由器上受支持。
-
incoming-interface-index
— 在哈希键中包含传入接口索引。 -
no-destination-port
— 省略哈希密钥中的 IP 目标端口。 -
no-source-port
— 省略哈希密钥中的 IP 源端口。 -
type-of-service
- 在哈希键中包含服务类型 (TOS) 字节。
系列 inet6
的数据选择:
-
gtp-tunnel-endpoint-identifer— 在 GPRS 隧道协议 (GTP) 流量的哈希密钥中包含隧道端点标识符 (TEID) 字段。
注意:此选项仅在带有 MPC 的 MX 系列路由器和 MX80 路由器上受支持。
-
incoming-interface-index
— 在哈希键中包含传入接口索引。 -
no-destination-port
— 省略哈希键中的 IP 目标端口。 -
no-source-port
— 省略哈希密钥中的 IP 源端口。 -
traffic-class
— 在哈希键中包含流量类字节。
系列 mpls
的数据选择:
-
ether-pseudowire
— 以太网伪线负载平衡 IP。有效负载中存在零控制字表示以太网帧。 -
incoming-interface-index
— 在哈希键中包含传入接口索引。 -
label-1-exp
- 第一个标签的 EXP 位用于哈希计算。 -
no-ether-pseudowire
— 从哈希密钥中省略以太网伪线有效负载数据(仅限带 MPC 的 MX 系列路由器)。 -
no-labels
— 从哈希键中省略 MPLS 标签(仅限PTX10008)。 -
no-payload
— 从哈希键中省略 MPLS 有效负载数据。
系列 multiservice
的数据选择:
-
incoming-interface-index
— 在哈希键中包含传入接口索引。 -
no-mac-addresses
— 从哈希键中省略源和目标 MAC 地址。 -
no-payload
- 从哈希键中省略有效负载数据。 -
outer-priority
- 在哈希键中包含外部 802.1 优先级位。 -
source-mac
— 在哈希键中包含源 MAC 地址 -
no-destination-mac
— 排除哈希键中的目标 MAC 地址。
所需权限级别
接口 — 在配置中查看此语句。
接口控制 — 将此语句添加到配置中。
发布信息
Junos OS 10.1 版中引入的语句。
services-loadbalancing
Junos OS 11.2 版中引入的语句。
gtp-tunnel-endpoint-identifier
Junos OS 13.2 版中引入的语句
Junos OS 14.1X53-D10 版中引入的 fabric-load-balance
语句。
从 fabric-load-balance
Junos OS 版本 14.1X53-D46、15.1R7、16.1R6、17.1R3、17.2R2、17.3R2 和 17.4R1 开始,该语句已弃用。
Junos OS 15.1X53-D30 版中引入的 hash-seed
语句。
ether-pseudowire
在适用于 M 系列、MX 系列和 PTX 系列的 Junos OS 16.1 版中引入的语句。
l2tp-tunnel-session-identifier
Junos OS 17.2 版中引入的语句
从 Junos OS 18.3R1 版开始,IPv6、GRE 和 PPPoE 数据包哈希计算的默认行为是包含流标签字段,以便在某些情况下改进负载平衡。使用该 no-payload
选项可恢复到以前的哈希计算方法。
Junos OS 19.4R1 版中为 QFX5120-32C 和 QFX5120-48Y 交换机引入的 ecmp-dlb
语句。
Junos OS 20.4R1 版中引入的选项 symmetric-hash
。
Junos OS 演化版 21.3R1 中引入的语句。
该 ecmp-dlb
语句在适用于 EX4400-24T、EX4400-24X 和 EX-4400-48F 交换机的 Junos OS 23.2R1 版中引入。
ecmp-dlb
Junos Evolved 22.2X100-D20 版中针对 QFX5240 交换机引入的反应式路径再平衡声明。