Skip to content
Ask AI

HQoS Configuration Guide

HQoS (Hierarchical Quality of Service) is an advanced traffic management mechanism. By employing multi-level queue scheduling and shaping strategies, it enables granular bandwidth control and priority assurance for complex network traffic. This optimizes bandwidth utilization efficiency and ensures the service quality of critical applications (such as voice, video, etc.).

Traditional QoS technologies typically manage traffic at a single network node or interface. In contrast, HQoS introduces the hierarchical concept, allowing for nested traffic management across multiple dimensions simultaneously (e.g., the overall link, user groups, individual users, and different service types within a user). This makes HQoS particularly well-suited for network environments with diverse application scenarios.

OperationCommandDescription
Enter the system configuration viewconfigure
Globally enable HQoShqos enable
OperationCommandDescription
Enter the system configuration viewconfigure
Create a global HQoS configurationhqos-profilenameThe following configurations are performed within the global HQoS configuration view
Configure global rate limitingglobal ratebyte/sUnit: byte/s
Bind custom user groupsuser-group-profile {fuzzymatchuser-group-name**|postmatchuser-group-name|prematchuser-group-name|user-group-name} {shaping pirbyte/spbsbytes}**supports batch binding of user groups using the following match modes:fuzzymatch: Fuzzy match; postmatch: Post-match; prematch: Pre-match; Individual rate limiting can be configured for user groups
Bind custom usersuser-profile {fuzzymatchuser-name**|postmatchuser-name|prematchuser-name|user-name} {shaping pirbyte/spbsbytes}**supports batch binding of users using the following match modes:fuzzymatch: Fuzzy match; postmatch: Post-match; prematch: Pre-match; Individual rate limiting can be configured for users
Configure rate limiting for the default user groupdefault-group-profile shaping pirbyte/spbsbytesUsers not bound to any custom user group belong to the default user group
Configure rate limiting for the default userdefault-user-profile shaping pirbyte/spbsbytesUsers that are not custom users belong to the default user
OperationCommandDescription
Enter the system configuration viewconfigure
Create Custom user groupshqos-user-group-profilenameThe following configurations are performed within the custom user group view
Bind custom usersuser-profile {fuzzymatchuser-name**|postmatchuser-name|prematchuser-name|user-name} {shaping pirbyte/spbsbytes}**supports batch binding of users using the following match modes:fuzzymatch: Fuzzy match; postmatch: Post-match; prematch: Pre-match; Individual rate limiting can be configured for users
Bind DSCP-type priority mapping relationshipsqos-map bind dscp_to_tcqos-map-namenote that the DSCP-type priority mapping table must be created before binding
OperationCommandDescription
Enter the system configuration viewconfigure
Create custom userhqos-user-profilenameThe following configurations are performed within the custom user view
Configure TC scheduling mode and rate limitingtc-queuesequence-numbermode strict|dwrr {shaping pirbyte/spbsbytes**}**
Bind DSCP-type priority mapping relationshipsqos-map bind dscp_to_tcqos-map-namenote that the DSCP-type priority mapping table must be created before binding
OperationCommandDescription
Enter the interface viewinterface ethernetinterface-id
bind the HQoS configuration on the interfacehqos-profilename**{shared|offload}**By default, the normal mode is used, meaning each port operates independently.In shared mode, all interfaces bound to this HQoS configuration file share the rate limit specified in the configuration.

Network requirements

The company’s total egress bandwidth is 800 Mbps. Departments A and B under the company are allocated 400 Mbps each. Within Department A, video conferencing traffic requires priority scheduling and is guaranteed 100 Mbps of bandwidth.

Procedure

1.Enable the HQoS function

sonic(config)# hqos enable

2.Create users for Department A and Department B

sonic(config)# hqos-user-profile A
sonic(config-user-A)# exit
sonic(config)# hqos-user-profile B
sonic(config-user-B)# exit
sonic(config)# access-list L3 A ingress
sonic(config-L3-acl-A)# rule 1 src-ip 1.1.1.1/24 set-hqos-user A packet-action permit
sonic(config-L3-acl-A)# exit
sonic(config)# access-list L3 B ingress
sonic(config-L3-acl-B)# rule 1 src-ip 2.1.1.1/24 set-hqos-user B packet-action permit

3.Create user groups for both departments and configure rate limiting for each department

sonic(config)# hqos-user-group-profile A
sonic(config-group-A)# user-profile A shaping pir 400000000 pbs 1000000
sonic(config-group-A)# exit
sonic(config)# hqos-user-group-profile B
sonic(config-group-B)# user-profile B shaping pir 400000000 pbs 1000000
sonic(config-group-B)# exit

4.Configure priority scheduling and bandwidth guarantee for the video conferencing traffic in Department A

sonic(config)# qos map dscp_to_tc dscp 46 1
sonic(config)# hqos-user-profile A
sonic(config-user-A)# tc-queue 1 mode strict shaping pir 100000000 pbs 1000000
sonic(config-user-A)# exit

5.Create a global HQoS configuration and bind the user groups to it

sonic(config)# hqos-profile test
sonic(config-hqos-test)# user-group-profile A
sonic(config-hqos-test)# user-group-profile B

6.Apply the configuration to the port

sonic(config)# interface ethernet 1
sonic(config-if-1)# hqos-profile test
sonic(config-if-1)# interface ethernet 2
sonic(config-if-2)# acl A priority 1
sonic(config-if-2)# interface ethernet 3
sonic(config-if-3)# acl B priority 2