---
title: Qos
slug: enterprise-v6p1/qos
createdAt: 2025-12-18T08:30:46.679Z
---

This chapter provides examples on how to use Netconf to manage QoS on AsterNOS devices.

# <font color="#1d50a2">QoS</font>

## <font color="#1d50a2">Get All QoS configuration</font>

Request example to retrieve QoS via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos/>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <qos-maps>
        <dscp-tc-maps>
          <dscp-tc-map>
            <name>map1</name>
            <mapping>
              <dscp>1</dscp>
              <tc>7</tc>
            </mapping>
          </dscp-tc-map>
        </dscp-tc-maps>
        <dot1p-tc-maps>
          <dot1p-tc-map>
            <name>map3</name>
            <mapping>
              <dot1p>0</dot1p>
              <tc>1</tc>
            </mapping>
          </dot1p-tc-map>
        </dot1p-tc-maps>
        <tc-queue-maps>
          <tc-queue-map>
            <name>map5</name>
            <mapping>
              <tc>0</tc>
              <queue>1</queue>
            </mapping>
          </tc-queue-map>
        </tc-queue-maps>
        <tc-dscp-maps>
          <tc-dscp-map>
            <name>map1</name>
            <mapping>
              <tc>0</tc>
              <dscp>1</dscp>
            </mapping>
          </tc-dscp-map>
          <tc-dscp-map>
            <name>map2</name>
            <mapping>
              <tc>1</tc>
              <dscp>0</dscp>
            </mapping>
          </tc-dscp-map>
          <tc-dscp-map>
            <name>map6</name>
            <mapping>
              <tc>0</tc>
              <dscp>1</dscp>
            </mapping>
          </tc-dscp-map>
        </tc-dscp-maps>
        <switch-qos-map>
          <tc-queue-map-name>map5</tc-queue-map-name>
        </switch-qos-map>
      </qos-maps>
      <traffic-behaviors>
        <traffic-behavior>
          <name>test_sr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>packets</meter-type>
          <cir>5</cir>
          <cbs>7500</cbs>
          <yellow-packet-action>REMARK</yellow-packet-action>
          <red-packet-action>FORWARD</red-packet-action>
          <remark-dot1p>1</remark-dot1p>
          <remark-dscp>3</remark-dscp>
          <remark-tc>5</remark-tc>
        </traffic-behavior>
        <traffic-behavior>
          <name>test_tr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>bytes</meter-type>
          <cir>5</cir>
          <cbs>6400</cbs>
          <yellow-packet-action>FORWARD</yellow-packet-action>
          <red-packet-action>DROP</red-packet-action>
        </traffic-behavior>
      </traffic-behaviors>
      <port-shapers/>
      <schedulers>
        <scheduler>
          <name>Ethernet6</name>
          <queue>2</queue>
          <pir>1000</pir>
        </scheduler>
      </schedulers>
      <limit-rates>
        <limit-rate>
          <port>Ethernet4</port>
          <direction>ingress</direction>
          <cir>5</cir>
          <cbs>6000</cbs>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</data>
