示例:在 MX104 路由器上针对以太网伪线的 UNI 方向配置基于 RFC 2544 的基准测试
此示例说明如何针对在两个路由器之间启用的以太网伪线服务的用户到网络接口 (UNI) 方向配置基于RFC2544的基准测试。该测试检测并分析互连路由器的性能。
要求
在基于RFC2544的基准测试中,MX 系列路由器仅支持反射器功能。此示例使用 MX104 3D 通用边缘路由器作为反射器。您还可以在 MX80 系列路由器以及配备 MPC1、MPC2 和 16 端口 10 千兆以太网 MPC 的 MX240、MX480 和 MX960 系列路由器上配置基准测试 Junos OS 16.1 或更高版本。要在 MX240、MX480、MX960 系列路由器上配置基于RFC2544的基准测试,请参阅 在 MX 系列 路由器上启用对基于 RFC 2544 的基准测试的支持。
此示例使用以下硬件和软件组件:
-
MX104(反射器)
-
ACX 系列路由器(发起器)
-
Junos OS 13.3 或更高版本
概述
考虑一个示例拓扑,其中的路由器路由器 A (MX104) 充当基于 RFC 2544 的基准测试测试的测试帧的反射器。路由器 A 上配置了面向客户边缘 (CE) 的逻辑接口和 inet 家族。路由器 A 不属于伪线,因此需要对其进行第 3 层家族配置。路由器 A(客户边缘设备 CE1)连接到路由器 B (ACX),后者通过 ETHERType 或第 2 层以太网有效负载在 UNI 方向上用作提供商边缘设备 PE1。路由器 B 上配置了逻辑接口、家族和 UNI 方向。路由器 B 或 PE1 通过 NNI 方向的以太网伪线连接到远程站点 PE2 的提供商边缘设备。CE1 和 PE1 之间的链路是以太网第 2 层网络,可以使用任意 EtherType 值进行配置。PE1 和 PE2 之间的链路是以太网线路 (E-Line) 或以太网专用线路 (EPL),其上发送了第 2 层有效负载和第 3 层传输。路由器 B 或 PE1 充当测试帧的启动器和终止器,这些测试帧被发送到路由器 A 并从中反射回来。
此基准测试用于计算路由器 A 和路由器 B 之间以太网伪线服务的用户到网络接口 (UNI) 方向上的性能属性。在测试过程中,从网络到网络接口 (NNI) 到达客户边缘的数据流量将被忽略。来自 CE 的数据包不会发送到 NNI,因为所有数据包都被视为测试探针。
图 1 显示了对以太网伪线服务的 UNI 方向执行 RFC 2544 测试的示例拓扑。
UNI 方向基准测试
配置
在此示例中,您将针对在两台路由器之间启用的以太网伪线服务的 UNI 方向配置基准测试,以检测和分析互连路由器的性能。
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 [edit] 层级的 CLI 中:
在路由器 B(发起方和终结方)上配置基准测试参数
set interfaces ge-0/0/0 vlan-tagging set interfaces ge-0/0/0 unit 0 vlan-id 101 set interfaces ge-0/0/0 unit 0 family inet address 192.0.2.1/24 set services rpm rfc2544-benchmarking profiles test-profile throughput test-type throughput set services rpm rfc2544-benchmarking profiles test-profile throughput packet-size 64 set services rpm rfc2544-benchmarking profiles test-profile throughput test-duration 20m set services rpm rfc2544-benchmarking profiles test-profile throughput bandwidth-kbps 500 set services rpm rfc2544-benchmarking tests test-name test1 interface ge-0/0/0.0 set services rpm rfc2544-benchmarking tests test-name test1 test-profile throughput set services rpm rfc2544-benchmarking tests test-name test1 mode initiate-and-terminate set services rpm rfc2544-benchmarking tests test-name test1 family inet set services rpm rfc2544-benchmarking tests test-name test1 dest-address 192.0.2.2 set services rpm rfc2544-benchmarking tests test-name test1 udp-port 4001
在路由器 A(反射器)上配置基准测试参数
set interfaces ge-0/0/4 vlan-tagging set interfaces ge-0/0/4 unit 0 encapsulation vlan-ccc set interfaces ge-0/0/4 unit 0 vlan-id 101 set services rpm rfc2544-benchmarking tests test-name test1 interface ge-0/0/4.0 set services rpm rfc2544-benchmarking tests test-name test1 mode reflect set services rpm rfc2544-benchmarking tests test-name test1 mode family ccc set services rpm rfc2544-benchmarking tests test-name test1 direction uni
在路由器 B(发起方和终结方)上配置基准测试参数
分步过程
下面要求您在各个配置层级中导航。有关 CLI 导航的信息,请参阅 在配置模式下使用 CLI 编辑器。
要在路由器 B 上配置测试参数,请执行以下作:
在配置模式下,转到
[edit interfaces]层次结构级别:[edit] user@host# edit interfaces
配置必须运行测试的接口。
[edit interfaces] user@host# edit ge-0/0/0
配置 VLAN 标记,以便传输和接收 802.1Q VLAN 标记帧。
[edit interfaces ge-0/0/0] user@host# set vlan-tagging
配置逻辑单元并将协议族指定为
inet。[edit interfaces ge-0/0/0] user@host# edit unit 0 family inet
指定逻辑接口的地址。
[edit interfaces ge-0/0/0 unit 0 family inet] user@host# set address 192.0.2.1/24
将逻辑接口上的 VLAN ID 配置为 101。
[edit interfaces ge-0/0/0 unit 0] user@host# set vlan-id 101
转到配置命令模式的顶层。
[edit interfaces ge-0/0/0 unit 0] user@host# top
在配置模式下,转到
[edit services]层级。[edit] user@host# edit services
配置RPM实时性能监控服务实例。
[edit services] user@host# edit rpm
为 RPM 实例配置基于 RFC 2544 的基准测试。
[edit services rpm] user@host# edit rfc2544-benchmarking
定义测试配置文件的名称,例如吞吐量。
[edit services rpm rfc2544-benchmarking] user@host# edit profiles test-profile throughput
将要执行的测试类型配置为吞吐量。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@host# set test-type throughput
将测试数据包的大小指定为 64 字节。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@host# set test-type packet-size 64
指定一个数字,后跟字母 h(表示小时)、m(表示分钟)或 s(表示秒),以小时、分钟或秒为单位指定执行测试的时间段。在此示例中,将时间段配置为 20 分钟。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@host# set test-type test-duration 20m
定义测试的理论最大带宽(以千比特/秒为单位),值从 1 Kbps 到 1,000,000 Kbps。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@host# set test-type bandwidth-kbps 500
输入
up命令,进入配置层次结构中的上一级。[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@host# up
输入
up命令,进入配置层次结构中的上一级。[edit services rpm rfc2544-benchmarking profiles] user@host# up
定义测试的名称,例如 test1。测试名称标识符的长度最多为 32 个字符。
[edit services rpm rfc2544-benchmarking] user@host# edit tests test-name test1
指定要与特定测试名称关联的测试配置文件的名称(例如,吞吐量)。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set test-profile throughput
指定运行基于 RFC 2544 的基准测试的逻辑接口 ge-0/0/0.0。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set test-interface ge-0/0/0.0
将基准测试期间发送的数据包的测试模式指定为
initiate-and-terminate。[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set mode initiate-and-terminate
配置用于基准测试的地址类型系列
inet。[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set family inet
将测试数据包的目标 IPv4 地址配置为 192.0.2.2。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set dest-address 192.0.2.2
将生成帧的 UDP 标头中要使用的目标的 UDP 端口指定为 4001。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set udp-port 4001
验证配置并提交
在配置模式下,输入 show 命令以确认您在路由器 B 上的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
路由器 B 上的基准测试参数:
[edit]
user@host# show
[edit interfaces]
ge-0/0/0 {
vlan-tagging;
unit 0 {
vlan-id 101;
family inet {
address 192.0.2.1/24;
}
}
}
[edit services rpm]
rfc2544-benchmarking {
profiles {
test-profile throughput {
test-type throughput
packet-size 64;
test-duration 20m;
bandwidth-kbps 500;
}
}
tests {
test-name test1 {
interface ge-0/0/0.0;
test-profile throughput;
mode initiate-and-terminate;
family inet;
dest-address 192.0.2.2
udp-port 4001;
}
}
}
配置正确后,提交配置:
[edit] user@host# commit
在路由器 A(反射器)上配置基准测试参数
分步过程
下面要求您在各个配置层级中导航。有关 CLI 导航的信息,请参阅 在配置模式下使用 CLI 编辑器。
要在路由器 A 上配置测试参数:
在配置模式下,转到
[edit interfaces]层次结构级别:[edit] user@host# edit interfaces
配置必须运行测试的接口。
[edit interfaces] user@host# edit ge-0/0/4
配置 VLAN 标记,以便传输和接收 802.1Q VLAN 标记帧。
[edit interfaces ge-0/0/4] user@host# set vlan-tagging
为接口配置逻辑单元。
[edit interfaces ge-0/0/4] user@host# edit unit 0
指定以太网 VLAN 电路的封装。
[edit interfaces ge-0/0/4 unit 0] user@host# set encapsulation vlan-ccc
在逻辑接口上将 VLAN ID 配置为 101。
[edit interfaces ge-0/0/4 unit 0] user@host# set vlan-id 101
转到配置命令模式的顶层。
[edit interfaces ge-0/0/4 unit 0] user@host# top
在配置模式下,转到
[edit services]层级。[edit] user@host# edit services
配置RPM实时性能监控服务实例。
[edit services] user@host# edit rpm
为 RPM 实例配置基于 RFC 2544 的基准测试。
[edit services rpm] user@host# edit rfc2544-benchmarking
定义测试的名称,例如 test1。测试名称标识符的长度最多为 32 个字符。
[edit services rpm rfc2544-benchmarking] user@host# edit tests test-name test1
指定运行基于 RFC 2544 的基准测试的逻辑接口。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set test-interface ge-0/0/4.0
指定
reflect为基准测试期间发送的数据包的测试模式。[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set mode reflect
配置用于基准测试的地址类型系列
ccc。[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set family ccc
指定必须运行测试的接口的方向,在本例中为 UNI。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set direction uni
验证配置并提交
在配置模式下,输入 show 命令以确认您在路由器 A 上的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
路由器 A 上的基准测试参数:
[edit]
user@host# show
[edit interfaces]
ge-0/0/4 {
vlan-tagging;
unit 0 {
encapsulation vlan-ccc;
vlan-id 101;
}
}
[edit services rpm]
rfc2544-benchmarking {
# Note, When in reflector mode, test profile is not needed
tests {
test-name test1 {
interface ge-0/0/4.0;
mode reflect;
family ccc;
direction uni;
}
}
}
配置正确后,提交配置。
[edit] user@host# commit
运行基准测试
-
在反射器(路由器 A)上开始基准测试。
user@host> test services rpm rfc2544-benchmarking test test1 start
测试成功完成后,测试会在发起方(路由器 B)处自动停止。在启动器上成功完成测试后,在反射器(路由器 A)处停止测试。
user@host> test services rpm rfc2544-benchmarking test test1 stop
验证基准测试结果
检查在路由器 A 和路由器 B 之间的已配置服务上执行的基准测试结果。
目的
验证是否为在路由器 A 和路由器 B 之间的已配置服务上运行的基准测试显示必要和所需的统计值。
行动
在作模式下,输入 show services rpm rfc2544-benchmarking (aborted-tests | active-tests | completed-tests | summary) 命令以显示有关每个实时性能监控 (RPM) 实例的基于 RFC 2544 的基准测试的每个类别或状态的结果信息,例如已终止测试、活动测试和已完成测试。
意义
输出显示已执行的基准测试的详细信息。有关 show services rpm rfc2544-benchmarking 作命令的更多信息,请参阅 show services rpm rfc2544-benchmarking CLI 资源管理器。