---
title: Traffic Regulation and Shaping
slug: enterprise-v5p2/traffic-regulation-and-shaping
description: qos configuration
createdAt: 2025-11-14T03:58:40.348Z
---

### <font color="#1d50a2">show traffic-behavior rule</font>

**\[Command]**
**show traffic-behavior rule**

**\[Purpose]**
Displays the configured aboute CAR policies

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show traffic-behavior rule
Name  Type  Mode    CIR  CBS
------ ------ ------ ------ -----
test  BYTES  SR_TCM 100000 64000
```

### <font color="#1d50a2">show traffic-behavior counter</font>

**\[Command]**
**show traffic-behavior counters**

**\[Purpose]**
View the hit statistics for the CAR

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show traffic-behavior counters
  PolicerId  Forward  DROP  Remark-Forward
------------- --------- ------ ----------------
flow_controll  1049585  12764      1810877
```

### <font color="#1d50a2">traffic-behavior</font>

**\[Command]**
**traffic-behavior** *traffic\_behavior\_Name*
**no traffic behavior**

**\[Purpose]**
Create a traffic behavior and go to the Traffic behavior view, or go to the existing Traffic behavior view, or bind the traffic behavior to interface

**\[Purpose]**
traffic-behavior-name traffic behavior name

**\[View]**
System view, Interface view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# traffic-behavior test
sonic(config-traffic-behavior-test)#
```

### <font color="#1d50a2">car \{sr-tcm|tr-tcm\} meter-type \{bytes|packets\}</font>

**\[Command]**
**car \{sr-tcm|tr-tcm} \[meter-type \{bytes|packets}] \[cir** *CIR\_value* **] \[cbs** *CBS\_value* **] \[pir** *PIR\_value* **]**
**\[pbs** *PBS\_value* **] \[yellow-packet-action \{DROP|FORWARD|REMARK}] \[red-packet-action \{DROP|FORWARD|REMARK}] \[remark-dot1p** *Dot1p\_value* **] \[remark-dscp** *Dscp\_value* **] \[remark-tc** *Tc\_value* **]**

**\[Purpose]**
Create a CAR template to bind to traffic behavior

**\[Parameter]**

| **Parameter**                    | **Description**                                                                                                                                               |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **sr-tcm**                       | Single bucket single speed mode, this mode only requires the configuration of cir and cbs                                                                     |
| **tr-tcm**                       | Double buckets and double speed mode                                                                                                                          |
| **meter-type \{bytes\|packets}** | If meter-type mode is **bytes**：cir, pir in kBps, cbs, pbs in byteIf meter-type mode is **packets**：cir, pir in Kpps, cbs, pbs in packetDefault mode is bytes |
| *CIR\_value*                     | Specifies the committed information rate (CIR), which is the allowed rate at which traffic can pass through                                                   |
| *CBS\_value*                     | Specifies the committed burst size (CBS), which is the average volume of burst traffic that can pass through an interface.                                    |
| *PIR\_value*                     | Specifies the peak information rate (PIR), which is the maximum rate at which traffic can pass through.                                                       |
| *PBS\_value*                     | Specifies the peak burst size (PBS), which is the maximum volume of burst traffic that can pass through an interface.                                         |

**\[View]**
Traffic behavior view

**\[Notes]**
When the burst size of the message \< cbs value, the message is marked as green
When cbs value \< burst size \< pbs value, the message is marked yellow
When burst size > pbs value, the message is marked as red
no car This command removes the CAR template

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# traffic-behavior test
sonic(config-traffic-behavior-test)# car sr-tcm meter-type PACKETS cir 1000000
```

### <font color="#1d50a2">traffic-behavior bind</font>

**\[Command]**
**traffic-behavior bind** *policer\_name*
**no traffic-behavior bind**

**\[Purpose]**
Bind traffic behavior to the interface

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# traffic-behavior bind test1
```

### <font color="#1d50a2">port-shaper enable</font>

**\[Command]**
**port-shaper enable&#x20;***pir pbs*
**no port-shaper enable**

**\[Purpose]**
Enable the traffic shaping function on the interface for rate limiting.

**\[Parameter]**

| **Parameter** | **Description**                                                             |
| ------------- | --------------------------------------------------------------------------- |
| pir			        | Configure the maximum allowed peak rate. Range: 55–4294967295. Unit: kbit/s |
| pbs			        | Configure the maximum allowed burst size. Range: 4096–16777215. Unit: byte  |

**\[View]**
Interface View

**\[User Scenario]**
Config traffic shaping to the interface. Traffic in the outbound direction from this interface will be rate-limited according to the user configuration.

**\[Use Cases]**

```none
sonic(config)# interface ethernet 1
sonic(config-if-1)# port-shaper enable 10000 128000
```