```

# <font color="#1d50a2">QoS Map</font>

This chapter provides examples on how to use Netconf to manage QoS Map, Port QoS Map and Switch QoS Map on AsterNOS devices.

## <font color="#1d50a2">Create DSCP to TC QosMap</font>

Request example to create DSCP to TC qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <dscp-tc-maps operation="create">
          <dscp-tc-map>
            <name>map1</name>
            <mapping>
              <dscp>1</dscp>
              <tc>7</tc>
            </mapping>
            <mapping>
              <dscp>3</dscp>
              <tc>3</tc>
            </mapping>
          </dscp-tc-map>
        </dscp-tc-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create Dot1p To TC QosMap</font>

Request example to create Dot1p to TC qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <dot1p-tc-maps operation="create">
          <dot1p-tc-map>
            <name>map3</name>
            <mapping>
              <dot1p>0</dot1p>
              <tc>1</tc>
            </mapping>
          </dot1p-tc-map>
          <dot1p-tc-map>
            <name>map4</name>
            <mapping>
              <dot1p>1</dot1p>
              <tc>0</tc>
            </mapping>
          </dot1p-tc-map>
        </dot1p-tc-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create TC To DSCP QosMap</font>

Request example to create TC To DSCP qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <tc-dscp-maps operation="create">
          <tc-dscp-map>
            <name>map6</name>
            <mapping>
              <tc>0</tc>
              <dscp>1</dscp>
            </mapping>
            <mapping>
              <tc>2</tc>
              <dscp>2</dscp>
            </mapping>
          </tc-dscp-map>
        </tc-dscp-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Create TC To Queue QosMap</font>

Request example to create TC To Queue qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <tc-queue-maps operation="create">
          <tc-queue-map>
            <name>map5</name>
            <mapping>
              <tc>0</tc>
              <queue>1</queue>
            </mapping>
            <mapping>
              <tc>2</tc>
              <queue>2</queue>
            </mapping>
          </tc-queue-map>
        </tc-queue-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify DSCP to TC QosMap</font>

Request example to modify DSCP to TC qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <dscp-tc-maps operation="merge">
          <dscp-tc-map>
            <name>map1</name>
            <mapping>
              <dscp>1</dscp>
              <tc>7</tc>
            </mapping>
          </dscp-tc-map>
        </dscp-tc-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Single QosMap</font>

Request example to delete single DSCP to TC qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <dscp-tc-maps>
          <dscp-tc-map operation="delete">
            <name>map1</name>
          </dscp-tc-map>
        </dscp-tc-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete All QosMap</font>

Request example to delete all DSCP to TC and Dot1p to TC qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <dscp-tc-maps operation="delete"/>
        <dot1p-tc-maps operation="delete"/>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get QosMap</font>

Request example to retrieve all DSCP to TC QosMap via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <qos-maps>
        <dscp-tc-maps/>
      </qos-maps>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <qos-maps>
        <dscp-tc-maps>
          <dscp-tc-map>
            <name>map1</name>
            <mapping>
              <dscp>1</dscp>
              <tc>7</tc>
            </mapping>
            <mapping>
              <dscp>3</dscp>
              <tc>3</tc>
            </mapping>
          </dscp-tc-map>
        </dscp-tc-maps>
      </qos-maps>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get QosMap Via RPC</font>

Request example to retrieve QosMap via rpc **show-qos-map**.

:::hint{type="warning"}
**NOTE:**
Supported Qos map type:

- all
- dot1p\_to\_tc
- dscp\_to\_tc
- mpls\_exp\_to\_tc
- tc\_to\_mpls\_exp
- tc\_to\_queue
- tc\_to\_dscp
- tc\_to\_dot1p
:::

```xml
<show-qos-map>
  <name>dscp_to_tc<name>
<show-qos-map>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
  {
    map1:{
      1:7,
      3:3
    }
  }
</data>
```

## <font color="#1d50a2">Get All QosMap</font>

Request example to retrieve all QosMap via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <qos-maps/>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <qos-maps>
        <dot1p-tc-maps>
          <dot1p-tc-map>
            <name>map3</name>
            <mapping>
              <dot1p>0</dot1p>
              <tc>1</tc>
            </mapping>
          </dot1p-tc-map>
        </dot1p-tc-maps>
        <tc-queue-maps>
          <tc-queue-map>
            <name>map5</name>
            <mapping>
              <tc>0</tc>
              <queue>1</queue>
            </mapping>
            <mapping>
              <tc>2</tc>
              <queue>2</queue>
            </mapping>
          </tc-queue-map>
        </tc-queue-maps>
        <tc-dscp-maps>
          <tc-dscp-map>
            <name>map1</name>
            <mapping>
              <tc>0</tc>
              <dscp>1</dscp>
            </mapping>
            <mapping>
              <tc>2</tc>
              <dscp>2</dscp>
            </mapping>
          </tc-dscp-map>
        </tc-dscp-maps>
        <switch-qos-map/>
      </qos-maps>
    </qos>
  </top>
      </data>
```

