< Home

Example for Configuring HQoS

Overview

HQoS uses multiple levels of queues to further differentiate service traffic, and provides uniform management and hierarchical scheduling for transmission objects such as users and services. HQoS enables network devices to control internal resources with the existing hardware, providing QoS guarantee for advanced users while reducing network construction cost.

The switch uses flow and subscriber queues to implement HQoS.

Configuration Notes

Only X1E series cards of the chassis switch support this configuration.

For applicable product models and versions, see Applicable Product Models and Versions.

For details about software mappings, visit Hardware Query Tool and search for the desired product model.

Networking Requirements

Voice, video, and data services from multiple users are transmitted on a network, and 802.1p priorities of voice, video, and data services are 6, 5, and 2, respectively. Bandwidth needs to be guaranteed for the voice, video, and data services in descending order of priority. Table 1 and Table 2 describe the configuration requirements.

Because the bandwidth is finite, the device needs to differentiate service priorities and shape traffic from different users to provide different bandwidth. Table 3 describes the configuration requirement.

Table 1 Congestion avoidance parameters of flow queues

Service Type

Color

Lower Drop Threshold (%)

Upper Drop Threshold (%)

Maximum Drop Probability

Voice

Green

80

100

10

Video

Yellow

60

80

20

Data

Red

40

60

40

Table 2 Congestion management parameters of flow queues

Service Type

CoS Value

Voice

EF

Video

AF3

Data

AF1

Table 3 Traffic shaping parameters of subscriber queues

User

PIR

Users in VLAN 10

8000 kbit/s

Users in VLAN 20

5000 kbit/s

Figure 1 HQoS networking

Configuration Roadmap

The configuration roadmap is as follows:
  1. Create VLANs and configure interfaces so that the users can access the Internet through the Switch.
  2. Create a DiffServ domain on the Switch to map 802.1p priorities of different service packets to PHBs and colors, and bind the DiffServ domain to the inbound interface of the Switch.
  3. Configure a flow queue WRED drop profile, flow queue profile, and profile parameters on the Switch so that the Switch provides different scheduling priorities, drop profile parameters, and traffic shaping parameters for different services.
  4. Configure ACLs on the Switch to differentiate service traffic of different users based on VLAN IDs.
  5. Configure subscriber queues and traffic shaping parameters on the Switch, and reference the flow queue WRED drop profile and flow queue profile to implement HQoS.

