Example for Configuring Priority Re-marking and Queue Scheduling
Overview
The device allocates or modifies priorities of received buckets based on rules, and schedules services based on allocated or modified priorities.
Priority re-marking enables the device to re-mark packet priorities. You can manually set or modify packet priorities to control packet scheduling and improve packet forwarding capability of the device.
Configuration Notes
- This example applies to the following products:
- S2752EI, S2710-SI, S2720-EI, S2750-EI
- S3700-SI, S3700-EI, S3700-HI
- S5700-LI, S5700S-LI, S5700-SI, S5700-EI, S5700-HI, S5710-C-LI, S5710-X-LI, S5710-EI, S5710-HI, S5720-LI, S5720S-LI, S5720-SI, S5720S-SI, S5720I-SI, S5720-EI, S5720-HI, S5730-HI, S5730-SI, S5730S-EI, S5731-H, S5731-S, S5731S-S, S5731S-H, S5732-H, S2730S-S, S5735-L-I, S5735-L1, S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S5735S-H, S5736-S
- S6700-EI, S6720-LI, S6720S-LI, S6720-SI, S6720S-SI, S6720-EI, S6720S-EI, S6720-HI, S6730-H, S6730-S, S6730S-S, S6730S-H
- S7703, S7706, S7712, S7703 PoE, S7706 PoE, S9703, S9706, S9712
For the product models whose applicable versions are not listed above, see Table 3-1 in "Applicable Products and Versions" for details.
To view detailed information about software mappings, visit Info-Finder, select a product series or product model, and click Hardware Center.
Networking Requirements
In Figure 3-251, a company has three services: data query, email processing, and file transfer. The three services have different priorities. When HostA and HostB access servers of the three services, the services must be processed in descending order of priority. Priority re-marking and queue scheduling can achieve this.
Configuration Roadmap
- Configure traffic classifiers to classify packets based on servers' IP addresses.
- Configure traffic behaviors and define priority re-marking.
- Configure a traffic policy and bind the traffic policy to the traffic classifiers and traffic behaviors, and apply the traffic policy to GE1/0/1 in the inbound direction to re-mark priorities of incoming packets.
- Configure PQ on GE1/0/2 to schedule packets in descending order of priority.
Procedure
- Configure ACLs to classify packets based on servers' IP addresses.
# Configure advanced ACL 3001 to classify packets with the destination IP address of 192.168.1.10.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] acl 3001 [SwitchA-acl-adv-3001] rule permit ip destination 192.168.1.10 0.0.0.0 [SwitchA-acl-adv-3001] quit
# Configure advanced ACL 3002 to classify packets with the destination IP address of 192.168.1.11.
[SwitchA] acl 3002 [SwitchA-acl-adv-3002] rule permit ip destination 192.168.1.11 0.0.0.0 [SwitchA-acl-adv-3002] quit
# Configure advanced ACL 3003 to classify packets with the destination IP address of 192.168.1.12.
[SwitchA] acl 3003 [SwitchA-acl-adv-3003] rule permit ip destination 192.168.1.12 0.0.0.0 [SwitchA-acl-adv-3003] quit
- Configure traffic classifiers to classify packets based on destination IP addresses.
# Configure a traffic classifier named dbserver to match packets with the destination IP address of 192.168.1.10.
[SwitchA] traffic classifier dbserver operator and [SwitchA-classifier-dbserver] if-match acl 3001 //Configure the device to match packets with the destination IP address of 192.168.1.10. [SwitchA-classifier-dbserver] quit
# Configure a traffic classifier named mailserver to match packets with the destination IP address of 192.168.1.11.
[SwitchA] traffic classifier mailserver operator and [SwitchA-classifier-mailserver] if-match acl 3002 //Configure the device to match packets with the destination IP address of 192.168.1.11. [SwitchA-classifier-mailserver] quit
# Configure a traffic classifier named ftpserver to match packets with the destination IP address of 192.168.1.12.
[SwitchA] traffic classifier ftpserver operator and [SwitchA-classifier-ftpserver] if-match acl 3003 //Configure the device to match packets with the destination IP address of 192.168.1.12. [SwitchA-classifier-ftpserver] quit
- Configure traffic behaviors and define priority re-marking.
# Configure a traffic behavior named dbserver to re-mark packets destined for 192.168.1.10 with 4.
[SwitchA] traffic behavior dbserver [SwitchA-behavior-dbserver] remark local-precedence 4 //Configure the device to re-mark the local priority of packets destined for 192.168.1.10 with 4. [SwitchA-behavior-dbserver] quit
# Configure a traffic behavior named mailserver to re-mark packets destined for 192.168.1.11 with 3.
[SwitchA] traffic behavior mailserver [SwitchA-behavior-mailserver] remark local-precedence 3 //Configure the device to re-mark the local priority of packets destined for 192.168.1.11 with 3. [SwitchA-behavior-mailserver] quit
# Configure a traffic behavior named ftpserver to re-mark packets destined for 192.168.1.12 with 2.
[SwitchA] traffic behavior ftpserver [SwitchA-behavior-ftpserver] remark local-precedence 2 //Configure the device to re-mark the local priority of packets destined for 192.168.1.12 with 2. [SwitchA-behavior-ftpserver] quit
- Configure a traffic policy and bind the traffic classifiers and traffic behaviors to the traffic policy.
[SwitchA] traffic policy policy1 [SwitchA-trafficpolicy-policy1] classifier dbserver behavior dbserver [SwitchA-trafficpolicy-policy1] classifier mailserver behavior mailserver [SwitchA-trafficpolicy-policy1] classifier ftpserver behavior ftpserver [SwitchA-trafficpolicy-policy1] quit
- Apply the traffic policy to GE1/0/1 to re-mark priorities of incoming packets.
[SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] traffic-policy policy1 inbound //Apply the traffic policy in the inbound direction. [SwitchA-GigabitEthernet1/0/1] quit
- Configure PQ on GE1/0/2 to schedule packets in descending order of priority.
On the S2700-52P-EI, S2700-52P-PWR-EI, S2710-SI, S3700-EI, S3700-HI, S3700-SI, S5700-EI, S5700-HI, S5710-EI, S5710-HI, S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S6700-EI, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, S6730S-S, S7700, and S9700, perform the following configurations.
[SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] qos pq //Configure PQ scheduling on the interface. In PQ mode, the device first schedules high-priority packets. [SwitchA-GigabitEthernet1/0/2] quit
This example uses a configuration file containing the qos pq command on a fixed switch as an example. On a modular switch, an interface queue uses PQ by default, and the qos pq command is not contained in the configuration file.
- On the S2720-EI, S2750-EI, S5700-LI, S5700S-LI, S5700-SI, S5710-C-LI, S5710-X-LI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S5735S-H, S5736-S, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI, perform the following configurations.
[SwitchA] qos schedule-profile pqtemplate //Create a scheduling profile. [SwitchA-qos-schedule-profile-pqtemplate] qos pq //Configure PQ scheduling. [SwitchA-qos-schedule-profile-pqtemplate] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] qos schedule-profile pqtemplate //Apply the scheduling profile to the interface. [SwitchA-GigabitEthernet1/0/2] quit
- Verify the configuration.
# Check the traffic policy configuration.
[SwitchA] display traffic policy user-defined User Defined Traffic Policy Information: Policy: policy1 Classifier: dbserver Operator: AND Behavior: dbserver Remark: Remark local-precedence af4 Classifier: mailserver Operator: AND Behavior: mailserver Remark: Remark local-precedence af3 Classifier: ftpserver Operator: AND Behavior: ftpserver Remark: Remark local-precedence af2 Total policy number is 1
# Check the traffic policy record. The traffic policy has been successfully applied to GE1/0/1.
[SwitchA] display traffic-policy applied-record policy1 ------------------------------------------------- Policy Name: policy1 Policy Index: 0 Classifier:dbserver Behavior:dbserver Classifier:mailserver Behavior:mailserver Classifier:ftpserver Behavior:ftpserver ------------------------------------------------- *interface GigabitEthernet1/0/1 traffic-policy policy1 inbound slot 1 : success ------------------------------------------------- Policy total applied times: 1.
Configuration Files
- SwitchA configuration file (applicable to the S2700-52P-EI, S2700-52P-PWR-EI, S2710-SI, S3700-EI, S3700-HI, S3700-SI, S5700-EI, S5700-HI, S5710-EI, S5710-HI, S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S2730S-S, S5735-L-I, S5735-L1,S300, S5735-L, S5735S-L, S5735S-L1, S5735S-L-M, S5735-S, S500, S5735S-S, S5735-S-I, S6700-EI, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, S6730S-S, S7700, and S9700)
# sysname SwitchA # acl number 3001 rule 5 permit ip destination 192.168.1.10 0 acl number 3002 rule 5 permit ip destination 192.168.1.11 0 acl number 3003 rule 5 permit ip destination 192.168.1.12 0 # traffic classifier dbserver operator and if-match acl 3001 traffic classifier ftpserver operator and if-match acl 3003 traffic classifier mailserver operator and if-match acl 3002 # traffic behavior dbserver remark local-precedence af4 traffic behavior ftpserver remark local-precedence af2 traffic behavior mailserver remark local-precedence af3 # traffic policy policy1 match-order config classifier dbserver behavior dbserver classifier mailserver behavior mailserver classifier ftpserver behavior ftpserver # interface GigabitEthernet1/0/1 traffic-policy policy1 inbound # interface GigabitEthernet1/0/2 qos pq # return
SwitchA configuration file (applicable to the S2720-EI, S2750-EI, S5700-LI, S5700S-LI, S5700-SI, S5710-C-LI, S5710-X-LI, S5720I-SI, S5720-LI, S5720S-LI, S5720S-SI, S5720-SI, S5730S-EI, S5730-SI, S5735S-H, S5736-S, S6720-LI, S6720S-LI, S6720S-SI, and S6720-SI)
# sysname SwitchA # acl number 3001 rule 5 permit ip destination 192.168.1.10 0 acl number 3002 rule 5 permit ip destination 192.168.1.11 0 acl number 3003 rule 5 permit ip destination 192.168.1.12 0 # traffic classifier dbserver operator and if-match acl 3001 traffic classifier ftpserver operator and if-match acl 3003 traffic classifier mailserver operator and if-match acl 3002 # traffic behavior dbserver remark local-precedence af4 traffic behavior ftpserver remark local-precedence af2 traffic behavior mailserver remark local-precedence af3 # traffic policy policy1 classifier dbserver behavior dbserver classifier mailserver behavior mailserver classifier ftpserver behavior ftpserver # interface GigabitEthernet1/0/1 traffic-policy policy1 inbound # interface GigabitEthernet1/0/2 qos schedule-profile pqtemplate # qos schedule-profile pqtemplate qos pq # return