## <font color="#1d50a2">Modify Switch QosMap</font>

Request example to modify switch qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <switch-qos-map operation="merge">
          <tc-queue-map-name>map5</tc-queue-map-name>
        </switch-qos-map>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:bf338ca0-e40d-46ad-96b3-3a583236dd8c">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Switch QosMap</font>

Request example to delete switch qos map via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <switch-qos-map operation="delete">
          <tc-queue-map-name>map5</tc-queue-map-name>
        </switch-qos-map>
      </qos-maps>
    </qos>
  </top>
```

## <font color="#1d50a2">Get Switch QosMap</font>

Request example to retrieve all QosMap via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <qos-maps>
        <switch-qos-map/>
      </qos-maps>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <qos-maps>
        <switch-qos-map>
          <tc-queue-map-name>map5</tc-queue-map-name>
        </switch-qos-map>
      </qos-maps>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Create Port QosMap</font>

Request example to bind QoS map to port via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <port-qos-maps operation="create">
          <port-qos-map>
            <name>Ethernet2</name>
            <dscp-tc-map-name>map1</dscp-tc-map-name>
            <dot1p-tc-map-name>map3</dot1p-tc-map-name>
          </port-qos-map>
        </port-qos-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:eb182e03-93a7-4a81-919a-18c25af177b2">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify Port QosMap</font>

Request example to modify port QoS map binding via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <port-qos-maps operation="merge">
          <port-qos-map>
            <name>Ethernet2</name>
            <dot1p-tc-map-name>map4</dot1p-tc-map-name>
          </port-qos-map>
        </port-qos-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:eb182e03-93a7-4a81-919a-18c25af177b2">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Port QosMap</font>

Request example to delete port QoS map binding configuration via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <qos-maps>
        <port-qos-maps>
          <port-qos-map operation="delete">
            <name>Ethernet2</name>
          </port-qos-map>
        </port-qos-maps>
      </qos-maps>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:eb182e03-93a7-4a81-919a-18c25af177b2">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Port QosMap</font>

Request example to retrieve port QoS map binding info via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <qos-maps>
        <port-qos-maps/>
      </qos-maps>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <qos-maps>
        <port-qos-maps>
          <port-qos-map>
            <name>Ethernet2</name>
            <dscp-tc-map-name>map1</dscp-tc-map-name>
            <dot1p-tc-map-name>map4</dot1p-tc-map-name>
          </port-qos-map>
        </port-qos-maps>
      </qos-maps>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get Port QosMap Via RPC</font>

Request example to retrieve port QosMap via rpc **show-interface-qos-map-bind**.

```xml
<show-interface-qos-map-bind/>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
  {
    Ethernet2:{
      dot1p_to_tc_map:[DOT1P_TO_TC_MAP|map4]
    }
  }
