After some time I have finally some energy to publish a bit more of some stuff about Huawei QoS. The following article will be concentrating on Custom Queuing as it is seen on VRP 3.40 on AR series routers (namely AR46 and AR28).
The first important thing to know is what the Custom Queuing actually does. CQ is a scheduling mechanism so it is in the center of simple QoS model ( classify > schedule > shape) and as all scheduling mechanisms it solves the maths of how much of what, how and when will be dispatched.
Ok so how the CQ actually works? The mechanism used is round robin with percentage (or as in our case queue byte count which is more precise) with dynamic resource allocation. So let say we will have a scenario that we want to divide line bandwidth in 2:4 ratio. If there will be congestion the ratio will be taken in account and limits will be imposed. If there is no congestion and the “4″ queue is not using the whole assigned bandwidth the “2″ queue can occupy more than it’s assigned proportion (i.e. 2,5).
The primary goal of this scheduling mechanisms is to redistribute bandwidth equally, but as you can define almost anything you can use it in more flexible manner.
In the below described scenario we will consider two types of traffic – voice and data (what is case of most SMB companies).
I. Find traffic of interestAs first step you should define how your traffic of interest will be recognized, I used just IP sources but you are limited just by the possibilities provided by any ACL type available.
# acl number 3001 rule 5 permit ip source 184.108.40.206 0 acl number 3002 rule 5 permit ip source 220.127.116.11 0 #
II. Create CQ List (CQL)In the CQL you will define the queues themselves and their behavior. We will use just two parameters which are queue lenhgt and serving. The firs parameter sets maximal length of the queue in the round-robin mechanism, the other defines how many bytes will be served when the queue will be accessed.
# qos cql 1 queue 1 queue-length 100 qos cql 1 queue 1 serving 2000 qos cql 1 queue 2 queue-length 100 qos cql 1 queue 2 serving 4000 qos cql 1 protocol ip acl 3001 queue 1 qos cql 1 protocol ip acl 3002 queue 2 #
Small footnote here – CQ can be used only on IP or MPLS protocols as it does not recognize anything else. From the test I did it seems that IP over FR worked all right.
IV. assign CQL to an interfaceThis step is very easy just remember the this should be inbound interface.
# interface GigabitEthernet0/0/0 ip address dhcp-alloc qos cq cql 1 #
V. shape outbound interface (optional)
As you might be in need of shaping (i.e. you use some reserved bandwidth for other purposes). You might need the shaper in place as otherwise the CQ will allow use of all available bandwidth. In my case I just needed a general traffic shaper. As the shaper below is rather non-intelligent you might want to do this in more granular fashion (i.e. create separate “shaping” QoS policy with another set of rules etc.)
# interface GigabitEthernet0/0/0.1 ip address 192.168.1.2 255.255.255.252 qos gts acl 3001 cir 500000 cbs 250000 ebs 0 queue-length 50 #
This config actually shapes the traffic matching ACL 3001 to 0.5mbps
And that is the whole thing. This is a very basic setup so you might want to tweak this as the shaping (and some other things) is bit bulky.