20-QoS Command

Download

Table of Contents

Chapter 1 QoS Overview Commands. 1-1

1.1 QoS Overview Commands. 1-1

1.1.1 display qos lr interface. 1-1

1.1.2 qos lr 1-2

Chapter 2 QoS Policy Configuration Commands. 2-1

2.1 QoS Policy Configuration Commands. 2-1

2.1.1 accounting. 2-1

2.1.2 car 2-1

2.1.3 classifier behavior 2-3

2.1.4 display qos policy. 2-4

2.1.5 display qos policy interface. 2-5

2.1.6 display traffic behavior 2-6

2.1.7 display traffic classifier 2-7

2.1.8 filter 2-8

2.1.9 if-match. 2-9

2.1.10 qos apply policy. 2-12

2.1.11 qos policy. 2-12

2.1.12 redirect 2-13

2.1.13 remark dot1p. 2-14

2.1.14 remark dscp. 2-15

2.1.15 remark ip-precedence. 2-16

2.1.16 remark local-precedence. 2-17

2.1.17 traffic behavior 2-17

2.1.18 traffic classifier 2-18

Chapter 3 WRR Queue Configuration Commands. 3-1

3.1 WRR Queue Configuration Commands. 3-1

3.1.1 display qos sp. 3-1

3.1.2 display qos wrr interface. 3-1

3.1.3 qos sp. 3-2

3.1.4 qos wrr 3-3

Chapter 4 Priority Mapping Configuration Commands. 4-1

4.1 Priority Mapping Configuration Commands. 4-1

4.1.1 display qos map-table. 4-1

4.1.2 qos map-table. 4-2

4.1.3 qos priority. 4-2

Chapter 5 VLAN Policy Commands. 5-1

5.1 VLAN Policy Commands. 5-1

5.1.1 display qos vlan-policy. 5-1

5.1.2 qos vlan-policy. 5-3

5.1.3 reset qos vlan-policy. 5-4

Chapter 6 Traffic Mirroring Configuration Commands. 6-1

6.1 Traffic Mirroring Configuration Commands. 6-1

6.1.1 display qos policy user-defined. 6-1

6.1.2 display traffic behavior user-defined. 6-2

6.1.3 mirror-to interface. 6-3

 


Chapter 1  QoS Overview Commands

1.1  QoS Overview Commands

1.1.1  display qos lr interface

Syntax

display qos lr interface [ interface-type interface-number ]

View

Any view

Parameter

interface-type: Port type.

interface-number: Port number.

Description

Use the display qos lr interface command to display the LR configuration and statistics information of a certain interface or all interfaces.

If the interface argument is not specified, this command will display the LR configuration and statistics information of all the interfaces.

Example

# Display the LR configuration and statistics information of all the interfaces.

<H3C> display qos lr interface

Interface: GigabitEthernet1/0/1

Direction: Outbound

 CIR 64000 (kbps),  CBS 4000000 (byte)

Table 1-1 Description on the fields of the display qos lr command

Field

Description

Interface

Port name, composed of port type and port number

Direction

Specify the direction of limited rate as outbound

CIR

Committed information rate, in kbps

CBS

Committed burst size, namely, the depth of the token bucket that holds the burst traffic, in byte

 

1.1.2  qos lr

Syntax

qos lr outbound cir committed-information-rate [ cbs committed-burst-size ]

undo qos lr outbound

View

Ethernet interface view/port group view

Parameter

outbound: Limits the rate of the outbound traffic.

cir committed-information-rate: Specifies the committed information rate in kbps. The committed-information-rate argument ranges from 64 to 1,000,000 and must be a multiple of 64.

cbs committed-burst-size: Specifies the committed burst size in bytes.

l           The committed-burst-size argument ranges from 4,000 to 16,000,000.

l           If the cbs keyword is not used, the system uses the default committed burst size, that is, 500 ms x committed-information-rate, or 16,000,000 if the multiplication is more than 16,000.000.

Description