</data>
```

# <font color="#1d50a2">QoS Traffic Behavior</font>

This chapter provides examples on how to use Netconf to manage Qos traffic behavior on AsterNOS devices.

**QoS Traffic Behavior Parameters**

## <font color="#1d50a2">Table 1\: QoS Traffic Behavior Parameters</font>

| **Parameter**        | **Type** | **Valid Values / Format** | **Description**                                                                                                                                                                       |
| -------------------- | -------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| mode                 | enum     | sr–tcm, tr–tcm            | Policer mode<br />sr–tcm: Single Rate Three color marker, CIR and CBS, Green, Yellow and Red.<br />tr–tcm: Two Rate Three color marker, CIR, CBS, PIR and PBS, Green, Yellow and Red. |
| meter–type           | enum     | packets, bytes            | Policer Meter Type<br />Policer Meter Type, default is bytes.                                                                                                                         |
| color–source         | string   | AWARE                     | Policer Color Source, readonly.                                                                                                                                                       |
| cir                  | integer  | > 0 (in KBps or Kpps)     | Committed burst size                                                                                                                                                                  |
| cbs                  | integer  | > 0 (in Bytes or packets) | Committed information rate.                                                                                                                                                           |
| pir                  | integer  | > 0 (in KBps or Kpps)     | Peak Information Rate – It works when the mode is tr–tcm.                                                                                                                             |
| pbs                  | integer  | > 0 (in KBps or Kpps)     | Peak Burst Size – It works when the mode is tr–tcm.                                                                                                                                   |
| yellow–packet–action | enum     | FORWARD, DROP or REMARK   | Action to take for Yellow color packets, default is FORWARD.                                                                                                                          |
| red–packet–action    | enum     | FORWARD, DROP or REMARK   | Action to take for Red color packets, default is FORWARD.                                                                                                                             |
| remark–dot1p         | integer  | 0–7                       | The value of dot1p for remark action, it works when yellow/red–packet–action is REMARK.                                                                                               |
| dscp                 | integer  | 0–63                      | The value of dscp for remark action, it works when yellow/red–packet–action is REMARK.                                                                                                |
| remark–tc            | integer  | 0–7                       | The value of tc for remark action, it works when yellow/red–packet–action is REMARK.                                                                                                  |

## <font color="#1d50a2">Create Traffic Behavior</font>

Request example to create qos traffic behavior via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <traffic-behaviors operation="create">
        <traffic-behavior>
          <name>test_sr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>packets</meter-type>
          <cir>5</cir>
          <cbs>7500</cbs>
          <yellow-packet-action>REMARK</yellow-packet-action>
          <red-packet-action>FORWARD</red-packet-action>
          <remark-dot1p>1</remark-dot1p>
          <remark-dscp>3</remark-dscp>
          <remark-tc>5</remark-tc>
        </traffic-behavior>
        <traffic-behavior>
          <name>test_tr_1</name>
          <mode>tr-tcm</mode>
          <meter-type>packets</meter-type>
          <cir>5</cir>
          <cbs>7500</cbs>
          <pir>7</pir>
          <pbs>10000</pbs>
          <yellow-packet-action>FORWARD</yellow-packet-action>
          <red-packet-action>REMARK</red-packet-action>
          <remark-dot1p>1</remark-dot1p>
          <remark-dscp>15</remark-dscp>
          <remark-tc>3</remark-tc>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify Traffic Behavior</font>

Request example to modify qos traffic behavior via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <traffic-behaviors operation="merge">
        <traffic-behavior>
          <name>test_tr_1</name>
          <mode>sr-tcm</mode>
          <cir>5</cir>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Traffic Behavior</font>

Request example to delete qos traffic behavior via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <traffic-behaviors>
        <traffic-behavior operation="delete">
          <name>test_tr_1</name>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Single Traffic Behavior</font>

Request example to retrieve single qos traffic behavior via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <traffic-behaviors>
        <traffic-behavior>
          <name>test_tr_1</name>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <traffic-behaviors>
        <traffic-behavior>
          <name>test_tr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>bytes</meter-type>
          <cir>5</cir>
          <cbs>6400</cbs>
          <yellow-packet-action>FORWARD</yellow-packet-action>
          <red-packet-action>DROP</red-packet-action>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get All Traffic Behavior</font>

Request example to retrieve all qos traffic behavior via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <traffic-behaviors/>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <traffic-behaviors>
        <traffic-behavior>
          <name>test_sr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>packets</meter-type>
          <cir>5</cir>
          <cbs>7500</cbs>
          <yellow-packet-action>REMARK</yellow-packet-action>
          <red-packet-action>FORWARD</red-packet-action>
          <remark-dot1p>1</remark-dot1p>
          <remark-dscp>3</remark-dscp>
          <remark-tc>5</remark-tc>
        </traffic-behavior>
        <traffic-behavior>
          <name>test_tr_1</name>
          <mode>sr-tcm</mode>
          <meter-type>bytes</meter-type>
          <cir>5</cir>
          <cbs>6400</cbs>
          <yellow-packet-action>FORWARD</yellow-packet-action>
          <red-packet-action>DROP</red-packet-action>
        </traffic-behavior>
      </traffic-behaviors>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Modify Port Traffic Behavior</font>

Request example to modify qos traffic behavior binding configuration via **edit-config**.

```xml
<config>
  <top>
    <interfaces>
      <interface operation="merge">
        <name>Ethernet3</name>
        <ingress-policer-name>test_tr_1</ingress-policer-name>
      </interface>
    </interfaces>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Port Traffic Behavior</font>

