QoS 配置
QoS 配置是 配置交换机中所述的交换机配置工作流的一部分。本主题提供更多详细信息,仅关注 QoS 概念和配置步骤。
服务质量 (QoS) 是一种流量控制机制,可帮助您在拥塞网络中将延迟敏感型流量(如语音)优先于其他流量。瞻博网络 Mist 基于每个接口启用 QoS。QoS的实现一般涉及以下几个方面:
-
对流量进行分类。
-
定义流量到队列的映射(转发类)。
-
为每个队列定义调度程序和重写规则。这些规则控制每个接口上流量的优先级、带宽控制和拥塞管理。
-
将 QoS 组件应用于接口。
在瞻博网络 Mist 中,QoS 利用行为聚合 (BA) 分类,其中传入流量中的 DiffServ 代码点 (DSCP) 或服务等级 (CoS) 值控制分类。BA 分类器将数据包头中的 CoS 值映射到转发等级和丢失优先级。
在接口上启用 QoS 会根据类和重写规则将 DSCP 标记添加到该端口。QoS 机制将带有 DSCP 标记的传入数据包映射到下表中列出的七个转发类之一:
如上表所示,数据包分类根据数据包的转发类将传入数据包分配给输出队列。如果链路出现流量拥堵,瞻博网络 Mist 会将延迟敏感型流量(例如语音流量)优先于其他流量(前提是传入流量已正确标记)。瞻博网络 Mist 还会自动配置重写规则,以便在数据包离开交换机时保留标记。
在交换机端口上启用 QoS
启用 QoS 可帮助您在拥塞网络中将延迟敏感型流量(如语音)优先于其他流量。您可以从交换机详细信息页面或交换机模板上的端口配置文件磁贴在交换机端口上配置 QoS。
确保在下行和上行端口配置文件上启用 QoS,以获得最佳结果。
要在交换机端口上启用 QoS:
要在组织级别配置 QoS,请单击 组织 > 交换机模板 > template name。或者,如果要在交换机级别配置 QoS,请单击 交换机 > switch name。
从“端口配置文件”磁贴中,选择要更新的端口配置文件。或者,如果要创建新的端口配置文件,请单击 添加配置文件。
在配置中,请记住选中“ QoS ”复选框。
通过单击端口配置文件配置窗口右上角的勾号保存配置。
在端口配置文件中配置 QoS 后,将配置文件分配给要在其上配置 QoS 的交换机端口。您可以从交换机配置模板的“选择交换机”部分的“端口配置”选项卡(请参阅 创建交换机配置模板)或“交换机详细信息”页面的“端口配置”部分(交换机详细信息)执行此操作。
覆盖 QoS
您还可以选择覆盖 WLAN 设置页面(站点 > WLAN > WLAN 名称)上的 QoS 配置。要覆盖 QoS 配置,请选中 覆盖 QoS 复选框,然后选择无线访问类(请参阅 WLAN 选项)。下游流量(AP >客户端)使用指定的覆盖访问类值进行标记。覆盖配置不支持上游流量(客户端> AP)。
有关瞻博网络 EX 交换机上 QoS 的更多详细信息,请参阅 示例:在 EX 系列交换机上配置 CoS。如果需要,可以通过交换机详细信息页面其他 CLI 命令部分中的 CLI 完成任何其他 QoS 配置更新。
验证 QoS 设置 (API)
以下示例已 “enable_qos”: true
针对端口配置文件 qos-test
和 uplink
.这表示端口配置文件已启用 QoS。
"port_usages": { "qos-test": { "name": "qos-test", "mode": "access", "disabled": false, "port_network": "vl10", "voip_network": null, "stp_edge": false, "all_networks": false, "networks": [], "port_auth": null, "speed": "auto", "duplex": "auto", "mac_limit": 0, "poe_disabled": false, "enable_qos": true }, "uplink": { "mode": "trunk", "all_networks": true, "stp_edge": false, "port_network": "vlan3", "voip_network": null, "name": "uplink", "disabled": false, "networks": [], "port_auth": null, "speed": "auto", "duplex": "auto", "mac_limit": 0, "poe_disabled": false, "enable_qos": true } },
通过 CLI 验证 QoS 配置
以下是交换机上的 QoS 配置示例:
set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af2 loss-priority high code-points af22 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af2 loss-priority high code-points af23 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af2 loss-priority low code-points af21 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af3 loss-priority high code-points af32 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af3 loss-priority high code-points af33 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af3 loss-priority low code-points af31 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class bizapp-af3 loss-priority low code-points cs3 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class default-app loss-priority low code-points be set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class net-control loss-priority low code-points nc1 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class net-control loss-priority low code-points nc2 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class net-tools loss-priority high code-points af12 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class net-tools loss-priority high code-points af13 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class net-tools loss-priority low code-points af11 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class video loss-priority high code-points af42 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class video loss-priority high code-points af43 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class video loss-priority low code-points af41 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class video loss-priority low code-points cs4 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class voice loss-priority low code-points cs5 set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default forwarding-class voice loss-priority low code-points ef set groups mist-qos-default class-of-service classifiers dscp dscp-classifier-default import default set groups mist-qos-default class-of-service forwarding-classes queue 0 default-app set groups mist-qos-default class-of-service forwarding-classes queue 1 video set groups mist-qos-default class-of-service forwarding-classes queue 2 bizapp-af3 set groups mist-qos-default class-of-service forwarding-classes queue 3 bizapp-af2 set groups mist-qos-default class-of-service forwarding-classes queue 4 net-tools set groups mist-qos-default class-of-service forwarding-classes queue 5 voice set groups mist-qos-default class-of-service forwarding-classes queue 7 net-control set groups mist-qos-default class-of-service interfaces ge-0/0/0 scheduler-map sched-maps-default set groups mist-qos-default class-of-service interfaces ge-0/0/0 unit 0 classifiers dscp dscp-classifier-default set groups mist-qos-default class-of-service interfaces ge-0/0/0 unit 0 rewrite-rules dscp dscp-rewriter-default set groups mist-qos-default class-of-service interfaces ge-0/0/9 scheduler-map sched-maps-default set groups mist-qos-default class-of-service interfaces ge-0/0/9 unit 0 classifiers dscp dscp-classifier-default set groups mist-qos-default class-of-service interfaces ge-0/0/9 unit 0 rewrite-rules dscp dscp-rewriter-default set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewrite-default import default set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class bizapp-af2 loss-priority low code-point af21 set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class bizapp-af3 loss-priority low code-point af31 set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class default-app loss-priority low code-point be set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class net-control loss-priority low code-point nc1 set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class net-tools loss-priority low code-point af11 set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class video loss-priority low code-point af41 set groups mist-qos-default class-of-service rewrite-rules dscp dscp-rewriter-default forwarding-class voice loss-priority low code-point ef set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class bizapp-af2 scheduler bizapp-af2-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class bizapp-af3 scheduler bizapp-af3-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class default-app scheduler default-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class net-control scheduler net-control-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class net-tools scheduler net-tools-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class video scheduler video-scheduler set groups mist-qos-default class-of-service scheduler-maps sched-maps-default forwarding-class voice scheduler voice-scheduler set groups mist-qos-default class-of-service schedulers bizapp-af2-scheduler buffer-size percent 10 set groups mist-qos-default class-of-service schedulers bizapp-af2-scheduler priority low set groups mist-qos-default class-of-service schedulers bizapp-af2-scheduler transmit-rate percent 10 set groups mist-qos-default class-of-service schedulers bizapp-af3-scheduler buffer-size percent 10 set groups mist-qos-default class-of-service schedulers bizapp-af3-scheduler priority low set groups mist-qos-default class-of-service schedulers bizapp-af3-scheduler transmit-rate percent 10 set groups mist-qos-default class-of-service schedulers default-scheduler buffer-size remainder set groups mist-qos-default class-of-service schedulers default-scheduler priority low set groups mist-qos-default class-of-service schedulers default-scheduler transmit-rate remainder set groups mist-qos-default class-of-service schedulers net-control-scheduler buffer-size percent 3 set groups mist-qos-default class-of-service schedulers net-control-scheduler priority low set groups mist-qos-default class-of-service schedulers net-control-scheduler transmit-rate percent 3 set groups mist-qos-default class-of-service schedulers net-tools-scheduler buffer-size percent 3 set groups mist-qos-default class-of-service schedulers net-tools-scheduler priority low set groups mist-qos-default class-of-service schedulers net-tools-scheduler transmit-rate percent 3 set groups mist-qos-default class-of-service schedulers video-scheduler buffer-size percent 8 set groups mist-qos-default class-of-service schedulers video-scheduler priority low set groups mist-qos-default class-of-service schedulers video-scheduler transmit-rate percent 8 set groups mist-qos-default class-of-service schedulers voice-scheduler buffer-size percent 10 set groups mist-qos-default class-of-service schedulers voice-scheduler priority strict-high set groups mist-qos-default class-of-service schedulers voice-scheduler shaping-rate percent 10
要验证与流量匹配的 QoS 策略及其相应的队列计数器,请执行以下操作:
-
通过运行以下命令查看当前接口统计信息和 CoS 信息:
root@ex2300-home> show interfaces ge-0/0/0 extensive ...... Queue counters: Queued packets Transmitted packets Dropped packets 0 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 7 0 0 0 Queue number: Mapped forwarding classes 0 default-app 1 video 2 bizapp-af3 3 bizapp-af2 4 net-tools 5 voice 7 net-control ...... CoS information: Direction : Output CoS transmit queue Bandwidth Buffer Priority Limit % bps % usec 0 default-app r r r 0 low none 1 video 8 80000000 8 0 low none 2 bizapp-af3 10 100000000 10 0 low none 3 bizapp-af2 10 100000000 10 0 low none 4 net-tools 3 30000000 3 0 low none 5 voice r r 10 0 strict-high none 7 net-control 3 30000000 3 0 low none Interface transmit statistics: Disabled
-
生成一些视频和语音流量。设备使用 DSCP 值标记流量(队列 1 用于视频流量,队列 5 用于语音流量)。
ping 8.8.8.8 -I eth0 -Q 184 PING 8.8.8.8 (8.8.8.8) from 10.0.0.2 eth0: 56(84) bytes of data. 53 packets transmitted, 53 received, 0% packet loss, time 140ms rtt min/avg/max/mdev = 2.421/2.811/5.064/0.428 ms
ping 8.8.8.8 -I eth0 -Q 136 PING 8.8.8.8 (8.8.8.8) from 10.0.0.2 eth0: 56(84) bytes of data. 62 packets transmitted, 62 received, 0% packet loss, time 157ms rtt min/avg/max/mdev = 2.396/3.103/6.578/0.609 ms
-
再次运行该
show interfaces ge-0/0/0 extensive
命令。您可以查看“排队的数据包”和“传输的数据包”下显示的数据包计数。root@ex2300-home> show interfaces ge-0/0/0 extensive ....... Egress queues: 8 supported, 7 in use Queue counters: Queued packets Transmitted packets Dropped packets 0 9821 9821 0 1 62 62 0 2 0 0 0 3 7185 7185 0 4 0 0 0 5 53 53 0 7 0 0 0 Queue number: Mapped forwarding classes 0 default-app 1 video 2 bizapp-af3 3 bizapp-af2 4 net-tools 5 voice 7 net-control ....... CoS information: Direction : Output CoS transmit queue Bandwidth Buffer Priority Limit % bps % usec 0 default-app r r r 0 low none 1 video 8 80000000 8 0 low none 2 bizapp-af3 10 100000000 10 0 low none 3 bizapp-af2 10 100000000 10 0 low none 4 net-tools 3 30000000 3 0 low none 5 voice r r 10 0 strict-high none 7 net-control 3 30000000 3 0 low none Interface transmit statistics: Disabled
另请参阅: 示例:在 EX 系列交换机上配置 CoS