Example for Configuring HQoS
Networking Requirements
As shown in Figure 6-3, two departments of the enterprise branch belong to VLAN10 and VLAN20 respectively and the enterprise headquarters belongs to VLAN30. The enterprise branch connects to the Router through the switch and connects to the headquarters through two sub-interfaces on GE3/0/0 of the Router. Each department has its voice, video, and data flows. Control packets of the NMS are transmitted in the enterprise.
Packets are marked with different DSCP priorities by the switch, and the priorities of voice service, NMS control service, video service, and data service are ef, cs6, af21, and af11. Each department needs to have its CIR and share the maximum bandwidth of the interface. Voice packets need to be processed first with short delay, NMS control packets need to be processed first, and bandwidth of video and data packets needs to be ensured.
Configuration Roadmap
- Create VLANs and VLANIF interfaces and configure interfaces so that enterprise users can access the WAN-side network through the Router.
- Configure sub traffic policies for VLAN10 and VLAN20 on the Router, configure traffic classifiers based on DSCP priorities to send voice packets to LLQ queues, NMS control packets to EF queues, and video and data packets to AF queues, and bind drop profiles.
- Configure a traffic policy on the Router, configure traffic classifiers based on VLAN IDs to shape packets from different VLANs, and bind the traffic policy to the sub traffic policies.
- Apply the traffic policy to the interface of the Router connected to the WAN-side network to provide differentiated QoS services.
Procedure
- Create VLANs and configure interfaces.
# Create VLAN10 and VLAN20 on the Router.
<Huawei> system-view [Huawei] sysname Router [Router] vlan batch 10 20
# Configure Eth2/0/0 as a trunk interface, and add Eth2/0/0 to VLAN 10.
[Router] interface ethernet 2/0/0 [Router-Ethernet2/0/0] port link-type trunk [Router-Ethernet2/0/0] port trunk allow-pass vlan 10 [Router-Ethernet2/0/0] quit
# Configure Eth2/0/1 as a trunk interface, and add Eth2/0/1 to VLAN 20.
[Router] interface ethernet 2/0/1 [Router-Ethernet2/0/1] port link-type trunk [Router-Ethernet2/0/1] port trunk allow-pass vlan 20 [Router-Ethernet2/0/1] quit
Configure the switch interface connected to the Router as a trunk interface, and add it to VLAN 10 and VLAN 20.
# Create VLANIF10 and VLANIF20, and assign IP addresses 192.168.1.1/24 and 192.168.2.1/24 to VLANIF 10 and VLANIF 20.
[Router] interface vlanif 10 [Router-Vlanif10] ip address 192.168.1.1 24 [Router-Vlanif10] quit [Router] interface vlanif 20 [Router-Vlanif20] ip address 192.168.2.1 24 [Router-Vlanif20] quit
# Assign IP address 192.168.3.1/24 to GE3/0/0.
[Router] interface gigabitethernet 3/0/0 [Router-GigabitEthernet3/0/0] ip address 192.168.3.1 24 [Router-GigabitEthernet3/0/0] quit
# Configure the control VLAN of GE3/0/0.1 as VLAN 10, set the encapsulation mode to dot1q, and assign 192.168.4.1/24 to it. Configure the control VLAN of GE3/0/0.2 as VLAN 20, set the encapsulation mode to dot1q, and assign 192.168.5.1/24 to it.
[Router] interface gigabitethernet 3/0/0.1 [Router-GigabitEthernet3/0/0.1] ip address 192.168.4.1 24 [Router-GigabitEthernet3/0/0.1] dot1q termination vid 10 [Router-GigabitEthernet3/0/0.1] quit [Router] interface gigabitethernet 3/0/0.2 [Router-GigabitEthernet3/0/0.2] ip address 192.168.5.1 24 [Router-GigabitEthernet3/0/0.2] dot1q termination vid 20 [Router-GigabitEthernet3/0/0.2] quit
- Configure sub traffic policies for groupa and groupb.
# Create traffic classifiers data, video, control, and voice on the Router to classify different service flows from the enterprise based on DSCP priorities.
[Router] traffic classifier data [Router-classifier-data] if-match dscp af11 [Router-classifier-data] quit [Router] traffic classifier video [Router-classifier-video] if-match dscp af21 [Router-classifier-video] quit [Router] traffic classifier control [Router-classifier-control] if-match dscp cs6 [Router-classifier-control] quit [Router] traffic classifier voice [Router-classifier-voice] if-match dscp ef [Router-classifier-voice] quit
# Create drop profiles data and video on the Router.
[Router] drop-profile data [Router-drop-profile-data] wred dscp [Router-drop-profile-data] dscp 10 low-limit 70 high-limit 85 discard-percentage 60 [Router-drop-profile-data] quit [Router] drop-profile video [Router-drop-profile-video] wred dscp [Router-drop-profile-video] dscp 18 low-limit 80 high-limit 95 discard-percentage 60 [Router-drop-profile-video] quit
# Create traffic behaviors data, video, control, and voice on the Router to configure congestion management and congestion avoidance for different service flows of the enterprise.
[Router] traffic behavior data [Router-behavior-data] queue af bandwidth pct 45 [Router-behavior-data] drop-profile data [Router-behavior-data] quit [Router] traffic behavior video [Router-behavior-video] queue af bandwidth pct 30 [Router-behavior-video] drop-profile video [Router-behavior-video] quit [Router] traffic behavior control [Router-behavior-control] queue ef bandwidth pct 5 [Router-behavior-control] quit [Router] traffic behavior voice [Router-behavior-voice] queue llq bandwidth pct 15 [Router-behavior-voice] quit
# Define sub traffic policies for groupa and groupb on the Router.
[Router] traffic policy groupa-sub [Router-trafficpolicy-groupa-sub] classifier voice behavior voice [Router-trafficpolicy-groupa-sub] classifier control behavior control [Router-trafficpolicy-groupa-sub] classifier video behavior video [Router-trafficpolicy-groupa-sub] classifier data behavior data [Router-trafficpolicy-groupa-sub] quit [Router] traffic policy groupb-sub [Router-trafficpolicy-groupb-sub] classifier voice behavior voice [Router-trafficpolicy-groupb-sub] classifier control behavior control [Router-trafficpolicy-groupb-sub] classifier video behavior video [Router-trafficpolicy-groupb-sub] classifier data behavior data [Router-trafficpolicy-groupb-sub] quit
- Configure a traffic policy.
# Configure traffic classifiers groupa and groupb on the Huawei to classify different service flows from the enterprise based on the VLAN ID.
[Router] traffic classifier groupa [Router-classifier-groupa] if-match vlan-id 10 [Router-classifier-groupa] quit [Router] traffic classifier groupb [Router-classifier-groupb] if-match vlan-id 20 [Router-classifier-groupb] quit
# Create traffic behaviors groupa and groupb on the Router to shape packets from different VLANs and bind them to sub traffic policies.
[Router] traffic behavior groupa [Router-behavior-groupa] gts cir 20000 cbs 500000 queue-length 50 [Router-behavior-groupa] traffic-policy groupa-sub [Router-behavior-groupa] quit [Router] traffic behavior groupb [Router-behavior-groupb] gts cir 30000 cbs 750000 queue-length 50 [Router-behavior-groupb] traffic-policy groupb-sub [Router-behavior-groupb] quit
# Configure a traffic policy on the Router.
[Router] traffic policy enterprise [Router-trafficpolicy-enterprise] classifier groupa behavior groupa [Router-trafficpolicy-enterprise] classifier groupb behavior groupb [Router-trafficpolicy-enterprise] quit
- Apply the traffic policy.
# Apply the traffic policy on GE3/0/0 of the Router in the outbound direction.
[Router] interface gigabitethernet 3/0/0 [Router-GigabitEthernet3/0/0] traffic-policy enterprise outbound
- Verify the configuration.
# View the interface configuration on the Router.
[Router-GigabitEthernet3/0/0] display this # interface GigabitEthernet3/0/0 ip address 192.168.3.1 255.255.255.0 traffic-policy enterprise outbound # return
# View the traffic policy configuration.
[Router-GigabitEthernet3/0/0] quit
[Router] display traffic-policy applied-record enterprise ------------------------------------------------- Policy Name: enterprise Policy Index: 2 Classifier:groupa Behavior:groupa Classifier:groupb Behavior:groupb ------------------------------------------------- *interface GigabitEthernet3/0/0 traffic-policy enterprise outbound slot 3 : success nest Policy : groupa-sub slot 0 : success nest Policy : groupb-sub slot 0 : success Classifier: groupa Operator: OR Rule(s) : if-match vlan-id 10 Behavior: groupa General Traffic Shape: CIR 20000 (Kbps), CBS 500000 (byte) Queue length 50 (Packets) Nest Policy : groupa-sub Classifier: voice Operator: OR Rule(s) : if-match dscp ef Behavior: voice Low-latency: Bandwidth 15 (%) Bandwidth 3000 (Kbps) CBS 75000 (Bytes) Classifier: control Operator: OR Rule(s) : if-match dscp cs6 Behavior: control Expedited Forwarding: Bandwidth 5 (%) Bandwidth 1000 (Kbps) CBS 25000 (Bytes) Queue Length: 64 (Packets) 131072 (Bytes) Classifier: video Operator: OR Rule(s) : if-match dscp af21 Behavior: video Assured Forwarding: Bandwidth 30 (%) Bandwidth 6000 (Kbps) Drop Method: WRED Drop-profile: video Classifier: data Operator: OR Rule(s) : if-match dscp af11 Behavior: data Assured Forwarding: Bandwidth 45 (%) Bandwidth 9000 (Kbps) Drop Method: WRED Drop-profile: data Behavior: Be Assured Forwarding: Bandwidth 50000 (Kbps) Classifier: groupb Operator: OR Rule(s) : if-match vlan-id 20 Behavior: groupb General Traffic Shape: CIR 30000 (Kbps), CBS 750000 (byte) Queue length 50 (Packets) Nest Policy : groupa-sub Nest Policy : groupb-sub Classifier: voice Operator: OR Rule(s) : if-match dscp ef Behavior: voice Low-latency: Bandwidth 15 (%) Bandwidth 4500 (Kbps) CBS 112500 (Bytes) Classifier: control Operator: OR Rule(s) : if-match dscp cs6 Behavior: control Expedited Forwarding: Bandwidth 5 (%) Bandwidth 1500 (Kbps) CBS 37500 (Bytes) Queue Length: 64 (Packets) 131072 (Bytes) Classifier: video Operator: OR Rule(s) : if-match dscp af21 Behavior: video Assured Forwarding: Bandwidth 30 (%) Bandwidth 9000 (Kbps) Drop Method: WRED Drop-profile: video Classifier: data Operator: OR Rule(s) : if-match dscp af11 Behavior: data Assured Forwarding: Bandwidth 45 (%) Bandwidth 13500 (Kbps) Drop Method: WRED Drop-profile: data Behavior: Be Assured Forwarding: Bandwidth 50000 (Kbps) ------------------------------------------------- Policy total applied times: 1.
Configuration Files
- Router configuration file
# sysname Router # vlan batch 10 20 # drop-profile data wred dscp dscp af11 low-limit 70 high-limit 85 discard-percentage 60 drop-profile video wred dscp dscp af21 low-limit 80 high-limit 95 discard-percentage 60 # traffic classifier control operator or if-match dscp cs6 traffic classifier groupb operator or if-match vlan-id 20 traffic classifier video operator or if-match dscp af21 traffic classifier groupa operator or if-match vlan-id 10 traffic classifier data operator or if-match dscp af11 traffic classifier voice operator or if-match dscp ef # traffic behavior control queue ef bandwidth pct 5 traffic behavior groupb gts cir 30000 cbs 750000 queue-length 50 traffic-policy groupb-sub traffic behavior video queue af bandwidth pct 30 drop-profile video traffic behavior groupa gts cir 20000 cbs 500000 queue-length 50 traffic-policy groupa-sub traffic behavior data queue af bandwidth pct 45 drop-profile data traffic behavior voice queue llq bandwidth pct 15 # traffic policy groupa-sub classifier voice behavior voice classifier control behavior control classifier video behavior video classifier data behavior data traffic policy enterprise classifier groupa behavior groupa classifier groupb behavior groupb traffic policy groupb-sub classifier voice behavior voice classifier control behavior control classifier video behavior video classifier data behavior data # interface Vlanif10 ip address 192.168.1.1 255.255.255.0 # interface Vlanif20 ip address 192.168.2.1 255.255.255.0 # interface Ethernet2/0/0 port link-type trunk port trunk allow-pass vlan 10 # interface Ethernet2/0/1 port link-type trunk port trunk allow-pass vlan 20 # interface GigabitEthernet3/0/0 ip address 192.168.3.1 255.255.255.0 traffic-policy enterprise outbound # interface GigabitEthernet3/0/0.1 dot1q termination vid 10 ip address 192.168.4.1 255.255.255.0 # interface GigabitEthernet3/0/0.2 dot1q termination vid 20 ip address 192.168.5.1 255.255.255.0 # return