本页内容
示例:在 MX104 路由器上为 3 层 IPv4 服务配置基于 RFC 2544 的基准测试
要求
MX 系列路由器在基于RFC2544的基准测试中仅支持反射器功能。此示例使用 MX104 3D 通用边缘路由器作为反射器。您还可以在具有 MPC1、MPC2 和 16 端口 10 千兆以太网 MPC 的 MX80 路由器以及 MX240、MX480 和 MX960 路由器上配置基准测试。要对 MX240、MX480、MX960 路由器配置基于RFC2544的基准测试,请参阅 对 MX 系列路由器启用对基于 RFC 2544 的基准测试的支持。
此示例不适用于ACX7100、ACX5448、ACX5048和ACX5096路由器,因为它们只能配置为反射器,不能配置为发起方。
此示例使用以下硬件和软件组件:
MX104 路由器(反射器)
ACX 系列路由器(发起方)
Junos OS 13.3 或更高版本
概述
考虑一个示例拓扑结构,其中路由器、路由器 A (ACX) 充当基于 RFC 2544 的基准测试的测试帧的发起者和终止器。路由器 A 通过第 3 层网络连接到另一个路由器路由器 B (MX104),作为反射器反射从路由器 A 接收的测试帧。IPv4 用于在第 3 层网络上传输测试帧。此基准测试用于计算路由器 A 和路由器 B 之间的 IPv4 服务参数。两个路由器上的逻辑接口均配置了 IPv4 地址,以测量 IPv4 服务网络设备的吞吐量、延迟、帧丢失和突发帧等性能属性。
图 1 显示了对第 3 层 IPv4 服务执行 RFC 2544 测试的示例拓扑。