Request example to retrieve qos traffic behavior binding configuration via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <interfaces>
      <interface>
        <name>Ethernet3</name>
      </interface>
    </interfaces>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <interfaces xmlns="http://asterfusion.com/ns/yang/asternos-interfaces">
      <interface>
        <name>Ethernet3</name>
        <admin-status>true</admin-status>
        <interface-mode>none</interface-mode>
        <mtu>9216</mtu>
        <ingress-policer-name>test_tr_1</ingress-policer-name>
        <ethernet-config xmlns="http://asterfusion.com/ns/yang/asternos-ports">
          <auto-negotiate>false</auto-negotiate>
          <port-speed>SPEED_1G</port-speed>
        </ethernet-config>
      </interface>
    </interfaces>
  </top>
</data>
```

## <font color="#1d50a2">Get Traffic Behavior Counters</font>

Request example to retrieve traffic behavior counters via rpc **show-traffic-behavior-counters**.

```xml
<show-traffic-behavior-counters/>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
    PolicerId    Forward(Packet/Byte)    DROP(Packet/Byte)    Remark-Forward(Packet/Byte)    Meter_type
  -----------  ----------------------  -------------------  -----------------------------  ------------
    test_sr_1                     100                    0                              0       packets
    test_tr_1                      50                    0                              0       packets