Use the qos lr command to limit the rate of outbound traffic via physical interfaces.

Use the undo qos lr command to cancel the limit.

Example

# Limit the rate of the physical port GigabitEthernet1/0/1 to send packets. CIR is 64 kbps and CBS is 9,216 bytes.

<H3C> system-view

[H3C] interface GigabitEthernet 1/0/1

[H3C-GigabitEthernet1/0/1] qos lr outbound cir 64 cbs 9216

 


Chapter 2  QoS Policy Configuration Commands

2.1  QoS Policy Configuration Commands

2.1.1  accounting

Syntax

accounting

undo accounting

View

Traffic behavior view

Parameter

None

Description

Use the accounting command to configure the accounting action for the traffic behavior.

Use the undo accounting command to remove the accounting configuration.

Related command: qos policy, traffic behavior, and classifier behavior.

Example

# Configure the accounting action for the traffic behavior.

<H3C> system-view

[H3C] traffic behavior database

[H3C-behavior-database] accounting

2.1.2  car

Syntax

car cir committed-information-rate [ cbs committed-burst-size ] [ red action ]

undo car

View

Traffic behavior view

Parameter

cir committed-information-rate: Specifies the committed information rate in kbps. The committed-information-rate argument ranges from 64 to 32,000,000 and must be a multiple of 64.

cbs committed-burst-size: Specifies the committed burst size in bytes.

l           The committed burst size argument ranges from 500 to 2,000,000.

l           If the cbs keyword is not used, the system uses the default committed burst size, that is, 500 ms x committed-information-rate, or 2,000,000 if the multiplication is more than 2,000,000.

red: The action to be taken when the traffic does not conform to cir. The default value is discard.

action: Specifies the following actions.

l           discard: Discards data packets.

l           pass: Sends data packets.

l           remark-dscp-pass new-dscp: Sets a new DSCP value and sends a data packet to the destination address, ranging from 0 to 63. Or input one of the keywords listed in Table 2-1 as the DSCP.

Table 2-1 DSCP values and the corresponding keywords

Keyword

DSCP value in decimal

DSCP value in binary

default

0

000000

af11

10

001010

af12

12

001100

af13

14

001110

af21

18

010010

af22

20

010100

af23

22

010110

af31

26

011010

af32

28

011100

af33

30

011110

af41

34

100010

af42

36

100100

af43

38

100110

cs1

8

001000

cs2

16

010000

cs3

24

011000

cs4

32

100000

cs5

40

101000

cs6

48

110000

cs7

56

111000

ef

46

101110

 

Description

Use the car command to configure TP for the traffic behavior.

Use the undo car command to remove the TP configuration.

When the car command is used in the policies applied on the port, the policies can be applied in the inbound direction of the port.

If this command is used repeatedly to configure TP for the same traffic behavior, the last configuration is effective.

Related command: qos policy, traffic behavior, and classifier behavior.

Example

# Configure TP for a traffic behavior. The normal traffic rate of packets is 6400 kbps.

<H3C> system-view

[H3C] traffic behavior database

[H3C-behavior-database] car cir 6400

2.1.3  classifier behavior

Syntax

classifier tcl-name behavior behavior-name

undo classifier tcl-name

View

Policy View

Parameter

tcl-name: Defined class name, a string of 1 to 31 characters.

behavior-name: Defined behavior name, a string of 1 to 31 characters.

Description

Use the classifier behavior command to specify the behavior for a class in the policy.

Use the undo classifier behavior command to cancel the usage of the specified class in the policy.

Each class in the policy can be associated with only one action.

Related command: qos policy.

Example

# Use the behavior “test” for the class “database” in the policy user1.

<H3C> system-view

[H3C] qos policy user1

[H3C-qospolicy-user1] classifier database behavior test

2.1.4  display qos policy

Syntax

display qos policy user-defined [ policy-name [ classifier tcl-name ] ]

View

Any view

Parameter

user-defined: User-defined policies.

