在聚合以太网接口上实现负载平衡
SUMMARY 在聚合以太网接口上实现负载平衡,可将流量划分到多个接口之间,从而减少网络拥塞。
将多个物理聚合以太网接口捆绑在一起以形成单个逻辑接口时,称为链路聚合。链路聚合可增加带宽,在发生故障时提供平滑降级,提高可用性并提供负载平衡功能。负载平衡使设备能够沿着多个接口划分传入和传出流量,从而减少网络拥塞。本主题介绍负载平衡以及如何在设备上配置负载平衡。
负载平衡和以太网链路聚合概述
可以为一组以太网端口创建链路聚合组 (LAG)。第 2 层桥接流量在这组的成员链路中进行了负载均衡,因此配置对于拥塞问题以及冗余很有吸引力。您可以在 M 系列和 T 系列路由器上配置多达 128 个 LAG 束,在 MX 系列路由器和 EX9200 交换机上配置多达 480 个 LAG 束。每个 LAG 束最多包含 16 个链路。(平台是否支持取决于安装中的 Junos OS 版本。)
默认情况下,跨 LAG 接口的散列密钥机制基于第 2 层字段(如帧源和目标地址)和第 3 层字段以及输入 逻辑接口 (单元)。默认 LAG 算法已针对第 2 层交换进行了优化。从 Junos OS 10.1 版开始,您还可以将第 2 层流量的负载平衡散列密钥配置为使用 payload
语句在第 3 层和第 4 层标头中的字段。但是,请注意,负载平衡行为特定于平台,并且基于适当的散列密钥配置。
有关更多信息,请参阅 在 LAG 链路上配置负载平衡。在第 2 层交换机中,一条链路被过度利用,其他链路未充分利用。
了解聚合以太网负载平衡
链路聚合功能用于捆绑多个物理聚合以太网接口,以形成一个逻辑接口。将一个或多个链路聚合在一起,形成虚拟链路或链路聚合组 (LAG)。MAC 客户端将此虚拟链路视为单个链路。链路聚合可增加带宽,在发生故障时提供平滑降级并提高可用性。
除了这些优势外,对聚合以太网捆绑包进行了增强,以提供负载平衡功能,确保聚合以太网捆绑包的成员链路中的链路利用率得到充分有效地利用。
负载平衡功能允许设备沿着多个路径或接口划分传入和传出流量,以减少网络拥塞。负载平衡可提高各种网络路径的利用率,并提供更有效的网络带宽。
通常,使用负载平衡的应用程序包括:
聚合接口(第 2 层)
聚合接口(对于聚合以太网,也称为 AE,对于聚合 SONET 称为 AS)是用于在两台设备之间的多个接口之间实现负载平衡的第 2 层机制。由于这是第 2 层负载平衡机制,因此每一端的所有单独组件链路都必须位于同一两台设备之间。Junos OS 支持以太网和 SONET 的非信号(静态)配置,以及用于通过以太网链路进行协商的 802.3ad 标准化 LACP 协议。
等价多路径 (ECMP)(第 3 层)
默认情况下,当活动路由的同一目标存在多个等价路径时,Junos OS 使用散列算法选择要安装在转发表中的下一跃点地址。每当目标下一跃点集以任何方式发生变化时,下一跃点地址将使用散列算法重新选择。还有一个选项,允许在转发表中安装多个下一跃点地址,称为按数据包负载平衡。
ECMP 负载平衡可以是:
跨 BGP 路径(BGP 多路径)
在 BGP 路径中,跨多个 LSP
在复杂的以太网拓扑中,流量增加会导致流量失衡,而负载平衡变得具有挑战性,原因如下:
通过聚合下一跃点实现负载均衡不正确
数据包散列计算不正确
数据包流差异不足
模式选择不正确
由于流量失衡,负载分布不畅,导致某些链路拥塞,而其他一些链路则无法有效利用。
为了克服这些挑战,Junos OS 提供了以下解决方案来解决聚合以太网捆绑包 (IEEE 802.3ad) 上真正的流量不平衡问题。
自适应负载平衡
自适应负载平衡使用反馈机制来纠正真正的流量不平衡。为了纠正不平衡权重,对链路的带宽和数据包流进行调整,以在 AE 捆绑包中的链路之间实现高效的流量分配。
要配置自适应负载平衡,请在层级添加语句
adaptive
[edit interfaces aex aggregated-ether-options load-balance]
。注:如果在聚合以太网接口上配置 VLAN ID,则不支持自适应负载平衡。此限制仅影响 PTX 系列数据包传输路由器和 QFX10000 交换机。
要以百分比配置容差值,请在
tolerance
层级添加可选关键字[edit interfaces aex aggregated-ether-options load-balance adaptive]
。要基于每秒数据包数(而非默认位/秒设置)配置自适应负载平衡,请在
pps
层级添加可选关键字[edit interfaces aex aggregated-ether-options load-balance adaptive]
。要基于最后两秒的采样率配置散列值扫描间隔,请在
scan-interval
层级添加可选关键字[edit interfaces aex aggregated-ether-options load-balance adaptive]
。注:仅在
pps
PTX 系列数据包传输路由器上支持和scan-interval
可选关键词。按数据包随机喷洒负载平衡
当自适应负载平衡选项失败时,按数据包随机喷发负载平衡是最后的手段。它可确保 AE 捆绑包的成员均等加载,而无需考虑带宽。每个数据包会导致数据包重新订购,因此只有在应用同意重新订购的情况下,才建议使用。按数据包随机喷洒可消除因软件错误而导致的流量失衡(数据包散列除外)。
要配置按数据包的随机喷发负载平衡,请在
per-packet
层级添加语句[edit interfaces aex aggregated-ether-options load-balance]
。
聚合以太网负载平衡解决方案相互排斥。配置多个负载平衡解决方案后,最后配置的解决方案将覆盖之前配置的解决方案。您可以通过发出命令来验证正在使用的 show interfaces aex aggregated-ether-options load-balance
负载平衡解决方案。
另请参阅
对使用 5 元数据的聚合以太网接口进行有状态负载平衡
当多个流从聚合以太网 (ae
) 接口中传输时,这些流必须均匀分布在不同的成员链路上,才能实现有效和最佳的负载平衡行为。为了获得一种精简且可靠的负载平衡方法,每次用于负载平衡的聚合以太网接口捆绑包的成员链路都发挥着重要作用。在早于 13.2R1 版的 Junos OS 版本中,在具有基于 Trio 的 FPC (MPC) 的 MX 系列路由器上,使用平衡模式下一跃点选择方法以及成员链路或下一跃点选择方法,以选择接口捆绑中的成员链路 ae
或下一跃点(或下一跃点单列表)链路。如果需要选择 2 个(2 个升至 unilist 中 n 个下一跃点的功率)中的一个,则链路选择的平衡模式会使用预先计算的哈希值中的 “n” 位。成员链路或下一跃点选择的不平衡模式使用预计算散列中的 8 位来选择选择表中的条目,这使用链路聚合组 (LAG) 或 ae
捆绑包的成员链路 ID 随机完成。
“平衡”与“不平衡”这一术语表示选择器表是否用于负载平衡机制。LAG 束使用不平衡模式(选择或表平衡)来平衡成员链路之间的流量。当流量最小时,不平衡模式可能会出现以下问题:链路选择逻辑仅利用预计算散列的子集位。无论散列算法的效率如何,它只是流的压缩表示。由于流间差异非常低,因此计算所得散列和子集无法提供有效利用所有 LAG 成员链路所需的变化。散列计算和选择器表中也存在过多的随机性。因此,当流数较低时,对于选择的每个子链路,其作为最佳负载平衡技术的偏差就越高。
每个子链路的偏差定义为
Vi = ((Ci - (M/N)))/N
其中
Vi 表示子链路“i”的偏差。
我表示子链路成员/索引。
Ci 表示为该子链路 “i” 传输的数据包。
M 表示该 LAG 捆绑包上传输的总数据包数。
N 表示该 LAG 中的子链路数量。
由于存在这些缺点,对于数量较少的流或流间差异较少的流,链路利用率会倾斜,并且存在几个子链路完全未利用的概率很高。从 Junos OS 13.2R1 版开始,带有 MPC 的 MX 系列路由器(MPC3E 和 MPC4E 除外)引入了执行统一负载平衡以及执行重新平衡的功能。当负载平衡因流数的变化而倾斜或扭曲时,不支持重新平衡。
添加记录和保留流状态并相应地分配流量负载的机制。因此,对于 m 个流数,这些流分布在 LAG 捆绑包的 n 个成员链路中或 ECMP 链路中的下一跃点单列表中。这种在成员链路之间拆分负载的方法称为 有状态负载平衡 ,它使用 5 元信息(源和目标地址、协议、源和目标端口)。这种方法可以直接映射到流,或映射到基于流中某些字段的预计算哈希。因此,在每个子链路上观察到的偏差都减少了。
此机制仅适用于最少数量的流(大约少于数千个流)。对于更多数量的流(1000 到 10,000 个流之间),建议使用基于 Trio 的分布式负载平衡机制。
考虑一个示例场景,其中 LAG 中的 “n” 链路标识为 0 到 n-1 的链路标识。哈希表或流表用于记录流显示时。散列密钥使用可唯一标识流的字段构造。查找结果可识别流当前使用的link_id。对于每个数据包,检查基于流标识符的流表。如果找到匹配项,则表示属于之前处理或检测到的流的数据包。链路 ID 与流相关联。如果未找到匹配项,则为属于该流的第一个数据包。链路 ID 用于选择链路,并将流插入到流表中。
要基于散列值启用每流的负载平衡,请将语句per-flow
[edit interfaces aeX unit logical-unit-number forwarding-options load-balance-stateful]
包含在层次结构级别。默认情况下,当存在多个等价路径时,Junos OS 仅使用基于目标地址的散列方法来选择转发下一跃点。默认情况下,所有数据包转发引擎插槽的哈希值都相同。要配置负载平衡算法以使用现有参数动态重新平衡 LAG,请在 rebalance interval
层级添加语句 [edit interfaces aeX unit logical-unit-number forwarding-options load-balance-stateful]
。参数通过在重新平衡间隔内跨所有入口数据包转发引擎 (PFE) 提供同步的再平衡切换,定期对流量进行负载平衡。您可以将间隔指定为每分钟 1 到 1000 个流范围内的值。要配置负载类型,请在 load-type (low | medium | high)
层级添加语句 [edit interfaces aeX unit logical-unit-number forwarding-options load-balance-stateful]
。
该 stateful per-flow
选项可在 AE 捆绑包上实现负载平衡功能。选项按 rebalance
指定间隔清除负载平衡状态。该 load
选项会通知数据包转发引擎要使用的适当内存模式。如果在此聚合以太网接口上流动的流数量较少(在 1 到 100 个流之间),则可以 low
使用此关键词。同样,对于相对较高的流(在 100 到 1000 个流之间), medium
可以使用关键字, large
而关键字可用于最大流(在 1000 到 10,000 个流之间)。用于为每个关键词实现有效负载平衡的大致流数是衍生信息。
命令清除 clear interfaces aeX unit logical-unit-number forwarding-options load-balance state
硬件级别的负载平衡状态,并支持从已清理的空状态重新平衡。仅当使用此命令时,才会触发此明确状态。命令将 clear interfaces aggregate forwarding-options load-balance state
清除所有聚合以太网接口负载平衡状态,然后重新创建它们。
为分段以太网接口或 LAG 捆绑包配置有状态负载平衡的准则
为聚合以太网接口配置状态负载平衡时,请记住以下几点:
移除或添加子链路后,将选择新的聚合选择器,并将流量流向新选择器。由于选择器为空,流已填充在选择器中。此行为会导致流重新分配,因为旧状态会丢失。这是没有启用有状态的每流负载平衡的现有行为。
如果传入的流量到达 MPC1E、MPC2E、MPC3E-3D、MPC5E 和 MPC6E 线卡,则 AE 接口上具有按流的有状态负载均衡功能。任何其他类型的线卡都不会影响此功能。如果 MPC 不支持此功能,将显示相应的 CLI 错误。
将入口线卡作为 MPC,将出口线卡用作 MPC 或 DPC,此功能可以正常工作。如果入口线卡是 DPC,而出口线卡是 DPC 或 MPC,则不支持有状态负载平衡。
组播流量(本机/泛洪)不支持此功能。
启用重新平衡选项或清除负载平衡状态可能会导致对活动流进行数据包重新订购,因为可以为流量选择不同的链路集。
虽然功能性能很高,但它会消耗大量的线卡内存。大约可以在受支持的 MPC 上启用 4000 个逻辑接口或 16 个聚合以太网逻辑接口。但是,当数据包转发引擎硬件内存较低时,根据可用内存,它会回退到默认负载平衡机制。在这种情况下,系统会生成系统日志记录消息并发送至路由引擎。支持有状态负载平衡的 AE 接口数量不存在限制;该限制由线卡决定。
如果流量经常老化,则设备需要移除或刷新负载平衡状态。因此,您必须配置重新平衡,或定期运行 clear 命令,以便进行适当的负载平衡。否则,可能会发生流量倾斜。当子链路中断或启动时,负载平衡行为不会对现有流进行更改。这种情况是避免数据包重新订购。新流会拾取产生的子链路。如果观察到负载分布效果不太好,则可以清除负载平衡状态,或使用重新平衡功能自动清除硬件状态。配置重新平衡工具时,流量会被重定向到不同链路,这可能会导致数据包重新订购。
在聚合以太网接口上配置有状态负载平衡
添加记录和保留流状态并相应地分配流量负载的机制。因此,对于 m 个流数,这些流分布在 LAG 捆绑包的 n 个成员链路中或 ECMP 链路中的下一跃点单列表中。这种在成员链路之间拆分负载的方法称为 有状态负载平衡 ,它使用 5 元信息(源和目标地址、协议、源和目标端口)。这种方法可以直接映射到流,或映射到基于流中某些字段的预计算哈希。因此,在每个子链路上观察到的偏差都减少了。
要对 ae
接口捆绑包配置有状态的负载平衡:
配置自适应负载平衡
本主题介绍如何配置自适应负载平衡。自适应负载平衡可保持聚合以太网 (AE) 捆绑包的成员链路带宽的有效利用。自适应负载平衡使用反馈机制,通过调整 AE 捆绑包内链路上的带宽和数据包流来纠正流量负载不平衡。
开始之前:
使用协议家族和 IP 地址配置一组接口。这些接口可以组成 AE 捆绑包的成员资格。
通过将一组路由器接口配置为聚合以太网并使用特定的 AE 组标识符,创建 AE 捆绑包。
要为 AE 捆绑包配置自适应负载平衡,请:
另请参阅
在 MX 系列路由器上的 802.3ad 链路聚合组上配置对称负载平衡
MX 系列路由器上的 802.3ad LAG 上的对称负载平衡概述
采用聚合以太网 PIC 的 MX 系列路由器支持在 802.3ad LAG 上实现对称负载平衡。当两台 MX 系列路由器通过 LAG 束上的深度包检测 (DPI) 设备以透明方式连接时,此功能非常重要。DPI 设备会跟踪流量,需要给定流量正向和反向信息。如果不在 802.3ad LAG 上实现对称负载平衡,DVI 可能会误解流,导致流量中断。通过使用此功能,可确保两个方向上相同设备的给定流量(双工)。
802.3ad LAG 上的对称负载平衡利用一种机制来更改源地址和目标地址,以便对字段(如源地址和目标地址)进行散列计算。在这些字段上计算的散列结果用于选择 LAG 的链路。正向流和反向流的散列计算必须相同。这是通过将源字段与反向流的目标字段交换来实现的。交换操作称为 补码哈希计算 ,或 symmetric-hash complement
常规(或未交换)操作称为 对称散列计算 或 symmetric-hash
。可交换字段包括 MAC 地址、IP 地址和端口。
在 MX 系列路由器上的 802.3ad LAG 上配置对称负载平衡
您可以指定是使用对称散列还是补充散列来实现流量负载均衡。要配置对称散列,请在 symmetric-hash
层级使用语句 [edit forwarding-options hash-key family inet]
。要配置对称散列补补,请在 symmetric-hash complement
层级使用语句和选项 [edit forwarding-options hash-key family inet]
。
也可通过指定 散列密钥在 PIC 级别执行这些操作。要配置 PIC 级别的散列密钥,请在symmetric-hash
层级和[edit chassis hash-key family multiservice]
层级使用 or symmetric-hash complement
语句[edit chassis hash-key family inet]
。
考虑中的 图 1示例。

