|
Open Ethernet Networking (OpEN) API Guide and Reference Manual
3.11.1.2
|
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.
This document provides a brief description of the Spanning Tree OpEN API. The Spanning Tree OpEN API allows processes outside of the EFOS main process (switchdrvr) access to Spanning Tree Management services. It provides the following services:
All 'Set' operations would affect the Switch behavior and configuration.
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: Get Spanning Tree MST Interface Designated Cost: dot1s_example 55 <instance id>=""> <interface>
Test 56: Get Spanning Tree MST Interface Designated Bridge ID: dot1s_example 56 <instance id>=""> <interface>
Test 57: Get Spanning Tree MST Interface Designated Port ID: dot1s_example 57 <instance id>=""> <interface>
Test 58: Get Spanning Tree auto calculate port path cost mode: dot1s_example 58 <interface>
Test 59: Get Spanning Tree External Port Path Cost: dot1s_example 59 <interface>
Test 60: Set Spanning Tree External Port Path Cost: dot1s_example 60 <interface> <cost>
Test 61: Get Spanning Tree Topology Change ACK: dot1s_example 61 <interface>
Test 62: Get Spanning Tree Hello Time: dot1s_example 62
Test 63: Get Spanning Tree Operational Edge Status: dot1s_example 63 <interface>
Test 64: Get Spanning Tree Point-To-Point MAC Status: dot1s_example 64 <interface>
Test 65: Get Spanning Tree Interface Regional Root ID: dot1s_example 65 <interface>
Test 66: Get Spanning Tree Interface Port Path Cost: dot1s_example 66 <interface>
Test 67: Get Spanning Tree MST Port Loop Inconsistant State: dot1s_example 67 <instance id>=""> <interface>
Test 68: Get Spanning Tree MST Transitions Into Loop Inconsistant: dot1s_example 68 <instance id>=""> <interface>
Test 69: Get Spanning Tree MST Transitions Out of Loop Inconsistant: dot1s_example 69 <instance id>=""> <interface>
Test 70: Clear Spanning Tree Interface Statistics: dot1s_example 70 <interface>
Test 71: Get Spanning Tree Interface Hello Time: dot1s_example 71 <interface>
Test 72: Get Spanning Tree Interface BPDU Guard Effect: dot1s_example 72 <interface>
Test 73: Set Spanning Tree Interface Restricted TCN Parameter: dot1s_example 73 <interface> <mode>
Test 74: Get Spanning Tree Interface Restricted TCN Parameter: dot1s_example 74 <interface>
Test 75: Get Spanning Tree Interface Auto Edge Status: dot1s_example 75 <interface>
Test 76: Set Spanning Tree Interface Auto Edge Status: dot1s_example 76 <interface> <mode>
Test 77: Get Spanning Tree Interface Up Time: dot1s_example 77 <interface>
Test 78: Get Spanning Tree Interface STP BPDUs Sent: dot1s_example 78 <interface>
Test 79: Get Spanning Tree Interface STP BPDUs Received: dot1s_example 79 <interface>
Test 80: Get Spanning Tree Interface RSTP BPDUs Sent: dot1s_example 80 <interface>
Test 81: Get Spanning Tree Interface RSTP BPDUs Received: dot1s_example 81 <interface>
Test 82: Get Spanning Tree Interface MSTP BPDUs Sent: dot1s_example 82 <interface>
Test 83: Get Spanning Tree Interface MSTP BPDUs Received: dot1s_example 83 <interface>
Test 84: Get the MSTP Bridge Max Age parameter for the CIST: s 84
Test 85: Set the MSTP Bridge Max Age parameter for the CIST: s 85 <maxAge>
Test 86: Get the MSTP Bridge hello time parameter for the CIST: s 86
Test 87: Get the MSTP Bridge forward delay for the CIST: s 87
Test 88: Set the MSTP Bridge forward delay for the CIST: s 88 <fwdDelay>
Test 89: Set the MSTP max hop count parameter for the device: s 89 <maxHopCount>
Test 90: Set the MSTP transmit hold count parameter for the device: s 90 <txHoldCount>
Test 91: Get the MSTP root port forward delay for the CIST: s 91
Test 92: Get the port ID that triggered topology change: s 92
Test 93: Get the MSTP port path cost in a specific instance: s 93 <mstId> <ifNum>
Test 94: Test Spanning Tree OpEN APIs sanity: dot1s_example 94 <interface>
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.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 EFOS main process (switchdrvr).