policy-name: Policy name, a string of 1 to 31 characters. If no policy name is specified, this command displays the configuration information of all user-defined policies.

tcl-name: Class name in the policy, a string of 1 to 31 characters.

Description

Use the display qos policy command to display the configuration information of the specified class or all classes in the specified policy or all policies and the configuration information of behavior(s) associated with the class(es).

Example

# Display the configuration information of all classes in all user-defined policies and the configuration information of the behaviors associated with the classes.

<H3C> display qos policy user-defined

 

  User Defined QoS Policy Information:

 

  Policy: test

   Classifier: USER1

     Behavior: USER1

      Marking:

        Remark IP Precedence 3

      Committed Access Rate:

        CIR 6400 (kbps), CBS 400000 (byte)

        Red Action: discard

 

   Classifier: database

     Behavior: database

      Marking:

        Remark IP Precedence 5

Table 2-2 Description on the fields of the display qos policy command

Field

Description

Policy

Policy name

Classifier

Class name. A policy can contain multiple classes and each class has a corresponding behavior and one or more match rule. Refer to the traffic classifier command for details.

Behavior

The behavior corresponding to a class in the policy. A behavior can have multiple rules. Refer to the traffic behavior command for details.

 

2.1.5  display qos policy interface

Syntax

display qos policy interface [ interface-type interface-number ] [ inbound ]

View

Any view

Parameter

interface-type: Port type.

interface-number: Port number.

inbound: Inbound direction.

Description

Use the display qos policy interface command to display the configuration and running status of the policy on the specified ports or all ports.

Example

# Display the configuration and running status of the policy on GigabitEthernet 1/0/1.

<H3C> display qos policy interface GigabitEthernet 1/0/1

 

  Interface: GigabitEthernet1/0/1

 

  Direction: Inbound

 

  Policy: test

   Classifier: USER1

     Operator: AND

     Rule(s) : if-match ip-precedence 5

     Behavior: USER1

      Marking:

        Remark IP Precedence 3

      Committed Access Rate:

        CIR 640 (kbps), CBS 40000 (byte)

        Red Action: discard

 

   Classifier: database

     Operator: AND

     Rule(s) : if-match acl 3131

     Behavior: database

      Marking:

        Remark IP Precedence 3

Table 2-3 Description on the fields of the display qos policy interface command

Field

Description

Interface

Port name, composed of port type and port number

Direction

The application direction of the policy on the port

Policy

The name of the policy  applied on the port

Classifier

The classification rule in the policy and the corresponding configuration information

Operator

The logic relationship among different classification rules in a class

Rule(s)

Classification rule(s) of the class

Behavior

The name and configuration information of the behavior in the policy. Refer to the commands related with behavior for details

 

2.1.6  display traffic behavior

Syntax

display traffic behavior user-defined [ behavior-name ]

View

Any view

Parameter

user-defined: User-defined behaviors.

behavior-name: Behavior name, a string of 1 to 31 characters. If no behavior name is specified, the command displays the information about all user-defined behaviors.

Description

Use the display traffic behavior command to display the configured traffic behavior information.

If no behavior name is specified, this command displays the information about all behaviors.

Example

# Display the information about user-defined traffic behaviors .

<H3C> display traffic behavior user-defined

  User Defined Behavior Information:

    Behavior: test

      Marking:

        Remark IP precedence 3

      Committed Access Rate:

        CIR 640 (kbps), CBS 40000 (byte)

        Red Action: discard

Table 2-4 Description on the fields of the display traffic behavior user-defined command

Field

Description

User Defined Behavior Information

Type of behavior: user-defined

Behavior

The name and content of the behavior. The content can involve multiple types

Marking

Remarking configuration

Committed Access Rate

Traffic limiting configuration

 

2.1.7  display traffic classifier

Syntax

display traffic classifier user-defined [ tcl-name ]

View

Any view

Parameter

user-defined: User-defined class.

tcl-name: Class name, a string of 1 to 31 characters.

Description

Use the display traffic classifier command to display the configured class information.