路由器 A 配置了对称散列,路由器 B 配置了对称散列补补。因此,对于给定的流 fx,从路由器 A 到路由器 B,再到 i2,后散列计算。同一流的 fx 反向流量是通过其散列(在交换源字段和目标字段后完成)通过同一 i2 设备从路由器 B 到路由器 A,并返回相同的链路索引;因为它是在交换的源地址和目标地址上进行的。
但是,选择的链接可能与连接到 DPI 的链接相对应,也可能不一致。换句话说,散列结果应指向连接的相同链路,以便流量能够双向通过同一 DPI 设备。为了确保发生这种情况,还需要使用相同的链路索引配置对应端口(连接到同一 DPI-iN 的端口)。这是在将子链路配置到 LAG 捆绑包时完成的。这可确保为给定散列结果选择的链路在任一路由器上始终相同。
请注意,任何两个相互连接的链路都应具有相同的链路索引,并且这些链路索引在给定捆绑包中必须是唯一的。
在 MX 系列路由器上的 802.3ad LAG 上配置对称负载平衡时,以下限制适用:
数据包转发引擎 (PFE) 可配置为在对称或补充模式下对流量进行散列。单个 PFE 复合体不能在两种操作模式下同时工作,这种配置可能会产生不良结果。
per-PFE 设置仅覆盖配置的系列的机箱范围设置。对于其他系列,PFE 复杂体仍继承机箱范围设置(配置时)或默认设置。
此功能仅支持 VPLS、INET 和桥接流量。
此功能不能与
per-flow-hash-seed load-balancing
选项协同工作。它要求以补充方式配置的所有 PFE 配合体共享同一种子。两个对应 PFE 复合体之间的种子变化可能会产生意想不到的结果。
有关更多信息,请参阅 适用于路由设备的 Junos OS VPN 库 和 路由设备的 Junos OS 管理库。
示例配置语句
要配置捆绑包级别的 802.3ad LAG 参数:
[edit interfaces] g(x)e-fpc/pic/port { gigether-options { 802.3ad { bundle; link-index number; } } }
link-index number
范围从 0 到 15。
您可以使用命令检查上述 show interfaces
配置的链接索引:
[edit forwarding-options hash-key] family inet { layer-3; layer-4; symmetric-hash { [complement;] } } family multiservice { source-mac; destination-mac; payload { ip { layer-3 { source-ip-only | destination-ip-only; } layer-4; } } symmetric-hash { [complement;] } }
对于基于第 3 层字段的第 2 层流量负载均衡,可以在每个 PIC 级别配置 802.3ad LAG 参数。机箱层次结构下提供这些配置选项,如下所示:
[edit chassis] fpc X { pic Y { . . . hash-key { family inet { layer-3; layer-4; symmetric-hash { [complement;] } } family multiservice { source-mac; destination-mac; payload { ip { layer-3 { source-ip-only | destination-ip-only; } layer-4; } } symmetric-hash { [complement;] } } } . . . } }
在基于 Trio 的 MPC 上配置对称负载平衡
由于配置存在一些差异,具有基于 Trio 的 MPC 的 MX 系列路由器支持通过 802.3ad 链路聚合组实现对称负载平衡。
要对基于 Trio 的 MPC 实现对称负载平衡,需要实现以下几点:
计算对称散列
两个路由器必须从正向和反向流量计算相同的哈希值。在基于 Trio 的平台上,计算得出的散列值与流的方向无关,因此本质上始终是对称的。因此,无需特定配置即可在基于 Trio 的平台上计算对称散列值。
但是,应注意,用于配置哈希的字段应具有相同的 LAG 两端包含和排除设置。
配置链路索引
要允许两个路由器使用相同的哈希值选择同一链路,LAG 中的链路必须在两个路由器上配置相同的链路索引。这可以通过语句来实现
link-index
。实现对称负载平衡
若要在基于 Trio 的 MPC 上配置对称负载平衡,请在
symmetric
层级添加语句[edit forwarding-options enhanced-hash-key]
。本声明仅适用于基于 Trio 的平台。该
symmetric
语句可用于任何协议家族,并支持路由器上所有聚合以太网捆绑包的对称负载平衡。语句需要在 LAG 的两端启用。默认情况下,此语句处于禁用状态。实现桥接和路由流量的对称性
在某些部署中,需要对称的 LAG 束由上游方向的第 2 层桥接流量和下游方向的 IPv4 路由流量遍历。在这种情况下,在每个方向上计算的哈希都是不同的,因为桥接数据包会考虑以太网 MAC 地址。为了克服这种情况,您可以从增强型散列密钥计算中排除源和目标 MAC 地址。
要从增强型散列密钥计算中排除源和目标 MAC 地址,请将语句
no-mac-addresses
包含在[edit forwarding-options enhanced-hash-key family multiservice]
层次结构级别。默认情况下,此语句处于禁用状态。
在基于 Trio 的 MPC 上启用对称负载平衡时,请记住以下注意事项:
流量极化是使用使用相同类型散列分配流量的拓扑时会发生的现象。当路由器级联时,可能会发生流量极化,这可能导致不均衡的流量分布。
当在级联路由器上配置 LAG 时,会发生流量极化。例如, 图 2如果某个流在设备 R1 和设备 R2 之间使用聚合以太网捆绑包的链路 1,则流也会在设备 R2 和设备 R3 之间使用聚合以太网捆绑包的链路 1。
图 2: 在基于 Trio 的 MPC 上启用对称负载平衡时,级联路由器上的流量极化这与随机链路选择算法不同,其中流可能会在设备 R1 和设备 R2 之间使用聚合以太网捆绑包的链路 1,以及设备 R2 和设备 R3 之间聚合以太网捆绑包的链路 2。
对称负载平衡不适用于基于路由前缀计算哈希的按前缀的负载均衡。
对称负载平衡不适用于 MPLS 或 VPLS 流量,因为在这些场景中,两个方向的标签都不相同。
配置示例
机箱范围设置配置示例
路由器 A
user@host> show configuration forwarding-options hash-key family multiservice { payload { ip { layer-3; } } symmetric hash; }
路由器 B
user@host> show configuration forwarding-options hash-key family multiservice { payload { ip { layer-3; } } symmetric-hash { complement; } }
按数据包转发引擎设置的配置示例
路由器 A
user@host> show configuration chassis fpc 2 pic 2 hash-key family multiservice { payload { ip { layer-3; } } symmetric hash; }
路由器 B
user@host> show configuration chassis fpc 2 pic 3 hash-key family multiservice { payload { ip { layer-3; } } symmetric-hash { complement; } }
配置 PIC 级对称散列,以在 MX 系列路由器的 802.3ad LAG 上实现负载平衡
当两个 MX 系列路由器(例如,路由器 A 和路由器 B)通过 LAG 捆绑包上的深度数据包检测 (DPI) 设备透明连接时,对称散列在 802.3ad 链路聚合组 (LAG) 上的负载平衡很有用。DPI 设备会同时跟踪前进和反向的流量。
如果配置了对称散列,则反向流量也将定向通过 LAG 上的同一子链路,并必然流经同一 DPI 设备。这样可以对正向和反向流中的流量的 DPI 进行正确核算。
如果未配置对称散列,则可能会为通过不同 DPI 设备的反向流量选择 LAG 上不同的子链路。这会导致 DPI 设备上的流量正向和反向流信息不全,导致 DPI 设备对流量的核算不完全。
对称散列是基于源地址和目标地址等字段计算的。您可以在机箱级别和 PIC 级别配置对称散列,以便基于第 2 层、第 3 层和第 4 层数据单元字段为家族 inet(IPv4 协议系列)和多服务(交换机或网桥)流量实现负载平衡。在机箱级别配置的对称散列适用于整个路由器,并由其所有 PIC 和数据包转发引擎继承。配置 PIC 级对称散列在数据包转发引擎级别可为您提供更精细的粒度。
对于通过 LAG 捆绑包通过 DPI 设备连接的两个路由器,您可以在一个路由器上配置,也可以在symmetric-hash complement远程路由器上配置symmetric-hash,反之亦然。
若要在机箱级别配置对称散列,请在 symmetric-hash 层次结构级别添加或 symmetric-hash complement
语句 [edit forwarding-options hash-key family]
。有关在机箱级别配置对称散列和配置链路索引的信息,请参阅 路由设备的 Junos OS 网络接口库和用于路由设备的Junos OS VPN 库。
在 MX 系列 DPC 上,在 PIC 级别配置对称散列是指在数据包转发引擎级别配置对称散列。
若要在入站流量接口的 PIC 级别(流量进入路由器的位置)配置对称散列,请在 symmetric-hash [edit chassis fpc slot-number pic pic-number hash-key] 层次结构级别添加或symmetric-hash complement
语句:
[edit chassis fpc slot-number pic pic-number hash-key] family multiservice { source-mac; destination-mac; payload { ip { layer-3 (source-ip-only | destination-ip-only); layer-4; } } symmetric-hash { complement; } }
family inet { layer-3; layer-4; symmetric-hash { complement; } }
PIC 级对称散列将覆盖在 [edit chassis forwarding-options hash-key] 层次结构级别配置的机箱级别对称散列。
目前仅适用于 VPLS、INET 和桥接流量,支持在 802.3ad 链路聚合组上进行负载平衡的对称散列。
PIC 或数据包转发引擎上的散列密钥配置可以处于“对称散列”或“对称散列补补”模式,但不能同时处于两种模式。
另请参阅
例子:配置 PIC 级对称散列,以平衡 MX 系列路由器上的 802.3ad LAG 的负载
这些示例仅适用于 MX240、MX480 和 MX960 路由器上支持的 DPC。有关支持的 DPC 列表,请参阅“相关文档”一节中的 MX240、MX480 和 MX960 路由器支持的 DPC 。
以下示例说明如何在 PIC 级别配置对称散列,以在 MX 系列路由器上实现负载平衡:
在两个路由器上为家族多服务配置对称散列
在流量进入路由器 A 的入站流量接口上,在 symmetric-hash
层次结构级别添加语句 [edit chassis fpc slot-number pic pic-number hash-key family multiservice]
:
[edit chassis fpc 2 pic 2 hash-key] family multiservice { source-mac; destination-mac; payload { ip { layer-3; layer-4; } } symmetric-hash; }
在流量进入路由器 B 的入站流量接口上,在 symmetric-hash complement
层次结构级别包括语句 [edit chassis fpc slot-number pic pic-number hash-key family multiservice]
:
[edit chassis fpc 0 pic 3 hash-key] family multiservice { source-mac; destination-mac; payload { ip { layer-3; layer-4; } } symmetric-hash { complement; } }
为两个路由器上的家族 inet 配置对称散列
在流量进入路由器 A 的入站流量接口上,在 symmetric-hash
层次结构级别添加语句 [edit chassis fpc slot-number pic pic-number hash-key family inet]
:
[edit chassis fpc 0 pic 1 hash-key] family inet { layer-3; layer-4; symmetric-hash; }
在流量进入路由器 B 的入站流量接口上,在 symmetric-hash complement
层次结构级别包括语句 [edit chassis fpc slot-number pic pic-number hash-key family inet]
:
[edit chassis fpc 1 pic 2 hash-key] family inet { layer-3; layer-4; symmetric-hash { complement; } }
在两个路由器上为家族 inet 和家族多服务配置对称散列
在流量进入路由器 A 的入站流量接口上,在 symmetric-hash
层次结构级别添加语句 [edit chassis fpc slot-number pic pic-number hash-key family multiservice]
:
[edit chassis fpc 1 pic 0 hash-key] family multiservice { payload { ip { layer-3; layer-4; } } symmetric-hash; }
在流量进入路由器 B 的入站流量接口上,在 symmetric-hash complement
层次结构级别包括语句 [edit chassis fpc slot-number pic pic-number hash-key family inet]
:
[edit chassis fpc 0 pic 3 hash-key] family inet { layer-3; layer-4; symmetric-hash { complement; } }
另请参阅
示例:配置聚合以太网负载平衡
示例:配置聚合以太网负载平衡
此示例说明如何配置聚合以太网负载平衡。
要求
此示例使用以下硬件和软件组件:
三个具有 MIC 和 MPC 接口的 MX 系列路由器或三个具有 PIC 和 FPC 接口的 PTX 系列数据包传输路由器
在所有设备上运行的 Junos OS 13.3 或更高版本
概述
当下一跳路由器有多个路径或接口可用时,需要在转发平面上实现负载平衡;最好在所有可用路径上均衡传入流量,以提高链路利用率。
聚合以太网捆绑包是一种典型的应用,它使用负载平衡来平衡捆绑包 (IEEE 802.3ad) 的成员链路的流量。
从 Junos OS 13.3 版开始,聚合以太网负载平衡得到增强,可提供两种解决方案来解决 MIC 或 MX 系列路由器的 MPC 上的聚合以太网捆绑包上的真实流量不平衡。从 Junos OS 14.1 版开始,聚合以太网负载平衡得到增强,可提供两种解决方案来解决 PTX 系列数据包传输路由器的 PIC 或 FPC 上的聚合以太网捆绑包上的真实流量不平衡。
聚合以太网负载平衡解决方案包括:
自适应 — 自适应负载平衡用于基于流的散列不足以实现统一负载分布的情况。这种负载平衡解决方案实施实时反馈和控制机制,以监控和管理网络负载的失衡。
自适应负载平衡解决方案通过修改选择器条目并定期扫描 AE 捆绑包每个成员链路上的链路利用率来纠正流量失衡,以检测任何偏差。检测到偏差时,将触发调整事件,并将更少的流映射到受影响的成员链路。因此,该成员链路提供的带宽会下降。这会产生一个连续的反馈环路,在一段时间内,可确保向所有成员链路提供相同数量的字节速率,从而在 AE 捆绑包中的每个成员链路上提供高效的流量分布。
要配置自适应负载平衡,请在层级添加语句
adaptive
[edit interfaces aex aggregated-ether-options load-balance]
。注:如果在聚合以太网接口上配置 VLAN ID,则不支持自适应负载平衡。此限制仅影响 PTX 系列数据包传输路由器。
该
pps
选项支持基于每秒数据包速率的负载平衡。默认设置为位/秒负载平衡。该值
scan-interval
将扫描时间长度配置为 30 秒的倍数。该值
tolerance
是流向捆绑包中聚合以太网链路的数据包流量中的变化限制。您可以指定最多 100% 的变化。未配置容差属性时,将启用 20% 的默认值,以实现自适应负载平衡。较小的容差值可以平衡更好的带宽,但需要更长的融合时间。注:仅在
pps
PTX 系列数据包传输路由器上支持和scan-interval
可选关键词。按数据包随机喷发 — 当自适应负载平衡解决方案出现故障时,按数据包随机喷发作为最后手段。按数据包随机喷洒负载平衡解决方案可将数据包随机喷洒到聚合下一跃点,从而帮助解决流量失衡问题。这可确保 AE 捆绑包的所有成员链路均等加载,从而导致数据包重新订购。
此外,每个数据包的随机喷雾可以识别导致流量失衡的入口数据包转发引擎,并消除了因软件错误而导致的流量失衡(数据包散列除外)。
要配置按数据包的随机喷发负载平衡,请在
per-packet
层级添加语句[edit interfaces aex aggregated-ether-options load-balance]
。注:PTX 系列数据包传输路由器不支持用于负载平衡的按数据包选项。
聚合以太网负载平衡解决方案相互排斥。配置多个负载平衡解决方案后,最后配置的解决方案将覆盖之前配置的解决方案。您可以通过发出 show interfaces aex aggregated-ether-options load-balance
命令来验证正在实施的负载平衡解决方案。
拓扑
在此拓扑中,R2 和 R3 路由器之间的链路上配置了两个聚合以太网捆绑包(ae0 和 ae1)。

