No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF API functions supported by the switch, including the data model and samples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Queue Scheduling and Traffic Shaping Management

Queue Scheduling and Traffic Shaping Management

This section describes the configuration model of queue scheduling and traffic shaping management and provides examples of XML packets.

Data Model

The configuration model file matching queue scheduling and traffic shaping management is huawei-qos.yang.

Table 2-243  Queue scheduling and traffic shaping management

Object

Description

Value Range

Remarks

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/name

Indicates the name of a queue scheduling profile.

The value is a string of 1 to 16 case-insensitive characters without spaces.

A maximum of six scheduling profiles are allowed.

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/id

Indicates the queue index.

The value is an integer that ranges from 0 to 7.

Eight queues must be configured simultaneously.

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/schedule/schedule-mode

Indicates the queue scheduling mode.

Enumerated value. The values are as follows:

  • strict-priority-queuing: PQ scheduling

  • deficit-round-robin-queuing: WDRR scheduling

  • weight-round-robin-queuing: WRR scheduling

N/A

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/schedule/weight

Indicates the weight of a queue that participates in WRR or WDRR scheduling.

The value is an integer that ranges from 0 to 100.

N/A

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/shaping/cir

Indicates the CIR for queue shaping.

The value is an integer, in kbit/s. The value range differs depending on the interface type:

  • GigabitEthernet: 0 to 1000000

  • XGigabitEthernet: 0 to 10000000

  • Port group: 0 to 10000000

N/A

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile/queue/shaping/cbs

Indicates the CBS for queue shaping.

The value is an integer that ranges from 4000 to 4294967295, in bytes.

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/marking/trust

Indicates the type of priority to be mapped for packets.

The value is a string. The values are as follows:

  • cos: 802.1p priority

  • dscp: DSCP priority

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/meter/meter-field/direction

Indicates that the rate of packets on an interface in the specified direction is limited.

Enumerated type. The value is inbound, indicating the inbound direction.

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/meter/meter-field/cir

Indicates the CIR for rate limiting on an interface.

The value is an integer, in kbit/s. The value range differs depending on the interface type:

  • GigabitEthernet: 64 to 1000000

  • XGigabitEthernet: 64 to 10000000

  • Port group: 64 to 10000000

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/meter/meter-field/cbs

Indicates the CBS for rate limiting on an interface.

The value is an integer that ranges from 4000 to 4294967295, in bytes.

If this object is not specified, the default meter-field/cbs is 125 times meter-field/cir.

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/queues/queue-porfile

Indicates the name of a queue scheduling profile.

The value must be the name of an existing queue scheduling profile.

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping/cir

Indicates the CIR when traffic shaping is performed for packets on an interface in the outbound direction.

The value is an integer, in kbit/s. The value range differs depending on the interface type:

  • GigabitEthernet: 64 to 1000000

  • XGigabitEthernet: 64 to 10000000

  • Port group: 64 to 10000000

N/A

/ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping/cbs

Indicates the CBS when traffic shaping is performed for packets on an interface in the outbound direction.

The value is an integer that ranges from 4000 to 4294967295, in bytes.

If this object is not specified, the default shaping/cbs is 125 times shaping/cir.

N/A

Configuring Queue Scheduling and Traffic Shaping

This section describes how to configure, modify, and delete queue scheduling and traffic shaping using the rpc method.

Table 2-244  Configuring queue scheduling and traffic shaping

Operation

XPATH

rpc

/huawei-qos:qos/traffic-queuing/queue-profiles/queue-profile

/ietf-interfaces:interfaces/interface/huawei-qos:qos/marking/trust

/ietf-interfaces:interfaces/interface/huawei-qos:qos/meter/meter-field

/ietf-interfaces:interfaces/interface/huawei-qos:qos/queues/queue-porfile

/ietf-interfaces:interfaces/interface/huawei-qos:qos/shaping

Data requirement 1

Configure queue scheduling and traffic shaping.

Item

Data

Description

Name of a queue scheduling profile

test

The name of a queue scheduling profile is test.

Queue index

0, 1, 2, 3, 4, 5, 6, 7

Queue scheduling and traffic shaping are configured for queues 0 to 7.

Queue scheduling mode

deficit-round-robin-queuing

The queue scheduling mode is WDRR.

Weight of a queue that participates in a scheduling mode

10, 11, 12, 13, 14, 15, 16, 17

The weights of queues 0 to 7 in WDRR scheduling mode are 10, 11, 12, 13, 14, 15, 16, and 17.

CIR for queue shaping

5000

The CIR for queue shaping is 5000 kbit/s.

CBS for queue shaping

125000

The CBS for queue shaping is 125000 bytes.

Type of priority to be mapped for packets

dscp

Packets are mapped based on the DSCP priority.

Rate limiting for packets on an interface in the specified direction

inbound