</data>
```

# <font color="#1d50a2">QoS Scheduler</font>

This chapter provides examples on how to use Netconf to manage Qos Scheduler on AsterNOS devices.

**QoS Scheduler Parameters**

## <font color="#1d50a2">Table 1\: QoS Scheduler Parameters</font>

| **Parameter** | **Type** | **Valid Values / Format**                                                                                                                                                           | **Description**                                                  |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| queue         | integer  | 0 - 7                                                                                                                                                                               | Queue index                                                      |
| algorithm     | enum     | STRICT, DWRR                                                                                                                                                                        | Scheduling algorithm                                             |
| weight        | integer  | 1 - 100                                                                                                                                                                             | Queue weight; only effective with weighted algorithms like DWRR. |
| pir           | integer  | For CX202P-16S, CX204Y-48S, CX206P-24S/48S:<br />1 - bandwidth (in Bps)<br />Others:<br />313000 - bandwidth (in Bps)                                                               | Peak Information Rate - limits max traffic rate for the queue.   |
| pbs           | integer  | For CX202P-16S, CX204Y-48S, CX206P-24S/48S:<br />1 – 16773120 (4095 \* 4K)<br />Others:<br />1 – 4190208 (1023 \* 4K)<br />Recommended step size:<br />4096 (i.e., multiples of 4K) | Peak Burst Size - allows burst data transfer up to this size.    |

## <font color="#1d50a2">Create Scheduler</font>

Request example to create qos scheduler via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <schedulers operation="create">
        <scheduler>
          <name>Ethernet1</name>
          <queue>3</queue>
          <algorithm>DWRR</algorithm>
          <weight>30</weight>
          <pir>750</pir>
          <pbs>8192</pbs>
        </scheduler>
        <scheduler>
          <name>Ethernet1</name>
          <queue>4</queue>
          <algorithm>DWRR</algorithm>
          <weight>20</weight>
          <pir>600</pir>
          <pbs>8192</pbs>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify Scheduler</font>

Request example to modify qos scheduler via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <schedulers>
        <scheduler operation="merge">
          <name>Ethernet1</name>
          <queue>3</queue>
          <algorithm>STRICT</algorithm>
          <pir>500</pir>
          <pbs>4096</pbs>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Single Scheduler</font>

Request example to delete qos scheduler via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <schedulers>
        <scheduler operation="delete">
          <name>Ethernet1</name>
          <queue>3</queue>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete All Scheduler</font>

Request example to delete qos scheduler via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <schedulers operation="delete">
      </schedulers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Single Schedulers</font>

Request example to retrieve single scheduler via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <schedulers>
        <scheduler>
          <name>Ethernet1</name>
          <queue>3</queue>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <schedulers>
        <scheduler>
          <name>Ethernet1</name>
          <queue>3</queue>
          <algorithm>STRICT</algorithm>
          <pir>500000</pir>
          <pbs>4096</pbs>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get All Schedulers</font>

Request example to retrieve qos scheduler via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <schedulers/>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <schedulers>
        <scheduler>
          <name>Ethernet1</name>
          <queue>3</queue>
          <algorithm>STRICT</algorithm>
          <pir>500000</pir>
          <pbs>8192</pbs>
        </scheduler>
        <scheduler>
          <name>Ethernet1</name>
          <queue>4</queue>
          <algorithm>DWRR</algorithm>
          <weight>20</weight>
          <pir>600000</pir>
          <pbs>16384</pbs>
        </scheduler>
      </schedulers>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get Scheduler Via RPC</font>

Request example to retrieve scheduler configuration via rpc **show-interface-uc-tx-queue**.

```xml
<show-interface-uc-tx-queue/>
```

Response example

```xml
<data>
  <name>Ethernet1</name>
  <queue>4</queue>
  <algorithm>DWRR</algorithm>
  <weight>10</weight>
  <pir>600000</pir>
  <pbs>16384</pbs>
</data>
```

# <font color="#1d50a2">QoS PortShaper</font>

This chapter provides examples on how to use Netconf to manage Qos PortShaper on AsterNOS devices.

**QoS PortShaper Parameters**

## <font color="#1d50a2">Table 1\: QoS PortShaper Parameters</font>

| **Parameter** | **Type** | **Valid Values / Format**                                                                                             | **Description**                                                |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| pir           | integer  | For CX202P-16S, CX204Y-48S, CX206P-24S/48S:<br />1 - bandwidth (in Bps)<br />Others:<br />313000 - bandwidth (in Bps) | Peak Information Rate - limits max traffic rate for the queue. |
| pbs           | integer  | For CX202P-16S, CX204Y-48S, CX206P-24S/48S:<br />1 – 4095 (in 4KBytes)<br />Others:<br />1 – 1023 (in 4KBytes)        | Peak Burst Size - allows burst data transfer up to this size.  |

## <font color="#1d50a2">Create PortShaper</font>

Request example to create qos portShaper via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <port-shapers operation="create">
        <port-shaper>
          <name>Ethernet3</name>
          <pbs>125</pbs>
          <pir>1000000</pir>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4adf96bf-6345-47b5-80fd-981eafd62df5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify PortShaper</font>

Request example to modify qos portShaper via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <port-shapers operation="merge">
        <port-shaper>
          <name>Ethernet2</name>
          <pbs>512</pbs>
          <pir>800000</pir>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4adf96bf-6345-47b5-80fd-981eafd62df5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Single PortShaper</font>

Request example to delete qos portShaper via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <port-shapers>
        <port-shaper operation="delete">
          <name>Ethernet2</name>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4adf96bf-6345-47b5-80fd-981eafd62df5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete All PortShaper</font>

Request example to delete qos portShaper via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <port-shapers operation="delete">
      </port-shapers>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4adf96bf-6345-47b5-80fd-981eafd62df5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Single PortShaper</font>

Request example to retrieve single qos portShaper via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <port-shapers>
        <port-shaper>
          <name>Ethernet2</name>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <port-shapers>
        <port-shaper>
          <name>Ethernet2</name>
          <pir>800000</pir>
          <pbs>512</pbs>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get All PortShaper</font>

Request example to retrieve all qos portShaper via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <port-shapers/>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <port-shapers>
        <port-shaper>
          <name>Ethernet2</name>
          <pir>800000</pir>
          <pbs>512</pbs>
        </port-shaper>
        <port-shaper>
          <name>Ethernet3</name>
          <pir>1000000</pir>
          <pbs>125</pbs>
        </port-shaper>
      </port-shapers>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get PortShaper Via RPC</font>

Request example to retrieve portShaper configuration via rpc **show-interface-port-shaper**.

```xml
<show-interface-port-shaper/>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
  {
    Ethernet2:{
      SCHEDULER|port_shaper_scheduler.Ethernet2:{
          pbs:2097152,
          pir:800000
      }
    }
  }
