Configuring QoS

This section contains payload examples to demonstrate how to use the NX-API REST API to configure QoS on the Cisco Nexus 3000 and 9000 Series switches.

Setting up a QoS Instance

QoS is instantiated when a QoS class-map or policy is created.

QoS Class Maps

The following examples pertain specifically to QoS class maps.

Configuring or Modifying a Class Map

Configuring or Modifying a Class Map
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c.json
 {
   "ipqosCMapEntity": {
     "children": [
       {
         "ipqosCMapInst": {
           "attributes": {
             "matchType": "match-all",
             "name": "class1"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class1</name>
            <matchType>match-all</matchType>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

You can create or modify a class map then reference class maps in policy maps.

Note: You cannot create a queuing class map; you must use one of the system-defined queuing class maps.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map type qos class1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Applying Descriptions to MQC Objects

Applying Descriptions to MQC Objects
POST http://<IP_Address>/api/mo/sys/ipqos/dflt.json
{
  "ipqosEntity": {
    "children": [
      {
        "ipqosDefaultQoS": {
          "children": [
            {
              "ipqosCMapEntity": {
                "children": [
                  {
                    "ipqosCMapInst": {
                      "attributes": {
                        "matchType": "match-all",
                        "name": "class1"
                      },
                      "children": [
                        {
                          "ipqosDescription": {
                            "attributes": {
                              "val": "This is a description of the class-map"
}}}]}}]}},

            {
              "ipqosPMapEntity": {
                "children": [
                  {
                    "ipqosPMapInst": {
                      "attributes": {
                        "matchType": "match-all",
                        "name": "pol1"
                      },
                      "children": [
                        {
                          "ipqosDescription": {
                            "attributes": {
                              "val": "This is a description of the policy-map"
}}}]}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class1</name>
            <matchType>match-all</matchType>
            <Description-items>
              <val>This is a description of the class-map</val>
            </Description-items>
          </CMapInst-list>
        </name-items>
      </c-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>pol1</name>
            <matchType>match-all</matchType>
            <Description-items>
              <val>This is a description of the policy-map</val>
            </Description-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

You can use the description command to add a description to a MQC object. The description can be up to 200 alphanumeric characters.

Note: You cannot modify the description of system-defined queuing class maps.


CLI Commands

The CLI commands and options listed below are the equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map type qos class1
 description This is a description of the class-map
policy-map pol1
 description This is a description of the policy-map

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring a Policy Class

Configuring a Policy Class
POST http://<IP_Address>/api/mo/sys/ipqos/dflt.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
       },
       "children": [
       {
       "ipqosMatchCMap": {
         "attributes": {
           "name": "class2",
           "userSetBit": "1"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class2</name>
                <userSetBit>1</userSetBit>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example creates a named object that represents a set of policies that are to be applied to a set of traffic classes and associates a class map with the policy map and enters the configuration mode for the specified system class.

Note: The associated class map must be the same type as the policy map type.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type qos p1
 class type qos class2

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring ACL Classification

Configuring ACL Classification
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class1"
    },
    "children": [
      {
        "ipqosAcl": {
          "attributes": {
            "name": "foo"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class1</name>
            <matchType>match-all</matchType>
            <acl-items>
              <Acl-list>
                <name>Access_Name</name>
              </Acl-list>
            </acl-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

You can classify traffic by matching packets based on existing ACLs. The permit and deny ACL keywords are ignored in the matching. QoS does not use the permit-deny functions of ACLs. You can classify by either IPv4, IPv6, or MAC address.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map type qos class1
 match access-group foo

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring CoS Classification

Configuring CoS Classification
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_cos.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_cos"
    },
    "children": [
      {
        "ipqosCos": {
          "attributes": {
            "val": "4"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_cos</name>
            <matchType>match-all</matchType>
            <cos-items>
              <Cos-list>
                <val>4</val>
              </Cos-list>
            </cos-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

You can classify traffic based on the class of service (CoS) in the IEEE 802.1Q header. This 3-bit field is defined in IEEE 802.1p to support QoS traffic classes. CoS is encoded in the high order 3 bits of the VLAN ID Tag field and is referred to as user_priority.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_cos
 match cos 4

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring DSCP Classification

Configuring DSCP Classification
POST http://<IP_Address>/api/mo/sys/ipqos/dflt.json
{
 "ipqosDefaultQoS": {
   "children": [
     {
       "ipqosCMapEntity": {
         "children": [
           {
             "ipqosCMapInst": {
               "attributes": {
                 "matchType": "match-all",
                 "name": "class_cos"
               },
               "children": [
                 {
                   "ipqosDscp": {
                     "attributes": {
                       "val": "af21"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_cos</name>
            <matchType>match-all</matchType>
            <dscp-items>
              <Dscp-list>
                <val>af21</val>
              </Dscp-list>
            </dscp-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example configures the traffic class by matching packets based on dscp-values.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_cos
 match dscp af21

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring IP RTP Classification

Configuring IP RTP Classification
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_cos.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_cos"
    },
    "children": [
      {
        "ipqosIpRtp": {
          "attributes": {
            "range": "3000"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_cos</name>
            <matchType>match-all</matchType>
            <ipRtp-items>
              <range>3000</range>
            </ipRtp-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

The IP Real-time Transport Protocol (RTP) is a transport protocol for real-time applications that transmit data such as audio or video and is defined by RFC 3550. Although RTP does not use a common TCP or UDP port, you typically configure RTP to use ports 16384 to 32767. UDP communications uses an even-numbered port and the next higher odd-numbered port is used for RTP Control Protocol (RTCP) communications.

You can configure classification based on UDP port ranges, which are likely to target applications using RTP.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_cos
 match IP rtp 3000

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Matching an MPLS Experimental Label

Matching an MPLS Experimental Label
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosMPLSExperimental": {
          "attributes": {
            "val": "3"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <mplsExperimental-items>
              <MPLSExperimental-list>
                <val>3</val>
              </MPLSExperimental-list>
            </mplsExperimental-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

The match mpls experimental topmost command classifies traffic on the basis of the EXP value in the topmost label header.


CLI Commands

These CLI commands and options are equivalent to the payload examples displayed in the pane on the right.

class-map class_c1
 match mpls experimental topmost 3

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating CoS Matches

Negating CoS Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotCos": {
          "attributes": {
            "val": "4"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <cosNot-items>
              <NotCos-list>
                <val>4</val>
              </NotCos-list>
            </cosNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example removes a specified class of service value as a match criteria.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match not cos 4

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating Packet Length Matches

Negating Packet Length Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotPacketLength": {
          "attributes": {
            "range": "100"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <packetLengthNot-items>
              <range>100</range>
            </packetLengthNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example removes a specified Layer 3 packet length in bytes as a match criteria.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match not packet length 100

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating MPLS Experimental Label Matches

Negating MPLS Experimental Label Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotMPLSExperimental": {
          "attributes": {
            "val": "3"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_co1</name>
            <matchType>match-all</matchType>
            <mplsExperimentalNot-items>
              <NotMPLSExperimental-list>
                <val>3</val>
              </NotMPLSExperimental-list>
            </mplsExperimentalNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example removes specified MPLS experimental label values as a match criteria.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_co1
 match not mpls experimental topmost 3

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating DSCP Matches

Negating DSCP Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotDscp": {
          "attributes": {
            "val": "af21"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <dscpNot-items>
              <NotDscp-list>
                <val>af21</val>
              </NotDscp-list>
            </dscpNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example removes specified DSCP values as a match criteria.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match not dscp af21

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating Precedence Matches

Negating Precedence Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotPrecedence": {
          "attributes": {
            "val": "critical"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <precedenceNot-items>
              <NotPrecedence-list>
                <val>critical</val>
              </NotPrecedence-list>
            </precedenceNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example removes a specified precedence value as a match criteria.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match not precedence critical

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Negating Protocol Matches

Negating Protocol Matches
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosNotProtocol": {
          "attributes": {
            "val": "arp"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <protocolNot-items>
              <NotProtocol-list>
                <val>arp</val>
              </NotProtocol-list>
            </protocolNot-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example matches on protocols that do not match the specified protocol.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match not protocol arp

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Layer 3 Packet Length Classification

Configuring Layer 3 Packet Length Classification
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosPacketLength": {
          "attributes": {
            "range": "100"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <packetLength-items>
              <range>100</range>
            </packetLength-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example configures the traffic class by matching packets based on various packet lengths (bytes). Values can range from 1 to 9198.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match packet length 100

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring IP Precedence Marking

Configuring IP Precedence Marking
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/c/name-class_c1.json
{
  "ipqosCMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "class_c1"
    },
    "children": [
      {
        "ipqosPrecedence": {
          "attributes": {
            "val": "critical"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <c-items>
        <name-items>
          <CMapInst-list>
            <name>class_c1</name>
            <matchType>match-all</matchType>
            <precedence-items>
              <Precedence-list>
                <val>critical</val>
              </Precedence-list>
            </precedence-items>
          </CMapInst-list>
        </name-items>
      </c-items>
    </dflt-items>
  </ipqos-items>
</System>

This example configures the traffic class by matching packets based on precedence-values.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

class-map class_c1
 match precedence critical

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Configuring Policy Maps

This section contains payload examples and CLIs to demonstrate many of the QoS policy map configuration options and to show how the REST APIs correspond to the CLI commands.

Defining a Policy Map

Defining a Policy Map
POST http://<mgmt0_IP>/api/mo/sys/ipqos/queuing/p.json
{
 "ipqosPMapEntity": {
   "children": [
     {
       "ipqosPMapInst": {
         "attributes": {
           "matchType": "match-all",
           "name": "foo"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>foo</name>
            <matchType>match-all</matchType>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example creates a named object that represents a set of policies that are to be applied to a set of traffic classes.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing foo

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring CoS Marking

Configuring CoS Marking
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/p/name-map1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "map1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetCos": {
                "attributes": {
                  "val": "1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>map1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class1</name>
                <userSetBit>1</userSetBit>
                <setCos-items>
                  <val>1</val>
                </setCos-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example sets the CoS value to cos-value. The value can range from 0 to 7.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map map1
 class class1
  set cos 1

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Setting the QoS Group

Setting the QoS Group
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class-default",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetQoSGrp": {
                "attributes": {
                  "id": "3"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class-default</name>
                <userSetBit>1</userSetBit>
                <setGrp-items>
                  <id>3</id>
                </setGrp-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example configures one or more qos-group values to match on for classification of traffic into this class map.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type qos p1
 class class-default
  set qos-group 3

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Disabling Dynamic Load Balancing

Disabling Dynamic Load Balancing
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetDlbDisable": {
                "attributes": {
                  "uid": "0"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class1</name>
                <userSetBit>1</userSetBit>
                <setDlbDisable-items>
                  <uid>0</uid>
                </setDlbDisable-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example disables DLB.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map p1
 class class1
  set dlb-disable

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring DSCP Marking

Configuring DSCP Marking
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetDscp": {
                "attributes": {
                  "tunnel": "no",
                  "val": "cs6"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class1</name>
                <userSetBit>1</userSetBit>
                <setDscp-items>
                  <tunnel>false</tunnel>
                  <val>cs6</val>
                </setDscp-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example sets the DSCP value.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map p1
 class class1
  set dscp cs6

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Bandwidth

Configuring Bandwidth
POST http://<mgmt0_IP>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "c-in-q1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetBW": {
                "attributes": {
                  "val": "40"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>c-in-q1</name>
                <userSetBit>1</userSetBit>
                <setBW-items>
                  <val>40</val>
                </setBW-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example assigns a minimum rate of the interface bandwidth to an output queue as the percentage of the underlying interface link rate. The range is from 0 to 100.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing p1
 class type queuing c-in-q1
  bandwidth percent 40

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Setting the MTU

Setting the MTU
POST http://<mgmt0_IP>/api/mo/sys/ipqos/nw/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "c-nq1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetMTU": {
                "attributes": {
                  "value": "2000"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <nw-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <cmap-items>
              <MatchCMap-list>
                <name>c-nq1</name>
                <userSetBit>1</userSetBit>
                <mtu-items>
                  <value>2000</value>
                </mtu-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </nw-items>
  </ipqos-items>
</System>

The example sets the MTU size.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type network-qos p1
 class type network-qos c-nq1
  mtu 2000

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Pause to Network QoS Policy Class

Configuring Pause to Network QoS Policy Class
POST http://<IP_Address>/api/mo/sys/ipqos/nw/p/name-p2.json
{
  "ipqosPMapInst": {
    "attributes": {
      "name": "p2"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class3",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosPause": {
                "attributes": {
                  "bufferSize": "50000",
                  "pauseThreshold": "40000",
                  "pfcCos0": "no",
                  "pfcCos1": "no",
                  "pfcCos2": "yes",
                  "pfcCos3": "no",
                  "pfcCos4": "no",
                  "pfcCos5": "no",
                  "pfcCos6": "no",
                  "pfcCos7": "no",
                  "resumeThreshold": "25000"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <nw-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p2</name>
            <cmap-items>
              <MatchCMap-list>
                <name>class3</name>
                <userSetBit>1</userSetBit>
                <pause-items>
                  <bufferSize>50000</bufferSize>
                  <pauseThreshold>40000</pauseThreshold>
                  <pfcCos0>false</pfcCos0>
                  <pfcCos1>false</pfcCos1>
                  <pfcCos2>true</pfcCos2>
                  <pfcCos3>false</pfcCos3>
                  <pfcCos4>false</pfcCos4>
                  <pfcCos5>false</pfcCos5>
                  <pfcCos6>false</pfcCos6>
                  <pfcCos7>false</pfcCos7>
                  <resumeThreshold>25000</resumeThreshold>
                </pause-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </nw-items>
  </ipqos-items>
</System>

This example specifies the buffer threshold settings for pause and resume.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type network-qos p2
 class type network-qos class3
  pause buffer-size 50000 pause-threshold 40000 resume-threshold 25000 pfc-cos 2

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Police to a Policy Class

Configuring Police to a Policy Class
POST http://<IP-Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "class2",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosPolice": {
                "attributes": {
                  "bcRate": "200",
                  "bcUnit": "ms",
                  "beRate": "unspecified",
                  "beUnit": "unspecified",
                  "cirRate": "8000",
                  "cirUnit": "bps",
                  "conformAction": "unspecified",
                  "conformSetCosTransmit": "0",
                  "conformSetDscpTransmit": "default",
                  "conformSetPrecTransmit": "routine",
                  "conformSetQosGrpTransmit": "0",
                  "exceedAction": "unspecified",
                  "exceedSetCosTransmit": "0",
                  "exceedSetDscpTransmit": "default",
                  "exceedSetPrecTransmit": "routine",
                  "exceedSetQosGrpTransmit": "0",
                  "pirRate": "unspecified",
                  "pirUnit": "unspecified",
                  "violateAction": "unspecified",
                  "violateSetCosTransmit": "0",
                  "violateSetDscpTransmit": "default",
                  "violateSetPrecTransmit": "routine",
                  "violateSetQosGrpTransmit": "0"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>class2</name>
                <userSetBit>1</userSetBit>
                <police-items>
                  <bcRate>200</bcRate>
                  <bcUnit>ms</bcUnit>
                  <beRate>unspecified</beRate>
                  <beUnit>unspecified</beUnit>
                  <cirRate>8000</cirRate>
                  <cirUnit>bps</cirUnit>
                  <conformAction>unspecified</conformAction>
                  <conformSetCosTransmit>0</conformSetCosTransmit>
                  <conformSetDscpTransmit>default</conformSetDscpTransmit>
                  <conformSetPrecTransmit>routine</conformSetPrecTransmit>
                  <conformSetQosGrpTransmit>0</conformSetQosGrpTransmit>
                  <exceedAction>unspecified</exceedAction>
                  <exceedSetCosTransmit>0</exceedSetCosTransmit>
                  <exceedSetDscpTransmit>default</exceedSetDscpTransmit>
                  <exceedSetPrecTransmit>routine</exceedSetPrecTransmit>
                  <exceedSetQosGrpTransmit>0</exceedSetQosGrpTransmit>
                  <pirRate>unspecified</pirRate>
                  <pirUnit>unspecified</pirUnit>
                  <violateAction>unspecified</violateAction>
                  <violateSetCosTransmit>0</violateSetCosTransmit>
                  <violateSetDscpTransmit>default</violateSetDscpTransmit>
                  <violateSetPrecTransmit>routine</violateSetPrecTransmit>
                  <violateSetQosGrpTransmit>0</violateSetQosGrpTransmit>
                </police-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </dflt-items>
  </ipqos-items>
</System>

This example shows how to configure policing.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type qos match-first p1
 class type qos class2
  police cir 8000 bc 200 ms

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Setting a Priority Level to a Queuing Policy Class

Setting a Priority Level to a Queuing Policy Class
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "c-in-q1",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosQueueLimit": {
                "attributes": {
                  "QueueLimitUnit": "none",
                  "QueueLimitVal": "2000",
                  "dynamic": "0"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>c-in-q1</name>
                <userSetBit>1</userSetBit>
                <QueueLimit-items>
                  <QueueLimitUnit>none</QueueLimitUnit>
                  <QueueLimitVal>2000</QueueLimitVal>
                  <dynamic>0</dynamic>
                </QueueLimit-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example assigns a tail drop threshold based on the queue size in bytes, kilobytes, or megabytes or allows the queue’s threshold size to be determined dynamically depending on the number of free cells available. The device drops packets that exceed the specified threshold.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing p1
 class type queuing c-in-q1
  queue-limit 2000

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring WRED on Egress Queues

Configuring WRED on Egress Queues
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
},
"children": [
  {
    "ipqosMatchCMap": {
      "attributes": {
        "name": "c-out-q1",
        "userSetBit": "1"
      },
      "children": [
        {
          "ipqosRandomDetect": {
            "attributes": {
              "capAverage": "no",
              "dropAvail": "0",
              "ecn": "no",
              "maxThreshold": "0",
              "maxThresholdUnit": "none",
              "minThreshold": "0",
              "minThresholdUnit": "none",
              "weight": "0"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>c-in-q1</name>
                <userSetBit>1</userSetBit>
                <RandDet-items>
                  <capAverage>false</capAverage>
                  <dropAvail>0</dropAvail>
                  <ecn>false</ecn>
                  <maxThreshold>0</maxThreshold>
                  <maxThresholdUnit>none</maxThresholdUnit>
                  <minThreshold>0</minThreshold>
                  <minThresholdUnit>none</minThresholdUnit>
                  <weight>0</weight>
                </RandDet-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example configures WRED on the specified queuing class.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing p1
 class type queuing c-in-q1
  random-detect

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Configuring Traffic Shaping

Configuring Traffic Shaping
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
  "attributes": {
    "name": "c-in-q2",
    "userSetBit": "1"
},
"children": [
{
  "ipqosShape": {
    "attributes": {
      "max": "40000",
      "maxRateUnit": "bps",
      "min": "8000",
      "minRateUnit": "bps"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>c-in-q2</name>
                <userSetBit>1</userSetBit>
                <shape-items>
                  <max>40000</max>
                  <maxRateUnit>bps</maxRateUnit>
                  <min>8000</min>
                  <minRateUnit>bps</minRateUnit>
                </shape-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example assigns a minimum and maximum bit rate on an output queue.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing p1
 class type queuing c-in-q2
  shape min 8000 bps max 40000

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Removing the Bandwidth Limit

Removing the Bandwidth Limit
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
  "ipqosPMapInst": {
    "attributes": {
      "matchType": "match-all",
      "name": "p1"
    },
    "children": [
      {
        "ipqosMatchCMap": {
          "attributes": {
            "name": "c-in-q2",
            "userSetBit": "1"
          },
          "children": [
            {
              "ipqosSetBW": {
                "attributes": {
                  "status": "deleted"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <p-items>
        <name-items>
          <PMapInst-list>
            <name>p1</name>
            <matchType>match-all</matchType>
            <cmap-items>
              <MatchCMap-list>
                <name>c-in-q2</name>
                <userSetBit>1</userSetBit>
                <setBW-items xc:operation="delete">
                </setBW-items>
              </MatchCMap-list>
            </cmap-items>
          </PMapInst-list>
        </name-items>
      </p-items>
    </queuing-items>
  </ipqos-items>
</System>

This example removes the bandwidth specification from this class.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

policy-map type queuing p1
 class type queuing c-in-q2
  no bandwidth percent 30

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

QoS on an Interface (input)

QoS on an Interface (input)
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/policy/in/intf-[eth1/4].json
{
  "ipqosIf": {
    "attributes": {
      "name": "eth1/4"
    },
    "children": [
      {
        "ipqosInst": {
          "attributes": {
            "name": "foo",
            "stats": "yes"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <policy-items>
        <in-items>
          <intf-items>
            <If-list>
              <name>eth1/4</name>
              <pmap-items>
                <name>foo</name>
                <stats>true</stats>
              </pmap-items>
            </If-list>
          </intf-items>
        </in-items>
      </policy-items>
    </dflt-items>
  </ipqos-items>
</System>

This example adds the policy map to the input packets of an interface.

An instance of the interface for QoS must be initialized before configuring QoS. The interface can be any of the following types:

  • ethernet - Ethernet IEEE 802.3z
  • loopback - Loopback interface
  • mgmt - Management interface
  • port-channel - Port Channel interface

Note: Sub-interfaces and breakout ports for the above are also supported.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface eth1/4
 service-policy type qos input foo

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

QoS on an Interface (output)

QoS on an interface (output)
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/policy/out/intf-[eth1/4].json
{
  "ipqosIf": {
    "attributes": {
      "name": "eth1/4"
    },
    "children": [
      {
        "ipqosInst": {
          "attributes": {
            "name": "foo",
            "stats": "yes"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <dflt-items>
      <policy-items>
        <out-items>
          <intf-items>
            <If-list>
              <name>eth1/4</name>
              <pmap-items>
                <name>foo</name>
                <stats>true</stats>
              </pmap-items>
            </If-list>
          </intf-items>
        </out-items>
      </policy-items>
    </dflt-items>
  </ipqos-items>
</System>

This example adds the policy map to the output packets of an interface.

An instance of the interface for QoS must be initialized before configuring QoS. The interface can be any of the following types:

  • ethernet - Ethernet IEEE 802.3z
  • loopback - Loopback interface
  • mgmt - Management interface
  • port-channel - Port Channel interface

Note: Sub-interfaces and breakout ports for the above are also supported.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface eth 1/4
 service-policy type qos output foo

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

QoS on the System

QoS on the system (input)
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
{
"ipqosEntity": {
  "children": [
{
  "ipqosQueuing": {
    "children": [
{
"ipqosServPol": {
  "children": [
{
  "ipqosIngress": {
    "children": [
{
"ipqosSystem": {
  "attributes": {
    "userSetBit": "0"
}}}]}},
{
  "ipqosEgress": {
    "children": [
{
"ipqosSystem": {
  "attributes": {
    "userSetBit": "0"
}}}]}}]}}]}},
{
  "ipqosNwQoS": {
    "children": [
{
"ipqosServPol": {
  "children": [
{
  "ipqosIngress": {
    "children": [
{
"ipqosSystem": {
  "attributes": {
    "userSetBit": "0"
}}}]}},
{
  "ipqosEgress": {
    "children": [
{
"ipqosSystem": {
  "attributes": {
    "userSetBit": "0"
}}}]}}]}}]}},
{
  "ipqosDefaultQoS": {
    "children": [
{
"ipqosServPol": {
  "children": [
{
  "ipqosIngress": {
    "children": [
{
"ipqosSystem": {
  "children": [
{
  "ipqosInst": {
    "attributes": {
      "name": "foo",
      "stats": "yes"
}}}]}}]}}]}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <queuing-items>
      <policy-items>
        <in-items>
          <sys-items>
            <userSetBit>0</userSetBit>
          </sys-items>
        </in-items>
        <out-items>
          <sys-items>
            <userSetBit>0</userSetBit>
          </sys-items>
        </out-items>
      </policy-items>
    </queuing-items>
    <nw-items>
      <policy-items>
        <in-items>
          <sys-items>
            <userSetBit>0</userSetBit>
          </sys-items>
        </in-items>
        <out-items>
          <sys-items>
            <userSetBit>0</userSetBit>
          </sys-items>
        </out-items>
      </policy-items>
    </nw-items>
    <dflt-items>
      <policy-items>
        <in-items>
          <sys-items>
            <pmap-items>
              <name>foo</name>
              <stats>true</stats>
            </pmap-items>
          </sys-items>
        </in-items>
      </policy-items>
    </dflt-items>
  </ipqos-items>
</System>

This example has all nw, queuing and dos policies being applied at the system level.


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

system qos
 service-policy type qos input foo

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Clearing Statistics

Clearing Statistics
POST http://<mgmt0_IP>/api/mo/sys/ipqos.json
{
"ipqosEntity": {
  "children": [
    {
      "ipqosStatClear": {
        "attributes": {
          "direction": "ingress",
          "ethernet": "0",
          "pmapType": "qos",
          "portChan": "0",
          "vlan": "0"
}}}]}}
{
    imdata:[]
}
<System>
  <ipqos-items>
    <statClear-items>
      <direction>ingress</direction>
      <ethernet>0</ethernet>
      <pmapType>qos</pmapType>
      <portChan>0</portChan>
      <vlan>0</vlan>
    </statClear-items>
  </ipqos-items>
</System>

This example displays statistics and the configured policy maps on all interfaces or the specified interface or on a specified data direction or QoS type.

Note: This example was added in Release 7.0(3)I6(1).


CLI Commands

The CLI commands and options are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

clear qos statistics interface input type qos

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload: https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html