配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
。
R1
set chassis aggregated-devices ethernet device-count 12 set interfaces xe-0/0/0 unit 0 family inet address 120.168.1.1/30 set interfaces xe-0/0/0 unit 0 family iso set interfaces xe-0/0/0 unit 0 family mpls set interfaces xe-0/0/1 unit 0 family inet address 120.168.2.1/30 set interfaces xe-0/0/1 unit 0 family iso set interfaces xe-0/0/1 unit 0 family mpls set interfaces ge-1/0/0 unit 0 family inet address 120.168.100.2/30 set interfaces ge-1/0/0 unit 0 family iso set interfaces ge-1/0/0 unit 0 family mpls set interfaces ge-1/0/1 unit 0 family inet address 120.168.101.2/30 set interfaces ge-1/0/1 unit 0 family iso set interfaces ge-1/0/1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 120.168.0.2/32 set interfaces lo0 unit 0 family iso address 49.0001.1201.6800.0002.00 set routing-options router-id 120.168.0.2 set routing-options autonomous-system 55 set protocols rsvp interface ge-1/0/0.0 set protocols rsvp interface ge-1/0/1.0 set protocols mpls label-switched-path videl-to-sweets to 120.168.0.9 set protocols mpls label-switched-path v-2-s-601 to 60.0.1.0 set protocols mpls label-switched-path v-2-s-601 primary v-2-s-601-primary hop-limit 5 set protocols mpls label-switched-path v-2-s-602 to 60.0.2.0 set protocols mpls label-switched-path v-2-s-602 primary v-2-s-602-primary hop-limit 5 set protocols mpls label-switched-path v-2-s-603 to 60.0.3.0 set protocols mpls label-switched-path v-2-s-604 to 60.0.4.0 set protocols mpls path v-2-s-601-primary 120.168.100.1 strict set protocols mpls path v-2-s-601-primary 120.168.104.2 strict set protocols mpls path v-2-s-602-primary 120.168.101.1 strict set protocols mpls path v-2-s-602-primary 120.168.105.2 strict set protocols mpls interface ge-1/0/0.0 set protocols mpls interface ge-1/0/1.0 set protocols bgp group pe-routers type internal set protocols bgp group pe-routers local-address 120.168.0.2 set protocols bgp group pe-routers family inet unicast set protocols bgp group pe-routers family inet-vpn unicast set protocols bgp group pe-routers neighbor 120.168.0.9 set protocols isis traffic-engineering family inet shortcuts set protocols isis level 1 disable set protocols isis interface ge-1/0/0.0 set protocols isis interface ge-1/0/1.0 set protocols isis interface lo0.0 set policy-options policy-statement nhs then next-hop self set policy-options policy-statement vpn-m5-export term 1 from protocol bgp set policy-options policy-statement vpn-m5-export term 1 from protocol direct set policy-options policy-statement vpn-m5-export term 1 then community add vpn-m5-target set policy-options policy-statement vpn-m5-export term 1 then accept set policy-options policy-statement vpn-m5-export term 2 then reject set policy-options policy-statement vpn-m5-import term 1 from protocol bgp set policy-options policy-statement vpn-m5-import term 1 from community vpn-m5-target set policy-options policy-statement vpn-m5-import term 1 then accept set policy-options policy-statement vpn-m5-import term 2 then reject set policy-options community vpn-m5-target members target:55:100 set routing-instances vpn-m5 instance-type vrf set routing-instances vpn-m5 interface xe-0/0/0.0 set routing-instances vpn-m5 interface xe-0/0/1.0 set routing-instances vpn-m5 route-distinguisher 120.168.0.2:1 set routing-instances vpn-m5 vrf-import vpn-m5-import set routing-instances vpn-m5 vrf-export vpn-m5-export set routing-instances vpn-m5 protocols bgp group ce type external set routing-instances vpn-m5 protocols bgp group ce peer-as 100 set routing-instances vpn-m5 protocols bgp group ce as-override set routing-instances vpn-m5 protocols bgp group ce neighbor 120.168.1.2 set routing-instances vpn-m5 protocols bgp group ce neighbor 120.168.2.2 set routing-instances vpn-m5 protocols ospf domain-id 1.0.0.0 set routing-instances vpn-m5 protocols ospf export vpn-m5-import set routing-instances vpn-m5 protocols ospf area 0.0.0.0 interface xe-0/0/1.0 set routing-instances vpn-m5 protocols ospf area 0.0.0.0 interface xe-0/0/0.0
R2
set chassis aggregated-devices ethernet device-count 5 set interfaces ge-1/2/0 unit 0 family inet address 120.168.100.1/30 set interfaces ge-1/2/0 unit 0 family iso set interfaces ge-1/2/0 unit 0 family mpls set interfaces ge-1/2/1 unit 0 family inet address 120.168.101.1/30 set interfaces ge-1/2/1 unit 0 family iso set interfaces ge-1/2/1 unit 0 family mpls set interfaces ge-1/3/0 gigether-options 802.3ad ae0 set interfaces ge-1/3/1 gigether-options 802.3ad ae0 set interfaces ge-1/3/2 gigether-options 802.3ad ae0 set interfaces ge-1/3/3 gigether-options 802.3ad ae0 set interfaces ge-1/3/4 gigether-options 802.3ad ae0 set interfaces ge-2/2/1 gigether-options 802.3ad ae1 set interfaces ge-2/2/2 gigether-options 802.3ad ae1 set interfaces ge-2/2/3 gigether-options 802.3ad ae1 set interfaces ge-2/2/4 gigether-options 802.3ad ae1 set interfaces ge-2/2/5 gigether-options 802.3ad ae1 set interfaces ge-2/2/6 gigether-options 802.3ad ae1 set interfaces ge-2/2/7 gigether-options 802.3ad ae1 set interfaces ge-2/2/8 gigether-options 802.3ad ae1 set interfaces ae0 aggregated-ether-options load-balance adaptive tolerance 10 set interfaces ae0 aggregated-ether-options link-speed 1g set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 unit 0 family inet address 120.168.104.1/30 set interfaces ae0 unit 0 family iso set interfaces ae0 unit 0 family mpls set interfaces ae1 aggregated-ether-options load-balance adaptive tolerance 10 set interfaces ae1 aggregated-ether-options link-speed 1g set interfaces ae1 aggregated-ether-options lacp active set interfaces ae1 unit 0 family inet address 120.168.105.1/30 set interfaces ae1 unit 0 family iso set interfaces ae1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 120.168.0.4/32 set interfaces lo0 unit 0 family iso address 49.0001.1201.6800.0004.00 set accounting-options selective-aggregate-interface-stats disable set protocols rsvp interface ge-1/2/0.0 set protocols rsvp interface ge-1/2/1.0 set protocols rsvp interface ae0.0 set protocols rsvp interface ae1.0 set protocols mpls interface ge-1/2/0.0 set protocols mpls interface ge-1/2/1.0 set protocols mpls interface ae0.0 set protocols mpls interface ae1.0 set protocols isis traffic-engineering family inet shortcuts set protocols isis level 1 disable set protocols isis interface ge-1/2/0.0 set protocols isis interface ge-1/2/1.0 set protocols isis interface ae0.0 set protocols isis interface ae1.0 set protocols isis interface lo0.0
R3
set chassis aggregated-devices ethernet device-count 5 set interfaces xe-4/0/0 unit 0 family inet address 120.168.9.1/30 set interfaces xe-4/0/0 unit 0 family mpls set interfaces xe-4/0/1 unit 0 family inet address 120.168.10.1/30 set interfaces xe-4/0/1 unit 0 family mpls set interfaces ge-5/0/1 gigether-options 802.3ad ae1 set interfaces ge-5/0/2 gigether-options 802.3ad ae1 set interfaces ge-5/0/3 gigether-options 802.3ad ae1 set interfaces ge-5/0/4 gigether-options 802.3ad ae1 set interfaces ge-5/0/5 gigether-options 802.3ad ae1 set interfaces ge-5/0/6 gigether-options 802.3ad ae1 set interfaces ge-5/0/7 gigether-options 802.3ad ae1 set interfaces ge-5/0/8 gigether-options 802.3ad ae1 set interfaces ge-5/3/0 gigether-options 802.3ad ae0 set interfaces ge-5/3/1 gigether-options 802.3ad ae0 set interfaces ge-5/3/2 gigether-options 802.3ad ae0 set interfaces ge-5/3/3 gigether-options 802.3ad ae0 set interfaces ge-5/3/4 gigether-options 802.3ad ae0 set interfaces ae0 aggregated-ether-options link-speed 1g set interfaces ae0 aggregated-ether-options lacp active set interfaces ae0 unit 0 family inet address 120.168.104.2/30 set interfaces ae0 unit 0 family iso set interfaces ae0 unit 0 family mpls set interfaces ae1 aggregated-ether-options link-speed 1g set interfaces ae1 aggregated-ether-options lacp active set interfaces ae1 unit 0 family inet address 120.168.105.2/30 set interfaces ae1 unit 0 family iso set interfaces ae1 unit 0 family mpls set interfaces lo0 unit 0 family inet address 120.168.0.9/32 set interfaces lo0 unit 0 family iso address 49.0001.1201.6800.0009.00 set routing-options router-id 120.168.0.9 set routing-options autonomous-system 55 set protocols rsvp interface xe-4/0/0.0 set protocols rsvp interface xe-4/0/1.0 set protocols rsvp interface ae0.0 set protocols rsvp interface ae1.0 set protocols mpls label-switched-path to-videl to 120.168.0.2 set protocols mpls interface xe-4/0/0.0 set protocols mpls interface xe-4/0/1.0 set protocols mpls interface ae0.0 set protocols mpls interface ae1.0 set protocols bgp group pe-routers type internal set protocols bgp group pe-routers local-address 120.168.0.9 set protocols bgp group pe-routers family inet unicast set protocols bgp group pe-routers family inet-vpn unicast set protocols bgp group pe-routers neighbor 120.168.0.2 set protocols isis traffic-engineering family inet shortcuts set protocols isis level 1 disable set protocols isis interface ae0.0 set protocols isis interface ae1.0 set protocols isis interface lo0.0 set policy-options policy-statement nhs then next-hop self set policy-options policy-statement vpn-m5-export term 1 from protocol bgp set policy-options policy-statement vpn-m5-export term 1 from protocol direct set policy-options policy-statement vpn-m5-export term 1 then community add vpn-m5-target set policy-options policy-statement vpn-m5-export term 1 then accept set policy-options policy-statement vpn-m5-export term 2 then reject set policy-options policy-statement vpn-m5-import term 1 from protocol bgp set policy-options policy-statement vpn-m5-import term 1 from protocol direct set policy-options policy-statement vpn-m5-import term 1 from community vpn-m5-target set policy-options policy-statement vpn-m5-import term 1 then accept set policy-options policy-statement vpn-m5-import term 2 then reject set policy-options community vpn-m5-target members target:55:100 set routing-instances vpn-m5 instance-type vrf set routing-instances vpn-m5 interface xe-4/0/0.0 set routing-instances vpn-m5 interface xe-4/0/1.0 set routing-instances vpn-m5 route-distinguisher 120.168.0.9:1 set routing-instances vpn-m5 vrf-import vpn-m5-import set routing-instances vpn-m5 vrf-export vpn-m5-export set routing-instances vpn-m5 protocols bgp group ce type external set routing-instances vpn-m5 protocols bgp group ce peer-as 100 set routing-instances vpn-m5 protocols bgp group ce as-override set routing-instances vpn-m5 protocols bgp group ce neighbor 120.168.9.2 set routing-instances vpn-m5 protocols bgp group ce neighbor 120.168.10.2 set routing-instances vpn-m5 protocols ospf domain-id 1.0.0.0 set routing-instances vpn-m5 protocols ospf export vpn-m5-import set routing-instances vpn-m5 protocols ospf area 0.0.0.0 interface xe-4/0/0.0 set routing-instances vpn-m5 protocols ospf area 0.0.0.0 interface xe-4/0/1.0
配置自适应负载平衡
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
要配置 R2 路由器:
修改每个路由器的相应接口名称、地址和任何其他参数后,对其他路由器重复此过程。
指定要创建的聚合以太网接口数量。
[edit chassis]
user@R2# set aggregated-devices ethernet device-count 5配置将 R2 连接到 R1 的千兆以太网接口链路。
[edit interfaces]
user@R2# set ge-1/2/0 unit 0 family inet address 120.168.100.1/30 user@R2# set ge-1/2/0 unit 0 family iso user@R2# set ge-1/2/0 unit 0 family mpls user@R2# set ge-1/2/1 unit 0 family inet address 120.168.101.1/30 user@R2# set ge-1/2/1 unit 0 family iso user@R2# set ge-1/2/1 unit 0 family mpls user@R2# set lo0 unit 0 family inet address 120.168.0.4/32 user@R2# set lo0 unit 0 family iso address 49.0001.1201.6800.0004.00配置 ae0 聚合以太网捆绑包的五个成员链路。
[edit interfaces]
user@R2# set ge-1/3/0 gigether-options 802.3ad ae0 user@R2# set ge-1/3/1 gigether-options 802.3ad ae0 user@R2# set ge-1/3/2 gigether-options 802.3ad ae0 user@R2# set ge-1/3/3 gigether-options 802.3ad ae0 user@R2# set ge-1/3/4 gigether-options 802.3ad ae0配置 ae1 聚合以太网捆绑包的八个成员链路。
[edit interfaces]
user@R2# set ge-2/2/1 gigether-options 802.3ad ae1 user@R2# set ge-2/2/2 gigether-options 802.3ad ae1 user@R2# set ge-2/2/3 gigether-options 802.3ad ae1 user@R2# set ge-2/2/4 gigether-options 802.3ad ae1 user@R2# set ge-2/2/5 gigether-options 802.3ad ae1 user@R2# set ge-2/2/6 gigether-options 802.3ad ae1 user@R2# set ge-2/2/7 gigether-options 802.3ad ae1 user@R2# set ge-2/2/8 gigether-options 802.3ad ae1在 R2 的 ae0 上实现聚合以太网负载平衡。
[edit interfaces]
user@R2# set ae0 aggregated-ether-options load-balance adaptive tolerance 10为 ae0 聚合以太网捆绑包配置链路速度。
[edit interfaces]
user@R2# set ae0 aggregated-ether-options link-speed 1g在 ae0 聚合以太网捆绑包上配置 LACP。
[edit interfaces]
user@R2# set ae0 aggregated-ether-options lacp active为 ae0 聚合以太网捆绑包配置接口参数。
[edit interfaces]
user@R2# set ae0 unit 0 family inet address 120.168.104.1/30 user@R2# set ae0 unit 0 family iso user@R2# set ae0 unit 0 family mpls在 R2 的 ae1 上启用聚合以太网负载平衡。
[edit interfaces]
user@R2# set ae1 aggregated-ether-options load-balance adaptive tolerance 10为 ae1 聚合以太网捆绑包配置链路速度。
[edit interfaces]
user@R2# set ae1 aggregated-ether-options link-speed 1g在 ae1 聚合以太网捆绑包上配置 LACP。
[edit interfaces]
user@R2# set ae1 aggregated-ether-options lacp active配置 ae1 聚合以太网捆绑包的接口参数。
[edit interfaces]
user@R2# set ae1 unit 0 family inet address 120.168.105.1/30 user@R2# set ae1 unit 0 family iso user@R2# set ae1 unit 0 family mpls禁用选择性聚合以太网统计信息。
[edit accounting-options]
user@R2# set selective-aggregate-interface-stats disable在 R2 的所有接口和 AE 捆绑包上配置 RSVP。
[edit protocols]
user@R2# set rsvp interface ge-1/2/0.0 user@R2# set rsvp interface ge-1/2/1.0 user@R2# set rsvp interface ae0.0 user@R2# set rsvp interface ae1.0在 R2 的所有接口和 AE 捆绑上配置 MPLS。
[edit protocols]
user@R2# set mpls interface ge-1/2/0.0 user@R2# set mpls interface ge-1/2/1.0 user@R2# set mpls interface ae0.0 user@R2# set mpls interface ae1.0在 R2 的所有接口和 AE 束上配置 IS-IS。
[edit protocols]
user@R2# set isis traffic-engineering family inet shortcuts user@R2# set isis level 1 disable user@R2# set isis interface ge-1/2/0.0 user@R2# set isis interface ge-1/2/1.0 user@R2# set isis interface ae0.0 user@R2# set isis interface ae1.0 user@R2# set isis interface lo0.0
结果
在配置模式下,输入 show chassis
、 show interfaces
、 show accounting-options
和 show protocols
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@R2# show chassis
aggregated-devices {
ethernet {
device-count 5;
}
}
user@R2# show interfaces
ge-1/2/0 {
unit 0 {
family inet {
address 120.168.100.1/30;
}
family iso;
family mpls;
}
}
ge-1/2/1 {
unit 0 {
family inet {
address 120.168.101.1/30;
}
family iso;
family mpls;
}
}
ge-1/3/0 {
gigether-options {
802.3ad ae0;
}
}
ge-1/3/1 {
gigether-options {
802.3ad ae0;
}
}
ge-1/3/2 {
gigether-options {
802.3ad ae0;
}
}
ge-1/3/3 {
gigether-options {
802.3ad ae0;
}
}
ge-1/3/4 {
gigether-options {
802.3ad ae0;
}
}
ge-2/2/1 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/2 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/3 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/4 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/5 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/6 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/7 {
gigether-options {
802.3ad ae1;
}
}
ge-2/2/8 {
gigether-options {
802.3ad ae1;
}
}
ae0 {
aggregated-ether-options {
load-balance {
adaptive tolerance 10;
}
link-speed 1g;
lacp {
active;
}
}
unit 0 {
family inet {
address 120.168.104.1/30;
}
family iso;
family mpls;
}
}
ae1 {
aggregated-ether-options {
load-balance {
adaptive tolerance 10;
}
link-speed 1g;
lacp {
active;
}
}
unit 0 {
family inet {
address 120.168.105.1/30;
}
family iso;
family mpls;
}
}
lo0 {
unit 0 {
family inet {
address 120.168.0.4/32;
}
family iso {
address 49.0001.1201.6800.0004.00;
}
}
}
user@R2# show accounting-options
selective-aggregate-interface-stats disable;
user@R2# show protocols
rsvp {
interface ge-1/2/0.0;
interface ge-1/2/1.0;
interface ae0.0;
interface ae1.0;
}
mpls {
interface ge-1/2/0.0;
interface ge-1/2/1.0;
interface ae0.0;
interface ae1.0;
}
isis {
traffic-engineering {
family inet {
shortcuts;
}
}
level 1 disable;
interface ge-1/2/0.0;
interface ge-1/2/1.0;
interface ae0.0;
interface ae1.0;
interface lo0.0;
}
验证
确认配置工作正常。
验证 ae0 上的自适应负载平衡
目的
验证 ae0 聚合以太网捆绑包上接收的数据包在五个成员链路中是否实现了负载平衡。
行动
在操作模式下,运行 show interfaces ae0 extensive
命令。
user@R2> show interfaces ae0 extensive Logical interface ae0.0 (Index 325) (SNMP ifIndex 917) (Generation 134) Flags: SNMP-Traps 0x4004000 Encapsulation: ENET2 Statistics Packets pps Bytes bps Bundle: Input : 848761 9 81247024 7616 Output: 166067308909 3503173 126900990064983 21423804256 Adaptive Statistics: Adaptive Adjusts: 264 Adaptive Scans : 27682 Adaptive Updates: 10 Link: ge-1/3/0.0 Input : 290888 5 29454436 3072 Output: 33183442699 704569 25358563587277 4306031760 ge-1/3/1.0 Input : 162703 1 14806325 992 Output: 33248375409 705446 25406995966732 4315342152 ge-1/3/2.0 Input : 127448 1 12130566 992 Output: 33184552729 697572 25354827700261 4267192376 ge-1/3/3.0 Input : 121044 1 11481262 1280 Output: 33245875402 697716 25405953405192 4265750584 ge-1/3/4.0 Input : 146678 1 13374435 1280 Output: 33205071207 697870 25374651121458 4269487384
含义
ae0 聚合以太网捆绑包的成员链路通过自适应负载平衡得到充分利用。
payload
语句在第 3 层和第 4 层标头中的字段。