示例:配置四级调度器层次结构
此示例说明如何配置调度器 4 级层次结构。
要求
开始之前:
查看如何配置调度器。请参阅 示例:在安全设备上配置服务等级计划程序。
查看 RED 丢弃配置文件。请参阅 了解 RED 丢弃配置文件。
查看如何配置和应用调度器图。请参阅 示例:配置和应用调度器图。
概述
此示例的配置参数如图 1 所示。队列显示在图的上部,下面还有其他三个层级。
图 1 的 PIR 值将配置为整形速率,并将 CIR 配置为以太网接口 ge-1/0/0
上的保证速率。PIR 可以超额订阅(也就是说,子级 PIR 的总和可能超过家长的 PIC,如 svlan 1
200 + 200 + 100 超过家长速率 400)。但是,子节点级别的 CIR 之和不得超过父节点的 CIR,如所有服务 VLAN 中所示(否则,永远无法在所有情况下提供保证速率)。
虽然可以直接将整形速率应用于物理接口,但分层调度程序必须使用流量控制配置文件来保存整形速率参数。
配置分层调度器的关键词在物理接口级别,VLAN 标记和 VLAN ID 也是。在此示例中,接口集由逻辑接口(单元)而不是外部 VLAN 标记定义。此示例中的所有 VLAN 标记都是客户 VLAN 标记。
此示例中的流量控制配置文件同时适用于服务 VLAN 级别(逻辑接口)和客户 VLAN (VLAN 标记)级别。
此示例显示了图 1 中接口 CoS 配置ge-1/0/0
的所有详细信息。
配置
本节包含以下主题:
配置接口
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层级的 [edit]
CLI 中,然后从配置模式进入 commit
。
set interfaces ge-1/0/0 hierarchical-scheduler set interfaces ge-1/0/0 vlan-tagging set interfaces ge-1/0/0 unit 0 vlan-id 100 set interfaces ge-1/0/0 unit 1 vlan-id 101 set interfaces ge-1/0/0 unit 2 vlan-id 102 set interfaces ge-1/0/0 unit 3 vlan-id 103 set interfaces ge-1/0/0 unit 4 vlan-id 104
逐步过程
要配置接口:
创建物理接口并启用分层调度和 VLAN 标记。
[edit interfaces ge-1/0/0] user@host# set hierarchical-scheduler user@host# set vlan-tagging
创建逻辑接口并分配 VLAN ID。
[edit interface ge-1/0/0] user@host# set unit 0 vlan-id 100 user@host# set unit 1 vlan-id 101 user@host# set unit 2 vlan-id 102 user@host# set unit 3 vlan-id 103 user@host# set unit 4 vlan-id 104
结果
在配置模式下,输入命令以确认 show interface ge-1/0/0
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show interface ge-1/0/0
hierarchical-scheduler;
vlan-tagging;
unit 0 {
vlan-id 100;
}
unit 1 {
vlan-id 101;
}
unit 2 {
vlan-id 102;
}
unit 3 {
vlan-id 103;
}
unit 4 {
vlan-id 104;
}
完成设备配置后,请从配置模式进入 commit
。
配置接口集
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set interfaces interface-set svlan-0 interface ge-1/0/0 unit 0 set interfaces interface-set svlan-0 interface ge-1/0/0 unit 1 set interfaces interface-set svlan-1 interface ge-1/0/0 unit 2 set interfaces interface-set svlan-1 interface ge-1/0/0 unit 3 set interfaces interface-set svlan-1 interface ge-1/0/0 unit 4
逐步过程
要配置接口集:
创建第一个逻辑接口及其 CoS 参数。
[edit interfaces] user@host# set interface-set svlan-0 interface ge-1/0/0 unit 0 user@host# set interface-set svlan-0 interface ge-1/0/0 unit 1
创建第二个逻辑接口及其 CoS 参数。
[edit interfaces] user@host# set interface-set svlan-1 interface ge-1/0/0 unit 2 user@host# set interface-set svlan-1 interface ge-1/0/0 unit 3 user@host# set interface-set svlan-1 interface ge-1/0/0 unit 4
结果
在配置模式下,输入命令以确认 show interfaces
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show interfaces
interface-set svlan-0 {
interface ge-1/0/0 {
unit 0;
unit 1;
}
}
interface-set svlan-1 {
interface ge-1/0/0 {
unit 2;
unit 3;
unit 4;
}
}
完成设备配置后,请从配置模式进入 commit
。
配置转发类
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service forwarding-classes queue 1 data set class-of-service forwarding-classes queue 2 video set class-of-service forwarding-classes queue 3 voice
逐步过程
要配置转发类:
指定队列号并将其映射到类名称。
[edit class-of-service forwarding-classes] user@host# set queue 1 data user@host# set queue 2 video user@host# set queue 3 voice
结果
在配置模式下,输入命令以确认 show class-of-service forwarding-classes
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service forwarding-classes
queue 1 data;
queue 2 video;
queue 3 voice;
完成设备配置后,请从配置模式进入 commit
。
配置流量控制配置文件
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service traffic-control-profiles tcp-500m-shaping-rate shaping-rate 500m set class-of-service traffic-control-profiles tcp-svlan0 shaping-rate 200m set class-of-service traffic-control-profiles tcp-svlan0 guaranteed-rate 100m set class-of-service traffic-control-profiles tcp-svlan0 delay-buffer-rate 300m set class-of-service traffic-control-profiles tcp-svlan1 shaping-rate 400m set class-of-service traffic-control-profiles tcp-svlan1 guaranteed-rate 300m set class-of-service traffic-control-profiles tcp-svlan1 delay-buffer-rate 100m set class-of-service traffic-control-profiles tcp-cvlan0 shaping-rate 100m set class-of-service traffic-control-profiles tcp-cvlan0 guaranteed-rate 60m set class-of-service traffic-control-profiles tcp-cvlan0 scheduler-map tcp-map-cvlan0 set class-of-service traffic-control-profiles tcp-cvlan1 shaping-rate 100m set class-of-service traffic-control-profiles tcp-cvlan1 guaranteed-rate 40m set class-of-service traffic-control-profiles tcp-cvlan1 scheduler-map tcp-map-cvlan1 set class-of-service traffic-control-profiles tcp-cvlan2 shaping-rate 200m set class-of-service traffic-control-profiles tcp-cvlan2 guaranteed-rate 100m set class-of-service traffic-control-profiles tcp-cvlan2 scheduler-map tcp-map-cvlanx set class-of-service traffic-control-profiles tcp-cvlan3 shaping-rate 200m set class-of-service traffic-control-profiles tcp-cvlan3 guaranteed-rate 150m set class-of-service traffic-control-profiles tcp-cvlan3 scheduler-map tcp-map-cvlanx set class-of-service traffic-control-profiles tcp-cvlan4 shaping-rate 100m set class-of-service traffic-control-profiles tcp-cvlan4 guaranteed-rate 50m set class-of-service traffic-control-profiles tcp-cvlan4 scheduler-map tcp-map-cvlanx
逐步过程
要配置流量控制配置文件:
为物理接口创建流量控制配置文件。
[edit class-of-service traffic-control-profiles] user@host# tcp-500m-shaping-rate shaping-rate 500m
创建 S-VLAN(逻辑接口)级别的流量控制配置文件和参数。
[edit class-of-service traffic-control-profiles] user@host# set tcp-svlan0 shaping-rate 200m user@host# set tcp-svlan0 guaranteed-rate 100m user@host# set tcp-svlan0 delay-buffer-rate 300m user@host# set tcp-svlan1 shaping-rate 400m user@host# set tcp-svlan1 guaranteed-rate 300m user@host# set tcp-svlan1 delay-buffer-rate 100m
创建 C-VLAN (VLAN 标记) 级别的流量控制配置文件和参数。
[edit class-of-service traffic-control-profiles] user@host# set tcp-cvlan0 shaping-rate 100m user@host# set tcp-cvlan0 guaranteed-rate 60m user@host# set tcp-cvlan0 scheduler-map tcp-map-cvlan0 user@host# set tcp-cvlan1 shaping-rate 100m user@host# set tcp-cvlan1 guaranteed-rate 40m user@host# set tcp-cvlan1 scheduler-map tcp-map-cvlan1 user@host# set tcp-cvlan2 shaping-rate 200m user@host# set tcp-cvlan2 guaranteed-rate 100m user@host# set tcp-cvlan2 scheduler-map tcp-map-cvlanx user@host# set tcp-cvlan3 shaping-rate 200m user@host# set tcp-cvlan3 guaranteed-rate 150m user@host# set tcp-cvlan3 scheduler-map tcp-map-cvlanx user@host# set tcp-cvlan4 shaping-rate 100m user@host# set tcp-cvlan4 guaranteed-rate 50m user@host# set tcp-cvlan4 scheduler-map tcp-map-cvlanx
结果
在配置模式下,输入命令以确认 show class-of-service traffic-control-profiles
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service traffic-control-profiles
tcp-500m-shaping-rate {
shaping-rate 500m;
}
tcp-svlan0 {
shaping-rate 200m;
guaranteed-rate 100m;
delay-buffer-rate 300m; # This parameter is not shown in the figure
}
tcp-svlan1 {
shaping-rate 400m;
guaranteed-rate 300m;
delay-buffer-rate 100m; # This parameter is not shown in the figure
}
tcp-cvlan0 {
shaping-rate 100m;
guaranteed-rate 60m;
scheduler-map tcp-map-cvlan0; # This example applies scheduler maps to customer VLANs
}
tcp-cvlan1 {
shaping-rate 100m;
guaranteed-rate 40m;
scheduler-map tcp-map-cvlan1; # This example applies scheduler maps to customer VLANs
}
tcp-cvlan2 {
shaping-rate 200m;
guaranteed-rate 100m;
scheduler-map tcp-map-cvlanx; # This example applies scheduler maps to customer VLANs
}
tcp-cvlan3 {
shaping-rate 200m;
guaranteed-rate 150m;
scheduler-map tcp-map-cvlanx; # This example applies scheduler maps to customer VLANs
}
tcp-cvlan4 {
shaping-rate 100m;
guaranteed-rate 50m;
scheduler-map tcp-map-cvlanx; # This example applies scheduler maps to customer VLANs
}
完成设备配置后,请从配置模式进入 commit
。
配置调度器
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service schedulers sched-cvlan0-qx transmit-rate 20m set class-of-service schedulers sched-cvlan0-qx buffer-size temporal 100k set class-of-service schedulers sched-cvlan0-qx priority low set class-of-service schedulers sched-cvlan0-qx drop-profile-map loss-priority low protocol any drop-profile dp-low set class-of-service schedulers sched-cvlan0-qx drop-profile-map loss-priority high protocol any drop-profile dp-high set class-of-service schedulers sched-cvlan1-q0 transmit-rate 20m set class-of-service schedulers sched-cvlan1-q0 buffer-size percent 40 set class-of-service schedulers sched-cvlan1-q0 priority high set class-of-service schedulers sched-cvlan1-q0 drop-profile-map loss-priority low protocol any drop-profile dp-low set class-of-service schedulers sched-cvlan1-q0 drop-profile-map loss-priority high protocol any drop-profile dp-high set class-of-service schedulers sched-cvlanx-qx transmit-rate percent 30 set class-of-service schedulers sched-cvlanx-qx buffer-size percent 30 set class-of-service schedulers sched-cvlanx-qx drop-profile-map loss-priority low protocol any drop-profile dp-low set class-of-service schedulers sched-cvlanx-qx drop-profile-map loss-priority high protocol any drop-profile dp-high set class-of-service schedulers sched-cvlan1-qx transmit-rate 10m set class-of-service schedulers sched-cvlan1-qx buffer-size temporal 100k set class-of-service schedulers sched-cvlan1-qx drop-profile-map loss-priority low protocol any drop-profile dp-low set class-of-service schedulers sched-cvlan1-qx drop-profile-map loss-priority high protocol any drop-profile dp-high
逐步过程
要配置调度器:
创建调度器及其参数。
[edit class-of-service schedulers] user@host# set sched-cvlan0-qx priority low transmit-rate 20m user@host# set sched-cvlan0-qx buffer-size temporal 100k user@host# set sched-cvlan0-qx priority low user@host# set sched-cvlan0-qx drop-profile-map loss-priority low protocol any drop-profile dp-low user@host# set sched-cvlan0-qx drop-profile-map loss-priority high protocol any drop-profile dp-high user@host# set sched-cvlan1-q0 priority high transmit-rate 20m user@host# set sched-cvlan1-q0 buffer-size percent 40 user@host# set sched-cvlan1-q0 priority high user@host# set sched-cvlan1-q0 drop-profile-map loss-priority low protocol any drop-profile dp-low user@host# set sched-cvlan1-q0 drop-profile-map loss-priority high protocol any drop-profile dp-high user@host# set sched-cvlanx-qx transmit-rate percent 30 user@host# set sched-cvlanx-qx buffer-size percent 30 user@host# set sched-cvlanx-qx drop-profile-map loss-priority low protocol any drop-profile dp-low user@host# set sched-cvlanx-qx drop-profile-map loss-priority high protocol any drop-profile dp-high user@host# set sched-cvlan1-qx transmit-rate 10m user@host# set sched-cvlan1-qx buffer-size temporal 100k user@host# set sched-cvlan1-qx drop-profile-map loss-priority low protocol any drop-profile dp-low user@host# set sched-cvlan1-qx drop-profile-map loss-priority high protocol any drop-profile dp-high
结果
在配置模式下,输入命令以确认 show class-of-service schedulers
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service schedulers
sched-cvlan0-qx {
transmit-rate 20m;
buffer-size temporal 100k;
priority low;
drop-profile-map loss-priority low protocol any drop-profile dp-low;
drop-profile-map loss-priority high protocol any drop-profile dp-high;
}
sched-cvlan1-q0 {
transmit-rate 20m;
buffer-size percent 40;
priority high;
drop-profile-map loss-priority low protocol any drop-profile dp-low;
drop-profile-map loss-priority high protocol any drop-profile dp-high;
}
sched-cvlanx-qx {
transmit-rate percent 30;
buffer-size percent 30;
drop-profile-map loss-priority low protocol any drop-profile dp-low;
drop-profile-map loss-priority high protocol any drop-profile dp-high;
}
sched-cvlan1-qx {
transmit-rate 10m;
buffer-size temporal 100k;
drop-profile-map loss-priority low protocol any drop-profile dp-low;
drop-profile-map loss-priority high protocol any drop-profile dp-high;
}
完成设备配置后,请从配置模式进入 commit
。
配置丢弃配置文件
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service drop-profiles dp-low interpolate fill-level 80 drop-probability 80 set class-of-service drop-profiles dp-low interpolate fill-level 100 drop-probability 100 set class-of-service drop-profiles dp-high interpolate fill-level 60 drop-probability 80 set class-of-service drop-profiles dp-high interpolate fill-level 80 drop-probability 100
逐步过程
要配置丢弃配置文件:
创建低丢弃配置文件。
[edit class-of-service drop-profiles] user@host# set dp-low interpolate fill-level 80 drop-probability 80 user@host# set dp-low interpolate fill-level 100 drop-probability 100
创建高丢弃配置文件。
[edit class-of-service drop-profiles] user@host# set dp-high interpolate fill-level 60 drop-probability 80 user@host# set dp-high interpolate fill-level 80 drop-probability 100
结果
在配置模式下,输入命令以确认 show class-of-service drop-profiles
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service drop-profiles
dp-low {
interpolate {
fill-level [ 80 100 ];
drop-probability [ 80 100 ];
}
}
dp-high {
interpolate {
fill-level [ 60 80 ];
drop-probability [ 80 100 ];
}
}
完成设备配置后,请从配置模式进入 commit
。
配置调度器图
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service scheduler-maps tcp-map-cvlan0 forwarding-class voice scheduler sched-cvlan0-qx set class-of-service scheduler-maps tcp-map-cvlan0 forwarding-class video scheduler sched-cvlan0-qx set class-of-service scheduler-maps tcp-map-cvlan0 forwarding-class data scheduler sched-cvlan0-qx set class-of-service scheduler-maps tcp-map-cvlan1 forwarding-class voice scheduler sched-cvlan1-q0 set class-of-service scheduler-maps tcp-map-cvlan1 forwarding-class video scheduler sched-cvlan1-qx set class-of-service scheduler-maps tcp-map-cvlan1 forwarding-class data scheduler sched-cvlan1-qx set class-of-service scheduler-maps tcp-map-cvlanx forwarding-class voice scheduler sched-cvlanx-qx set class-of-service scheduler-maps tcp-map-cvlanx forwarding-class video scheduler sched-cvlanx-qx set class-of-service scheduler-maps tcp-map-cvlanx forwarding-class data scheduler sched-cvlanx-qx
逐步过程
要配置三个调度器图:
创建第一个调度器图。
[edit class-of-service scheduler-maps] user@host# set tcp-map-cvlan0 forwarding-class voice scheduler sched-cvlan0-qx user@host# set tcp-map-cvlan0 forwarding-class video scheduler sched-cvlan0-qx user@host# set tcp-map-cvlan0 forwarding-class data scheduler sched-cvlan0-qx
创建第二个调度器图。
[edit class-of-service scheduler-maps] user@host# set tcp-map-cvlan1 forwarding-class voice scheduler sched-cvlan1-q0 user@host# set tcp-map-cvlan1 forwarding-class video scheduler sched-cvlan1-qx user@host# set tcp-map-cvlan1 forwarding-class data scheduler sched-cvlan1-qx
创建第三个调度器图。
[edit class-of-service scheduler-maps] user@host# set tcp-map-cvlanx forwarding-class voice scheduler sched-cvlanx-qx user@host# set tcp-map-cvlanx forwarding-class video scheduler sched-cvlanx-qx user@host# set tcp-map-cvlanx forwarding-class data scheduler sched-cvlanx-qx
结果
在配置模式下,输入命令以确认 show class-of-service scheduler-maps
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service scheduler-maps
tcp-map-cvlan0 {
forwarding-class voice scheduler sched-cvlan0-qx;
forwarding-class video scheduler sched-cvlan0-qx;
forwarding-class data scheduler sched-cvlan0-qx;
}
tcp-map-cvlan1 {
forwarding-class voice scheduler sched-cvlan1-q0;
forwarding-class video scheduler sched-cvlan1-qx;
forwarding-class data scheduler sched-cvlan1-qx;
}
tcp-map-cvlanx {
forwarding-class voice scheduler sched-cvlanx-qx;
forwarding-class video scheduler sched-cvlanx-qx;
forwarding-class data scheduler sched-cvlanx-qx;
}
完成设备配置后,请从配置模式进入 commit
。
应用流量控制配置文件
CLI 快速配置
要快速配置示例的此部分,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,将命令复制并粘贴到层次结构级别的 CLI 中 [edit]
,然后从配置模式进入 commit
。
set class-of-service interfaces ge-1/0/0 output-traffic-control-profile tcp-500m-shaping-rate set class-of-service interfaces ge-1/0/0 unit 0 output-traffic-control-profile tcp-cvlan0 set class-of-service interfaces ge-1/0/0 unit 1 output-traffic-control-profile tcp-cvlan1 set class-of-service interfaces ge-1/0/0 unit 2 output-traffic-control-profile tcp-cvlan2 set class-of-service interfaces ge-1/0/0 unit 3 output-traffic-control-profile tcp-cvlan3 set class-of-service interfaces ge-1/0/0 unit 4 output-traffic-control-profile tcp-cvlan4 set class-of-service interfaces interface-set svlan0 output-traffic-control-profile tcp-svlan0 set class-of-service interfaces interface-set svlan1 output-traffic-control-profile tcp-svlan1
逐步过程
要应用流量控制配置文件:
为接口应用流量控制配置文件。
[edit class-of-service interfaces ge-1/0/0] user@host# set output-traffic-control-profile tcp-500m-shaping-rate
为 C-VLAN 应用流量控制配置文件。
[edit class-of-service interfaces ge-1/0/0] user@host# set unit 0 output-control-traffic-control-profile tcp-cvlan0 user@host# set unit 1 output-control-traffic-control-profile tcp-cvlan1 user@host# set unit 2 output-control-traffic-control-profile tcp-cvlan2 user@host# set unit 3 output-control-traffic-control-profile tcp-cvlan3 user@host# set unit 4 output-control-traffic-control-profile tcp-cvlan4
为 S-VLAN 应用流量控制配置文件。
[edit class-of-service interfaces] user@host# set interface-set-svlan0 output-control-traffic-control-profile tcp-svlan0 user@host# set interface-set-svlan1 output-control-traffic-control-profile tcp-svlan1
结果
在配置模式下,输入命令以确认 show class-of-service interfaces
您的配置。如果输出未显示预期的配置,请重复此示例中的配置说明,以便进行更正。
[edit]
user@host# show class-of-service interfaces
ge-1/0/0 {
output-traffic-control-profile tcp-500m-shaping-rate;
unit 0 {
output-traffic-control-profile tcp-cvlan0;
}
unit 1 {
output-traffic-control-profile tcp-cvlan1;
}
unit 2 {
output-traffic-control-profile tcp-cvlan2;
}
unit 3 {
output-traffic-control-profile tcp-cvlan3;
}
unit 4 {
output-traffic-control-profile tcp-cvlan4;
}
}
interface-set svlan0 {
output-traffic-control-profile tcp-svlan0;
}
interface-set svlan1 {
output-traffic-control-profile tcp-svlan1;
}
完成设备配置后,请从配置模式进入 commit
。