配置
在此示例中,您可以为路由器 A 上的接口 ge-0/0/0 和路由器 B 上的接口 ge-0/0/4 之间的第 3 层 IPv4 服务配置基准测试,以检测和分析互连路由器的性能。请勿在路由器 B 上配置测试配置文件,因为它作为反射器运行。在配置发起方(路由器 A)之前,必须配置反射器(路由器 B),因为反射器需要已配置并运行测试,然后才能对发起方启动测试。如果先对发起方启动测试,则发送的所有数据包都会丢失,直到您在反射器上启动测试。
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到 [edit
] 层次结构级别的 CLI 中:
在路由器 B 上配置基准测试参数
set interfaces ge-0/0/4 unit 0 family inet address 192.0.2.2/24 set services rpm rfc2544-benchmarking tests test-name test1 test-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 family inet set services rpm rfc2544-benchmarking tests test-name test1 destination-ipv4-address 192.0.2.2 set services rpm rfc2544-benchmarking tests test-name test1 destination-udp-port 4001 set services rpm rfc2544-benchmarking tests test-name test1 source-ipv4-address 192.0.2.1
在路由器 A 上配置基准测试参数
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 bandwidth-kbps 1000 set services rpm rfc2544-benchmarking tests test-name test1 test-profile throughput set services rpm rfc2544-benchmarking tests test-name test1 test-interface ge-0/0/0.0 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 destination-ipv4-address 192.0.2.2 set services rpm rfc2544-benchmarking tests test-name test1 destination-udp-port 4001 set services rpm rfc2544-benchmarking tests test-name test1 source-ipv4-address 192.0.2.1
在路由器 B 上配置基准测试参数
逐步过程
以下内容要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
在路由器 B 上配置测试参数:
-
在配置模式下,转到
[edit interfaces]
层次结构级别:[edit] user@RouterB# edit interfaces
-
配置必须运行测试的接口。
[edit interfaces] user@RouterB# edit ge-0/0/4
-
配置逻辑单元并将协议家族指定为
inet
。[edit interfaces ge-0/0/4] user@RouterB# edit unit 0 family inet
-
指定逻辑接口的地址。
[edit interfaces ge-0/0/4 unit 0 family inet] user@RouterB# set address 192.0.2.2/24
-
转到配置模式的顶层。
[edit interfaces ge-0/0/4 unit 0] user@RouterB# top
-
在配置模式下,转到
[edit services rpm rfc2544-benchmarking]
层次结构级别。[edit] user@RouterB# edit services rpm rfc2544-benchmarking
-
为测试定义一个名称,例如 test1。测试名称标识符的长度最多为 32 个字符。
[edit services rpm rfc2544-benchmarking] user@RouterB# edit tests test-name test1
-
指定逻辑接口 ge-0/0/4.0,运行基于 RFC 2544 的基准测试。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterB# set test-interface ge-0/0/4.0
-
指定
reflect
为基准测试期间发送的数据包的测试模式。[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterB# set mode reflect
-
为基准测试配置地址类型家族
inet
。[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterB# set family inet
-
将测试数据包的目标 IPv4 地址配置为 192.0.2.2。在反射器上配置的目标 IPv4 地址必须与发起方上配置的目标 IPv4 地址匹配。如果改为配置 192.0.2.1,则将显示以下错误消息:
error: test test1 - Could not determine local interface for address 192.0.2.1
。[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set destination-ipv4-address 192.0.2.2
-
将将在生成帧的 UDP 标头中使用的目标的 UDP 端口指定为 4001。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set destination-udp-port 4001
-
为测试数据包配置源 IPv4 地址。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@host# set source-ipv4-address 192.0.2.1
-
转到配置模式的顶层。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterB# top
-
提交配置。
[edit] user@RouterB# commit
-
确认配置。如果输出不包含以下配置,请重复此示例中的配置说明,以便进行更正。
[edit interfaces] ge-0/0/4 { unit 0 { family inet { address 192.0.2.2/24; } } } [edit services rpm] rfc2544-benchmarking { # Note, When in reflector mode, test profile is not needed tests { test-name test1 { test-interface ge-0/0/4.0; mode reflect; family inet; destination-ipv4-address 192.0.2.2; destination-udp-port 4001; source-ipv4-address 192.0.2.1 } } }
-
退出操作模式。
[edit] user@RouterB# exit user@RouterB>
-
开始对反射器进行基准测试。
user@host> test services rpm rfc2544-benchmarking test test1 start
在发起方成功完成测试后,可以通过输入
test services rpm rfc2544-benchmarking test test1 stop
命令在反射器处停止测试。
在路由器 A 上配置基准测试参数
逐步过程
以下内容要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 在配置模式下使用 CLI 编辑器。
在路由器 A 上配置测试参数:
-
在配置模式下,转到
[edit interfaces]
层次结构级别:[edit] user@RouterA# edit interfaces
-
配置必须运行测试的接口。
[edit interfaces] user@RouterA# edit ge-0/0/0
-
配置逻辑单元并指定协议家族。
[edit interfaces ge-0/0/0] user@RouterA# edit unit 0 family inet
-
指定逻辑接口的地址。
[edit interfaces ge-0/0/0 unit 0 family inet] user@RouterA# set address 192.0.2.1/24
-
转到配置模式的顶层。
[edit interfaces ge-0/0/0 unit 0] user@RouterA# top
-
在配置模式下,转到
[edit services rpm rfc2544-benchmarking]
层次结构级别。[edit] user@RouterA# edit services rpm rfc2544-benchmarking
-
为测试配置文件定义一个名称,例如吞吐量。
[edit services rpm rfc2544-benchmarking] user@RouterA# edit profiles test-profile throughput
-
配置要作为吞吐量来执行的测试类型。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@RouterA# set test-type throughput
-
将测试数据包的大小指定为 64 字节。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@RouterA# set packet-size 64
-
将测试的理论最大带宽定义为每秒千位,值从 1,000 Kbps 到 1,000,000 Kbps。
[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@RouterA# set bandwidth-kbps 1000
-
输入命令以
up
进入配置层次结构中的上一级别。[edit services rpm rfc2544-benchmarking profiles test-profile throughput] user@RouterA# up
-
输入命令以
up
进入配置层次结构中的上一级别。[edit services rpm rfc2544-benchmarking profiles] user@RouterA# up
-
为测试定义一个名称,例如 test1。测试名称标识符的长度最多为 32 个字符。
[edit services rpm rfc2544-benchmarking] user@RouterA# edit tests test-name test1
-
指定要与特定测试名称关联的测试配置文件的名称(例如吞吐量)。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set test-profile throughput
-
指定逻辑接口 ge-0/0/0.0,运行基于 RFC 2544 的基准测试。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set test-interface ge-0/0/0.0
-
将基准测试期间发送的数据包指定为启动和终止的测试模式。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set mode initiate-and-terminate
-
为基准测试配置地址类型家族
inet
。[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set family inet
-
配置测试数据包的目标 IPv4 地址。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set destination-ipv4-address 192.0.2.2
-
将将在生成帧的 UDP 标头中使用的目标的 UDP 端口指定为 4001。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set destination-udp-port 4001
-
为测试数据包配置源 IPv4 地址。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# set source-ipv4-address 192.0.2.1
-
转到配置模式的顶层。
[edit services rpm rfc2544-benchmarking tests test-name test1] user@RouterA# top
-
提交配置。
[edit] user@RouterA# commit
-
确认配置。如果输出不包含以下配置,请重复此示例中的配置说明,以便进行更正。
[edit] user@RouterA# show [edit interfaces] ge-0/0/0 { unit 0 { family inet { address 192.0.2.1/24; } } } [edit services rpm] rfc2544-benchmarking { profiles { test-profile throughput { test-type throughput packet-size 64; bandwidth-kbps 1000; } } tests { test-name test1 { test-profile throughput; interface ge-0/0/0.0; mode initiate-and-terminate; family inet; destination-ipv4-address 192.0.2.2 destination-udp-port 4001; source-ipv4-address 192.0.2.1 } } }
-
退出操作模式。
[edit] user@RouterA# exit user@RouterA>
-
在发起方启动基准测试。
user@RouterA> test services rpm rfc2544-benchmarking test test1 start
测试成功完成后,它会自动停止在发起方。在发起方成功完成测试后,您可以在操作模式下在路由器 B 上输入命令,从而
test services rpm rfc2544-benchmarking test test1 stop
在反射器处停止测试。
结果
如果尚未这样做,请通过在 [编辑接口] 和 [编辑服务 rpm] 层次结构级别的配置模式中输入 show
命令,确认您在路由器 A 和路由器 B 上的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
路由器 A 上的基准测试参数配置:
[edit interfaces] ge-0/0/0 { unit 0 { family inet { address 192.0.2.1/24; } } } [edit services rpm] rfc2544-benchmarking { profiles { test-profile throughput { test-type throughput packet-size 64; bandwidth-kbps 1000; } } tests { test-name test1 { test-profile throughput; test-interface ge-0/0/0.0; mode initiate-and-terminate; family inet; destination-ipv4-address 192.0.2.2 destination-udp-port 4001; source-ipv4-address 192.0.2.1 } } }
路由器 B 上的基准测试参数配置:
[edit interfaces] ge-0/0/4 { unit 0 { family inet { address 192.0.2.2/24; } } } [edit services rpm] rfc2544-benchmarking { # Note, When in reflector mode, test profile is not needed tests { test-name test1 { test-interface ge-0/0/4.0; mode reflect; family inet; destination-ipv4-address 192.0.2.2; destination-udp-port 4001; source-ipv4-address 192.0.2.1 } } }