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 V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG 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).
Storm Control

Storm Control

This section describes the configuration model of storm control and provides examples of XML packets.

Data Model

The configuration model file matching storm control is huawei-storm-control.yang.

Table 2-256  Storm control

Object

Description

Value

Remarks

/huawei-storm-control:storm-controls/storm-control/packet-type

Indicates the type of packets for which storm control is enabled.

Enumerated value. The values are as follows:

  • broadcast: broadcast packets.
  • multicast: unknown multicast packets.
  • unicast: unknown unicast packets.

N/A

/huawei-storm-control:storm-controls/storm-control/rate-type/packet/min-rate

Indicates the lower threshold in packet rate limit mode.

The value is an integer, in pps. The value range is as follows:

  • GE interface: 1 to 1488100.
  • XGE interface: 1 to 14881000.

N/A

/huawei-storm-control:storm-controls/storm-control/rate-type/packet/max-rate

Indicates the upper threshold in packet rate limit mode.

The value is an integer, in pps. The value range is as follows:

  • GE interface: 1 to 1488100.
  • XGE interface: 1 to 14881000.

N/A

/huawei-storm-control:storm-controls/action

Indicates the storm control action.

Enumerated value. The values are as follows:

  • block: blocks packets.
  • error-down: shuts down an interface.

N/A

/huawei-storm-control:storm-controls/log

Indicates whether to record logs during storm control.

Boolean value:

  • true: Logs are recorded during storm control.
  • false: Logs are not recorded during storm control.

By default, logs are not recorded during storm control.

N/A

/huawei-storm-control:storm-controls/trap

Indicates whether to report traps during storm control.

Boolean value:

  • true: Traps are reported during storm control.
  • false: Traps are not reported during storm control.

By default, traps are not reported during storm control.

N/A

/huawei-storm-control:storm-controls/interval

Indicates the storm detection interval.

The value is an integer that ranges from 1 to 180, in seconds. The default value is 5s.

N/A

/huawei-storm-control:storm-controls/storm-control-state/port-name

Indicates the name of an interface for which storm control is enabled.

The value is a string.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/packet-type

Indicates the type of packets for which storm control is enabled.

Enumerated value. The values are as follows:

  • broadcast: broadcast packets.
  • multicast: unknown multicast packets.
  • unicast: unknown unicast packets.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/min-rate

Indicates the lower threshold of rate limit for storm control.

The value is an integer.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/max-rate

Indicates the upper threshold of rate limit for storm control.

The value is an integer.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/mode-state

Indicates the mode in which rate is limited for storm control.

The value is pps, indicating packet mode.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/action-state

Indicates the storm control action.

Enumerated value. The values are as follows:

  • block: Packets are blocked.
  • err-down: The interface is shut down.
  • none: No action is configured.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/punish-status

Indicates the status of the interface.

Enumerated value. The values are as follows:

  • block: When the rate of receiving packets is greater than the value of MaxRate and the storm control action is block, the status of the interface is Block.
  • normal: Packets are normally forwarded.
  • err-down: When the rate of receiving packets is greater than the value of MaxRate and the storm control action is error-down, the status of the interface is Err-down.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/trap-state

Indicates the status of the trap function for storm control.

Enumerated value. The values are as follows:

  • on: The trap function for storm control is enabled.
  • off: The trap function for storm control is disabled.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/log-state

Indicates the status of the log function for storm control.

Enumerated value. The values are as follows:

  • on: The log function for storm control is enabled.
  • off: The log function for storm control is disabled.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/interval-state

Indicates the storm detection interval.

The value is an integer.

This object only supports the get operation.

/huawei-storm-control:storm-controls/storm-control-state/last-punish-time

Indicates the last time when storm control is performed.

The value is string.

This object only supports the get operation.

Configuring Storm Control

This section describes how to configure storm control using the config method.

Table 2-257  Configuring storm control

Operation

XPATH

edit-config:config

/huawei-storm-control:storm-controls/storm-control/packet-type

/huawei-storm-control:storm-controls/storm-control/rate-type/packet/min-rate

/huawei-storm-control:storm-controls/storm-control/rate-type/packet/max-rate

Data Requirements

Item

Data

Description

Interface number

GigabitEthernet0/0/1

Configure storm control in packet rate limit mode for broadcast packets on GE0/0/1. The lower threshold is 3000 pps, and the upper threshold is 6000 pps.

Interface type

ethernetCsmacd

Type of packets for which storm control is enabled

broadcast

Lower threshold in packet rate limit mode

3000

Upper threshold in packet rate limit mode

6000

Request Example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" 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>
          <storm-control:storm-controls xmlns:storm-control="urn:huawei:yang:huawei-storm-control">
            <storm-control:storm-control>
              <storm-control:packet-type>broadcast</storm-control:packet-type>
              <storm-control:packet>
                <storm-control:min-rate>3000</storm-control:min-rate>
                <storm-control:max-rate>6000</storm-control:max-rate>
              </storm-control:packet>
            </storm-control:storm-control>
          </storm-control:storm-controls>
        </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="3">
  <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="3">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-path>/</error-path>
    <error-message>parse rpc config error.(Unknown element "interfaces".).</error-message>
  </rpc-error>
</rpc-reply>

Querying Storm Control Configuration

This section describes how to query storm control configuration using the get method.

Table 2-258  Querying storm control configuration

Operation

XPATH

get

/huawei-storm-control:storm-controls/storm-control-state

Request Example

Query storm control configuration on GE0/0/1.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <if:interfaces-state xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name/>
          <storm-control:storm-controls xmlns:storm-control="urn:huawei:yang:huawei-storm-control"/>
        </if:interface>
      </if:interfaces-state>
    </filter>
  </get>
</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="0">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>GigabitEthernet0/0/1</name>
        <storm-controls xmlns="urn:huawei:yang:huawei-storm-control">
          <storm-control-state>
            <packet-type>broadcast</packet-type>
            <port-name>GE0/0/1</port-name>
            <min-rate>5000</min-rate>
            <max-rate>7500</max-rate>
            <mode-state>pps</mode-state>
            <action-state>none</action-state>
            <punish-status>normal</punish-status>
            <trap-state>off</trap-state>
            <log-state>off</log-state>
            <interval-state>5</interval-state>
            <last-punish-time>-</last-punish-time>
          </storm-control-state>
          <storm-control-state>
            <packet-type>unicast</packet-type>
            <port-name>GE0/0/1</port-name>
            <min-rate>5000</min-rate>
            <max-rate>8000</max-rate>
            <mode-state>pps</mode-state>
            <action-state>none</action-state>
            <punish-status>normal</punish-status>
            <trap-state>off</trap-state>
            <log-state>off</log-state>
            <interval-state>5</interval-state>
            <last-punish-time>-</last-punish-time>
          </storm-control-state>
        </storm-controls>
      </interface>
    </interfaces-state>
  </data>
</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="0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-path/>
    <error-message>Failed to get top datapath</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 7239

Downloads: 8

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