This section describes how to configure, modify, and delete queue scheduling and traffic shaping using the rpc method.
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 |
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 xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-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>
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>
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 xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-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>