If no class name is specified, this command displays the information about all classes.

Example

# Display the user-defined class information.

<H3C> display traffic classifier user-defined

User Defined Classifier Information:

 Classifier: USER1

  Operator: OR

  Rule(s) : if-match ip-precedence 5

 

 Classifier: database

 Operator: OR

  Rule(s) : if-match acl 3131

Table 2-5 Description on the fields of the display traffic classifier user-defined command

Field

Description

User Defined Classifier Information

Type of class: user-defined

Classifier

The name and content of the class. The content can involve multiple types.

Operator

The logic relationship among the classification rules

Rule

Classification rule(s)

 

2.1.8  filter

Syntax

filter { deny | permit }

undo filter

View

Traffic behavior view

Parameter

discard: Drops packets.

permit: Sends packets.

Description

Use the filter command to configure the traffic filter action for the traffic behavior.

Use the undo filter command to remove the configuration.

 

  Caution:

Except for the accounting command, the filter deny command cannot be used together with any other commands that are used to configure actions for traffic behavior.

 

Example

# Configure the filter action of dropping packets for the traffic behavior.

<H3C> system-view

[H3C] traffic behavior database

[H3C-behavior-database] filter deny

2.1.9  if-match

Syntax

if-match match-criteria

undo if-match match-criteria

View

Class view

Parameter

match-criteria: Match rule of the class. Refer to Table 2-6 for the value range.

Table 2-6 The match rule values of the class

Value

Description

acl access-list-number

Defines a rule that matches an ACL. The value range of access-list-number is from 2000 to 4999

acl ipv6 access-list-number

Defines an IPv6 ACL rule. The value of the access-list-number argument is in the range of 2,000 to 3,999.

IPv6 ACL rules can only be implemented by referencing ACL6 rules.

any

Defines a rule to match all packets

dot1p dot1p-list

Defines a rule that matches 802.1p priority. The value of 802.1p priority is in the range of 0 to 7

dscp dscp-list

Defines a rule that matches DSCP. dscp-list is the list of DSCP values, The DSCP values range from 0 to 63

destination-mac mac-address

Defines a rule that matches the destination MAC address

ip-precedence ip-precedence-list

Defines a rule that matches IP precedence. ip-precedence-list is the list of IP precedence values, The IP precedence values range from 0 to 7

source-mac mac-address

Defines a rule that matches the source MAC address

customer-vlan-id vlan-id-list

Defines a rule that matches VLAN IDs of the user network. vlan-id-list is the list of VLAN IDs , The VLAN IDs range from 1 to 4094

service-vlan-id vlan-id-list

Defines a rule that matches VLAN IDs of the operator network. vlan-id-list is the list of VLAN IDs, The VLAN IDs range from 1 to 4094

 

Description

Use the if-match command to define a rule for all the packets matching the specified rule.

Use the undo if-match command to delete the rule for all packets matching the specified match rule.

 

&  Note:

Please obey the following restrictions when defining a rule; otherwise you will fail to apply the policies.

l      If the customer-vlan-id, dot1p, dscp, ip-precedence or service-vlan-id is to be matched, do not configure multiple values in a rule at the same time when you use the if-match command to define match rules.

l      Do not configure multiple values in a rule at the same time when you use the if-match command to define match rules.

l      When you specify the logic relation as AND, if you configure the ACL IPv6 matching rule, you cannot configure other rules except if-match any at the same time.

 

Related command: traffic classifier.

Example

# Define the match rule of class1 to match packets whose destination MAC address is 0050-ba27-bed3.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match destination-mac 0050-ba27-bed3

# Define the match rule of class2 to match packets whose source MAC address is 0050-ba27-bed2.

<H3C> system-view

[H3C] traffic classifier class2

[H3C-classifier-class2] if-match source-mac 0050-ba27-bed2

# Define the match rule of class1 to match ACL 3101.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match acl 3101

# Define a rule that matches all packets.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match any

