第 3 层服务等级 (CoS)
瞻博网络云原生路由器支持第 3 层服务等级 (CoS),也称为第 3 层服务质量 (QoS)。本主题概述了支持 CoS 机制,以及配置和验证示例。
L3 CoS 概述
当网络出现拥塞和延迟时,必须对某些数据包进行优先级排序,以避免数据随机丢失。服务等级 (CoS),也称为服务质量 (QoS),通过将类似类型的流量(例如电子邮件、流视频、语音、大型文档文件传输)划分为多个类来实现这种优先级划分。然后,您可以对每个组应用不同的优先级(例如吞吐量和数据包丢失的优先级),从而控制流量行为。瞻博网络云原生路由器支持 CoS,使其能够对流量进行区分或分类。它可以根据配置的规则丢弃流量或降低流量的优先级。您可以参阅 Junos 文档,详细了解 服务等级 。
云原生路由器 CoS 应用支持 DiffServ,后者在 IPv4 和 IPv6 数据包头的差异化服务字段中使用 6 位差异化服务代码点 (DSCP)。对于 IPv6,DSCP 称为流量类。该配置使用 DSCP 值来决定传入数据包的 CoS 处理方式。DSCP 字段还用于将修改后的数据包优先级通知到下一跃点。
云原生路由器支持的 CoS 机制
云原生路由器支持分类器、监管器和重写/标记 CoS 机制。让我们在以下各节中详细了解云原生路由器 CoS 实施。
转发等级和丢失优先级
转发类会影响在数据包传输 JCNR 时应用于数据包的转发和标记策略。默认情况下,云原生路由器未定义任何转发类。您最多可以定义 16 个自定义转发类,映射到 8 个队列。
在云原生路由器 CoS 实现中,转发类和丢失优先级一起用于重写规则和监管器。分类器将损失优先级设置为低、中低、中高和高。以下是在云原生路由器 CoS 实施中使用丢失优先级的一些方式:
QoS 块 | 如何使用损失优先级 |
---|---|
分类 |
转发类和丢失优先级由分类器设置。 |
重写 |
丢失优先级与流量类(转发类)一起用作索引,以获取新的 DSCP 值。 |
监管器 | 只有颜色感知监管器使用丢失优先级。丢失优先级映射到流量颜色,如下所示:
|
调度 | 转发类和丢失优先级是调度程序的输入,用于根据严格优先级对流量进行排队。 |
分类
数据包分类是指对传入数据包进行检查。此函数将数据包与特定的 CoS 服务级别相关联。分类器将传入数据包与转发类和丢失优先级相关联,并根据关联的转发类将数据包分配给输出队列。支持两种常规类型的分类器:
-
行为聚合分类器 — 行为聚合 (BA) 是一种分类方法,可在数据包进入 JCNR 时对其进行作。系统将检查数据包标头中的 CoS 值,此单个字段将确定应用于数据包的 CoS 设置。BA 分类器允许您根据差分服务代码点 (DSCP) 值和 DSCP IPv6 值设置数据包的转发类和丢包优先级。BA 分类器在接口级别配置。您可以参阅 Junos 文档,详细了解行为 聚合分类器 。
-
多域流量分类器 — 多域 (MF) 分类器可以检查数据包中的多个字段,例如数据包的源地址和目标地址以及源端口号和目标端口号。使用多域分类器时,您可以根据防火墙过滤器 (ACL) 规则设置数据包的转发类和丢包优先级。如果数据包同时匹配 BA 和 MF 分类器,则 MF 分类器优先。您可以参阅 Junos 文档,详细了解多 散流量分类器 。
监管器
监管器允许您将特定类别的流量限制为指定的带宽和突发大小。监管器根据配置的流量速率和突发大小测量(测量)每个数据包。然后,它会将数据包和计量结果传递给标记器(重写规则),标记器会分配与计量结果相对应的数据包丢弃优先级。根据配置的特定交通限制集,监管器将交通流识别为属于两个或三个类别之一,这些类别类似于用于控制汽车交通的交通信号灯的颜色。可以针对每个数据包或每个流量类应用监管器。 云原生路由器 CoS 实施支持 16 个监管器配置文件。您可以在 Junos 文档中阅读有关 监管器实施 的更多信息。在云原生路由器 CoS 实施中,监管器在单速率三色标记 (srTCM) 或双速率三色标记 (trTCM) 模式下工作。监管人员可以在颜色感知或色盲模式下执行交通颜色标记。在颜色感知模式下,监管器会将分类器派生的数据包颜色视为附加输入。在色盲模式下,监管器在确定新颜色时不考虑数据包的颜色。我们将在下表中查看每种模式的不同考虑因素。
-
单速率三色 — 单速率三色标记 (srTCM) 根据配置的提交信息速率 (CIR)、提交的突发大小 (CBS) 和峰值突发大小 (PBS) 测量流量。当服务是根据数据包长度(而不是峰值到达速率)来构建时,单速率三色监管器最为有用。基于以下考虑,流量被标记为属于三个类别之一:绿色、黄色或红色:
表 2:色彩感知 srTCM 传入颜色 数据包计量
可能的情况
新颜色
对数据包的作
绿
CIR、CBS、PBS
CBS下方
绿
未丢弃
高于 CBS 但低于 PBS
黄色 使用重写规则更改流量类。
高于PBS
红
丢弃
黄色
美国公共广播公司(PBS)
PBS下方
黄色
使用重写规则更改流量类。
高于PBS
红
丢弃 红 未按流量计费 那 红 丢弃 表 3:色盲 srTCM 数据包计量
可能的情况
新颜色
对数据包的作
CIR、CBS、PBS
CBS下方
绿
未丢弃
高于 CBS 但低于 PBS
黄色 使用重写规则更改流量类。
高于PBS
红
丢弃
-
双速率三色 — 双速率三色标记 (trTCM) 根据配置的 CIR 和峰值信息速率 (PIR) 测量流量。当根据到达率(而不一定是数据包长度)构建服务时,双速率三色监管器最有用。基于以下注意事项,流量被标记为属于以下三个类别之一:
表 4:色彩感知 trTCM 传入颜色 数据包计量
可能的情况
新颜色
对数据包的作
绿
CIR、PIR
低于 CIR
绿
未丢弃
高于 CIR 但低于 PIR
黄色 使用重写规则更改流量类。
PIR 以上
红
丢弃
黄色
PIR
PIR 以下
黄色
使用重写规则更改流量类。
PIR 以上
红
丢弃 红 未按流量计费 那 红 丢弃 表 5:色盲 trTCM 数据包计量
可能的情况
新颜色
对数据包的作
CIR、PIR
低于 CIR
绿
未丢弃
高于 CIR 但低于 PIR
黄色 使用重写规则更改流量类。
PIR 以上
红
丢弃
Policer 标记的颜色映射到丢失优先级,如下所示:
颜色 |
丢失优先级 |
---|---|
绿 |
低 |
黄色 |
中-低(将颜色映射到丢失优先级时不使用中-高) |
红 |
高 |
重写/标记
重写规则或标记可在传出数据包中设置相应的 CoS 位。这允许下一个下游路由设备将数据包分类到相应的服务组中。当路由设备位于网络边界,并且必须更改 CoS 值以满足目标对等方的策略时,重写或标记出站数据包会很有用。重写配置文件将应用于接口,并基于分类器派生的转发类和丢包优先级和/或监管器的计量结果。云原生路由器重写规则支持将外部 IPv4/IPv6 DSCP 标记复制到内部 IP 报头 DSCP 字段以及 MPLS EXP 位标记。云原生路由器支持 16 个重写配置文件。您可以在 Junos 文档中阅读有关 重写规则 的更多信息。
云原生路由器 CoS 实施不支持对与任何 CoS 块不匹配的流量进行隐式尽力而为处理。必须配置显式捕获规则,以便尽力处理。
云原生路由器 CoS 实施仅针对隧道数据包(MPLSoUDP 和 VXLAN)修改外部 IP 报头的 DSCP 值。
调度
Scheduler 是云原生路由器 CoS 实现的最后一个块,用于计算数据包的优先级。云原生路由器实施严格的优先级 8 队列调度程序,优先级从高到低。转发类直接映射到调度程序优先级。云原生路由器在部署舵图中最多支持 4 个调度器配置文件,最多支持 16 个调度器图和转发类。您可以在 Junos 文档中阅读有关 调度器 的更多信息。您可以使用下表中提供的 8 个优先级之一配置调度程序。请注意,调度器优先级已映射到接口队列(8 个队列)。
优先权 |
调度优先级(队列) |
---|---|
高 |
调度优先级 1 |
低 |
调度优先级 7(最少) |
低-高 |
调度优先级 5 |
低延迟 |
调度优先级 4 |
中低 |
调度优先级 6 |
中高 |
调度优先级 2 |
中低 |
调度优先级 3 |
严格-高 |
调度优先级 0(最高) |
支持的接口
云原生路由器支持以下接口进行 CoS 实现:
CoS 组件/接口类型 | Pod 接口 |
交换矩阵接口 |
IRB 接口 |
---|---|---|---|
分类 |
支持 | 支持 |
支持 |
监管器 |
支持 |
支持 |
支持 |
标记 |
支持 |
支持 |
支持 |
调度 | 不支持 | 支持 | 不支持 |
L3 CoS 配置
配置转发类
默认情况下,云原生路由器没有配置任何转发类。您最多可以配置 16 个转发类,映射到 8 个队列。用户定义的队列映射将被忽略,因为队列号派生自调度器配置中定义的优先级,并与队列号一对一映射:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set class-of-service forwarding-classes class af11 queue-num 3 set class-of-service forwarding-classes class af12 queue-num 3 set class-of-service forwarding-classes class af13 queue-num 3 set class-of-service forwarding-classes class af21 queue-num 4 set class-of-service forwarding-classes class af22 queue-num 4 set class-of-service forwarding-classes class af23 queue-num 4 set class-of-service forwarding-classes class af31 queue-num 5 set class-of-service forwarding-classes class af32 queue-num 5 set class-of-service forwarding-classes class af33 queue-num 5 set class-of-service forwarding-classes class cs1 queue-num 6 set class-of-service forwarding-classes class cs2 queue-num 6 set class-of-service forwarding-classes class cs3 queue-num 7 set class-of-service forwarding-classes class cs4 queue-num 7 set class-of-service forwarding-classes class ef queue-num 1 set class-of-service forwarding-classes class nc1 queue-num 0 set class-of-service forwarding-classes class nc2 queue-num 0 crpdSelector: matchLabels: node: worker
配置分类器
您可以配置 BA 分类器并将其应用于接口:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set class-of-service classifiers dscp BA_1 forwarding-class af11 loss-priority high code-points 000001 set class-of-service classifiers dscp BA_1 forwarding-class af11 loss-priority low code-points 001010 set class-of-service classifiers dscp BA_1 forwarding-class af11 loss-priority medium-high code-points 001110 set class-of-service classifiers dscp BA_1 forwarding-class af11 loss-priority medium-low code-points 001100 set class-of-service classifiers dscp BA_1 forwarding-class ef loss-priority low code-points 101111 set class-of-service classifiers dscp BA_1 forwarding-class nc1 loss-priority low code-points 110000 set class-of-service classifiers dscp BA_1 forwarding-class nc1 loss-priority low code-points 111000 set class-of-service classifiers dscp-ipv6 BA6_1 forwarding-class ef loss-priority low code-points 101111 set class-of-service classifiers dscp-ipv6 BA6_1 forwarding-class nc2 loss-priority high code-points 111000 set class-of-service interfaces eno2 unit 0 classifiers dscp BA_1 set class-of-service interfaces eno2 unit 0 classifiers dscp-ipv6 BA6_1 crpdSelector: matchLabels: node: worker
您可以将 MF 分类器配置为防火墙过滤器:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set firewall family inet filter MCFF_1 term 1 from source-port 1001 set firewall family inet filter MCFF_1 term 1 then forwarding-class af11 set firewall family inet filter MCFF_1 term 1 then loss-priority medium-low set firewall family inet filter MCFF_1 term 2 from icmp-type echo-request set firewall family inet filter MCFF_1 term 2 then forwarding-class af31 set firewall family inet filter MCFF_1 term 2 then loss-priority medium-low set firewall family inet filter MCFF_1 term 3 then accept set firewall family inet6 filter MCFF6_1 term 1 from source-port 1001 set firewall family inet6 filter MCFF6_1 term 1 then forwarding-class af11 set firewall family inet6 filter MCFF6_1 term 1 then loss-priority low set firewall family inet6 filter MCFF6_1 term 2 then accept set interfaces eno2 unit 0 family inet filter input MCFF_1 set interfaces eno2 unit 0 family inet6 filter input MCFF6_1 crpdSelector: matchLabels: node: worker
配置监管器
您可以使用作类型 three-color-policer
配置监管器,如下所示:
单速率三色计 (srTCM) 监管器:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set firewall three-color-policer srTCM_1 action loss-priority high then discard set firewall three-color-policer srTCM_1 single-rate color-aware set firewall three-color-policer srTCM_1 single-rate committed-information-rate 500m set firewall three-color-policer srTCM_1 single-rate committed-burst-size 20k set firewall three-color-policer srTCM_1 single-rate excess-burst-size 20k set firewall family inet filter FF_1 term 1 then three-color-policer single-rate srTCM_1 set firewall family inet6 filter FF6_1 term 1 then three-color-policer single-rate srTCM_1 crpdSelector: matchLabels: node: worker
双速率三色计 (trTCM) 监管器:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set firewall three-color-policer trTCM_1 action loss-priority high then discard set firewall three-color-policer trTCM_1 two-rate color-aware set firewall three-color-policer trTCM_1 two-rate committed-information-rate 100m set firewall three-color-policer trTCM_1 two-rate committed-burst-size 2048 set firewall three-color-policer trTCM_1 two-rate peak-information-rate 200m set firewall three-color-policer trTCM_1 two-rate peak-burst-size 2048 set firewall family inet filter FF_1 term 1 from forwarding-class af11 set firewall family inet filter FF_1 term 1 then three-color-policer two-rate trTCM_1 set firewall family inet6 filter FF6_1 term 1 from forwarding-class af11 set firewall family inet6 filter FF6_1 term 1 then three-color-policer two-rate trTCM_1 crpdSelector: matchLabels: node: worker
您可以使用监管器配置分类器。
带监管器的 BA 分类器:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set firewall family inet filter FF_1 term 1 from forwarding-class af11 set firewall family inet filter FF_1 term 1 then three-color-policer single-rate srTCM_1 set firewall family inet6 filter FF6_1 term 1 from forwarding-class af11 set firewall family inet6 filter FF6_1 term 1 then three-color-policer single-rate srTCM_1 set class-of-service interfaces eno2 unit 0 classifiers dscp BA_1 set class-of-service interfaces eno2 unit 0 classifiers dscp-ipv6 BA6_1 set interfaces eno2 unit 0 family inet filter input FF_1 set interfaces eno2 unit 0 family inet6 filter input FF6_1 crpdSelector: matchLabels: node: worker
MF 分类器作为带有监管器的防火墙过滤器:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set firewall family inet filter MCFF_1 term 1 from source-port 1001 set firewall family inet filter MCFF_1 term 1 then forwarding-class af11 set firewall family inet filter MCFF_1 term 1 then three-color-policer single-rate srTCM_1 set firewall family inet filter MCFF_1 term 2 from icmp-type echo-request set firewall family inet filter MCFF_1 term 2 then forwarding-class af31 set firewall family inet filter MCFF_1 term 2 then three-color-policer single-rate srTCM_1 set firewall family inet filter MCFF_1 term 3 then accept set firewall family inet6 filter MCFF6_1 term 1 from source-port 1001 set firewall family inet6 filter MCFF6_1 term 1 then forwarding-class af11 set firewall family inet6 filter MCFF6_1 term 1 then three-color-policer single-rate srTCM_1 set firewall family inet6 filter MCFF6_1 term 2 then accept set interfaces eno2 unit 0 family inet filter input MCFF_1 set interfaces eno2 unit 0 family inet6 filter input MCFF6_1
配置重写/标记
您可以按如下方式配置重写/标记:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set class-of-service rewrite-rules dscp RE_1 forwarding-class af11 loss-priority high code-point 010010 set class-of-service rewrite-rules dscp RE_1 forwarding-class af11 loss-priority low code-point 001100 set class-of-service rewrite-rules dscp RE_1 forwarding-class af11 loss-priority medium-high code-point 000001 set class-of-service rewrite-rules dscp RE_1 forwarding-class af11 loss-priority medium-low code-point 001110 set class-of-service rewrite-rules dscp RE_1 forwarding-class ef loss-priority low code-point 001010 set class-of-service rewrite-rules dscp RE_1 forwarding-class ef loss-priority medium-high code-point 001001 set class-of-service rewrite-rules dscp-ipv6 RE6_1 forwarding-class af11 loss-priority high code-point 010010 set class-of-service rewrite-rules dscp-ipv6 RE6_1 forwarding-class af11 loss-priority low code-point 001100 set class-of-service rewrite-rules dscp-ipv6 RE6_1 forwarding-class af11 loss-priority medium-high code-point 000001 set class-of-service rewrite-rules dscp-ipv6 RE6_1 forwarding-class af11 loss-priority medium-low code-point 001110 set class-of-service rewrite-rules dscp-ipv6 RE6_1 forwarding-class ef loss-priority low code-point 001001 set class-of-service interfaces eno3 unit 0 rewrite-rules dscp RE_1 set class-of-service interfaces eno3 unit 0 rewrite-rules dscp-ipv6 RE6_1 crpdSelector: matchLabels: node: worker
隧道数据包的 MPLS Exp 重写:
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set class-of-service rewrite-rules exp RE_3 forwarding-class af11 loss-priority low code-point 111 set class-of-service rewrite-rules exp RE_3 forwarding-class af11 loss-priority medium-high code-point 101 set class-of-service rewrite-rules exp RE_3 forwarding-class af11 loss-priority medium-low code-point 110 set class-of-service interfaces eno3 unit 0 rewrite-rules exp RE_3 crpdSelector: matchLabels: node: worker
配置调度程序
您可以将调度程序配置为 8 个优先级之一。调度器映射配置转发类到调度器映射,并在接口级别应用。
apiVersion: configplane.juniper.net/v1 kind: Configlet metadata: name: configlet-sample namespace: jcnr spec: config: |- set class-of-service schedulers S1 priority medium-high set class-of-service schedulers S2 priority strict-high set class-of-service schedulers S3 priority high set class-of-service schedulers S4 priority low set class-of-service scheduler-maps VOICE-SCHED-MAP forwarding-class af11 scheduler S1 set class-of-service scheduler-maps VOICE-SCHED-MAP forwarding-class af12 scheduler S2 set class-of-service scheduler-maps VOICE-SCHED-MAP forwarding-class ef scheduler S3 set class-of-service scheduler-maps VOICE-SCHED-MAP forwarding-class nc1 scheduler S4 set class-of-service interfaces eno2 scheduler-map VOICE-SCHED-MAP crpdSelector: matchLabels: node: worker
qos-scheduler-profile
,CoS 配置才有效。调度程序配置文件必须配置 CPU 和带宽分配。有关详细信息,请参阅
Helm Chart 自定义。
L3 CoS 验证
用于验证 L3 CoS 配置的 CLI 命令
验证 cRPD 上的分类器配置
您可以在 cRPD shell 上使用以下命令验证 L3 CoS 配置:
- 使用
show class-of-service classifier
命令验证分类器配置。下面提供了示例输出:user@host> show class-of-service classifier Classifier: BA_1, Code point type: dscp Code point Forwarding class Loss priority 000001 af11 high 001000 cs1 medium-high 001010 af11 low 001100 af11 medium-low 001110 af11 medium-high 010000 cs1 medium-high 010010 af21 medium-low 010100 af22 medium-high 010110 af23 high 011100 af32 high 101111 ef low 110000 nc1 low 111000 nc1 low 111010 af31 low Classifier: BA6_1, Code point type: dscp-ipv6 Code point Forwarding class Loss priority 001010 af33 low 010000 cs2 medium-high 011000 cs3 medium-low 101111 ef low 110000 cs4 medium-low 111000 nc2 high
- 使用
show class-of-service code-point-aliases
命令验证 code-point-alisases 配置。下面提供了示例输出:user@host> show class-of-service code-point-aliases Code point type: dscp Alias Bit pattern af11 001010 af12 001100 af13 001110 af21 010010 af22 010100 af23 010110 af31 011010 af32 011100 af33 011110 af41 100010 af42 100100 af43 100110 be 000000 cs1 001000 cs2 010000 cs3 011000 cs4 100000 cs5 101000 cs6 110000 cs7 111000 ef 101110 nc1 110000 nc2 111000 Code point type: dscp-ipv6 Alias Bit pattern af11 001010 af12 001100 af13 001110 af21 010010 af22 010100 af23 010110 af31 011010 af32 011100 af33 011110 af41 100010 af42 100100 af43 100110 be 000000 cs1 001000 cs2 010000 cs3 011000 cs4 100000 cs5 101000 cs6 110000 cs7 111000 ef 101110 nc1 110000 nc2 111000
- 使用
show class-of-service interface
命令验证接口上的 CoS 配置。下面提供了示例输出:user@host> show class-of-service interface eno2 Physical interface: eno2 Maximum usable queues: 8, Queues in use: 8 Logical interface: eno2.0 Object Name Type Classifier BA_1 dscp Classifier BA6_1 dscp-ipv6
- 使用
show class-of-service rewrite-rule
命令验证重写规则配置。下面提供了示例输出:user@host> show class-of-service rewrite-rule Rewrite rule: RE_1, Code point type: dscp Forwarding class Loss priority Code point ef low 100001 af11 low 000010 af11 high 000101 af11 medium-low 000011 af11 medium-high 000100 af21 medium-low 000110 af22 medium-high 000111 af23 high 001000 af31 low 001111 af32 high 001010 cs1 medium-high 001011 nc1 low 001101 Rewrite rule: RE6_1, Code point type: dscp-ipv6 Forwarding class Loss priority Code point ef low 000001 af33 low 001110 cs2 medium-high 010011 cs3 medium-low 101010 cs4 medium-low 111111 nc2 high 111100 Rewrite rule: RE_3, Code point type: exp Forwarding class Loss priority Code point af11 low 111 af11 medium-low 110 af11 medium-high 101
验证 vRouter 上的 CoS 分类器
bash-5.1# qosdpdk --list cla Classifer name: BA_1 Traffic-class: dscp =============================================================== code-points loss priority forwarding-class-id =============================================================== 000000(0) n/a n/a 000001(1) high 65 000010(2) n/a n/a 000011(3) n/a n/a 000100(4) n/a n/a 000101(5) n/a n/a 000110(6) n/a n/a 000111(7) n/a n/a 001000(8) medium-high 74 001001(9) n/a n/a 001010(10) low 65 001011(11) n/a n/a 001100(12) medium-low 65 001101(13) n/a n/a 001110(14) medium-high 65 001111(15) n/a n/a 010000(16) medium-high 74 010001(17) n/a n/a 010010(18) medium-low 68 010011(19) n/a n/a 010100(20) medium-high 69 010101(21) n/a n/a 010110(22) high 70 010111(23) n/a n/a 011000(24) n/a n/a 011001(25) n/a n/a 011010(26) n/a n/a 011011(27) n/a n/a 011100(28) high 72 011101(29) n/a n/a 011110(30) n/a n/a 011111(31) n/a n/a ====================================================================== Classifer name: BA6_1 Traffic-class: dscpv6 =============================================================== code-points loss priority forwarding-class-id =============================================================== 000000(0) n/a n/a 000001(1) n/a n/a 000010(2) n/a n/a 000011(3) n/a n/a 000100(4) n/a n/a 000101(5) n/a n/a 000110(6) n/a n/a 000111(7) n/a n/a 001000(8) n/a n/a 001001(9) n/a n/a 001010(10) low 73 001011(11) n/a n/a 001100(12) n/a n/a 001101(13) n/a n/a 001110(14) n/a n/a 001111(15) n/a n/a 010000(16) medium-high 75 010001(17) n/a n/a 010010(18) n/a n/a 010011(19) n/a n/a 010100(20) n/a n/a 010101(21) n/a n/a 010110(22) n/a n/a 010111(23) n/a n/a 011000(24) medium-low 76 011001(25) n/a n/a 011010(26) n/a n/a 011011(27) n/a n/a 011100(28) n/a n/a 011101(29) n/a n/a 011110(30) n/a n/a 011111(31) n/a n/a ======================================================================
验证重写规则
bash-5.1# qosdpdk --list re-write Re-Write name: RE_1 Traffic-class: dscp ====================================================================== loss priority Forwarding-class re-write prio ====================================================================== low 0 001100(12) low 1 n/a low 2 n/a low 3 101111(47) low 4 001010(10) low 5 010100(20) low 6 111010(58) low 7 011100(28) low 8 n/a low 9 n/a low 10 010000(16) low 11 n/a low 12 n/a low 13 n/a low 14 n/a low 15 111100(60) high 0 010010(18) high 1 n/a high 2 n/a high 3 n/a high 4 n/a high 5 n/a high 6 n/a high 7 n/a high 8 n/a high 9 n/a high 10 n/a high 11 n/a high 12 n/a high 13 n/a high 14 n/a high 15 n/a medium-low 0 001110(14) medium-low 1 110000(48) medium-low 2 010110(22) medium-low 3 100000(32) medium-low 4 n/a medium-low 5 n/a medium-low 6 n/a medium-low 7 n/a medium-low 8 n/a medium-low 9 n/a medium-low 10 n/a medium-low 11 n/a medium-low 12 n/a medium-low 13 n/a medium-low 14 n/a medium-low 15 n/a medium-high 0 000001(1) medium-high 1 n/a medium-high 2 n/a medium-high 3 n/a medium-high 4 001001(9) medium-high 5 n/a medium-high 6 n/a medium-high 7 n/a medium-high 8 n/a medium-high 9 n/a medium-high 10 n/a medium-high 11 n/a medium-high 12 n/a medium-high 13 n/a medium-high 14 n/a medium-high 15 n/a ====================================================================== Re-Write name: RE6_1 Traffic-class: dscpv6 ====================================================================== loss priority Forwarding-class re-write prio ====================================================================== low 0 001100(12) low 1 n/a low 2 n/a low 3 101111(47) low 4 001001(9) low 5 010100(20) low 6 111010(58) low 7 011100(28) low 8 n/a low 9 n/a low 10 010000(16) low 11 n/a low 12 n/a low 13 n/a low 14 n/a low 15 111100(60) high 0 010010(18) high 1 n/a high 2 n/a high 3 n/a high 4 n/a high 5 n/a high 6 n/a high 7 n/a high 8 n/a high 9 n/a high 10 n/a high 11 n/a high 12 n/a high 13 n/a high 14 n/a high 15 n/a medium-low 0 001110(14) medium-low 1 110000(48) medium-low 2 010110(22) medium-low 3 100000(32) medium-low 4 n/a medium-low 5 n/a medium-low 6 n/a medium-low 7 n/a medium-low 8 n/a medium-low 9 n/a medium-low 10 n/a medium-low 11 n/a medium-low 12 n/a medium-low 13 n/a medium-low 14 n/a medium-low 15 n/a medium-high 0 000001(1) medium-high 1 n/a medium-high 2 n/a medium-high 3 n/a medium-high 4 n/a medium-high 5 n/a medium-high 6 n/a medium-high 7 n/a medium-high 8 n/a medium-high 9 n/a medium-high 10 n/a medium-high 11 n/a medium-high 12 n/a medium-high 13 n/a medium-high 14 n/a medium-high 15 n/a ======================================================================
验证 MF 分类器的 ACL
bash-5.1# acl --list-filters --family inet ======================================= Filter: MCFF_3 ======================================= Term: 1 ----- Priority: 256 Src ports: [1005 - 1005] POLICER Id: 0 Action: policer (V4MCFF_31trTCM_2) Action: fc (af11) ======================================= ======================================= Filter: MCFF_3 ======================================= Term: 2 ----- Priority: 255 ICMP Type: 8 POLICER Id: 1 Action: policer (V4MCFF_32trTCM_2) Action: fc (af31) ======================================= ======================================= Filter: MCFF_3 ======================================= Term: 3 ----- Priority: 254 Action: accept (n/a) ======================================= bash-5.1# bash-5.1# acl --list-filters --family inet6 ======================================= Filter: MCFF6_3 ======================================= Term: 1 ----- Priority: 256 Dest IP: ::/0 Src IP: ::/0 Src ports: [1005 - 1005] POLICER Id: 2 Action: policer (V6MCFF6_31trTCM_2) Action: fc (af11) ======================================= ======================================= Filter: MCFF6_3 ======================================= Term: 2 ----- Priority: 255 Dest IP: ::/0 Src IP: ::/0 Dst ports: [2152 - 2152] POLICER Id: 3 Action: policer (V6MCFF6_32trTCM_2) Action: fc (nc2) ======================================= ======================================= Filter: MCFF6_3 ======================================= Term: 3 ----- Priority: 254 Dest IP: ::/0 Src IP: ::/0 Action: accept (n/a) ======================================= bash-5.1#
V4MCFF_31trTCM_2
,术语 2 具有同一监管器
srTCM_2.
的监管器实例
V4MCFF_32trTCM_2
验证监管器统计信息
bash-5.1# qosdpdk --get policer --name V4MCFF_32trTCM_2 ===================================== Policer parameters: ===================================== policer name: V4MCFF_32trTCM_2 policer id: 1 policer type: trTCM policer loss_priority: high policer tcm_action: tcm_discard policer color type: color_aware policer_cir: 6250000 policer_pir: 8750000 policer_cbs: 10000 policer_pbs: 10000 rx_pkts: 1 rx_bytes: 54 drop_pkts: 1 drop_bytes: 54 =====================================
bash-5.1# acl --family inet --filter FF_1 --action V4FF_11srTCM_1 inet filter "FF_1": Policer "V4FF_11srTCM_1" Rx Packets: 1 Rx Bytes: 54 Dropped Packets: 1 Dropped Bytes: 54
验证调度器统计信息
bash-5.1# qosdpdk --get sch --name VOICE-SCHED-MAP Fetch Qos FC info Scheduler name: VOICE-SCHED-MAP Scheduler Index: 0 ============================================== forwarding-class priority ============================================== af11(64) medium-high(2) af12(65) strict-high(0) ef(77) high(1) nc1(78) low(7)
验证接口速率统计信息:
bash-5.1# scheduler --rate Interface rate statistics ------------------------- Interface Vif Scheduler Sched-core-Rx Sched-Port-Rx Sched-Port-Tx ID core Errors Packets Errors Packets Errors Packets eno2 2 4 0 123123 1003 123123 0 123123
验证调度器端口统计信息:
bash-5.1# scheduler --port 2 Scheduler port stats for vif 2, lcore id 4 -------------------------------------------------------------------------------------------------------------- Prio Pkts Bytes Pkts Bytes Avg OK OK Dropped Dropped Qlen -------------------------------------------------------------------------------------------------------------- [00] 4653800464 4500225051704 0 0 0 [01] 5832256302 8795042503416 0 0 0 [02] 4698800780 7085790896132 0 0 0 [03] 2331518465 3520455006380 0 0 0 [04] 116345 175448260 0 0 0 [05] 116345 175448260 0 0 0 [06] 116345 175448260 0 0 0 [07] 1164485219 1756043285364 0 0 0 --------------------------------------------------------------------------------------------------------------
验证调度器端口速率统计信息:
bash-5.1# scheduler –-portrate 2 Scheduler port stats for vif0/2 ------------------------------- Scheduler port stats for vif 2, lcore id 4 -------------------------------------------- Prio Pkts Bytes Pkts Bytes Avg OK OK Dropped Dropped Qlen -------------------------------------------- [00] 68195 102839272 0 0 0 [01] 136391 205678545 0 0 0 [02] 68196 102840779 0 0 0 [03] 68197 102842285 0 0 0 [04] 68196 102840779 0 0 0 [05] 68196 102840779 0 0 0 [06] 68196 102840779 0 0 0 [07] 136390 205677038 0 0 0 --------------------------------------------
清除调度器端口统计信息:
bash-5.1# scheduler --port 2 --clear Counters cleared for scheduler port 2
验证接口上应用的 CoS 功能
bash-5.1# vif --get 2 Vrouter Interface Table Flags: P=Policy, X=Cross Connect, S=Service Chain, Mr=Receive Mirror Mt=Transmit Mirror, Tc=Transmit Checksum Offload, L3=Layer 3, L2=Layer 2 D=DHCP, Vp=Vhost Physical, Pr=Promiscuous, Vnt=Native Vlan Tagged Mnp=No MAC Proxy, Dpdk=DPDK PMD Interface, Rfl=Receive Filtering Offload, Mon=Interface is Monitored Uuf=Unknown Unicast Flood, Vof=VLAN insert/strip offload, Df=Drop New Flows, L=MAC Learning Enabled Proxy=MAC Requests Proxied Always, Er=Etree Root, Mn=Mirror without Vlan Tag, HbsL=HBS Left Intf HbsR=HBS Right Intf, Ig=Igmp Trap Enabled, Ml=MAC-IP Learning Enabled, Me=Multicast Enabled LsDp=Link down in DP only, Ccc=CCC Enabled, HwTs=Hardware support for Timestamp vif0/2 PCI: 0000:ca:01.2 (Speed 10000, Duplex 1) NH: 8 MTU: 9216 Type:Physical HWaddr:48:5a:0d:6f:b2:1a IPaddr:10.0.1.1 IP6addr:1001::1 DDP: OFF SwLB: ON Vrf:0 Mcast Vrf:0 Flags:L3Vof QOS:0 Ref:17 RX port packets:37865806023 errors:0 RX queue errors to lcore 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Fabric Interface: 0000:ca:01.2 Status: UP Driver: net_iavf Qos classifier: dscp:BA_1 dscpv6:BA6_1 Rewrite: dscp:RE_1 dscpv6:RE6_1 Scheduler: VOICE-SCHED-MAP RX packets:37865806022 bytes:5452675961518 errors:0 TX packets:18646972033 bytes:25596179340972 errors:0 Drops:1835520 Scheduler Enqueue packets:27565192935 errors:0 Scheduler Dequeue packets:27565192935 errors:0 TX port packets:18646972033 errors:0 inet acl MCFF_1 inet6 acl MCFF6_1