Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Spanning Tree Protocol (STP)

The Spanning Tree Protocol (STP) is a network protocol that ensures a loop-free topology for any bridged Ethernet local area network. The basic function of STP is to prevent bridge loops in a Layer 2 network. Spanning tree also allows a network design to include spare (redundant) links to provide automatic backup paths if an active link fails, without the danger of bridge loops, or the need for manual enabling/disabling of these backup links.

Spanning Tree Protocol (STP) is standardized as IEEE 802.1D. As the name suggests, it creates a spanning tree within a mesh network of connected layer-2 bridges (typically Ethernet switches), and disables those links that are not part of the spanning tree, leaving a single active path between any two network nodes.

Spanning Tree OpEN API

This document provides a brief description of the Spanning Tree OpEN API. The Spanning Tree OpEN API allows processes outside of the ICOS main process (switchdrvr) access to Spanning Tree Management services. It provides the following services:

All 'Set' operations would affect the Switch behavior and configuration.

Example C Application dot1s_example

dot1s_example is a sample application that demonstrates the use of the Spanning Tree OpEN API's. dot1s_example is started from the command line and has the following usage syntax:

Usage: dot1s_example <test#> <arg1> <arg2> ...
Test 1: Set Spanning Tree Operational Mode: dot1s_example 1 <mode>
Test 2: Get Spanning Tree Operational Mode: dot1s_example 2
Test 3: Set Spanning Tree Interface BPDU Filter Mode: dot1s_example 3 <interface> <mode>
Test 4: Get Spanning Tree Interface BPDU Filter Mode: dot1s_example 4 <interface>
Test 5: Set Spanning Tree Interface BPDU Flood Mode: dot1s_example 5 <interface> <mode>
Test 6: Get Spanning Tree Interface BPDU Flood Mode: dot1s_example 6 <interface>
Test 7: Set Spanning Tree BPDU Guard Mode: dot1s_example 7 <mode>
Test 8: Get Spanning Tree BPDU Guard Mode: dot1s_example 8
Test 9: Set Spanning Tree Configuration Name: dot1s_example 9 <name>
Test 10: Get Spanning Tree Configuration Name: dot1s_example 10
Test 11: Set Spanning Tree Configuration Revision: dot1s_example 11 <revision>
Test 12: Get Spanning Tree Configuration Revision: dot1s_example 12
Test 13: Set Spanning Tree Configuration Force Version: dot1s_example 13 <version>
Test 14: Get Spanning Tree Configuration Force Version: dot1s_example 14
Test 15: Set Spanning Tree Interface Guard Mode: dot1s_example 15 <interface> <mode>
Test 16: Get Spanning Tree Interface Guard Mode: dot1s_example 16 <interface>
Test 17: Create Spanning Tree Instance: dot1s_example 17 <instance id>
Test 18: Delete Spanning Tree Instance: dot1s_example 18 <instance id>
Test 19: Get All Spanning Tree Instances: dot1s_example 19
Test 20: Set Spanning Tree MST Instance Priority: dot1s_example 20 <instance id> <priority>
Test 21: Get Spanning Tree MST Instance Priority: dot1s_example 21 <instance id>
Test 22: Add Spanning Tree MST Instance - VLAN Association: dot1s_example 22 <instance id> <vlanid>
Test 23: Delete Spanning Tree MST Instance - VLAN Association: dot1s_example 23 <instance id> <vlanid>
Test 24: Get All VLANs associated with the Spanning Tree Instance: dot1s_example 24 <instance id>
Test 25: Get All Forwarding Database Ids associated with the Spanning Tree Instance: dot1s_example 25 <instance id>
Test 26: Set Spanning Tree Interface Mode: dot1s_example 26 <interface> <mode>
Test 27: Get Spanning Tree Interface Mode: dot1s_example 27 <interface>
Test 28: Get Spanning Tree Interface Forwarding State: dot1s_example 28 <interface> <instance id>
Test 29: Get Spanning Tree Interface Mode: dot1s_example 29 <interface> <instance id>
Test 30: Set Spanning Tree Interface Edge Port Mode: dot1s_example 30 <interface> <mode>
Test 31: Get Spanning Tree Interface Edge Port Mode: dot1s_example 31 <interface>
Test 32: Get the Spanning Tree MST Bridge Identifier for a specific instance: dot1s_example 32 <instance id>
Test 33: Get the Spanning Tree MST Time since the last Topology Change for a specific instance: dot1s_example 33 <instance id>
Test 34: Get the Spanning Tree MST count of Topology Changes in a specific instance: dot1s_example 34 <instance id>
Test 35: Get if a topology change is in progress for any port assigned to a specific Spanning Tree Port instance: dot1s_example 35 <instance id>
Test 36: Get the Spanning Tree MST Designated Root Identifier in a specific instance: dot1s_example 36 <instance id>
Test 37: Get the Spanning Tree MST Designated Root Path Cost parameter in a specific instance: dot1s_example 37 <instance id>
Test 38: Get the Spanning Tree MST Root Port ID in a specific instance: dot1s_example 38 <instance id>
Test 39: Get the CIST max age: dot1s_example 39
Test 40: Get the Max Hop count for the device: dot1s_example 40
Test 41: Get the Tx Hold count value for the device: dot1s_example 41
Test 42: Get the CIST Bridge Forward Delay: dot1s_example 42
Test 43: Get the CIST Hello Time for a specific port: dot1s_example 43 <interface>
Test 44: Get the CIST Bridge Hold Time: dot1s_example 44
Test 45: Get the CIST Regional Root Identifier: dot1s_example 45
Test 46: Get the CIST Regional Root Path Cost: dot1s_example 46
Test 47: Test Spanning Tree OpEN APIs sanity: dot1s_example 47 <interface>
Test 32: Get Spanning Tree MST Interface port details: dot1s_example 32 <instance id>=""> <interface>
Test 33: Set Spanning Tree MST Interface priority: dot1s_example 33 <instance id>=""> <interface> <priority>
Test 34: Get Spanning Tree MST Interface priority: dot1s_example 34 <instance id>=""> <interface>
Test 35: Get Spanning Tree MST Interface Path Cost Mode: dot1s_example 35 <instance id>=""> <interface>
Test 36: Set Spanning Tree MST Interface Cost: dot1s_example 36 <instance id>=""> <interface> <priority>
Test 37: Get Spanning Tree MST Interface Operational Cost: dot1s_example 37 <instance id>=""> <interface>
Test 38: Get Spanning Tree MST Interface Designated Root ID: dot1s_example 38 <instance id>=""> <interface>
Test 39: Get Spanning Tree MST Interface Designated Cost: dot1s_example 39 <instance id>=""> <interface>
Test 40: Get Spanning Tree MST Interface Designated Bridge ID: dot1s_example 40 <instance id>=""> <interface>
Test 41: Get Spanning Tree MST Interface Designated Port ID: dot1s_example 41 <instance id>=""> <interface>
Test 42: Get Spanning Tree External Port Path Cost Mode: dot1s_example 42 <interface>
Test 43: Get Spanning Tree External Port Path Cost: dot1s_example 43 <interface>
Test 44: Set Spanning Tree External Port Path Cost: dot1s_example 44 <interface> <cost>
Test 45: Get Spanning Tree Topology Change ACK: dot1s_example 45 <interface>
Test 46: Get Spanning Tree Hello Time: dot1s_example 46
Test 47: Get Spanning Tree Operational Edge Status: dot1s_example 47 <interface>
Test 48: Get Spanning Tree Point-To-Point MAC Status: dot1s_example 48 <interface>
Test 49: Get Spanning Tree Interface Regional Root ID: dot1s_example 49 <interface>
Test 50: Get Spanning Tree Interface Port Path Cost: dot1s_example 50 <interface>
Test 51: Get Spanning Tree MST Port Loop Inconsistant State: dot1s_example 51 <instance id>=""> <interface>
Test 52: Get Spanning Tree MST Transitions Into Loop Inconsistant: dot1s_example 52 <instance id>=""> <interface>
Test 53: Get Spanning Tree MST Transitions Out of Loop Inconsistant: dot1s_example 53 <instance id>=""> <interface>
Test 54: Clear Spanning Tree Interface Statistics: dot1s_example 54 <interface>
Test 55: Test Spanning Tree OpEN APIs sanity: dot1s_example 55 <interface>