# Define the match rule of class1 to match packets whose DSCP value is 1.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match dscp 1

# Define the match rule of class1 to match packets whose IP precedence value is 1.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match ip-precedence 1

# Define the match rule of class1 to match packets whose VLAN ID of the user network is 1.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match customer-vlan-id 1

# Define the match rule of class1 to match packets whose VLAN ID of the operator network is 1.

<H3C> system-view

[H3C] traffic classifier class1

[H3C-classifier-class1] if-match service-vlan-id 1

2.1.10  qos apply policy

Syntax

qos apply policy policy-name inbound

undo qos apply policy inbound

View

Ethernet interface view/port group view

Parameter

inbound: Inbound direction.

policy policy-name: Specifies the policy name, a string of 1 to 31 characters.

Description

Use the qos apply policy command to apply the associated policy on the port.

Use the undo apply policy command to delete the associated policy.

Example

# Apply the policy named USER1 to the inbound direction of GigabitEthernet1/0/1.

<H3C> system-view

[H3C] interface GigabitEthernet 1/0/1

[H3C-GigabitEthernet1/0/1] qos apply policy USER1 inbound

2.1.11  qos policy

Syntax

qos policy policy-name

undo qos policy policy-name

View

System view

Parameter

policy policy-name: Policy name, a string of 1 to 31 characters.

Description

Use the qos policy command to define a policy and enter policy view.

Use the undo qos policy command to delete a policy.

If the policy is applied on a certain port, it is not allowed to delete the policy. To delete it, you must first cancel the application of the policy on this port and then use the undo qos policy command to delete the policy.

Related command: classifier behavior, and qos apply policy.

Example

# Define a policy named USER1.

<H3C> system-view

[H3C] qos policy user1

[H3C-qospolicy-user1]

2.1.12  redirect

Syntax

redirect interface interface-type interface-number

undo redirect

View

Traffic behavior view

Parameter

interface-type: Port type.

interface-number: Port number.

Description

Use the redirect command to configure the traffic redirect action for the traffic behavior.

Use the undo redirect command to remove the configuration.

Example

# Define the traffic redirect action for the traffic behavior to redirect the traffic to GigabitEthernet1/0/1.

<H3C> system-view

[H3C] traffic behavior database

[H3C-behavior-database] redirect interface GigabitEthernet 1/0/1

2.1.13  remark dot1p

Syntax

remark dot1p 8021p

undo remark dot1p

View

Traffic behavior view

Parameter

8021p: Specifies a 802.1p priority , ranging from 0 to 7.

Description

Use the remark dot1p command to configure the 802.1p priority of a packet.

Use the undo remark dot1p command to cancel the 802.1p priority of the packet.

 

  Caution:

remark dot1p and remark local-precedence cannot be configured at the same time.

 

Related command: qos policy, traffic behavior, and classifier behavior

Example

# Configure the 802.1p priority of the packet as 2.

<H3C> system-view

[H3C] traffic behavior database

[H3C-behavior-database] remark dot1p 2

2.1.14  remark dscp

Syntax

remark dscp dscp-value

undo remark dscp

View

Traffic behavior view

Parameter

dscp-value: Specifies a DSCP value, ranging from 0 to 63. It also can be a key word, as shown in the following table.

Table 2-7 Relationship between DSCP keywords and values

Key word

DSCP value (binary)

DSCP value (decimal)

default

000000

0

af11

001010

10

af12

001100

12

af13

001110

14

af21

010010

18

af22

010100

20

af23

010110

22

af31

011010

26

af32

011100

28

af33

011110

30

af41

100010

34

af42

100100

36

af43

100110

38

cs1

001000

8

cs2

010000

16

cs3

011000

24

cs4

100000

32

cs5

101000

40

cs6

110000

48

cs7

111000

56

ef

101110

46

 

Description

Use the remark dscp command to configure the DSCP value of a packet.

Use the undo remark dscp command to remove the DSCP value of the packet.

Related command: qos policy, traffic behavior, and classifier behavior