Procedure

  1. Create VLANs and configure interfaces.

    # Create VLAN 10 on SwitchA, configure GE1/0/1 and GE1/0/2 as access interfaces and add them to VLAN 10, and configure GE2/0/1 as a trunk interface and add it to VLAN 10.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] vlan batch 10
    [SwitchA] interface gigabitethernet 1/0/1
    [SwitchA-GigabitEthernet1/0/1] port link-type access
    [SwitchA-GigabitEthernet1/0/1] port default vlan 10
    [SwitchA-GigabitEthernet1/0/1] quit
    [SwitchA] interface gigabitethernet 1/0/2
    [SwitchA-GigabitEthernet1/0/2] port link-type access
    [SwitchA-GigabitEthernet1/0/2] port default vlan 10
    [SwitchA-GigabitEthernet1/0/2] quit
    [SwitchA] interface gigabitethernet 2/0/1
    [SwitchA-GigabitEthernet2/0/1] port link-type trunk
    [SwitchA-GigabitEthernet2/0/1] port trunk allow-pass vlan 10
    [SwitchA-GigabitEthernet2/0/1] quit

    # Create VLAN 20 on SwitchB, configure GE1/0/1 and GE1/0/2 as access interfaces and add them to VLAN 20, and configure GE2/0/1 as a trunk interface and add it to VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchB
    [SwitchB] vlan batch 20
    [SwitchB] interface gigabitethernet 1/0/1
    [SwitchB-GigabitEthernet1/0/1] port link-type access
    [SwitchB-GigabitEthernet1/0/1] port default vlan 20
    [SwitchB-GigabitEthernet1/0/1] quit
    [SwitchB] interface gigabitethernet 1/0/2
    [SwitchB-GigabitEthernet1/0/2] port link-type access
    [SwitchB-GigabitEthernet1/0/2] port default vlan 20
    [SwitchB-GigabitEthernet1/0/2] quit
    [SwitchB] interface gigabitethernet 2/0/1
    [SwitchB-GigabitEthernet2/0/1] port link-type trunk
    [SwitchB-GigabitEthernet2/0/1] port trunk allow-pass vlan 20
    [SwitchB-GigabitEthernet2/0/1] quit

    # Create VLAN 10 and VLAN 20 on SwitchC, configure GE1/0/1 as a trunk interface and add it to VLAN 10 and VLAN 20, and configure GE2/0/1 as a trunk interface and add it to VLAN 10 and VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchC
    [SwitchC] vlan batch 10 20
    [SwitchC] interface gigabitethernet 1/0/1
    [SwitchC-GigabitEthernet1/0/1] port link-type trunk
    [SwitchC-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 20
    [SwitchC-GigabitEthernet1/0/1] quit
    [SwitchC] interface gigabitethernet 2/0/1
    [SwitchC-GigabitEthernet2/0/1] port link-type trunk
    [SwitchC-GigabitEthernet2/0/1] port trunk allow-pass vlan 10 20
    [SwitchC-GigabitEthernet2/0/1] quit

    # Create VLAN 10 and VLAN 20 on the Switch, configure GE1/0/1, GE1/0/2, and GE2/0/1 as trunk interfaces, and add GE1/0/1 to VLAN 10, GE1/0/2 to VLAN 20, and GE2/0/1 to VLAN 10 and VLAN 20.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] vlan batch 10 20
    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] port link-type trunk
    [Switch-GigabitEthernet1/0/1] port trunk allow-pass vlan 10
    [Switch-GigabitEthernet1/0/1] quit
    [Switch] interface gigabitethernet 1/0/2
    [Switch-GigabitEthernet1/0/2] port link-type trunk
    [Switch-GigabitEthernet1/0/2] port trunk allow-pass vlan 20
    [Switch-GigabitEthernet1/0/2] quit
    [Switch] interface gigabitethernet 2/0/1
    [Switch-GigabitEthernet2/0/1] port link-type trunk
    [Switch-GigabitEthernet2/0/1] port trunk allow-pass vlan 10 20
    [Switch-GigabitEthernet2/0/1] quit

  2. Configure priority mapping.

    # Create a DiffServ domain ds1 to map 802.1p priorities 6, 5, 2 to EF, AF3, and AF1, respectively, and color packets green, yellow, and red, respectively.

    [Switch] diffserv domain ds1
    [Switch-dsdomain-ds1] 8021p-inbound 6 phb ef green  //Create a DiffServ domain to map 802.1p priorities of different service packets to PHBs so that packets enter different queues.
    [Switch-dsdomain-ds1] 8021p-inbound 5 phb af3 yellow
    [Switch-dsdomain-ds1] 8021p-inbound 2 phb af1 red
    [Switch-dsdomain-ds1] quit

    # Bind the DiffServ domain to GE1/0/1 and GE1/0/2 on the Switch.

    [Switch] interface gigabitethernet 1/0/1
    [Switch-GigabitEthernet1/0/1] trust upstream ds1  //Apply the DiffServ domain to the interface.
    [Switch-GigabitEthernet1/0/1] trust 8021p inner  //Configure the interface to trust 802.1p priorities.
    [Switch-GigabitEthernet1/0/1] quit
    [Switch] interface gigabitethernet 1/0/2
    [Switch-GigabitEthernet1/0/2] trust upstream ds1  //Apply the DiffServ domain to the interface.
    [Switch-GigabitEthernet1/0/2] trust 8021p inner  //Configure the interface to trust 802.1p priorities.
    [Switch-GigabitEthernet1/0/2] quit

  3. Configure a flow queue WRED drop profile and define parameters in the profile.

    # Create a flow queue WRED drop profile named wred1 on the Switch and set parameters of green, yellow, and red packets in the flow queue WRED drop profile.

    [Switch] flow-wred-profile wred1  //Configure a WRED drop profile.
    [Switch-flow-wred-wred1] color green low-limit 80 high-limit 100 discard-percentage 10  //Configure a WRED drop profile, and set the upper and lower drop threshold and maximum drop probability for green packets.
    [Switch-flow-wred-wred1] color yellow low-limit 60 high-limit 80 discard-percentage 20  //When the percentage of the yellow packet length to the queue length reaches 60%, the device starts to discard packets with the maximum drop probability of 20%. When the percentage of the yellow packet length to the queue length reaches 80%, the device discards all new packets.
    [Switch-flow-wred-wred1] color red low-limit 40 high-limit 60 discard-percentage 40
    [Switch-flow-wred-wred1] quit

  4. Configure a flow queue profile and define parameters in the profile.

    # Configure a flow queue profile named flow1 on the Switch, bind flow queue profile flow1 to flow queue WRED drop profile wred1, and configure different scheduling parameters.

    [Switch] flow-queue-profile flow1  //Configure a flow queue profile.
    [Switch-flow-queue-flow1] qos queue 5 pq flow-wred-profile wred1  //Configure PQ scheduling for queue 5 and reference the WRED drop profile wred1.
    [Switch-flow-queue-flow1] qos queue 3 wfq weight 20 flow-wred-profile wred1  //Configure WFQ scheduling for queue 3, set the WFQ weight to 20, and reference the WRED drop profile wred1.
    [Switch-flow-queue-flow1] qos queue 1 wfq weight 10 flow-wred-profile wred1  //Configure WFQ scheduling for queue 1, set the WFQ weight to 10, and reference the WRED drop profile wred1.
    [Switch-flow-queue-flow1] quit

  5. Configure ACLs.

    # Configure ACL 4001 and ACL 4002 on the Switch, and configure ACL rules based on VLAN 10 and VLAN 20.

    [Switch] acl number 4001
    [Switch-acl-L2-4001] rule 1 permit vlan-id 10   //Configure an ACL rule to match packets with VLAN 10.
    [Switch-acl-L2-4001] quit
    [Switch] acl number 4002
    [Switch-acl-L2-4002] rule 1 permit vlan-id 20   //Configure an ACL rule to match packets with VLAN 20.
    [Switch-acl-L2-4002] quit

  6. Configure subscriber queues and parameters.

    # Configure subscriber queues based on ACL 4001 and ACL 4002 on the Switch and reference flow queue profile flow1.

    [Switch] interface gigabitethernet 2/0/1
    [Switch-GigabitEthernet2/0/1] traffic-user-queue outbound acl 4001 pir 8000 flow-queue-profile flow1  //Create a subscriber queue that references ACL 4001, set the PIR to 8000 kbit/s, and reference the flow queue flow1.
    [Switch-GigabitEthernet2/0/1] traffic-user-queue outbound acl 4002 pir 5000 flow-queue-profile flow1  //Create a subscriber queue that references ACL 4002, set the PIR to 5000 kbit/s, and reference the flow queue flow1.
    [Switch-GigabitEthernet2/0/1] quit
    [Switch] quit

  7. Verify the configuration.

    # Check the configuration of the WRED drop profile of a flow queue, including the profile name, upper and lower drop thresholds of green, yellow, and red packets, and maximum drop probability.

    <Switch> display flow-wred-profile name wred1
    Flow-wred-profile[1]: wred1                                                     
    Queue depth         : 1048576                                                   
    Color     Low-limit   High-limit  Discard-percentage                            
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -               
    Green     80          100         10                                            
    Yellow    60          80          20                                            
    Red       40          60          40                                            
    ----------------------------------------------------------------- 

    # Check the flow queue profile configuration, including the profile name and WFQ weights.

    <Switch> display flow-queue-profile name flow1
    Flow-queue-profile[1]: flow1                                                    
    Queue Schedule(Weight) Shaping         flow-wred-profile                        
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -         
    0     PQ               None            default                                  
    1     WFQ(10)          None            wred1                                    
    2     PQ               None            default                                  
    3     WFQ(20)          None            wred1                                    
    4     PQ               None            default                                  
    5     PQ               None            wred1                                    
    6     PQ               None            default                                  
    7     PQ               None            default                                  
    ----------------------------------------------------------------------- 

    # Check traffic statistics on subscriber queues.

    <Switch> display traffic-user-queue statistics interface gigabitethernet 2/0/1 outbound acl 4001 
    --------------------------------------------------------------------------------
     Interface: GigabitEthernet2/0/1                                                
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             0         |          packets: pass:                       4,127                                                            
                       |                   drop:               2,798,787,076                                                            
                       |          bytes:   pass:                     610,796                                                            
                       |                   drop:             414,220,487,248                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             1         |          packets: pass:                       4,127                                                            
                       |                   drop:               5,597,436,717                                                            
                       |          bytes:   pass:                     610,796                                                            
                       |                   drop:             828,420,634,116                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             2         |          packets: pass:                           0                                                            
                       |                   drop:                           0                                                            
                       |          bytes:   pass:                           0                                                            
                       |                   drop:                           0                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             3         |          packets: pass:                       4,127                                                            
                       |                   drop:               5,597,436,713                                                            
                       |          bytes:   pass:                     610,796                                                            
                       |                   drop:             828,420,633,524                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             4         |          packets: pass:                       4,127                                                            
                       |                   drop:               2,798,716,293                                                            
                       |          bytes:   pass:                     610,796                                                            
                       |                   drop:             414,210,011,364                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             5         |          packets: pass:                       4,127                                                            
                       |                   drop:               2,798,716,294                                                            
                       |          bytes:   pass:                     610,796                                                            
                       |                   drop:             414,210,011,512                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             6         |          packets: pass:                           0                                                            
                       |                   drop:                           0                                                            
                       |          bytes:   pass:                           0                                                            
                       |                   drop:                           0                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             7         |          packets: pass:               1,119,509,460                                                            
                       |                   drop:               1,679,210,961                                                            
                       |          bytes:   pass:             165,687,400,080                                                            
                       |                   drop:             248,523,222,228                                                            
    --------------------------------------------------------------------------------                                                    
    
    <Switch> display traffic-user-queue statistics interface gigabitethernet 2/0/1 outbound acl 4002 
    --------------------------------------------------------------------------------
     Interface: GigabitEthernet2/0/1                                                
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             0         |          packets: pass:                       4,125                                                            
                       |                   drop:                   5,218,026                                                            
                       |          bytes:   pass:                     610,500                                                            
                       |                   drop:                 772,267,848                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             1         |          packets: pass:                       4,125                                                            
                       |                   drop:                  10,440,178                                                            
                       |          bytes:   pass:                     610,500                                                            
                       |                   drop:               1,545,146,344                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             2         |          packets: pass:                           0                                                            
                       |                   drop:                           0                                                            
                       |          bytes:   pass:                           0                                                            
                       |                   drop:                           0                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             3         |          packets: pass:                       4,125                                                            
                       |                   drop:                  10,440,178                                                            
                       |          bytes:   pass:                     610,500                                                            
                       |                   drop:               1,545,146,344                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             4         |          packets: pass:                       4,125                                                            
                       |                   drop:                   5,218,027                                                            
                       |          bytes:   pass:                     610,500                                                            
                       |                   drop:                 772,267,996                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             5         |          packets: pass:                       4,125                                                            
                       |                   drop:                   5,218,027                                                            
                       |          bytes:   pass:                     610,500                                                            
                       |                   drop:                 772,267,996                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             6         |          packets: pass:                           0                                                            
                       |                   drop:                           0                                                            
                       |          bytes:   pass:                           0                                                            
                       |                   drop:                           0                                                            
    --------------------------------------------------------------------------------                                                    
         Queue ID      |                   Statistics information                                                                       
    --------------------------------------------------------------------------------                                                    
             7         |          packets: pass:                   2,092,988                                                            
                       |                   drop:                   3,129,165                                                            
                       |          bytes:   pass:                 309,762,224                                                            
                       |                   drop:                 463,116,420                                                            
    --------------------------------------------------------------------------------

