配置基于模板的HQoS示例
根据不同的子接口接入不同业务的流量,以基于模板的场景为例,介绍如何配置HQoS示例。
组网需求
用户通过DSLAM接入路由器,路由器为骨干网的接入设备。如图8-4所示。
用户的三个业务映射到DSLAM的3个PVC中,在路由器上同一用户的流量分别通过GE0/1/0.1、GE0/1/0.2和GE0/1/0.3三个子接口上接入,不同的子接口接入不同业务的流量。流量进入路由器时带有两层tag,内层tag表示用户,外层tag表示业务。要对用户的流量进行统一调度,保证带宽为100M,其中EF流量带宽为30M、AF1流量带宽为10M。用户所属用户组的总带宽为500M。在接入路由器下行接口EF类型的报文流量不能超过120M。同时,业务类型PC、VOIP和IPTV分别标记外层VLAN tag为1、2、3;内层VLAN tag均为1~100。
本例中Subinterface1.1,Subinterface2.1,Subinterface3.1,interface2分别代表GE0/1/0.1,GE0/1/0.2,GE0/1/0.3,GE0/2/0。
配置思路
采用如下的思路配置基于模板的HQoS功能。
配置流队列WRED对象的报文丢弃的参数。
配置流队列的调度算法及参数。
配置用户组队列shaping值。
配置业务模板的精度调整长度。
配置QoS模板中用户队列调度参数。
配置类队列WRED对象的报文丢弃的参数。
在接入路由器下行接口配置类队列。
数据准备
完成此例配置,需准备以下数据:
flow-wred报文丢弃的参数
flow-queue调度算法及其参数
user-group-queue的shaping值
QoS模板中user-queue CIR、PIR和network-header-length的值
QoS模板应用的接口
port-queue引用的port-wred的参数
port-queue调度算法及其参数、shaping值
操作步骤
- 配置流队列引用的WRED对象
# 配置flow-wred报文丢弃的参数。
<HUAWEI> system view
[~HUAWEI] flow-wred test
[*HUAWEI-flow-wred-test] color green low-limit 70 high-limit 100 discard-percentage 100
[*HUAWEI-flow-wred-test] color yellow low-limit 60 high-limit 90 discard-percentage 100
[*HUAWEI-flow-wred-test] color red low-limit 50 high-limit 80 discard-percentage 100
[*HUAWEI-flow-wred-test] commit
[~HUAWEI-flow-wred-test] return
完成上述配置后,执行命令display flow-wred configuration verbose,可以查看流队列WRED对象的配置参数。
<HUAWEI> display flow-wred configuration verbose test
Flow wred name : test --------------------------------------------------- Color Low-limit High-limit Discard-percent --------------------------------------------------- green 70 100 100 yellow 60 90 100 red 50 80 100
Queue Depth : 1000
Reference relationships : NULL
- 配置流队列的调度算法及其参数
# 配置flow-queue的调度算法、WRED参数及shaping值。
<HUAWEI> system view
[~HUAWEI] flow-queue test
[*HUAWEI-flow-queue-template-test] queue af1 lpq flow-wred test shaping 10000
[*HUAWEI-flow-queue-template-test] queue ef pq flow-wred test shaping 30000
[*HUAWEI-flow-queue-template-test] commit
[~HUAWEI-flow-queue-template-test] return
完成上述配置后,执行命令display flow-queue configuration verbose,可以查看流队列模板的配置信息。
<HUAWEI> display flow-queue configuration verbose test
Codes: Arith(Schedule algorithm) U-Weight(Schedule weight configured by users) I-Weight(Inverse schedule weight used by TM) A-Weight(Actual schedule weight obtained by users) Shp(Shaping value, the percentage of subscriber queue's PIR) Pct(The percentage of subscriber queue's PIR) Drop-Arith(The name of the WRED object used by the flow queue) Flow Queue Template : test ------------------------------------------------------------------ Cos Arith U-Weight I-Weight A-Weight Shp Pct Drop-Arith ------------------------------------------------------------------ be wfq 10 3 10.00 - - Tail Drop af1 lpq - - - 10000 - test af2 wfq 10 3 10.00 - - Tail Drop af3 wfq 15 2 15.00 - - Tail Drop af4 wfq 15 2 15.00 - - Tail Drop ef pq - - - 30000 - test cs6 pq - - - - - Tail Drop cs7 pq - - - - - Tail Drop Reference relationships : NULL
- 配置用户组队列shaping值
# 配置user-group-queue
<HUAWEI> system view
[~HUAWEI] user-group-queue test
[*HUAWEI-user-group-queue-test-slot-all] shaping 500000 inbound
[*HUAWEI-user-group-queue-test-slot-all] commit
[~HUAWEI-user-group-queue-test-slot-all] return
完成上述配置后,执行命令display user-group-queue configuration verbose,可以查看用户组队列的配置信息以及引用关系。
<HUAWEI> display user-group-queue configuration verbose test
user-group-queue-name : test
slot : all
[current configuration]
inbound
shaping-value <kbps> : 500000
pbs-value <byte> : 524288
outbound
shaping-value <kbps> : NA
pbs-value <byte> : NA
weight-value : NA flow-wred-name : NA
[reference relationship]
NULL
- 配置业务模板的精度调整长度。
# 配置service-template及network-header-length。
<HUAWEI> system view
[~HUAWEI] service-template test
[*HUAWEI-service-template-test-slot-all] network-header-length 12 inbound
[*HUAWEI-service-template-test-slot-all] commit
[~HUAWEI-service-template-test-slot-all] quit
完成上述配置后,执行命令display service-template configuration verbose,可以查看业务模板的配置信息,network-header-length值以及引用关系。<HUAWEI> display service-template configuration verbose
[service-template detail information] total number : 1 slot all : 1 service-template-name : test slot : all [current configuration] inbound network-header-length: 12 outbound network-header-length: NA [reference relationship] NULL
- 配置QoS模板调度参数并应用到接口上。
# 配置QoS模板中user-queue的调度参数
<HUAWEI> system view
[~HUAWEI] qos-profile test
[*HUAWEI-qos-profile-test] user-queue cir 100000 flow-queue test user-group-queue test service-template test
[*HUAWEI-qos-profile-test] commit
[~HUAWEI-qos-profile-test] return
# 创建QinQ子接口并配置QinQ Termination,在接口GE0/1/0.1、GE0/1/0.2和GE0/1/0.3上应用QoS模板。
<HUAWEI> system-view
[~HUAWEI] interface gigabitethernet 0/1/0.1
[*HUAWEI-GigabitEthernet0/1/0.1] control-vid 1 qinq-termination
[*HUAWEI-GigabitEthernet0/1/0.1] qinq termination pe-vid 1 ce-vid 1 to 100
[*HUAWEI-GigabitEthernet0/1/0.1] ip address 10.10.1.1 24
[*HUAWEI-GigabitEthernet0/1/0.1] qos-profile test inbound pe-vid 1 ce-vid 1 to 100 group group1
[*HUAWEI-GigabitEthernet0/1/0.1] commit
[~HUAWEI-GigabitEthernet0/1/0.1] quit
[~HUAWEI] interface gigabitethernet 0/1/0.2
[*HUAWEI-GigabitEthernet0/1/0.2] control-vid 2 qinq-termination
[*HUAWEI-GigabitEthernet0/1/0.2] qinq termination pe-vid 2 ce-vid 1 to 100
[*HUAWEI-GigabitEthernet0/1/0.2] ip address 10.10.2.1 24
[*HUAWEI-GigabitEthernet0/1/0.2] qos-profile test inbound pe-vid 2 ce-vid 1 to 100 group group1
[*HUAWEI-GigabitEthernet0/1/0.2] commit
[~HUAWEI-GigabitEthernet0/1/0.2] quit
[~HUAWEI] interface gigabitethernet 0/1/0.3
[*HUAWEI-GigabitEthernet0/1/0.3] control-vid 3 qinq-termination
[*HUAWEI-GigabitEthernet0/1/0.3] qinq termination pe-vid 3 ce-vid 1 to 100
[*HUAWEI-GigabitEthernet0/1/0.3] ip address 10.10.3.1 24
[*HUAWEI-GigabitEthernet0/1/0.3] qos-profile test inbound pe-vid 3 ce-vid 1 to 100 group group1
[*HUAWEI-GigabitEthernet0/1/0.3] commit
[~HUAWEI-GigabitEthernet0/1/0.3] quit
完成上述配置后,执行命令display qos-profile configuration qos-profile-name和display qos-profile application profile-name,可以看到QoS模板的配置和应用信息。
<HUAWEI> display qos-profile configuration test
qos-profile: test inbound: outbound: both: user-queue cir 100000 pir 100000 flow-queue test user-group-queue test service-template test
<HUAWEI> display qos-profile application test
qos-profile test: GigabitEthernet0/1/0.1 GigabitEthernet0/1/0.2 GigabitEthernet0/1/0.3 Reference number by access user:[inbound] 0, [outbound] 0 Reference number by VNI:[inbound] 0, [outbound] 0
执行命令display qos-profile statistics interface gigabitethernet0/1/0.1 pe-vid 1 ce-vid 1 inbound可以看到接口GE0/1/0.1上QoS模板的统计信息。
<HUAWEI> display qos-profile statistics interface gigabitethernet 0/1/0.1 pe-vid 1 ce-vid 1 inbound
GigabitEthernet0/1/0.1 inbound traffic statistics: [be] Pass: 38,226,678 packets, 3,784,441,122 bytes Discard: 183,848,703 packets, 18,201,021,597 bytes Last 5 minutes pass rate: 112,576 pps, 89,160,656 bps Last 5 minutes discard rate: 223,089 pps, 176,686,608 bps [af1] Pass: 9,940,098 packets, 984,069,702 bytes Discard: 721,620,432 packets, 71,440,422,768 bytes Last 5 minutes pass rate: 11,962 pps, 9,474,208 bps Last 5 minutes discard rate: 323,664 pps, 256,341,960 bps [af2] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [af3] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [af4] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [ef] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [cs6] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [cs7] Pass: 0 packets, 0 bytes Discard: 0 packets, 0 bytes Last 5 minutes pass rate: 0 pps, 0 bps Last 5 minutes discard rate: 0 pps, 0 bps [total] Pass: 48,166,776 packets, 4,768,510,824 bytes Discard: 905,469,135 packets, 89,641,444,365 bytes Last 5 minutes pass rate: 124,538 pps, 98,634,864 bps Last 5 minutes discard rate: 546,753 pps, 433,028,568 bps
- 配置类队列引用的WRED对象
# 配置类队列引用的port-wred报文丢弃的参数。
<HUAWEI> system view
[~HUAWEI] port-wred test
[*HUAWEI-port-wred-test] color green low-limit 70 high-limit 100 discard-percentage 100
[*HUAWEI-port-wred-test] color yellow low-limit 60 high-limit 90 discard-percentage 100
[*HUAWEI-port-wred-test] color red low-limit 50 high-limit 80 discard-percentage 100
[*HUAWEI-port-wred-test] commit
[~HUAWEI-port-wred-test] return
完成上述配置后,执行命令display port-wred configuration verbose,可以查看类队列WRED对象的配置参数。
<HUAWEI> display port-wred configuration verbose test
Port wred name : test --------------------------------------------------- Color Low-limit High-limit Discard-percent --------------------------------------------------- green 70 100 100 yellow 60 90 100 red 50 80 100 Queue Depth : 8000 Reference relationships : NULL
- 配置类队列
# 配置port-queue的调度算法、WRED参数及shaping值。
<HUAWEI> system view
[~HUAWEI] interface gigabitethernet 0/2/0
[~HUAWEI-GigabitEthernet0/2/0] undo shutdown
[*HUAWEI-GigabitEthernet0/2/0] port-queue ef pq shaping 120 port-wred test outbound
[*HUAWEI-GigabitEthernet0/2/0] commit
[~HUAWEI-GigabitEthernet0/2/0] return
完成上述配置后,执行命令display port-queue configuration interface,可以查看类队列的详细配置信息。
<HUAWEI> display port-queue configuration interface gigabitethernet 0/2/0 outbound
GigabitEthernet0/2/0 outbound current port-queue configuration: be : arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 af1: arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 af2: arithmetic: wfq weight: 10 tm weight: 3 fact weight: 10.00 shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 af3: arithmetic: wfq weight: 15 tm weight: 2 fact weight: 15.00 shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 af4: arithmetic: wfq weight: 15 tm weight: 2 fact weight: 15.00 shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 ef : arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): 120 port-wred: test green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 cs6: arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0 cs7: arithmetic: pq weight: NA tm weight: NA fact weight: NA shaping(mbps): NA port-wred: NA green(low-high limit) (kbytes) 0 - 0 yellow(low-high limit)(kbytes) 0 - 0 red (low-high limit) (kbytes) 0 - 0 current queue-length (kbytes) 0
- 检查配置结果
当网络中有流量通过时,发现用户1的AF1、EF流量和用户2的EF流量均按照配置的保证带宽进行转发。
在路由器的下行接口GE0/2/0执行命令display port-queue statistics,可以看到EF流量迅速增长。
<HUAWEI> display port-queue statistics interface gigabitethernet 0/2/0 ef outbound
GigabitEthernet0/2/0 outbound traffic statistics: [ef] Current usage percentage of queue: 10 Total pass: 5,097,976 packets, 458,817,750 bytes Total discard: 0 packets, 0 bytes Drop tail discard: 0 packets, 0 bytes Wred discard: 0 packets, 0 bytes Last 30 seconds pass rate: 12,030 pps, 8,661,600 bps Last 30 seconds discard rate: 0 pps, 0 bps Drop tail discard rate: 0 pps, 0 bps Wred discard rate: 0 pps, 0 bps buffer size: 10 kbytes used buffer size: 0 kbytes Peak rate: 2013-11-17 13:15:18 8,661,600 bps
配置文件
路由器的配置文件
#
sysname HUAWEI
#
flow-wred test
color green low-limit 70 high-limit 100 discard-percentage 100
color yellow low-limit 60 high-limit 90 discard-percentage 100
color red low-limit 50 high-limit 80 discard-percentage 100
#
flow-queue test
queue af1 lpq shaping 10000 flow-wred test
queue ef pq shaping 30000 flow-wred test
#
user-group-queue test
shaping 500000 inbound
#
service-template test
network-header-length 12 inbound
#
qos-profile test
user-queue cir 100000 pir 100000 flow-queue test user-group-queue test service-template test
#
port-wred test
color green low-limit 70 high-limit 100 discard-percentage 100
color yellow low-limit 60 high-limit 90 discard-percentage 100
color red low-limit 50 high-limit 80 discard-percentage 100
#
interface GigabitEthernet0/1/0.1
encapsulation qinq-termination
qinq termination pe-vid 1 ce-vid 1 to 100
ip address 10.10.1.1 255.255.255.0
qos-profile test inbound pe-vid 1 ce-vid 1 to 100 group group1
#
interface GigabitEthernet0/1/0.2
encapsulation qinq-termination
qinq termination pe-vid 2 ce-vid 1 to 100
ip address 10.10.2.1 255.255.255.0
qos-profile test inbound pe-vid 2 ce-vid 1 to 100 group group1
#
interface GigabitEthernet0/1/0.3
encapsulation qinq-termination
qinq termination pe-vid 3 ce-vid 1 to 100
ip address 10.10.3.1 255.255.255.0
qos-profile test inbound pe-vid 3 ce-vid 1 to 100 group group1
#
interface GigabitEthernet0/2/0
undo shutdown
ip address 10.20.1.1 255.255.255.0
port-queue ef pq shaping 120 port-wred test outbound
#
ospf 10
area 0.0.0.0
network 10.20.1.0 0.0.0.255
network 10.10.1.0 0.0.0.255
network 10.10.2.0 0.0.0.255
network 10.10.3.0 0.0.0.255
#
return