</data>
```

# <font color="#1d50a2">QoS Limit Rate</font>

This chapter provides examples on how to use Netconf to manage Qos limit rate on AsterNOS devices.

**QoS Limit Rate Parameters**

## <font color="#1d50a2">Table 1\: QoS Limit Rate Parameters</font>

| **Parameter** | **Type** | **Valid Values / Format** | **Description**                            |
| ------------- | -------- | ------------------------- | ------------------------------------------ |
| direction     | enum     | ingress, egress           | Apply rules to ingress or egress direction |
| cir           | integer  | > 0 (in KBps)             | Committed information rate.                |
| cbs           | integer  | > 0 (in Bytes)            | Committed burst size.                      |

## <font color="#1d50a2">Create Port Limit Rate</font>

Request example to create qos limit rate rules for port via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <limit-rates operation="create">
        <limit-rate>
          <port>Ethernet3</port>
          <direction>ingress</direction>
          <cir>3</cir>
          <cbs>4000</cbs>
        </limit-rate>
        <limit-rate>
          <port>Ethernet3</port>
          <direction>egress</direction>
          <cir>5</cir>
          <cbs>6000</cbs>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Modify Port Limit Rate</font>

Request example to modify qos limit rate rules for port via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <limit-rates operation="merge">
        <limit-rate>
          <port>Ethernet4</port>
          <direction>ingress</direction>
          <cir>5</cir>
          <cbs>6000</cbs>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Ingress Port Limit Rate</font>

Request example to delete qos limit rate rules for ingress port via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <limit-rates>
        <limit-rate operation="delete">
          <port>Ethernet3</port>
          <direction>ingress</direction>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Delete Port Limit Rate</font>

Request example to delete qos limit rate rules for port via **edit-config**.

```xml
<config>
  <top>
    <qos>
      <limit-rates>
        <limit-rate operation="delete">
          <port>Ethernet3</port>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</config>
```

Response example

```xml
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:9c68d96e-3bdd-4b50-9161-060947d27bd5">
  <ok/>
</rpc-reply>
```

## <font color="#1d50a2">Get Ingress Port Limit Rate</font>

Request example to retrieve qos limit rate rules for ingress port via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <limit-rates>
        <limit-rate>
          <port>Ethernet3</port>
          <direction>ingress</direction>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <limit-rates>
        <limit-rate>
          <port>Ethernet3</port>
          <direction>ingress</direction>
          <cir>3</cir>
          <cbs>4000</cbs>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</data>
```

## <font color="#1d50a2">Get Port Limit Rate</font>

Request example to retrieve qos limit rate rules for port via **get-config** with subtree filter.

```xml
<filter type="subtree">
  <top>
    <qos>
      <limit-rates>
        <limit-rate>
          <port>Ethernet3</port>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</filter>
```

Response example