Configuration Files

  • SwitchA configuration file

    #
    sysname SwitchA
    #                                                                               
    vlan batch 10                                                                   
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     port link-type access                                                          
     port default vlan 10                                                           
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     port link-type access                                                          
     port default vlan 10                                                           
    #                                                                               
    interface GigabitEthernet2/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 10                                                  
    #                                                                                
    return
  • SwitchB configuration file

    #
    sysname SwitchB
    #                                                                               
    vlan batch 20                                                                   
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     port link-type access                                                          
     port default vlan 20                                                           
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     port link-type access                                                          
     port default vlan 20                                                           
    #                                                                               
    interface GigabitEthernet2/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 20                                                  
    #                                                                               
    return
  • SwitchC configuration file

    #
    sysname SwitchC
    #                                                                               
    vlan batch 10 20                                                                   
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 10 20                                               
    #                                                                               
    interface GigabitEthernet2/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 10 20                                               
    # 
    return
  • Switch configuration file

    #
    sysname Switch
    #
    vlan batch 10 20
    #
    diffserv domain ds1
     8021p-inbound 2 phb af1 red
     8021p-inbound 5 phb af3 yellow
     8021p-inbound 6 phb ef green
    #
    acl number 4001  
     rule 1 permit vlan-id 10
    acl number 4002  
     rule 1 permit vlan-id 20
    #
    flow-wred-profile wred1
     color green low-limit 80 high-limit 100 discard-percentage 10
     color yellow low-limit 60 high-limit 80 discard-percentage 20
     color red low-limit 40 high-limit 60 discard-percentage 40
    #
    flow-queue-profile flow1
     qos queue 1 wfq weight 10 flow-wred-profile wred1
     qos queue 3 wfq weight 20 flow-wred-profile wred1
     qos queue 5 flow-wred-profile wred1              
    #
    interface GigabitEthernet1/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 10                                                  
     trust upstream ds1                                                             
     trust 8021p inner                                                              
    #
    interface GigabitEthernet1/0/2                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 20                                                  
     trust upstream ds1                                                             
     trust 8021p inner                                                              
    #                                                                               
    interface GigabitEthernet2/0/1                                                  
     port link-type trunk                                                           
     port trunk allow-pass vlan 10 20                                               
     traffic-user-queue outbound acl 4001 pir 8000 flow-queue-profile flow1
     traffic-user-queue outbound acl 4002 pir 5000 flow-queue-profile flow1
    #                                                                               
    return

Applicable Product Models and Versions

Table 4 Applicable product models and versions

Product

Product Model

Software Version

S5700

S5720-HI

V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10

S7700

S7703, S7706, S7712

V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C10, V200R012C00, V200R013C00, V200R019C00, V200R019C10

S7703 PoE

V200R013C00, V200R019C00, V200R019C10

S7706 PoE

V200R013C00, V200R019C00, V200R019C10

S9700

S9703, S9706, S9712

V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C10, V200R012C00, V200R013C00

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic