qos car

Function

The qos car command configures traffic policing on an interface.

The undo qos car command deletes the traffic policing configuration.

By default, the traffic policing is not configured on an interface.

Format

qos car { cir-percentage cir-percentage-value [ pir-percentage pir-percentage-value ] } [ [ cbs cbs-value ] [ pbs pbs-value ] ] [ green { discard | pass [ service-class class color color ] } | yellow { discard | pass [ service-class class color color ] } | red { discard | pass [ service-class class color color ] } ] * { inbound | outbound } [ color-aware ]

qos car { cir cir-value [ pir pir-value ] } [ cbs cbs-value [ pbs pbs-value ] ] [ adjust adjust-value ] [ green { discard | pass [ service-class class color color ] } | yellow { discard | pass [ service-class class color color ] } | red { discard | pass [ service-class class color color ] } ] * { inbound | outbound } [ vlan { vlan-id1 [ to vlan-id2 ] &<1-10> } ] [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ color-aware ]

undo qos car { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] &<1-10> | all }

undo qos car { inbound | outbound }

Parameters

Parameter Description Value
cbs cbs-value

Specifies the CBS, that is, the depth of the first token bucket that is assumed to be bucket C. The CBS indicates the volume of the traffic that can pass at a burst. It is recommended to set the CBS to a value greater than 10 times the length of a packet.

The value is an integer ranging from 0 to 4294967295, in bytes.

outbound

Configures traffic policing for outgoing (downstream) packets.

-

color-aware

Specifies the color-aware mode. By default, the color-blind mode is used.

-

cir-percentage cir-percentage-value

Specifies the percentage value of cir.

The value is an integer ranging from 0 to 100.

pir-percentage pir-percentage-value

Specifies the percentage value of pir.

The value is an integer ranging from 0 to 100.

pbs pbs-value

Specifies the PBS, that is, the volume of the peak traffic that can pass at a burst. PBS is considered the depth of the second bucket that is assumed to be bucket P. It is recommended to set the PBS to a value greater than 10 times the packet length.

The default value of pbs-value is related to the set value of pir-value.

The value is an integer ranging from 0 to 4294967295, in bytes.

inbound

Configures traffic policing for incoming (upstream) packets.

-

cir cir-value

Specifies the CIR, that is, the rate at which traffic is allowed to pass.

The value is an integer ranging from 0 to 4294967295, in kbit/s.

pir pir-value

Specifies the PIR, that is, the maximum rate at which traffic is allowed to pass. In addition, pir-value should not be smaller than cir-value.

The value is an integer ranging 0 to 4294967295, in kbit/s.

vlan vlan-id1

Specifies a start VLAN ID.

The value is an integer in the range 1 to 4094.

to vlan-id2

Specifies an end VLAN ID.

vlan-id2 must be greater than or equal to vlan-id1. vlan-id2 and vlan-id1 specify a VLAN ID range.

If you do not specify to vlan-id2, CAR is only implemented for the VLAN specified by vlan-id1.

The value is an integer in the range 1 to 4094.

identifier

Specifies the allocation type.

If the identifier parameter is not specified, all users share one CAR bandwidth.

-

none

The allocation type is not specified, and all users share one CAR bandwidth.

-

vid

Indicates that bandwidth is allocated to packets based on VLAN IDs in outer VLAN tags. Packets with the same VLAN ID in outer VLAN tags share one CAR bandwidth.

-

ce-vid

Indicates that bandwidth is allocated to packets based on VLAN IDs in inner VLAN tags. Packets with the same VLAN ID in inner VLAN tags share one CAR bandwidth.

-

vid-ce-vid

Indicates that bandwidth is allocated to packets based on VLAN IDs in both inner and outer VLAN tags. Packets with the same inner and outer VLAN IDs share one CAR bandwidth.

-

green

Indicates the action to be taken on the packets when the traffic reaches the CIR. The default action is pass.

-

discard

Indicate discard action to be taken on packets of a color (green, yellow, and red).

-

pass

Indicate pass action to be taken on packets of a color (green, yellow, and red).

-

service-class class

Specifies the CoS of packets to be re-marked.

The CoS can be CS7, CS6, EF, AF4, AF3, AF2, AF1, or BE.

color color

Specifies the color of packets to be re-marked.

The color can be green, yellow, or red.

yellow

Indicates the action to be taken on data packets when the traffic rate of the data packets exceeds the CIR but is smaller than the PIR. The default action is pass.

-

red

Indicates the action to be taken on data packets when the traffic rate of the data packets exceeds the PIR. The default action is discard.

-

adjust adjust-value

Specifies a precise compensation value.

The value is an integer that ranges from -32 to 31.

The precision compensation value is based on the L2 length of the packet (including the Ethernet header and CRC but excluding the CRC preamble).

all

All VLANs.

-

Views

100GE interface view, 10G LAN interface view, 10G WAN interface view, EVC view of a 10GE interface, 25GE interface view, 400GE interface view, 40GE interface view, 50GE interface view, Eth-Trunk interface view, FlexE interface view, GE optical interface view, GE electrical interface view, PW-VE sub-interface view, Tunnel interface view, EVC view of an Eth-Trunk interface, EVC view of an Ethernet interface, EVC view of a GE interface

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
qos write

Usage Guidelines

Usage Scenario

There are a large number of users in the network and they send data constantly. Continuous burst data from numerous users can make the network congested. As a result, the running and service quality of the network are affected to a great extent. The interface-based traffic policing can be configured to limit the traffic that is sent to internet so that the bandwidth resources are available regardless of whether the network is idle or congested.

To limit the bandwidth of an interface, run the qos car command to limit the traffic rate of the interface. This traffic policing policy is used to police the total traffic on an interface, that is, the sum of IPv4 and IPv6 traffic.

Precautions

When QoS is configured on an interface and the PBS is 0, actions cannot be configured for packets colored yellow.

The PIR values displayed on the device and NMS are as follows:

  • When only the CIR is configured and the PIR is not configured, the default value of the PIR is 0. The PIR is not displayed in the command configuration file or on the NMS.
  • When the PIR is set to 0, it is not displayed in the configuration file.

Dot1q, QinQ, Eth-Trunk dot1q, and Eth-Trunk QinQ VLAN tag termination sub-interfaces do not support QoS CAR. However, you can configure traffic policing by applying a QoS profile to an interface.

This command is valid for IP packets only.

If you run the qos car command repeatedly on an interface, the latest configuration overrides the previous one.

An interface does not distinguish protocol packets from data packets during the CAR control. Therefore, it is recommended that you configure a larger CIR; otherwise, protocol packets may be discarded.

If member interfaces of a trunk interface reside on different forwarding or traffic management modules, the effective CIR or PIR for CAR or user-queue can be a multiple of the configured one.

If an interface is bound to a VSI instance, the hard-pipe enable command configured for the VSI instance is mutually exclusive with the qos car command.

If the traffic policing is needed to be reconfigured in the EVC interface, the previous qos car configuration should be cleared.

If only the CIR is configured but the CBS is not configured, the CBS is equal to the value of CIR multiplied by 187 by default. The maximum value is 18700000. So are pir and pbs.

Example

# Configure traffic policing for upstream packets on GE 0/1/0. The CIR is 1 Mbit/s and the PIR is 6 Mbit/s. Yellow packets are allowed to pass through the device, re-marked green, and mapped to AF1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[*HUAWEI-GigabitEthernet0/1/0] qos car cir 1000 pir 6000 green pass yellow pass service-class af1 color green red discard inbound
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >