---
title: QoS Configuration
slug: enterprise-v6p1/TJIl-qos-configuration
description: qos configuration
createdAt: 2025-11-14T03:58:43.844Z
---

## <font color="#1d50a2">Priority Map Configuration</font>

### <font color="#1d50a2">show qos map \{all|dot1p\_to\_tc|dscp\_to\_tc|tc\_to\_queue\}</font>

**\[Command]**
**show qos map \{all|dot1p\_to\_tc|dscp\_to\_tc|tc\_to\_queue}**

**\[Purpose]**
Display QoS map configuration information

**\[View]**
System view

**\[Parameter]**

| **Parameter**     | **Description**                                                   |
| ----------------- | ----------------------------------------------------------------- |
| **all**           | Display all priority mapping configuration information            |
| **dot1p\_to\_tc** | Mapping of 802.1P priority of packet to internal priority         |
| **dscp\_to\_tc**  | Mapping of the DSCP priority of a packet to the internal priority |
| **tc\_to\_queue** | Mapping the priority of packet to the egress queue                |

**\[Use Cases]**

```plaintext
sonic(config)# show qos map all
{
  "DOT1P_TO_TC_MAP":{
    "dot1x-tc":{
      "0":"0",
      "1":"1",
      "2":"2",
      "3":"3",
      "4":"4",
      "5":"5",
      "6":"6",
      "7":"7"
    }
  },
  "DSCP_TO_TC_MAP":{},
  "MAP_PFC_PRIORITY_TO_QUEUE":{},
  "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP":{},
  "TC_TO_PRIORITY_GROUP_MAP":{},
  "TC_TO_QUEUE_MAP":{}
}
```

### <font color="#1d50a2">show interface qos-map-bind</font>

**\[Command]**
**show interface qos-map-bind**

**\[Purpose]**
Show all Qos map and interface binding configurations

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show interface qos-map-bind
{
  "Ethernet1":{
    "dot1p_to_tc_map":"[DOT1P_TO_TC_MAP|1]"
  }
}
```

### <font color="#1d50a2">show queue counters</font>

**\[Command]**
**show queue counters \[** *interface\_name* **]**
**show queue counters clear**

**\[Purpose]**
View export queue statistics

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic(config)# do show queue counters 1
   Port  TxQ  Counter/pkts  Counter/bytes  Drop/pkts  Drop/bytes
--------- ----- -------------- --------------- ----------- ------------
Ethernet1  ALL0        0        0      0       0
Ethernet1  ALL1        0        0      0       0
Ethernet1  ALL2        0        0      0       0
Ethernet1  ALL3        0        0      0       0
Ethernet1  ALL4        0        0      0       0
Ethernet1  ALL5        0        0      0       0
Ethernet1  ALL6        0        0      0       0
Ethernet1  ALL7        0        0      0       0
```

### <font color="#1d50a2">qos map \{dot1p\_to\_tc|dscp\_to\_tc|tc\_to\_queue\}</font>

**\[Command]**
**qos map \{dot1p\_to\_tc|dscp\_to\_tc|tc\_to\_queue}** *profile\_name pri\_origin pri\_mapped*

**\[Purpose]**
Add QoS mapping table template

**\[Parameter]**

| **Parameter**     | **Description**                                           |
| ----------------- | --------------------------------------------------------- |
| **dot1p\_to\_tc** | Mapping of 802.1P priority of packet to internal priority |
| **tc\_to\_queue** | Mapping the priority of packet to the egress queue        |
| *profile\_name*   | Qos\_map name                                             |
| *pri\_origin*     | Pre-mapping priority                                      |
| *pri\_mapped*     | Priority after mapping                                    |

**\[View]**
System configuration view

**\[User Scenario]**
If user need to prioritize packets received by a device based on the dot1p/DSCP values carried in the packet for QoS scheduling, user can configure the mapping of packet priorities to local priorities using the **qos map \{dot1p\_to\_tc|dscp\_to\_tc} \<profile\_name> \<in\_value>** command.
The **qos map tc\_to\_queue \<profile\_name> \<in\_value>** command configures the mapping of local priorities to output queues, allowing you to implement different QoS strategies based on different scheduling methods for the output queues.

**\[Notes]**
By default, the local priority is mapped to the queue is:

| **tc** | **queue** |
| ------ | --------- |
| 0      | 0         |
| 1      | 1         |
| 2      | 2         |
| 3      | 3         |
| 4      | 4         |
| 5      | 5         |
| 6      | 6         |
| 7      | 7         |

**\[Use Cases]**

