示例:在 EX 系列交换机上配置 CoS
在交换机上配置服务等级 (CoS) 来管理流量,以便在网络出现拥塞和延迟时,关键应用得到保护。使用 CoS,您可以将交换机上的流量划分为多个类,并提供不同级别的吞吐量和丢包情况。这对于对抖动和延迟敏感的流量(如语音流量)尤为重要。
此示例说明如何在网络中的单个 EX 系列交换机上配置 CoS。
要求
此示例使用以下硬件和软件组件:
EX 系列交换机
EX 系列交换机使用的 Junos OS 9.0 或更高版本
概述和拓扑
此示例使用 图 1 中所示的拓扑。
的拓扑
此配置示例的拓扑由接入层的 EX 交换机组成。
EX 系列接入交换机配置为支持 VLAN 成员资格。在接入层交换机上,将接口ge-0/0/0和ge-0/0/1分配给两个 VoIP IP 电话的语音 VLAN (voice-vlan)。交换机接口ge-0/0/2已分配给监控摄像机的摄像机 VLAN (camera-vlan)。交换机接口ge-0/0/3、ge-0/0/4、ge-0/0/5ge-0/0/6、被分配给服务器 VLAN (server-vlan),用于托管各种应用程序(如 Citrix、Microsoft、Oracle 和 SAP 提供的应用程序)的服务器。中继端口 ge-0/0/20 和 ge-0/0/21 被分配给服务器、语音、员工和摄像头 VLAN,并用作连接分布层交换机的上行链路端口。
VLAN 配置组件如表 1 所示。
| VLAN 名称 |
VLAN ID |
VLAN 子网和可用 IP 地址 |
VLAN 说明 |
|---|---|---|---|
|
|
|
|
用于员工 VoIP 通信的语音 VLAN。 |
|
|
|
|
监控摄像头的 VLAN。 |
|
|
|
|
用于托管企业应用的服务器的 VLAN。 |
EX 系列交换机上支持 PoE 功能的端口支持以太网供电 (PoE),可为连接到端口的 VoIP 电话提供网络连接和电源。 表 2 显示了分配给 VLAN 的交换机接口,以及连接到 48 端换机上交换机端口的设备的 IP 地址,这些交换机的所有端口都支持 PoE。
| 接口 |
VLAN 成员 |
IP 地址 |
端口设备 |
|---|---|---|---|
|
|
|
|
两部VoIP电话。 |
|
|
|
|
监控摄像头。 |
|
|
|
|
四台服务器托管应用程序,例如由 Citrix、Microsoft、Oracle 和 SAP 提供的应用程序。 |
此示例说明如何在独立的 EX 系列交换机上配置 CoS。此示例不考虑 CoS 的跨网络应用,在这些应用中,您可以在入口和出换机上实施不同的配置,以便为网络中一组节点的不同类别提供差异化处理。
尽管您有时会看到配置了传输速率的严格高优先级调度程序,但这种配置具有误导性,因为严格高优先级调度程序可获得无限带宽,而传输速率参数对它们没有影响。使用此配置,如果出现拥塞,优先级较低的队列可能会挨饿。具有严格-高优先级的调度器最好配置整形率参数,这是限制其带宽的正确方法。
配置
程序
CLI 快速配置
要快速配置 CoS,请复制以下命令并将其粘贴到交换机终端窗口中:
[edit] set class-of-service forwarding-classes class app queue-num 5 set class-of-service forwarding-classes class mail queue-num 1 set class-of-service forwarding-classes class db queue-num 2 set class-of-service forwarding-classes class erp queue-num 3 set class-of-service forwarding-classes class video queue-num 4 set class-of-service forwarding-classes class best-effort queue-num 0 set class-of-service forwarding-classes class voice queue-num 6 set class-of-service forwarding-classes class network-control queue-num 7 set firewall family ethernet-switching filter voip_class term voip from source-address 192.168.1.1/28 set firewall family ethernet-switching filter voip_class term voip from source-address 192.168.1.2/28 set firewall family ethernet-switching filter voip_class term voip from protocol udp set firewall family ethernet-switching filter voip_class term voip from source-port 2698 set firewall family ethernet-switching filter voip_class term voip then forwarding-class voice loss-priority low set firewall family ethernet-switching filter voip_class term network_control from precedence [net-control internet-control] set firewall family ethernet-switching filter voip_class term network_control then forwarding-class network-control loss-priority low set firewall family ethernet-switching filter voip_class term best_effort_traffic then forwarding-class best-effort loss-priority low set interfaces ge-0/0/0 description phone1–voip-ingress-port set interfaces ge-0/0/0 unit 0 family ethernet-switching filter input voip_class set class-of-service interfaces ge-0/0/0 shaping-rate 100m set interfaces ge-0/0/1 description phone2–voip-ingress-port set interfaces ge-0/0/1 unit 0 family ethernet-switching filter input voip_class set firewall family ethernet-switching filter video_class term video from source-address 192.168.1.17/28 set firewall family ethernet-switching filter video_class term video from protocol udp set firewall family ethernet-switching filter video_class term video from source-port 2979 set firewall family ethernet-switching filter video_class term video then forwarding-class video loss-priority low set firewall family ethernet-switching filter video_class term network_control from precedence [net-control internet-control] set firewall family ethernet-switching filter video_class term network_control then forwarding-class network-control loss-priority low set firewall family ethernet-switching filter video_class term best_effort_traffic then forwarding-class best-effort loss-priority low set interfaces ge-0/0/2 description video-ingress-port set interfaces ge-0/0/2 unit 0 family ethernet-switching filter input video_class set firewall family ethernet-switching filter app_class term app from source-address 192.168.1.33/28 set firewall family ethernet-switching filter app_class term app from protocol tcp set firewall family ethernet-switching filter app_class term app from source-port [1494 2512 2513 2598 2897] set firewall family ethernet-switching filter app_class term app then forwarding-class app loss-priority low set firewall family ethernet-switching filter app_class term mail from source-address 192.168.1.34/28 set firewall family ethernet-switching filter app_class term mail from protocol tcp set firewall family ethernet-switching filter app_class term mail from source-port [25 143 389 691 993 3268 3269] set firewall family ethernet-switching filter app_class term mail then forwarding-class mail loss-priority low set firewall family ethernet-switching filter app_class term db from source-address 192.168.1.35/28 set firewall family ethernet-switching filter app_class term db from protocol tcp set firewall family ethernet-switching filter app_class term db from source-port [1521 1525 1527 1571 1810 2481] set firewall family ethernet-switching filter app_class term db then forwarding-class db loss-priority low set firewall family ethernet-switching filter app_class term erp from source-address 192.168.1.36/28 set firewall family ethernet-switching filter app_class term erp from protocol tcp set firewall family ethernet-switching filter app_class term erp from source-port [3200 3300 3301 3600] set firewall family ethernet-switching filter app_class term erp then forwarding-class erp loss-priority low set firewall family ethernet-switching filter app_class term network_control from precedence [net-control internet-control] set firewall family ethernet-switching filter app_class term network_control then forwarding-class network-control loss-priority low set firewall family ethernet-switching filter app_class term best_effort_traffic then forwarding-class best-effort loss-priority low set interfaces ge-0/0/3 unit 0 family ethernet-switching filter input app_class set interfaces ge-0/0/4 unit 0 family ethernet-switching filter input app_class set interfaces ge-0/0/5 unit 0 family ethernet-switching filter input app_class set interfaces ge-0/0/6 unit 0 family ethernet-switching filter input app_class set class-of-service schedulers voice-sched shaping-rate percent 10 set class-of-service schedulers voice-sched buffer-size percent 10 set class-of-service schedulers voice-sched priority strict-high set class-of-service schedulers video-sched priority low set class-of-service schedulers video-sched transmit-rate percent 15 set class-of-service schedulers app-sched buffer-size percent 10 set class-of-service schedulers app-sched priority low set class-of-service schedulers app-sched transmit-rate percent 10 set class-of-service schedulers mail-sched buffer-size percent 5 set class-of-service schedulers mail-sched priority low set class-of-service schedulers mail-sched transmit-rate percent 5 set class-of-service schedulers db-sched buffer-size percent 10 set class-of-service schedulers db-sched priority low set class-of-service schedulers db-sched transmit-rate percent 10 set class-of-service schedulers erp-sched buffer-size percent 10 set class-of-service schedulers erp-sched priority low set class-of-service schedulers erp-sched transmit-rate percent 10 set class-of-service schedulers nc-sched shaping-rate percent 5 set class-of-service schedulers nc-sched buffer-size percent 5 set class-of-service schedulers nc-sched priority strict-high set class-of-service schedulers be-sched buffer-size percent 35 set class-of-service schedulers be-sched priority low set class-of-service schedulers be-sched transmit-rate percent 35 set class-of-service scheduler-maps ethernet-cos-map forwarding-class voice scheduler voice-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class video scheduler video-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class app scheduler app-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class mail scheduler mail-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class db scheduler db-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class erp scheduler erp-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class network-control scheduler nc-sched set class-of-service scheduler-maps ethernet-cos-map forwarding-class best-effort scheduler be-sched set class-of-service interfaces ge-0/0/20 scheduler-map ethernet-cos-map set class-of-service interfaces ge-0/0/21 scheduler-map ethernet-cos-map set class-of-service schedulers voice-sched-queue-shap shaping-rate 30m set class-of-service scheduler-maps sched-map-be forwarding-class best-effort scheduler voice-sched-queue-shap set class-of-service interfaces ge-0/0/2 scheduler-map sched-map-be
分步过程
要配置和应用 CoS,请执行以下作:
配置 8 个转发类和 8 个队列之间的一对一映射:
[edit class-of-service] user@switch# set forwarding-classes class app queue-num 5 user@switch# set forwarding-classes class mail queue-num 1 user@switch# set forwarding-classes class db queue-num 2 user@switch# set forwarding-classes class erp queue-num 3 user@switch# set forwarding-classes class video queue-num 4 user@switch# set forwarding-classes class best-effort queue-num 0 user@switch# set forwarding-classes class voice queue-num 6 user@switch# set forwarding-classes class network-control queue-num 7
定义防火墙过滤器
voip_class以对 VoIP 流量进行分类:[edit firewall] user@switch# set family ethernet-switching filter voip_class
定义术语
voip:[edit firewall] user@switch# set family ethernet-switching filter voip_class term voip from source-address 192.168.1.1/28 user@switch# set family ethernet-switching filter voip_class term voip from source-address 192.168.1.2/28 user@switch# set family ethernet-switching filter voip_class term voip protocol udp user@switch# set family ethernet-switching filter voip_class term voip source-port 2698 user@switch# set family ethernet-switching filter voip_class term voip then forwarding-class voice loss-priority low
定义术语
network_control(用于筛选器voip_class):[edit firewall] user@switch# set family ethernet-switching filter voip_class term network_control from precedence [net-control internet-control] user@switch# set family ethernet-switching filter voip_class term network_control then forwarding-class network-control loss-priority low
定义没有匹配条件的术语
best_effort_traffic(对于voip_class筛选器):[edit firewall] user@switch# set family ethernet-switching filter voip_class term best_effort_traffic then forwarding-class best-effort loss-priority low
将防火墙过滤器
voip_class作为输入过滤器应用于 VoIP 电话的接口:[edit interfaces] user@switch# set ge-0/0/0 description phone1-voip-ingress-port user@switch# set ge-0/0/0 unit 0 family ethernet-switching filter input voip_class user@switch# set ge-0/0/1 description phone2-voip-ingress-port user@switch# set ge-0/0/1 unit 0 family ethernet-switching filter input voip_class
在接口 ge-0/0/0 上应用端口整形:
[edit] user@switch# set class-of-service interfaces ge-0/0/0 shaping-rate 100m
定义防火墙过滤器
video_class以对视频流量进行分类:[edit firewall] user@switch# set family ethernet-switching filter video_class
定义术语
video:[edit firewall] user@switch# set family ethernet-switching filter video_class term video from source-address 192.168.1.17/28 user@switch# set family ethernet-switching filter video_class term video protocol udp user@switch# set family ethernet-switching filter video_class term video source-port 2979 user@switch# set family ethernet-switching filter video_class term video then forwarding-class video loss-priority low
定义术语
network_control(用于筛选器video_class):[edit firewall] user@switch# set family ethernet-switching filter video_class term network_control from precedence [net-control internet-control] user@switch# set family ethernet-switching filter video_class term network_control then forwarding-class network-control loss-priority low
定义没有匹配条件的术语
best_effort_traffic(对于video_class筛选器):[edit firewall] user@switch# set family ethernet-switching filter video_class term best_effort_traffic then forwarding-class best-effort loss-priority low
将防火墙过滤器
video_class作为输入过滤器应用于监控摄像头的接口:[edit interfaces] user@switch# set ge-0/0/2 description video-ingress-port user@switch# set ge-0/0/2 unit 0 family ethernet-switching filter input video_class
定义防火墙过滤器
app_class以对应用程序服务器流量进行分类:[edit firewall] user@switch# set family ethernet-switching filter app_class
定义术语
app(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term app from source-address 192.168.1.33/28 user@switch# set family ethernet-switching filter app_class term app protocol tcp user@switch# set family ethernet-switching filter app_class term app source-port [1494 2512 2513 2598 2897] user@switch# set family ethernet-switching filter app_class term app then forwarding-class app loss-priority low
定义术语
mail(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term mail from source-address 192.168.1.34/28 user@switch# set family ethernet-switching filter app_class term mail protocol tcp user@switch# set family ethernet-switching filter app_class term mail source-port [25 143 389 691 993 3268 3269] user@switch# set family ethernet-switching filter app_class term mail then forwarding-class mail loss-priority low
定义术语
db(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term db from source-address 192.168.1.35/28 user@switch# set family ethernet-switching filter app_class term db protocol tcp user@switch# set family ethernet-switching filter app_class term db source-port [1521 1525 1527 1571 1810 2481] user@switch# set family ethernet-switching filter app_class term db then forwarding-class db loss-priority low
定义术语
erp(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term erp from source-address 192.168.1.36/28 user@switch# set family ethernet-switching filter app_class term erp protocol tcp user@switch# set family ethernet-switching filter app_class term erp source-port [3200 3300 3301 3600] user@switch# set family ethernet-switching filter app_class term erp then forwarding-class erp loss-priority low
定义术语
network_control(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term network_control from precedence [net-control internet-control] user@switch# set family ethernet-switching filter app_class term network_control then forwarding-class network-control loss-priority low
定义术语
best_effort_traffic(用于筛选器app_class):[edit firewall] user@switch# set family ethernet-switching filter app_class term best_effort_traffic then forwarding-class best-effort loss-priority low
将防火墙过滤器
app_class作为输入过滤器应用于托管应用程序的服务器的接口:[edit interfaces] user@switch# set ge-0/0/3 unit 0 family ethernet-switching filter input app_class user@switch# set ge-0/0/4 unit 0 family ethernet-switching filter input app_class user@switch# set ge-0/0/5 unit 0 family ethernet-switching filter input app_class user@switch# set ge-0/0/6 unit 0 family ethernet-switching filter input app_class
配置调度器:
[edit class-of-service] user@switch# set schedulers voice-sched shaping-rate percent 10 user@switch# set schedulers voice-sched buffer-size percent 10 user@switch# set schedulers voice-sched priority strict-high user@switch# set schedulers video-sched priority low user@switch# set schedulers video-sched transmit-rate percent 15 user@switch# set schedulers app-sched buffer-size percent 10 user@switch# set schedulers app-sched priority low user@switch# set schedulers app-sched transmit-rate percent 10 user@switch# set schedulers mail-sched buffer-size percent 5 user@switch# set schedulers mail-sched priority low user@switch# set schedulers mail-sched transmit-rate percent 5 user@switch# set schedulers db-sched buffer-size percent 10 user@switch# set schedulers db-sched priority low user@switch# set schedulers db-sched transmit-rate percent 10 user@switch# set schedulers erp-sched buffer-size percent 10 user@switch# set schedulers erp-sched priority low user@switch# set schedulers erp-sched transmit-rate percent 10 user@switch# set schedulers nc-sched shaping-rate percent 5 user@switch# set schedulers nc-sched buffer-size percent 5 user@switch# set schedulers nc-sched priority strict-high user@switch# set schedulers nc-sched transmit-rate percent 5 user@switch# set schedulers be-sched buffer-size percent 35 user@switch# set schedulers be-sched priority low user@switch# set schedulers be-sched transmit-rate percent 35
使用调度器图
ethernet-cos-map将转发类分配给调度器:[edit class-of-service] user@switch# set scheduler-maps ethernet-cos-map forwarding-class voice scheduler voice-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class video scheduler video-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class app scheduler app-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class mail scheduler mail-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class db scheduler db-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class erp scheduler erp-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class network-control scheduler nc-sched user@switch# set scheduler-maps ethernet-cos-map forwarding-class best-effort scheduler be-sched
将调度器图与传出接口相关联:
[edit class-of-service interfaces] user@switch# set ge-0/0/20 scheduler-map ethernet-cos-map user@switch# set ge-0/0/21 scheduler-map ethernet-cos-map
为尽力而为队列应用队列整形:
[edit] user@switch# set class-of-service schedulers voice-sched-queue-shap shaping-rate 30m user@switch# set class-of-service scheduler-maps sched-map-be forwarding-class best-effort scheduler voice-sched-queue-shap user@switch# set class-of-service interfaces ge-0/0/2 scheduler-map sched-map-be
结果
显示配置结果:
user@switch> show firewall
firewall family ethernet-switching {
filter voip_class {
term voip {
from {
source-address {
192.168.1.1/28;
192.168.1.2/28;
}
protocol udp;
source-port 2698;
}
then {
forwarding-class voice;
loss-priority low;
}
}
term network control {
from {
precedence [net-control internet-control];
}
then {
forwarding-class network-control;
loss-priority low;
}
}
term best_effort_traffic {
then {
forwarding-class best-effort;
loss-priority low;
}
}
}
filter video_class {
term video {
from {
source-address {
192.168.1.17/28;
}
protocol udp;
source-port 2979;
}
then {
forwarding-class video;
loss-priority low;
}
}
term network control {
from {
precedence [net-control internet-control];
}
then {
forwarding-class network-control;
loss-priority low;
}
}
term best_effort_traffic {
then {
forwarding-class best-effort;
loss-priority low;
}
}
}
filter app_class {
term app {
from {
source-address {
192.168.1.33/28;
}
protocol tcp;
source-port [1491 2512 2513 2598 2897];
}
then {
forwarding-class app;
loss-priority low;
}
}
term mail {
from {
source-address {
192.168.1.34/28;
}
protocol tcp;
source-port [25 143 389 691 993 3268 3269];
}
then {
forwarding-class mail;
loss-priority low;
}
}
term db {
from {
source-address {
192.168.1.35/28;
}
protocol tcp;
source-port [1521 1525 1527 1571 1810 2481];
}
then {
forwarding-class db;
loss-priority low;
}
}
term erp {
from {
source-address {
192.168.1.36/28;
}
protocol tcp;
source-port [3200 3300 3301 3600];
}
then {
forwarding-class erp;
loss-priority low;
}
}
term network control {
from {
precedence [net-control internet-control];
}
then {
forwarding-class network-control;
loss-priority low;
}
}
term best_effort_traffic {
then {
forwarding-class best-effort;
loss-priority low;
}
}
}
}
user@switch# show class-of-service
forwarding-classes {
class app queue-num 5;
class mail queue-num 1;
class db queue-num 2;
class erp queue-num 3;
class video queue-num 4;
class best-effort queue-num 0;
class voice queue-num 6;
class network-control queue-num 7;
}
interfaces {
ge-0/0/0 {
shaping-rate 100m;
}
ge-0/0/2 {
scheduler-map sched-map-be;
}
ge-0/0/20 {
scheduler-map ethernet-cos-map;
}
ge-0/0/21 {
scheduler-map ethernet-cos-map;
}
}
schedulers {
voice-sched-queue-shap {
shaping-rate 30m;
}
voice-sched {
shaping-rate percent 10;
buffer-size percent 10;
priority strict-high;
}
video-sched {
buffer-size percent 15;
priority low;
transmit-rate percent 15;
}
app-sched {
buffer-size percent 10;
priority low;
transmit-rate percent 10;
}
mail-sched {
buffer-size percent 5;
priority low;
transmit-rate percent 5;
}
db-sched {
buffer-size percent 10;
priority low;
transmit-rate percent 10;
}
erp-sched {
buffer-size percent 10;
priority low;
transmit-rate percent 10;
}
nc-sched {
shaping-rate percent 5;
buffer-size percent 5;
priority strict-high;
}
be-sched {
buffer-size percent 35;
priority low;
transmit-rate percent 35;
}
}
scheduler-maps {
ethernet-cos-map {
forwarding-class voice scheduler voice-sched;
forwarding-class video scheduler video-sched;
forwarding-class app scheduler app-sched;
forwarding-class mail scheduler mail-sched;
forwarding-class db scheduler db-sched;
forwarding-class erp scheduler erp-sched;
forwarding-class network-control scheduler nc-sched;
forwarding-class best-effort scheduler be-sched;
}
sched-map-be {
forwarding-class best-effort scheduler voice-sched-queue-shap;
}
}
user@switch# show interfaces
ge-0/0/0 {
unit 0 {
family ethernet {
filter {
input voip_class;
}
}
}
}
ge-0/0/1 {
unit 0 {
family ethernet {
filter {
input voip_class;
}
}
}
}
ge-0/0/2 {
unit 0 {
family ethernet {
filter {
input video_class;
}
}
}
}
ge-0/0/3 {
unit 0 {
family ethernet {
filter {
input app_class;
}
}
}
}
ge-0/0/4 {
unit 0 {
family ethernet {
filter {
input app_class;
}
}
}
}
ge-0/0/5 {
unit 0 {
family ethernet {
filter {
input app_class;
}
}
}
}
ge-0/0/6 {
unit 0 {
family ethernet {
filter {
input app_class;
}
}
}
}
验证
要确认配置工作正常,请执行以下任务:
验证定义的转发类是否存在以及是否映射到队列
目的
验证是否已定义转发类、、、dberp、mailvideonetwork-control和voice转发类app并将其best-effort映射到队列。
行动
user@switch> show class-of-service forwarding-class Forwarding class ID Queue app 0 5 db 1 2 erp 2 3 best-effort 3 0 mail 4 1 voice 5 6 video 6 4 network-control 7 7
意义
此输出显示转发类已定义并映射到相应的队列。
验证是否已将转发类分配给调度程序
目的
验证是否已将转发类分配给计划程序。
行动
user@switch> show class-of-service scheduler-map
Scheduler map: ethernet-cos-map, Index: 2
Scheduler: voice-sched, Forwarding class: voice, Index: 22
Shaping rate: 10 percent, Rate Limit: none, Buffer size: 10 percent,
Priority: Strict-high
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: video-sched, Forwarding class: video, Index: 22
Transmit rate: 10 percent, Rate Limit: none, Buffer size: 10 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: app-sched, Forwarding class: app, Index: 22
Transmit rate: 10 percent, Rate Limit: none, Buffer size: 10 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: mail-sched, Forwarding class: mail, Index: 22
Transmit rate: 5 percent, Rate Limit: none, Buffer size: 5 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: db-sched, Forwarding class: db, Index: 22
Transmit rate: 10 percent, Rate Limit: none, Buffer size: 10 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: erp-sched, Forwarding class: erp, Index: 22
Transmit rate: 10 percent, Rate Limit: none, Buffer size: 10 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: be-sched, Forwarding class: best-effort, Index: 20
Transmit rate: 35 percent, Rate Limit: none, Buffer size: 35 percent,
Priority: low
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
Scheduler: nc-sched, Forwarding class: network-control, Index: 22
Shaping rate: 5 percent, Rate Limit: none, Buffer size: 5 percent,
Priority: Strict-high
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
意义
此输出显示已将转发类分配给调度程序。
验证是否已将调度器图应用于接口
目的
验证是否已将调度器图应用于接口。
行动
user@switch> show class-of-service interface ... Physical interface: ge-0/0/20, Index: 149 Queues supported: 8, Queues in use: 8 Scheduler map: ethernet-cos-map, Index: 43366 Input scheduler map: <default>, Index: 3 ... Physical interface: ge-0/0/21, Index: 150 Queues supported: 8, Queues in use: 8 Scheduler map: ethernet-cos-map, Index: 15103 Input scheduler map: <default>, Index: 5 ...
意义
此输出包括已应用调度器映射 (ethernet-cos-map) 的接口的详细信息(ge-0/0/20 和 ge-0/0/21)。
验证是否已应用端口整形
目的
验证端口整形是否已应用于接口。
行动
以下是将端口整形应用于接口 ge-0/0/0之前的输出,当该接口上有 400 Mpbs 的出口流量退出时:
user@switch> show interfaces ge-0/0/0 extensive
Physical interface: ge-0/0/0, Enabled, Physical link is Up
Interface index: 239, SNMP ifIndex: 548, Generation: 242
Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online,
Media type: Copper
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x0
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Hold-times : Up 0 ms, Down 0 ms
Current address: 00:23:9c:0b:ae:8d, Hardware address: 00:23:9c:0b:ae:8d
Last flapped : 2012-07-07 03:21:52 UTC (1d 18:02 ago)
Statistics last cleared: 2012-07-07 23:54:34 UTC (21:29:59 ago)
Traffic statistics:
Input bytes : 0 0 bps
Output bytes : 2299853696 345934816 bps
Input packets: 0 0 pps
Output packets: 17967609 337827 pps
IPv6 transit statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0
Output errors:
Carrier transitions: 0, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
Egress queues: 8 supported, 4 in use
Queue counters: Queued packets Transmitted packets Dropped packets
0 best-effort 0 18302337 0
1 assured-forw 0 0 0
5 expedited-fo 0 0 0
7 network-cont 0 0 0
Queue number: Mapped forwarding classes
0 best-effort
1 assured-forwarding
5 expedited-forwarding
7 network-control
Active alarms : None
Active defects : None
MAC statistics: Receive Transmit
Total octets 0 2299853696
Total packets 0 17967609
Unicast packets 0 17967609
Broadcast packets 0 0
Multicast packets 0 0
CRC/Align errors 0 0
FIFO errors 0 0
MAC control frames 0 0
MAC pause frames 0 0
Oversized frames 0
Jabber frames 0
Fragment frames 0
Code violations 0
Autonegotiation information:
Negotiation status: Complete
Link partner:
Link mode: Full-duplex, Flow control: Symmetric, Remote fault: OK, Link partner Speed: 1000 Mbps
Local resolution:
Flow control: Symmetric, Remote fault: Link OK
Packet Forwarding Engine configuration:
Destination slot: 1
CoS information:
Direction : Output
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort 95 950000000 95 NA low none
7 network-control 5 50000000 5 NA low none
Interface transmit statistics: Disabled
Logical interface ge-1/0/10.0 (Index 69) (SNMP ifIndex 638) (Generation 138)
Flags: SNMP-Traps 0x0 Encapsulation: ENET2
Traffic statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol eth-switch, Generation: 163, Route table: 0
Flags: Trunk-Mode
此输出中的“流量统计信息:”字段显示出口流量为 ~400 Mpbs (345,934,816 bps)。将 100 Mbps 的端口整形应用于 ge-0/0/0 接口时,您会看到和 命令show class-of-service interface ge-0/0/0的以下输出show interfaces ge-0/0/0 statistics:
user@switch> show interfaces ge-0/0/0 statistics
Physical interface: ge-0/0/0, Enabled, Physical link is Up
Interface index: 239, SNMP ifIndex: 548, Generation: 242
Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online,
Media type: Copper
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x0
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Hold-times : Up 0 ms, Down 0 ms
Current address: 00:23:9c:0b:ae:8d, Hardware address: 00:23:9c:0b:ae:8d
Last flapped : 2012-07-07 03:21:52 UTC (1d 18:10 ago)
Statistics last cleared: 2012-07-07 23:54:34 UTC (21:37:58 ago)
Traffic statistics:
Input bytes : 0 0 bps
Output bytes : 15779512832 100223104 bps
Input packets: 0 0 pps
Output packets: 123277444 97874 pps
IPv6 transit statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0
Output errors:
Carrier transitions: 0, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
Egress queues: 8 supported, 4 in use
Queue counters: Queued packets Transmitted packets Dropped packets
0 best-effort 0 123350092 57012484
1 assured-forw 0 0 0
5 expedited-fo 0 0 0
7 network-cont 0 0 0
Queue number: Mapped forwarding classes
0 best-effort
1 assured-forwarding
5 expedited-forwarding
7 network-control
Active alarms : None
Active defects : None
MAC statistics: Receive Transmit
Total octets 0 15779512832
Total packets 0 123277444
Unicast packets 0 123277444
Broadcast packets 0 0
Multicast packets 0 0
CRC/Align errors 0 0
FIFO errors 0 0
MAC control frames 0 0
MAC pause frames 0 0
Oversized frames 0
Jabber frames 0
Fragment frames 0
Code violations 0
Autonegotiation information:
Negotiation status: Complete
Link partner:
Link mode: Full-duplex, Flow control: Symmetric, Remote fault: OK, Link partner Speed: 1000 Mbps
Local resolution:
Flow control: Symmetric, Remote fault: Link OK
Packet Forwarding Engine configuration:
Destination slot: 1
CoS information:
Direction : Output
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort 95 95000000 95 NA low none
7 network-control 5 5000000 5 NA low none
Interface transmit statistics: Disabled
Logical interface ge-1/0/10.0 (Index 69) (SNMP ifIndex 638) (Generation 138)
Flags: SNMP-Traps 0x0 Encapsulation: ENET2
Traffic statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol eth-switch, Generation: 163, Route table: 0
Flags: Trunk-Mode
user@switch> show class-of-service interface ge-0/0/0
Physical interface: ge-0/0/0, Index: 165
Queues supported: 8, Queues in use: 4
Shaping rate: 100000000 bps
...
...
意义
在命令的输出 show interfaces ge-0/0/0 statistics 中,流量统计信息: 字段显示出口流量为 ~100 Mbps (100,223,104 bps)。命令的 show class-of-service interface ge-0/0/0 输出显示整形速率为 100,000,000 bps,表示 100 Mbps 的端口整形应用于 ge-0/0/0 接口。
验证是否已应用队列整形
目的
验证队列整形是否已应用于尽力而为队列。
行动
以下是当有 400 Mbbs 的出口流量退出该接口时,将队列整形应用于尽力服务队列之前的输出:
user@switch> show interfaces ge-0/0/2 extensive
Physical interface: ge-0/0/2, Enabled, Physical link is Up
Interface index: 239, SNMP ifIndex: 548, Generation: 242
Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online,
Media type: Copper
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x0
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Hold-times : Up 0 ms, Down 0 ms
Current address: 00:23:9c:0b:ae:8d, Hardware address: 00:23:9c:0b:ae:8d
Last flapped : 2012-07-07 03:21:52 UTC (1d 18:02 ago)
Statistics last cleared: 2012-07-07 23:54:34 UTC (21:29:59 ago)
Traffic statistics:
Input bytes : 0 0 bps
Output bytes : 2299853696 345934816 bps
Input packets: 0 0 pps
Output packets: 17967609 337827 pps
IPv6 transit statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0
Output errors:
Carrier transitions: 0, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
Egress queues: 8 supported, 4 in use
Queue counters: Queued packets Transmitted packets Dropped packets
0 best-effort 0 18302337 0
1 assured-forw 0 0 0
5 expedited-fo 0 0 0
7 network-cont 0 0 0
Queue number: Mapped forwarding classes
0 best-effort
1 assured-forwarding
5 expedited-forwarding
7 network-control
Active alarms : None
Active defects : None
MAC statistics: Receive Transmit
Total octets 0 2299853696
Total packets 0 17967609
Unicast packets 0 17967609
Broadcast packets 0 0
Multicast packets 0 0
CRC/Align errors 0 0
FIFO errors 0 0
MAC control frames 0 0
MAC pause frames 0 0
Oversized frames 0
Jabber frames 0
Fragment frames 0
Code violations 0
Autonegotiation information:
Negotiation status: Complete
Link partner:
Link mode: Full-duplex, Flow control: Symmetric, Remote fault: OK, Link partner Speed: 1000 Mbps
Local resolution:
Flow control: Symmetric, Remote fault: Link OK
Packet Forwarding Engine configuration:
Destination slot: 1
CoS information:
Direction : Output
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort 95 950000000 95 NA low none
7 network-control 5 50000000 5 NA low none
Interface transmit statistics: Disabled
Logical interface ge-1/0/10.0 (Index 69) (SNMP ifIndex 638) (Generation 138)
Flags: SNMP-Traps 0x0 Encapsulation: ENET2
Traffic statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol eth-switch, Generation: 163, Route table: 0
Flags: Trunk-Mode
此输出中的流量统计信息:字段显示出口流量为 ~400 Mpbs (345,934,816 bps)。将 30 Mbps 的队列整形应用于尽力而为队列时,您会看到和 show class-of-service scheduler-map sched-map-be 命令的以下输出show interfaces ge-0/0/2 statistics:
user@switch> show interfaces ge-0/0/2 statistics
Physical interface: ge-0/0/2, Enabled, Physical link is Up
Interface index: 239, SNMP ifIndex: 548, Generation: 242
Link-level type: Ethernet, MTU: 1514, Speed: Auto, Duplex: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled, Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online,
Media type: Copper
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x0
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Hold-times : Up 0 ms, Down 0 ms
Current address: 00:23:9c:0b:ae:8d, Hardware address: 00:23:9c:0b:ae:8d
Last flapped : 2012-07-07 03:21:52 UTC (1d 18:29 ago)
Statistics last cleared: 2012-07-08 21:46:22 UTC (00:04:56 ago)
Traffic statistics:
Input bytes : 0 0 bps
Output bytes : 5376128896 30097712 bps
Input packets: 0 0 pps
Output packets: 42001003 29392 pps
IPv6 transit statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Input errors:
Errors: 0, Drops: 0, Framing errors: 0, Runts: 0, Policed discards: 0, L3 incompletes: 0, L2 channel errors: 0, L2 mismatch timeouts: 0, FIFO errors: 0, Resource errors: 0
Output errors:
Carrier transitions: 0, Errors: 0, Drops: 0, Collisions: 0, Aged packets: 0, FIFO errors: 0, HS link CRC errors: 0, MTU errors: 0, Resource errors: 0
Egress queues: 8 supported, 4 in use
Queue counters: Queued packets Transmitted packets Dropped packets
0 best-effort 0 41986978 57813642
1 assured-forw 0 0 0
5 expedited-fo 0 0 0
7 network-cont 0 0 0
Queue number: Mapped forwarding classes
0 best-effort
1 assured-forwarding
5 expedited-forwarding
7 network-control
Active alarms : None
Active defects : None
MAC statistics: Receive Transmit
Total octets 0 5376128896
Total packets 0 42001003
Unicast packets 0 42001003
Broadcast packets 0 0
Multicast packets 0 0
CRC/Align errors 0 0
FIFO errors 0 0
MAC control frames 0 0
MAC pause frames 0 0
Oversized frames 0
Jabber frames 0
Fragment frames 0
Code violations 0
Autonegotiation information:
Negotiation status: Complete
Link partner:
Link mode: Full-duplex, Flow control: Symmetric, Remote fault: OK, Link partner Speed: 1000 Mbps
Local resolution:
Flow control: Symmetric, Remote fault: Link OK
Packet Forwarding Engine configuration:
Destination slot: 1
CoS information:
Direction : Output
CoS transmit queue Bandwidth Buffer Priority Limit
% bps % usec
0 best-effort r r r NA low none
Interface transmit statistics: Disabled
Logical interface ge-1/0/10.0 (Index 69) (SNMP ifIndex 638) (Generation 138)
Flags: SNMP-Traps 0x0 Encapsulation: ENET2
Traffic statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Local statistics:
Input bytes : 0
Output bytes : 0
Input packets: 0
Output packets: 0
Transit statistics:
Input bytes : 0 0 bps
Output bytes : 0 0 bps
Input packets: 0 0 pps
Output packets: 0 0 pps
Protocol eth-switch, Generation: 163, Route table: 0
Flags: Trunk-Mode
user@switch> show class-of-service scheduler-map sched-map-be
Scheduler map: sched-map-be, Index: 31271
Scheduler: voice-sched-queue-shap, Forwarding class: best-effort, Index: 64106
Transmit rate: remainder, Rate Limit: none, Buffer size: remainder,
Buffer Limit: none, Priority: low
Excess Priority: unspecified
Shaping rate: 30000000 bps
Drop profiles:
Loss priority Protocol Index Name
High non-TCP 1 <default-drop-profile>
High TCP 1 <default-drop-profile>
意义
在命令的输出 show interfaces ge-0/0/2 statistics 中,流量统计信息: 字段显示出口流量为 ~30 Mbps (30,097,712 bps)。命令的 show class-of-service scheduler-map sched-map-be 输出显示,30,000,000 bps(即 30 Mbps)的整形速率应用于尽力而为队列。