```xml
<data>
  <top>
    <qos xmlns="http://asterfusion.com/ns/yang/asternos-qos">
      <limit-rates>
        <limit-rate>
          <port>Ethernet3</port>
          <direction>ingress</direction>
          <cir>3</cir>
          <cbs>4000</cbs>
        </limit-rate>
        <limit-rate>
          <port>Ethernet3</port>
          <direction>egress</direction>
          <cir>5</cir>
          <cbs>6000</cbs>
        </limit-rate>
      </limit-rates>
    </qos>
  </top>
</data>
```

# <font color="#1d50a2">Queue Counters</font>

This chapter provides examples on how to use Netconf to manage queue counters on AsterNOS devices.

## <font color="#1d50a2">Get Queue Counters</font>

Request example to retrieve queue counters for specific interface via rpc **show-queue-counters**.

```xml
<show-queue-counters>
  <interface_num>2</interface_num>
</show-queue-counters>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">For namespace :
      Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
  ---------  -----  --------------  ---------------  -----------  ------------
  Ethernet2   ALL0               0                0            0             0
  Ethernet2   ALL1               0                0            0             0
  Ethernet2   ALL2               0                0            0             0
  Ethernet2   ALL3               0                0            0             0
  Ethernet2   ALL4               0                0            0             0
  Ethernet2   ALL5               0                0            0             0
  Ethernet2   ALL6               0                0            0             0
  Ethernet2   ALL7               0                0            0             0
</data>
```

## <font color="#1d50a2">Get All Queue Counters</font>

Request example to retrieve all queue counters via **edit-config**.

```xml
<show-queue-counters/>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
    Port    RxQ    Counter/pkts    Drop/pkts    Rate/pkts
  ------  -----  --------------  -----------  -----------
    CPU   ALL0           16664            0       0.00/s
    CPU   ALL1               0            0       0.00/s
    CPU   ALL2               8            0       0.00/s
    CPU   ALL3               0            0       0.00/s
    CPU   ALL4           63760            0       0.00/s
    CPU   ALL5               0            0       0.00/s
    CPU   ALL6               0            0       0.00/s
    CPU   ALL7               0            0       0.00/s

  <!-- The counters in the middle have been omitted -->
  For namespace :
        Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes
  ----------  -----  --------------  ---------------  -----------  ------------
  Ethernet77   ALL0               0                0            0             0
  Ethernet77   ALL1               0                0            0             0
  Ethernet77   ALL2               0                0            0             0
  Ethernet77   ALL3               0                0            0             0
  Ethernet77   ALL4               0                0            0             0
  Ethernet77   ALL5               0                0            0             0
  Ethernet77   ALL6               0                0            0             0
  Ethernet77   ALL7               0                0            0             0
</data>
```

## <font color="#1d50a2">Clear Queue Counters</font>

Request example to clear all queue counters via rpc **clear-queue-counters**.

```xml
<show-queue-counters>
  <interface_num>2</interface_num>
</show-queue-counters>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
  Clear and update saved counters for CPU
  Clear and update saved counters for Ethernet1
  <!-- The output in the middle have been omitted -->
  Clear and update saved counters for Ethernet77
</data>
```

## <font color="#1d50a2">Get CPU Queue Counters</font>

Request example to retrieve CPU queue counters for specific interface via rpc **show-queue-cpu-port**.

```xml
<show-queue-cpu-port/>
```

Response example

```xml
<data xmlns="http://asterfusion.com/ns/yang/asternos-qos">
  Port    RxQ    Counter/pkts    Drop/pkts    Rate/pkts
------  -----  --------------  -----------  -----------
  CPU   ALL0             104            0       2.00/s
  CPU   ALL1               0            0       0.00/s
  CPU   ALL2               0            0       0.00/s
  CPU   ALL3               0            0       0.00/s
  CPU   ALL4               0            0       0.00/s
  CPU   ALL5               0            0       0.00/s
  CPU   ALL6               0            0       0.00/s
  CPU   ALL7               0            0       0.00/s
</data>
```