The rate of packets on an interface in the inbound direction is limited.

CIR for rate limiting on an interface

6000

The CIR for rate limiting on an interface is 6000 kbit/s.

CBS for rate limiting on an interface

150000

The CBS for rate limiting on an interface is 150000 bytes.

CIR when traffic shaping is performed for packets on an interface in the outbound direction

8000

The CIR is 8000 kbit/s when traffic shaping is performed for packets on an interface in the outbound direction.

CBS when traffic shaping is performed for packets on an interface in the outbound direction

200000

The CBS is 200000 bytes when traffic shaping is performed for packets on an interface in the outbound direction.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos">
        <qos:traffic-queuing>
          <qos:queue-profiles>
            <qos:queue-profile>
              <qos:name>test</qos:name>
              <qos:queue>
                <qos:id>0</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>10</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>1</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>11</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>2</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>12</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>3</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>13</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>4</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>14</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>5</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>15</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>6</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>16</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>7</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>17</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
            </qos:queue-profile>
          </qos:queue-profiles>
        </qos:traffic-queuing>
      </qos:qos>
    </config>
  </edit-config>
</rpc>
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>GigabitEthernet0/0/1</if:name>
          <if:type>ethernetCsmacd</if:type>
          <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos">
            <qos:marking>
              <qos:trust>dscp</qos:trust>
            </qos:marking>
            <qos:meter>
              <qos:meter-field>
                <qos:direction>inbound</qos:direction>
                <qos:cir>6000</qos:cir>
                <qos:cbs>150000</qos:cbs>
              </qos:meter-field>
            </qos:meter>
            <qos:queues>
              <qos:queue-porfile>test</qos:queue-porfile>
            </qos:queues>
            <qos:shaping>
              <qos:cir>8000</qos:cir>
              <qos:cbs>200000</qos:cbs>
            </qos:shaping>
          </qos:qos>
        </if:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

Response example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>Some node(s) does not supported in protocol layer right now.</error-message>
  </rpc-error>
</rpc-reply>

Data requirement 2

Change the weight for queue scheduling of queue 1. Only changed data items are provided here. For other information, see data requirement 1.

Item

Data

Description

Queue index

1

The WDRR weight of queue 1 is 50.

Weight of a queue that participates in a scheduling mode

50

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos">
        <qos:traffic-queuing>
          <qos:queue-profiles>
            <qos:queue-profile>
              <qos:name>test</qos:name>
              <qos:queue>
                <qos:id>0</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>10</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>1</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="replace">50</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>2</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>12</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>3</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>13</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>4</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>14</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>5</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>15</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>6</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>16</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
              <qos:queue>
                <qos:id>7</qos:id>
                <qos:schedule>
                  <qos:schedule-mode>deficit-round-robin-queuing</qos:schedule-mode>
                  <qos:weight>17</qos:weight>
                </qos:schedule>
                <qos:shaping>
                  <qos:cir>5000</qos:cir>
                  <qos:cbs>125000</qos:cbs>
                </qos:shaping>
              </qos:queue>
            </qos:queue-profile>
          </qos:queue-profiles>
        </qos:traffic-queuing>
      </qos:qos>
    </config>
  </edit-config>
</rpc>

Response example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7">
  <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>

Data requirement 3

Delete the queue scheduling and traffic shaping configuration, that is, delete the configuration in data requirement 1.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="5" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos">
        <qos:traffic-queuing>
          <qos:queue-profiles>
            <qos:queue-profile xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
              <qos:name>test</qos:name>
              <qos:queue>
                <qos:id>0</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>1</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>2</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>3</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>4</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>5</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>6</qos:id>
              </qos:queue>
              <qos:queue>
                <qos:id>7</qos:id>
              </qos:queue>
            </qos:queue-profile>
          </qos:queue-profiles>
        </qos:traffic-queuing>
      </qos:qos>
    </config>
  </edit-config>
</rpc>
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="9" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>GigabitEthernet0/0/1</if:name>
          <if:type>ethernetCsmacd</if:type>
          <qos:qos xmlns:qos="urn:huawei:params:xml:ns:yang:huawei-qos" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete">
            <qos:marking>
              <qos:trust>dscp</qos:trust>
            </qos:marking>
            <qos:meter>
              <qos:meter-field>
                <qos:direction>inbound</qos:direction>
                <qos:cir>6000</qos:cir>
                <qos:cbs>150000</qos:cbs>
              </qos:meter-field>
            </qos:meter>
            <qos:queues>
              <qos:queue-porfile>test</qos:queue-porfile>
            </qos:queues>
            <qos:shaping>
              <qos:cir>8000</qos:cir>
              <qos:cbs>200000</qos:cbs>
            </qos:shaping>
          </qos:qos>
        </if:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

Response example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <ok/>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2019-10-18

Document ID: EDOC1000178028

Views: 5128

Downloads: 0

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next