```plaintext
sonic(config)# qos map tc_to_queue queue 0 0
sonic(config)# qos map tc_to_queue queue 1 1
sonic(config)# qos map tc_to_queue queue 2 2
sonic(config)# qos map tc_to_queue queue 3 3
sonic(config)# qos map tc_to_queue queue 4 4
sonic(config)# qos map tc_to_queue queue 5 5
sonic(config)# qos map tc_to_queue queue 6 6
sonic(config)# qos map tc_to_queue queue 7 7
```

### <font color="#1d50a2">qos-map-all bind tc\_to\_queue</font>

**\[Command]**
**qos-map-all bind tc\_to\_queue** *profile\_name*

**\[Purpose]**
All interfaces are bound to QoS map

**\[Parameter]**

| **Parameter**   | **Description** |
| --------------- | --------------- |
| *profile\_name* | Qos\_map name   |

**\[View]**
System configuration view

**\[Use Cases]**

```plaintext
sonic(config)# qos-map-all bind tc_to_queue test
```

### <font color="#1d50a2">qos-map bind \{dscp\_to\_tc|dot1p\_to\_tc\}</font>

**\[Command]**
**qos-map bind \{dscp\_to\_tc|dot1p\_to\_tc}** *profile\_name*

**\[Purpose]**
Single interface with QoS map binding

**\[Parameter]**

| **Parameter**   | **Description** |
| --------------- | --------------- |
| *profile\_name* | Qos\_map name   |

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# qos-map bind dscp_to_tc ceshi
```

## <font color="#1d50a2">Traffic Regulation</font>

### <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.                                         |

**\[Note]**
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">Queue Scheduling</font>

### <font color="#1d50a2">show interface uc-tx-queue</font>

**\[Command]**
**show interface uc-tx-queue**

**\[Purpose]**
Display the queue scheduling method of the interface

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show interface uc-tx-queue
{
  "Ethernet1|0":{
    "SCHEDULER|scheduler.Ethernet1_0":{
      "type":"STRICT"
    }
  },
  "Ethernet1|2":{
    "SCHEDULER|scheduler.Ethernet1_2":{
      "type":"STRICT"
    }
  }
}
```

### <font color="#1d50a2">uc-tx-queue scheduler *queue\_id*  mode \[STRICT|DWRR\]</font>

**\[Command]**
**uc-tx-queue scheduler** *queue\_id* **mode STRICT**
**uc-tx-queue scheduler** *queue\_id* **mode DWRR** *weight*
**uc-tx-queue scheduler**

**\[Purpose]**
Configure a scheduling mode for queues on an interface

**\[Parameter]**

| **Parameter** | **Description**                        |
| ------------- | -------------------------------------- |
| *queue\_id*   | Queue ID, value range: 0\~7            |
| **STRICT**    | Enable strict priority queuing         |
| **DWRR**      | Enable DWRR priority queuing           |
| *weight*      | Weight of a queue, Value range: 0\~100 |

**\[View]**
Interface view

**\[Usage Scenario]**
In a network, the queue scheduling algorithm is a core mechanism for implementing Quality of Service (QoS) control. It manages the usage of link bandwidth for different types of packets, ensuring that various data streams receive services at different levels. Different queues under the same interface can adopt a mixed scheduling mode of STRICT and DWRR.
In this mode, queues configured with STRICT mode based on priority are scheduled first. When there are no packets in the STRICT mode queues, the system schedules DWRR queues based on their weights. By default, the scheduling method for queues is DWRR (Deficit Weighted Round Robin), with equal weights of 1.
This configuration allows network administrators to manage different types of traffic more flexibly, ensuring that high-priority traffic receives faster processing, while low-priority traffic can still effectively utilize link bandwidth.

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# uc-tx-queue scheduler 0 mode strict
sonic(config-if-1)# uc-tx-queue scheduler 1 mode strict
sonic(config-if-1)# uc-tx-queue scheduler 2 mode DWRR weight 80
sonic(config-if-1)# uc-tx-queue scheduler 3 mode DWRR weight 80
```

### <font color="#1d50a2">uc-tx-queue scheduler *queue\_id*</font>

**\[Command]**
**uc-tx-queue scheduler** *queue\_id* **\[pir** *PIR\_value* **]\[pbs** *PBS\_value* **]**

**\[Purpose]**
Configure queue rate limiting

**\[Parameter]**

| **Parameter** | **Description**                                                      |
| ------------- | -------------------------------------------------------------------- |
| *pir*         | Specifies the peak information rate of the queue, the unit is byte/s |
| *pbs*         | Specifies the peak burst size of the queue, the unit is byte         |

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 1
sonic(config-if-1)# uc-tx-queue scheduler 0 pir 1000
```