Initialization

In the main function, the sample application initializes the OpEN API RPC service by calling openapiClientRegister() and waits for the RPC service in switchdrvr to start. A Client Handle is returned by openapiClientRegister() which is used while invoking the OpEN APIs. The application then exercises the associated OpEN APIs and logs informational and/or error messages on the console. The example application runs to its completion and exits.

dot1s_example

dot1s_example.c is a sample application that demonstrates the use of the Spanning Tree OpEN API. It exercises all the Spanning Tree OpEN APIs with appropriate arguments to manage the Spanning Tree component in the ICOS main process (switchdrvr).

DOT1S CLI/API Cross Reference

CLI Command OpEN API Reference
(Config)#
[no]spanning-tree bpduguard
openapiDot1SBPDUGuardModeSet()
openapiDot1SBPDUGuardModeGet()
(Config)#
[no]spanning-tree configuration name <name>
openapiDot1SConfigNameSet()
openapiDot1SConfigNameGet()
(Config)#
[no]spanning-tree configuration revision <revision>
openapiDot1SConfigRevisionSet()
openapiDot1SConfigRevisionGet()
(Config)#
[no]spanning-tree forceversion {802.ld | 802.lw | 802.ls}
openapiDot1SForceVersionSet()
openapiDot1SForceVersionGet()
(Config)#
[no]spanning-tree
openapiDot1SModeSet()
openapiDot1SModeGet()
(Config)#
[no]spanning-tree mst instance <mstid>
openapiDot1SMSTInstanceSet()
openapiDot1SMSTInstanceFirstGet()
openapiDot1SMSTInstanceFirstGet()
(Config)#
[no] spanning-tree mst vlan <mstid> <vlan-list>
openapiDot1SMSTInstanceVLANSet()
openapiDot1SMSTInstanceFirstVLANGet()
openapiDot1SMSTInstanceNextVLANGet()
(Config)#
[no]spanning-tree mst priority <mstid> <priority>
openapiDot1SMSTInstancePrioritySet()
openapiDot1SMSTInstancePriorityGet()
(Interface-Config Mode)#
[no]spanning-tree bpdufilter
openapiDot1SIntfBPDUFilterModeSet()
openapiDot1SIntfBPDUFilterModeGet()
(Interface-Config Mode)#
[no]spanning-tree bpduflood
openapiDot1SIntfBPDUFloodModeSet()
openapiDot1SIntfBPDUFloodModeGet()
(Interface-Config Mode)#
[no]spanning-tree edgeport
openapiDot1SIntfEdgePortModeSet()
openapiDot1SIntfEdgePortModeGet()
(Interface-Config Mode)#
[no]spanning-tree guard [loop | none | root]
openapiDot1SIntfGuardModeSet()
openapiDot1SIntfGuardModeGet()
(Interface-Config Mode)#
[no] spanning-tree port mode {<slot/port> | all}
openapiDot1SIntfModeSet()
openapiDot1SIntfModeGet()
(Priv-User Mode)#
show spanning-tree
openapiDot1SMSTInstanceFirstFIdGet()
openapiDot1SMSTInstanceNextFIdGet()
openapiDot1sMSTInstanceBridgeIdentifierGet()
openapiDot1sMSTInstanceTimeSinceTopologyChangeGet()
openapiDot1sMSTInstanceTopologyChangeCountGet()
openapiDot1sMSTInstanceTopologyChangeParamGet()
openapiDot1sMSTInstanceDesignatedRootIDGet()
openapiDot1sMSTInstanceRootPathCostGet()
openapiDot1sMSTInstanceRootPortIDGet()
openapiDot1sCISTMaxAgeGet()
openapiDot1sBridgeMaxHopGet()
openapiDot1sBridgeTxHoldCountGet()
openapiDot1sCISTRootFwdDelayGet()
openapiDot1sCISTHelloTimeGet()
openapiDot1sCISTBridgeHoldTimeGet()
openapiDot1sCISTRegionalRootIDGet()
openapiDot1sCISTRegionalRootPathCostGet()
(Priv-User Mode)#
show spanning-tree mst port summary <spanning-tree instance> <interface>
openapiDot1SIntfPortRoleGet()
openapiDot1SIntfPortLoopInconsistentStateGet()
(Priv-User Mode)#
show spanning-tree mst port detailed <spanning-tree instance> <interface>
openapiDot1SMSTIntfPortIDGet()
openapiDot1SMstiPortPriorityGet()
openapiDot1SMstiPortPathCostModeGet()
openapiDot1SMstiOperPortPathCostGet()
openapiDot1SCistExtPortPathCostModeGet()
openapiDot1SCistExtPortPathCostGet()
openapiDot1SMstiPortDesignatedRootIDGet()
openapiDot1SMstiDesignatedCostGet()
openapiDot1SMstiDesignatedBridgeIDGet()
openapiDot1SMstiDesignatedPortIDGet()
openapiDot1SCistPortTopologyChangeAckGet()
openapiDot1SCistHelloTimeGet()
openapiDot1SCistPortOperEdgeGet()
openapiDot1SCistPortOperPointToPointGet()
openapiDot1SCistPortRegionalRootIDGet()
openapiDot1SCistPortPathCostGet()
openapiDot1SMstiPortLoopInconsistentStateGet()
openapiDot1SPortStatsTransitionsIntoLoopInconsistentStateGet()
openapiDot1SPortStatsTransitionsOutOfLoopInconsistentStateGet()
openapiDot1SPortRestrictedTcnGet()
openapiDot1SPortAutoEdgeGet()
openapiDot1SPortUpTimeGet()
openapiDot1SPortStatsSTPBPDUsSentGet()
openapiDot1SPortStatsSTPBPDUsReceivedGet()
openapiDot1SPortStatsRSTPBPDUsSentGet()
openapiDot1SPortStatsRSTPBPDUsReceivedGet()
openapiDot1SPortStatsMSTPBPDUsSentGet()
openapiDot1SPortStatsMSTPBPDUsReceivedGet()
(Interface-Config Mode)#
[no] spanning-tree mst <mstid> port-priority <priority>
openapiDot1SMstiPortPrioritySet()
openapiDot1SMstiPortPriorityGet()
(Interface-Config Mode)#
[no] spanning-tree mst <mstid> cost {<cost> | auto}
openapiDot1SMstiPortPathCostSet()
(Priv-User Mode)#
clear counters {<slot/port> | all}
openapiDot1SPortStatsClear()
(Interface-Config Mode)#
[no] spanning-tree auto-edge
openapiDot1SPortAutoEdgeSet()
openapiDot1SPortAutoEdgeGet()
(Interface-Config Mode)#
[no] spanning-tree cost {<cost> | auto}
openapiDot1SCistExtPortPathCostSet()
openapiDot1SCistExtPortPathCostGet()
openapiDot1SCistExtPortPathCostModeGet()
(Interface-Config Mode)#
[no] spanning-tree tcnguard
openapiDot1SPortRestrictedTcnSet()
openapiDot1SPortRestrictedTcnGet()