某公司网络------1/0/26[S5560]1/0/25-------DCI-----------1/1/2[S5500]
--------------BGP出口
某局点5560上1/0/26口配置了qos 的car限速,限速500M。但是从监控看的话,inbound的流量有时候都到了800M,比如下图中的12点多的时候。因此怀疑现场限速不生效。
某公司网络------1/0/26[S5560]1/0/25-------DCI-----------1/1/2[S5500] --------------BGP出口
接口配置如下
#
interface Ten-GigabitEthernet1/0/25
port link-mode bridge
description DCI
port link-type trunk
undo port trunk permit vlan 1
port trunk permit vlan 7 104 112 426 500 4050 to 4051
#
interface Ten-GigabitEthernet1/0/26
port link-mode bridge
description shangtang-BGP-500M-master
port access vlan 453
mirroring-group 1 mirroring-port both
qos apply policy ST500M inbound
qos apply policy ST500M outbound
#
traffic classifier ST500M operator and
if-match any
#
#
traffic behavior ST500M
accounting byte
car cir 512000 cbs 32000000 ebs 1024 green pass red discard yellow pass
#
#
qos policy ST500M
classifier ST500M behavior ST500M
#
#
interface Vlan-interface453
description shangtang-BGP-100M
ip address 175.102.16.33 255.255.255.240
ip policy-based-route 3XBGP
#
#
policy-based-route 3XBGP permit node 5
if-match acl 3010
apply next-hop 10.78.80.45
apply next-hop 10.78.80.49
#
policy-based-route 3XBGP permit node 10
if-match acl 3030
apply next-hop 10.78.80.45
apply next-hop 10.78.80.49
#
#
acl number 3010
description 3XBGP
rule 0 permit ip source 175.102.19.80 0.0.0.15
rule 5 permit ip source 175.102.16.0 0.0.0.31
rule 15 permit ip source 175.102.16.32 0.0.0.15
#
acl number 3030
rule 0 permit ip
source 175.102.134.96 0.0.0.31
现场的流量监控图是通过在不同时刻对1/0/26接口snmp读取input字节数(节点值为1.3.6.1.2.1.31.1.1.1.6)和output字节数(节点为1.3.6.1.2.1.31.1.1.1.10),然后除以时间计算速率得到的流量图。
开始怀疑限速不生效是接口读取的节点有问题,因为读取的入方向字节数是在限速之前的值,所以得到的速率是限速之前的值。
之后,一线反馈5560EI的上行口1/0/25出方向在对应时刻也相应的超限速了(经过确认上行口出方向基本只有1/0/26进来的流量),上行5500设备的下行口流量也相应超限速了。从该现象看,如果限速成功了,上行口出方向流量应该是限速后的值,不应该超过500M,所以说明限速应该还是不成功。
下图为5560EI上行设备5500下行口的流量监控图
之后对配置进一步分析,发现接口所在vlan应用了PBR,且PBR的下一跳指向的地址的出口为1/0/25,具体的ARP如下
10.78.80.45 80f6-2e97-4977 426 XGE1/0/25 5 D
所以此时怀疑从1/0/26口进来的流量匹配PBR直接转发了(此时进一步和一线确认,1/0/26口所在vlan 453是网关地址,进来的流量基本都会匹配到该PBR的acl rule规则),所以car限速不生效。
查看底层ACL
========
Acl-Type MQC Port, Stage IFP, SinglePort, Installed, Active
Prio Mjr/Sub 518/4, Group 5 [5], Slice/Idx 10/3, Entry 208, Single: 2563
PolicyID 110, CBMapID 0, ClassID 110, BehaviorID 111 [IN]
Rule Match --------
Ports: 0x0000080000000000; 0x3c3ffe001fffffff
Lookup: STP forwarding, 0x18, 0x18
Actions --------
CAR cir 0x7d000, cbs 0x1000, pir 0x7d000, pbs 0x2000, mode trTCM color blind
Account mode packets, green and red
Grn Permit
Red Deny
Yel Deny
Accounting: Hi 293811819, LO 2008688
========
Acl-Type Policy Based Routing V4, Stage IFP, NoExpand, Installed, Active
Prio Mjr/Sub 519/1, Group 3 [3], Slice/Idx 11/14, Entry 190, Single: 2830
PBRV4 Policy 3XBGP, VlanIntf 975, Node 5, ApplyIdx 0, Match ACl 1(Yes 1: No 0)
ACL GroupNo : 3010, RuleID : 5
Rule Match --------
Ports: 0x003fce001ffffffe; 0x3c3ffe001fffffff
Lookup: STP forwarding, L2 dst L3 bit[y], 0x118, 0x118
Outer Vlan: 0x1c5, 0xfff //对应vlan 453
Source IP: 175.102.16.0, 255.255.255.224
IP Type: Any IPv4 packet
My Station Hit
Actions --------
Redirect do NOT
L3Switch nexthop_idx 0x186c1
Permit
经过确认,pbr的动作中被默认下发了permit,而QOS CAR限速中又有red deny的动作,当进来的流量同时匹配PBR和QOS CAR,此时QOS CAR动作就无法生效了,所以相当于CAR限速就不生效了。此外,这个vlan内的其他二层报文是可以car限速的,因为此时二层报文并不会匹配到int vlan下的PBR,此时因为MQC CAR的acl规则是if-match any,所以仍然会匹配CAR限速。
现场可以采用Qos lr限速或者调整组网将将PBR取消掉。
此外,针对接口入方向采用MQC CAR后,要想通过snmp读取值计算速率,可以采用如下的方:
在接口配置流统,
节点值采用1.3.6.1.4.1.25506.2.65.2.1.5.6.3.1节点,然后通过
2:hh3cCBQoSCarGreenBytes.1.0 (Counter64)+ 6: hh3cCBQoSCarYellowBytes.1.0 (Counter64) 作为入方向总字节数。
walk 节点 hh3cCBQoSCarRunInfoEntry 显示
***** SNMP QUERY STARTED *****
1: hh3cCBQoSCarGreenPackets.1.0 (Counter64) 0
2: hh3cCBQoSCarGreenBytes.1.0 (Counter64) 32874
3: hh3cCBQoSCarRedPackets.1.0 (Counter64) 0
4: hh3cCBQoSCarRedBytes.1.0 (Counter64) 42380
5: hh3cCBQoSCarYellowPackets.1.0 (Counter64) 0
6: hh3cCBQoSCarYellowBytes.1.0 (Counter64) 0
7: hh3cCBQoSCarClassName.1.0 (OCTET STRING) ST500M [53.54.35.30.30.4D (hex) Size = 6]
Start time :
End time :
Duration : 95ms
命令行显示:
[5130HI-probe]display qos policy interface GigabitEthern...
[5130HI-probe]display qos policy interface GigabitEthernet 10/0/15
Interface: GigabitEthernet10/0/15
Direction: Inbound
Policy: ST500M
Classifier: ST500M
Operator: AND
Rule(s) :
If-match any
Behavior: ST500M
Accounting enable:
75254 (Bytes)
Committed Access Rate:
CIR 8 (kbps), CBS 512 (Bytes), EBS 0 (Bytes)
Green action : pass
Yellow action : pass
Red action : discard
Green packets : 32874 (Bytes)
Red packets : 42380 (Bytes)
***** SNMP QUERY FINISHED *****
Name: hh3cCBQoSCarRunInfoEntry
Type: OBJECT-TYPE
OID: 1.3.6.1.4.1.25506.2.65.2.1.5.6.3.1
Full path: iso(1).org(3).dod(6).internet(1).private(4).enterprises(1).hh3c(25506).hh3cCommon(2).hh3cQos2(65).hh3cCBQos2(2).hh3cCBQoSObjects(1).hh3cCBQoSApplyPolicyStaticsObjects(5).hh3cCBQoSStaticsObjects(6).hh3cCBQoSCarRunInfoTable(3).hh3cCBQoSCarRunInfoEntry(1)
Module: HH3C-CBQOS2-MIB
Parent: hh3cCBQoSCarRunInfoTable
First child: hh3cCBQoSCarGreenPackets
Numerical syntax: Null
Base syntax: Hh3cCBQoSCarRunInfoEntry
Composed syntax: Hh3cCBQoSCarRunInfoEntry
Status: current
Max access: not-accessible
Sequences: 1: hh3cCBQoSCarGreenPackets - Counter64(70 - counter (64 bit))
2: hh3cCBQoSCarGreenBytes - Counter64(70 - counter (64 bit))
3: hh3cCBQoSCarRedPackets - Counter64(70 - counter (64 bit))
4: hh3cCBQoSCarRedBytes - Counter64(70 - counter (64 bit))
5: hh3cCBQoSCarYellowPackets - Counter64(70 - counter (64 bit))
6: hh3cCBQoSCarYellowBytes - Counter64(70 - counter (64 bit))
7: hh3cCBQoSCarClassName - OCTET STRING(4 - octets)
8: hh3cCBQoSCarGreenpps - Counter64(70 - counter (64 bit))
9: hh3cCBQoSCarGreenbps - Counter64(70 - counter (64 bit))
10: hh3cCBQoSCarRedpps - Counter64(70 - counter (64 bit))
11: hh3cCBQoSCarRedbps - Counter64(70 - counter (64 bit))
12: hh3cCBQoSCarYellowpps - Counter64(70 - counter (64 bit))
13: hh3cCBQoSCarYellowbps - Counter64(70 - counter (64 bit))
Indexes: 1: hh3cCBQoSApplyObjectIndex
2: hh3cCBQoSPolicyClassIndex
总结:
若设备上同时配置了QoS方式的入方向流量监管(即通常意义上的car限速)和策略路由(PBR),并且有流量同时匹配两种策略,则只有策略路由对该流量生效。
若设备上同时配置了动作是filter deny的MQC和策略路由(PBR),并且有流量同时匹配两种策略,则只有策略路由对该流量生效。
Qos lr的方式和MQC的方式 对于相同的二层报文的限速是一样的。
对于三层转发的报文,qos lr 限速对于不带tag报文限速是500Mbps,带tag报文限速和字节长度有关系,但是误差都小于10%。
以下是Qos lr 限速500M入方向的测试数据。
字节 |
报文不带tag(MBps) |
报文带tag(MBps) |
||
二层 |
匹配三层PBR |
二层 |
匹配三层PBR |
|
64 |
531 |
500 |
501 |
500 |
128 |
515 |
500 |
500 |
484 |
1024 |
502 |
500 |
500 |
498 |
1518 |
501 |
500 |
500 |
498 |
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作