car (Traffic behavior view)

Function

The car command configures and modifies traffic policing for a traffic behavior.

The undo car command cancels the traffic policing configuration.

By default, traffic policing is not configured for traffic behavior.

Format

car { cir cir-value [ pir pir-value ] } [ cbs cbs-value [ pbs pbs-value ] ] [ adjust adjust-value ] [ green { discard | pass [ remark dscp dscp | service-class class color color ] } | yellow { discard | pass [ remark dscp dscp | service-class class color color ] } | red { discard | pass [ remark dscp dscp | service-class class color color ] } ] * [ summary ] [ color-aware ] [ limit-type pps ]

undo car [ { cir cir-value [ pir pir-value ] } [ cbs cbs-value [ pbs pbs-value ] ] [ adjust adjust-value ] [ green { discard | pass [ remark dscp dscp | service-class class color color ] } | yellow { discard | pass [ remark dscp dscp | service-class class color color ] } | red { discard | pass [ remark dscp dscp | service-class class color color ] } ] * [ summary ] [ color-aware ] [ limit-type pps ] ]

Parameters

Parameter Description Value
cir cir-value

Specifies the CIR, that is, the committed information 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 the set cir-value.

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

cbs cbs-value

Specifies the CBS, that is, the committed burst size. This indicates the number of bits that the device can transmit at a burst, which is also the depth of the first token bucket (assuming that this is bucket C).

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

The CBS value that can take effect is related to a specific board.

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.

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

adjust adjust-value

Specifies the value of packet length adjust.

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

green

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

-

discard

Indicates that packets of a color (green, yellow, or red) are discarded.

-

pass

Indicates that packets of a color (green, yellow, or red) can pass.

-

remark

Specify remark.

-

dscp dscp

Indicates the DSCP value of IPv4 or IPv6 packets.

The value is an integer, ranging from 0 to 63.

service-class class

Specifies the CoS of packets to be re-marked.

The value is an enumerated type and can be case-insensitive CS7, CS6, EF, AF4, AF3, AF2, AF1, or BE.

color color

Specifies the color of packets to be re-marked.

The value is an enumerated type and can be green, yellow, or red.

yellow

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

-

red

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

-

summary

The parameter summary indicates the traffic policing takes effect on both value-added service and basic service. The paramter can be configured but it does not take effect.

-

color-aware

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

-

pps

Specifies that if the value cir-value or pir-value is configured, the packet is limited by second.

If the parameter limit-type pps is specified in a traffic policy, the CAR and statistics functions based on layer 2 and layer 3 packet length. If the command qos link-adjustment link-layer-exclude (Traffic policy view) is also configured in the traffic policy, the command qos link-adjustment link-layer-exclude does not take effect.

-

Views

Traffic behavior view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
qos write

Usage Guidelines

Usage Scenario

You can run this command to restrict certain traffic that enters the device.

It is mainly applied to the network edge to ensure that the core device can process data normally.

Prerequisites

You need to create a traffic behavior in the system view before setting the CAR in the traffic behavior view.

Configuration Impact

When the traffic policy configured with the CAR action is applied to an interface, the CAR action is performed on the traffic matching the rules defined in the traffic classifier. That is, the excessive packets are discarded.

After the traffic policing policy is applied to an interface, traffic policing is implemented for the traffic matching the rule based on the parameters set in the car command firstly. Then interface-based traffic policing is implemented for the traffic matching the rule based on the parameters set in the qos car command.

Follow-up Procedure

You need to configure the traffic behavior and traffic policy, bind the traffic behavior to the traffic classifier in the traffic policy, and apply the traffic policy to interfaces.

Precautions

In MF classification, CAR based on the packet rate and CAR based on packet length compensation are mutually exclusive.

The parameter color-aware indicates that CAR is in color-aware mode. CAR is in color-blind mode by default. Use CAR for outgoing traffic as an example. If the color-aware mode is used, the CAR action for outgoing traffic is implemented based on the color modification result of the CAR, re-marking, and service-class actions on incoming traffic. If the color-blind mode is used, the CAR action for outgoing traffic is not implemented based on the color modification result.

Yellow packets are not identified for a single bucket at a single rate. Therefore, the packet color cannot be set to yellow.

The traffic policy that contains CAR can be applied to incoming or outgoing traffic on an interface.

If this command is configured for multiple times, the later configuration overrides the previous one.

The relationships between the CIR, PIR, CBS, and PBS in the command are described as follows:

  • The PIR is recommended to be greater than the configured CIR.
  • The CBS is recommended to be greater than the configured CIR.
  • The PBS is recommended to be greater than the configured PIR.
  • 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.
  • You are advised to follow the configuration rule: CBS >= PBS = CIR/8 x (1-1.5) x 1000
  • In the view of traffic behavior view, the command car and user-queue (traffic behavior view) are mutually exclusive.

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.

Yellow packets can not be configured, when PBS value is 0.

The adjust and limit-type pps commands cannot both be configured.

Example

# Set the CIR to 1 Mbit/s and the PIR to 6 Mbit/s, allow green packets to pass, and set the CoS of green packets to af1.
<HUAWEI> system-view
[~HUAWEI] traffic behavior b1
[*HUAWEI-behavior-b1] car cir 1000 pir 6000 green pass service-class af1 color green yellow pass red discard
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >