car (traffic behavior view)
Function
The car command configures traffic policing in a traffic behavior.
The undo car command deletes traffic policing from a traffic behavior.
By default, traffic policing is not configured in a traffic behavior.
Format
car cir cir-value [ pir pir-value ] [ cbs cbs-value pbs pbs-value ] [ share ] [ green { discard | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ yellow { discard | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ] [ red { discard | pass [ remark-8021p 8021p-value | remark-dscp dscp-value ] } ]
undo car
Parameters
Parameter |
Description |
Value |
---|---|---|
cir |
Specifies the committed information rate (CIR), which is the allowed rate at which traffic can pass through. |
- |
cir-value |
Specifies the absolute value of the CIR. |
The value is an integer that ranges from 8 to 4294967295, in kbit/s. |
pir |
Specifies the peak information rate (PIR), which is the maximum rate of traffic that can pass through an interface. |
- |
pir-value |
Specifies the absolute value of the PIR. |
The value is an integer that ranges from 8 to 4294967295, in kbit/s. The PIR must be greater than or equal to the CIR. The default PIR is equal to the CIR. |
share |
Indicates that all the rules in a traffic classifier bound to a traffic behavior share CAR parameters. |
- |
cbs cbs-value |
Specifies the committed burst size (CBS), which is the average volume of burst traffic that can pass through an interface. |
The value is an integer that ranges from 1500 to 4294967295, in bytes. The default setting is as follows:
|
pbs pbs-value |
Specifies the peak burst size (PBS), which is the maximum volume of burst traffic that can pass through an interface. |
The value is an integer that ranges from 1500 to 4294967295, in bytes. The default setting is as follows:
|
yellow green red |
Specifies the packet color. The packet color is determined by parameters cbs cbs-value and pbs pbs-value of this command. By default, green packets and yellow packets are allowed to pass through, and red packets are discarded. |
- |
discard |
Discards packets of a color. |
- |
pass |
Permits packets of a color to pass through. |
- |
remark-dscp dscp-value |
Re-marks the DSCP priority of packets of a color. |
The value can be the DiffServ code, an integer ranging from 0 to 63; the value can also be the name of the DSCP service type, such as af11, af12, af13, af21, af22, af23, af31, af32, af33, af41, af42, af43, cs1-cs7, default, and ef. The values corresponding to names of DSCP service types are as follows:
|
remark-8021p 8021p-value |
Re-marks the 802.1p priorities of packets. |
The value is an integer that ranges from 0 to 7. |
Usage Guidelines
Usage Scenario
Traffic policing based on traffic classifiers controls traffic that matches traffic classification rules and discards the excess traffic to limit traffic within a proper range and protect network resources.
When data is sent from a high-speed link to a low-speed link, the bandwidth on the interface of the low-speed link is insufficient. As a result, a large number of packets are discarded. To solve this problem, configure traffic policing for outgoing traffic on the interface of the high-speed link. The interface then discards the packets whose rate exceeds the traffic policing rate so that the outgoing traffic rate is limited in a proper range. You can also configure traffic policing for incoming traffic on the interface of the low-speed link. The interface then discards the received packets whose rate exceeds the traffic policing rate.
Traffic policing based on flow policies controls rates of packets of different types.
- When the size of a packet is less than the CBS, the packet is colored green.
- When the size of a packet is greater than or equal to the CBS but less than the PBS, the packet is colored yellow.
- When the size of a packet is greater than or equal to the PBS, the packet is colored red.
Prerequisites
A traffic behavior has been created using the traffic behavior command.
Precautions
When the CBS is smaller than the number of bytes in a packet, packets of this type are discarded.
To prevent device failure to identify the packet color, you are advised to set the PBS to be larger than the CBS.
When the minimum granularity of traffic policing is greater than the maximum rate of an interface, traffic policing does not take effect on the interface. You need to set the CIR or PIR to be smaller than the maximum rate of the interface.
If a traffic policy contains traffic behaviors that re-mark the 802.1p priority of green packets, this policy cannot be applied to the inbound direction of GE, XGE, or Eth-Trunk ports of the AC6605.
Example
<AC6605> system-view [AC6605] traffic behavior tb1 [AC6605-behavior-tb1] car cir 384 pir 768 green pass yellow pass remark-dscp 0 red discard