STP Functions¶
sth::emulation_stp_config¶
Purpose¶
Creates, modifies, or removes the STP emulation bridge on the specified port(s). Spanning Tree Protocol (STP) is used to prevent loops that occur in redundant network configurations. It provides fault tolerance by allowing redundant paths, but assures a single active path to any destination by blocking all except the current best path to a destination.
All STP-participating switches gather information about other switches in the network by exchanging bridge protocol data unit (BPDU) data messages. This message exchange supports the following modes:
- Election of a Root Switch for the STP network topology
- Election of a Designated Switch for each switched LAN segment
- Elimination of network loops by placing redundant switch ports in Blocking
- Spanning Tree Algorithm (STA)
Spirent HLTAPI supports the following types of STP:
- STP (IEEE 802.1D, 1998 edition)
- Rapid Spanning Tree Protocol (RSTP) (IEEE 802.1W)
- Per-VLAN Spanning Tree Plus (PVST+) (per port, using 802.1Q trunking)
- Rapid Per-VLAN Spanning Tree Plus (RPVST+)
- Multiple STP (MSTP) (IEEE 802.1S)
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_stp_config [-mode {create|modify|delete|enable|disable} M] [-port_handle <port_handle>] [-handle <STP_device_handle>] [-stp_type {stp|rstp|pvst|rpvst|mstp}] [-port_type {trunk| access}] [-bridge_priority <0-65535>] [-count <integer>] [-encap {ethernet_ii|ethernet_ii_vlan|ethernet_ii_qinq}] [-enable_pt2pt_link {true|false}] [-enable_mac_addr_reduction {true|false}] [-ether_type <string>] [-event_log_level { convergence_events|debug }] [-forward_delay <4-30>] [-hello_time <1-10>] [-hold_count <1-30>] [-gateway_ip_addr <a.b.c.d> ] [-gateway_ip_addr_step <a.b.c.d>] [-gateway_ipv6_addr <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-gateway_ipv6_addr_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-ip_version {ipv4 | ipv6 | }] [-local_ip_addr <a.b.c.d>] [-local_ip_addr_step <a.b.c.d>] [-local_ip_prefix_len <0-32>] [-local_ipv6_addr <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-local_ipv6_addr_step <aaaa:bbbb:cccc:dddd:eeee:ffff:gggg:hhhh>] [-local_ipv6_prefix_len <0-128>] [-mac_addr <aa:bb:cc:dd:ee:ff>] [-mac_addr_step <aa:bb:cc:dd:ee:ff>] [-msg_age <1-39>] [-max_age_time <6-40>] [-native_vlan <1-4094>] [-port_priority <0-255>] [-port_number <1-255>] [-remaining_hops <1-255>] [-root_bridge_type {custom| self}] [-root_priority <0-65535>] [-root_mac_address <aa:bb:cc:dd:ee:ff>] [-root_path_cost <0-200000000>] [-region_root_bridge_type {custom| self}] [-region_root_priority <0-65535>] [-region_root_mac_address <aa:bb:cc:dd:ee:ff>] [-region_root_path_cost <0-200000000>] [-qinq_incr_mode {inner | outer | both}] [-vlan_start <0-4095>] [-vlan_count <integer>] [-vlan_priority <0-7>] [-vlan_id <0-4095>] [-vlan_id_mode {increment|fixed}] [-vlan_id_step <0-4095>] [-vlan_id_count <1-4096>] [-vlan_user_priority <1-7>] [-vlan_cfi {0|1}] [-vlan_id_outer <0-4095>] [-vlan_id_outer_mode {increment|fixed}] [-vlan_id_outer_step <0-4095>] [-vlan_id_outer_count <1-4096>] [-vlan_outer_user_priority <1-7>] [-vlan_outer_cfi <0|1>]
Arguments¶
-
-port_handle
¶
Specifies the port on which to create the STP emulation bridge. This argument is Mandatory for create mode.
-
-handle
¶
Specifies a STP handle returned from this procedure. Required for modify, delete, enable, or disable modes.
-
-mode
¶
Specifies the action to perform on the specified port. This is a Mandatory argument. Possible values are create, modify, delete, disable, and enable. The modes are described below:
create - Creates one or more emulated STP devices on the port specified by the -port_handle argument. modify - Changes the configurations for the STP device identified by the -handle argument. delete - Deletes the STP device identified by the -handle argument. disable - Disables the configurations for the STP device identified by the -handle argument. enable - Enables the configurations for the STP device identified by the -handle argument.
-
-bridge_priority
¶
Specifies the priority for the emulated STP bridge. A low value indicates a high bridge priority. The value must be a multiple of 4096. Possible values range from 0 to 65535. The default value is 32768.
-
-bridge_mac_address
¶
Specifies the MAC address of the emulated STP bridge. The value is the second component of the bridge ID. The default value is 00:00:10:00:10:00.
-
-count
¶
Number of STP devices to create. The default value is 1.
-
-enable_pt2pt_link
¶
Enables or disables point-to-point link. Possible values are true (enable) and false (disable). The default value is false. This argument can be configured only when -stp_type is set to rstp. For type STP, the point-to-point link is always disabled; for types PVST, RPVST and MSTP, the point-to-point link is always enabled.
-
-enable_mac_addr_reduction
¶
Enables or disables MAC address reduction. MAC address reduction results in a unique MAC address by deriving the last 3 bytes of the address from the VLAN ID. This argument is only used with types PVST and RPVST. Possible values are true and false. The default value is false.
-
-encap
¶
Specifies the Layer 2 framing mode for encapsulated devices. Possible values are described below:
ethernet_ii - Ethernet II. ethernet_ii_vlan - Ethernet II with a single VLAN tag. ethernet_ii_qinq - Ethernet II with two VLAN tags.
The default value is ethernet_ii.
-
-ether_type
¶
Specifies the Ethernet type used by PVST/RPVST. This argument is available when port_type is set to trunk. The default value is 8100.
-
-gateway_ip_addr
¶
Configures the starting IPv4 gateway address of the emulated STP devices. The value must be in IPv4 format. You must specify -ip_version to ipv4.
-
-gateway_ip_addr_step
¶
Defines the increment used to generate IPv4 gateway addresses. The value must be in IPv4 format. The default value is 0.0.0.0. You must specify -ip_version to ipv4.
-
-gateway_ipv6_addr
¶
Configures the starting IPv6 gateway address of the emulated STP devices. The value must be in IPv6 format. You must specify -ip_version to ipv6.
-
-gateway_ipv6_addr_step
¶
Defines the increment used to generate IPv6 gateway addresses. The value must be in IPv6 format. The default value is ::. You must specify -ip_version to ipv6.
-
-ip_version
¶
Defines the IP version of the STP emulated device. Possible values are ipv4, ipv6 and . The default value is ipv4.
-
-local_ip_addr
¶
Defines the starting IPv4 address of the emulated STP devices. The value must be in IPv4 format. You must specify -ip_version to ipv4.
-
-local_ip_addr_step
¶
Defines the increment used to generate IPv4 addresses. The value must be in IPv4 format. The default value is 0.0.0.1. You must specify -ip_version to ipv4.
-
-local_ip_prefix_len
¶
Specifies the IPv4 prefix length for the emulated STP devices. Possible values range from 0 to 32. The default value is 24. You must specify -ip_version to ipv4.
-
-local_ipv6_addr
¶
Defines the starting IPv6 address of the emulated STP devices. The value must be in IPv6 format. You must specify -ip_version to ipv6.
-
-local_ipv6_addr_step
¶
Defines the increment used to generate IPv6 addresses. The value must be in IPv6 format. The default is ::1. You must specify -ip_version to ipv6.
-
-local_ipv6_prefix_len
¶
Specifies the IPv6 prefix length for the emulated STP devices. Possible values range from 0 to 128. The default value is 64. You must specify -ip_version to ipv6.
-
-mac_addr
¶
Specifies the starting value for MAC addresses. The value must be in MAC format.
-
-mac_addr_step
¶
Specifies the step value applied to the base MAC address. The value must be in MAC format. The default value is 00.00.00.00.00.01.
-
-native_vlan
¶
Specifies the native VLAN number. Possible values range from 1 to 4094. The default value is 1. This argument is available when -stp_type is set to pvst, rpvst or mstp.
-
-port_type
¶
Specifies the port type when -stp_type is set to pvst or rpvst. Possible values are trunk and access.
trunk: Indicates a Common or Mono Spanning Tree region.
access: Runs a single instance
-
-qinq_incr_mode
¶
Specifies the increment mode for ethernet_ii_qinq encapsulation. This parameter only applies to Q-in-Q Ethernet interfaces. Possible values are inner, outer and both. The default is inner. The modes are described below:
inner - The inner VLAN ID is incremented first until the specified number of inner VLANs is exhausted, then the outer VLAN ID is incremented. This continues in a round-robin fashion until the number of sessions is exhausted. outer - The outer VLAN ID is incremented first until the specified number of outer VLANs is exhausted, and then the inner VLAN ID is incremented. This continues in a round-robin fashion until the number of sessions is exhausted. both - The inner VLAN ID and outer VLAN ID increment at the same time. This continues in a round-robin fashion until the number of sessions is exhausted.
-
-stp_type
¶
Specifies the protocol type for the spanning tree algorithm. Possible values are stp, rstp, pvst,rpvst and mstp. The default value is stp. The types are described below:
stp - Spanning Tree Protocol (IEEE 802.1D). Supports bridge domains and enables the bridge to construct a loop-free topology across an extended LAN. rstp - Rapid Spanning Tree Protocol (IEEE 802.1W). An evolution of the 802.1D standard. pvst - Per-VLAN Spanning Tree Plus. Uses 802.1Q trunking technology to provide PVST functionality. It maintains a spanning tree instance for each VLAN configured on the network. When you specify this mode, you must also specify -port_type to access or trunk. (This is a Cisco proprietary protocol.) rpvst - Rapid Per-VLAN Spanning Tree Plus. Runs an instance of RSTP for each VLAN configured on the network. When you specify this mode, you must also specify -port_type to access or trunk. (This is a Cisco proprietary protocol.) mstp - Multiple Spanning Tree Protocol (IEEE 802.1S). Industry standard, per-VLAN MSTP. It configures a separate spanning tree for each VLAN and blocks the links that are redundant within each spanning tree. MSTP allows formation of MST regions that can run multiple MST instances (MSTI). When you specify this type, you must also configure one or more MSTP region(s) with mode create using the sth::emulation_mstp_region_config function. You can also modify the default MSTIs with sth::emulation_msti_config.
-
-port_priority
¶
Specifies the priority for the port on the emulated STP bridge. The value is the first component of the port ID. It must be a multiple of 16. Possible values range from 0 to 255. The default value is 128.
-
-port_number
¶
Specifies the port number of the emulated STP bridge. The value is the second component of the port ID. Possible values range from 1 to 255. The default value is 1.
-
-msg_age
¶
Specifies the age of the message in seconds. Possible values range from 1 to 39. The default value is 1. This argument is available when -root_bridge_type is set to custom.
-
-max_age_time
¶
Specifies the timeout value used to discard STP messages. Possible values range from 6 to 40. The default value is 20.
-
-hello_time
¶
Specifies the time interval between the generations of configuration BPDUs by the root bridge. Possible values range from 1 to 10. The default value is 2.
-
-forward_delay
¶
Specifies the time that the bridge remains in listening and learning states before entering the forwarding state. Possible values range from 4 to 30. The default value is 15.
-
-hold_count
¶
Specifies the maximum number of BPDUs transmitted per second. Possible values range from 1 to 30. The default value is 3.
-
-root_bridge_type
¶
Identifies the root bridge type. Possible values are self and custom. If you specify self, current bridge is the root bridge. If you specify custom, you can identify a different bridge as the root bridge.
-
-root_priority
¶
Specifies the priority for the root bridge. It must be a multiple of 4096. Possible values range from 0 to 65535. The default value is 32768. This argument is available when root_bridge_type is set to custom.
-
-root_mac_address
¶
Specifies the MAC address of the root bridge. The value must be in MAC format. The default value is 00:00:10:00:10:00. This argument is available when root_bridge_type is set to custom.
-
-root_path_cost
¶
Specifies the cost to reach the root bridge. Possible values range from 0 to 200000000. The default value is 0. This argument is available when root_bridge_type is set to custom.
-
-event_log_level
¶
Specifies the event log level. Possible values are convergence_events and debug. The default value is debug.
-
-region_root_bridge_type
¶
Identifies the initial regional root bridge type for the current Internal Spanning Tree (IST). Possible values are self and custom. If you specify self, the current bridge is the regional root bridge. If you specify custom, you can identify a different bridge as the regional root bridge. This argument is available when -stp_type is set to mstp and region_root_bridge_type is set to custom.
-
-region_root_priority
¶
Defines the bridge priority of the regional root bridge for the current IST. The root priority value is used to determine which bridge is elected as root, and it must be a multiple of 4096. Possible values range from 0 to 65535. The default value is 32768. This argument is available when -stp_type is set to mstp and region_root_bridge_type is set to custom.
-
-region_root_mac_address
¶
Configures the MAC address of the regional root bridge for the current IST. The value must in MAC format. The default value is 00:00:10:00:10:00. This argument is available when -stp_type is set to mstp and region_root_bridge_type is set to custom.
-
-region_root_path_cost
¶
Specifies the cost to reach the regional root bridge for the current IST. This value is used by the DUT to determine which port is the primary path to the root bridge. Possible values range from 0 to 200000000. The default value is 0. This argument is available when -stp_type is set to mstp and region_root_bridge_type is set to custom.
-
-remaining_hops
¶
Specifies the MSTP remaining hops for current IST. Possible values range from 1 to 255. The default value is 16. This argument is available when stp_type is set to mstp.
-
-vlan_start
¶
Specifies the starting VLAN ID. Possible values range from 0 to 4095. The default value is 100. This argument is available when stp_type stp_type is set to pvst or rpvst and port_type is set to trunk.
-
-vlan_count
¶
Specifies the Number of VLANs. The default value is 1. This argument is available when -stp_type stp_type is set to pvst or rpvst and port_type is set to trunk.
-
-vlan_priority
¶
Specifies the VLAN priority. Possible values range from 0 to 7. The default value is 1. This argument is available when -stp_type is set to pvst or rpvst and port_type is set to trunk.
-
-vlan_id
¶
Specifies the starting VLAN ID for the encapsulation of ethernet_ii_vlan, or the starting inner VLAN ID for the ethernet_ii_qinq encapsulation. Possible values range from 0 to 4095. The default value is 100.
-
-vlan_id_mode
¶
Specifies how Spirent HLTAPI will assign VLAN IDs. Possible values are increment and fixed. The modes are described below:
increment - For all STP devices, the VLAN ID increments by the step value specified by -vlan_id_step. fixed - The VLAN ID remains the same for all STP devices.
The default value is increment.
-
-vlan_id_step
¶
Specifies the value that Spirent HLTAPI uses to increment the VLAN ID. Possible values range from 1 to 4095. The default value is 1.
-
-vlan_id_count
¶
Specifies the number of VLAN IDs to use when generating STP devices. Possible values range from 1 to 4096. The default value is 1.
-
-vlan_user_priority
¶
Specifies the VLAN priority for the VLANs on the specified port. Possible values range from 0 to 7. The default value is 0.
-
-vlan_cfi
¶
Sets the canonical format indicator (CFI) field in VLAN for the emulated router node. Possible values are 0 (Ethernet) and 1 (Token Ring). If it is set to 0, it indicates the network is Ethernet. If it is set to 1, it indicates that Token Ring and packets are dropped by Ethernet ports. The default value is 0.
-
-vlan_id_outer
¶
Specifies the starting outer VLAN ID for the ethernet_ii_qinq encapsulation. Possible values range from 0 to 4095. The default value is 100.
Note
This parameter only applies to Ethernet Q-in-Q interfaces.
-
-vlan_id_outer_mode
¶
Specifies how Spirent HLTAPI will assign outer VLAN IDs. Possible values are increment and fixed. The modes are described below:
increment - For all STP devices, the VLAN ID increments by the step value specified by -vlan_id_outer_step.
fixed - The VLAN ID remains the same for all STP devices. The default value is increment.
-
-vlan_id_outer_step
¶
Specifies the value by which to increment the outer VLAN ID (-vlan_id_outer) for subsequent packets. Possible values range from 1 to 4095. The default value is 1.
-
-vlan_id_outer_count
¶
Specifies the number of outer VLAN IDs to use when generating STP devices. Possible values range from 1 to 4096. The default is 1.
-
-vlan_outer_user_priority
¶
Specifies the VLAN priority to assign to the outer VLAN header. Possible values range from 1 to 7. The default is 7.
-
-vlan_outer_cfi
¶
Sets the CFI field in the outer VLAN tag for the emulated router node. Possible values are 0 (Ethernet) and 1 (Token Ring). If it is set to 0, it indicates the network is Ethernet. If it is set to 1, it indicates that Token Ring and packets are dropped by Ethernet ports. The default value is 0.
Arguments Unsupported by Save as HLTAPI¶
The following Spirent HLTAPI arguments are currently not supported by the Save as HLTAPI function:
-qinq_incr_mode
-vlan_id_count
-vlan_id_mode
-vlan_id_outer_count
-vlan_id_outer_mode
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
handles A list of handles that identify the STP devices created by the
``sth::emulation_stp_config`` function.
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_stp_config
function creates, modifies, deletes, disables, and
enables one or more emulated STP devices/topologies on the specified port. Use
the -mode argument to specify the action to perform. (See the -mode argument
description for information about the actions.)
When you create a STP device, use the -port_handle argument to specify the
Spirent HLTAPI port that the emulated device will use for STP communication.
(The port handle value is contained in the keyed list returned by the
sth::connect
function.)
If the performed action fails, Spirent HLTAPI returns an error message. For example, if the user tries to configure a non-existing session handle under modify mode, an error message will be returned.
Examples¶
#### HLTAPI for Tcl ####
The following example creates a new STP device:
# A port with handle hltHostPor must already exist.
set status [sth::emulation_stp_config -modecreate \
-port_handle $hltHostPort \
-stp_type stp\
-bridge_priority 4096\
-mac_address 00:00:10:00:00:00 \
-port_priority 16\
-port_number 2\
-root_bridge_type custom\
-root_priority 4096\
-root_mac_address 00:00:00:00:00:01\
-root_path_cost 50]
keylget returnedString handle deviceHdl
The following example modifies the created STP device:
set returnKlist [::sth::emulation_stp_config -handle $deviceHdl \
-bridge_priority 8192 \
-mode modify]
The following example deletes the created STP device:
set returnKlist [::sth::emulation_stp_config -handle $deviceHdl \
-mode delete]
#### HLTAPI for Python ####
The following example creates a new STP device:
device_ret0 = sth.emulation_stp_config (
mode = 'create',
region_root_bridge_type= 'self',
region_root_priority= '32768',
region_root_mac_address= '00:00:10:00:10:00',
region_root_path_cost= '0',
remaining_hops = '16',
ip_version = 'ipv4',
encap = 'ethernet_ii',
port_handle = port_handle[0],
enable_pt2pt_link = 'true',
native_vlan = '1',
stp_type = 'mstp',
ether_type = '8100',
enable_mac_addr_reduction= 'false',
port_type = 'trunk',
msg_age = '1',
hello_time = '2',
port_priority = '128',
bridge_priority = '32768',
root_path_cost = '0',
root_mac_address = '00:00:10:00:10:00',
port_number = '1',
root_priority = '32768',
root_bridge_type = 'self',
forward_delay = '15',
hold_count = '3',
max_age_time = '20',
event_log_level = 'debug',
bridge_mac_address = '00:00:10:00:10:00',
mac_addr = '00:10:94:00:00:01',
mac_addr_step = '00:00:00:00:00:01',
local_ip_prefix_len = '24',
gateway_ip_addr = '192.85.1.1',
local_ip_addr_step = '0.0.0.1',
gateway_ip_addr_step= '0.0.0.0',
local_ip_addr = '192.85.1.3');
Sample Output::
Sample Output:
{'status': '1', 'handle': 'host3', 'port_handle': 'port1'}
#### HLTAPI for Perl ####
The following example creates a new STP device:
my %device_ret0 = sth::emulation_stp_config (
mode => 'create',
region_root_bridge_type=> 'self',
region_root_priority=> '32768',
region_root_mac_address=> '00:00:10:00:10:00',
region_root_path_cost=> '0',
remaining_hops => '16',
ip_version => 'ipv4',
encap => 'ethernet_ii',
port_handle => "$hport[1]",
enable_pt2pt_link => 'true',
native_vlan => '1',
stp_type => 'mstp',
ether_type => '8100',
enable_mac_addr_reduction=> 'false',
port_type => 'trunk',
msg_age => '1',
hello_time => '2',
port_priority => '128',
bridge_priority => '32768',
root_path_cost => '0',
root_mac_address => '00:00:10:00:10:00',
port_number => '1',
root_priority => '32768',
root_bridge_type => 'self',
forward_delay => '15',
hold_count => '3',
max_age_time => '20',
event_log_level => 'debug',
bridge_mac_address => '00:00:10:00:10:00',
mac_addr => '00:10:94:00:00:01',
mac_addr_step => '00:00:00:00:00:01',
local_ip_prefix_len => '24',
gateway_ip_addr => '192.85.1.1',
local_ip_addr_step => '0.0.0.1',
gateway_ip_addr_step=> '0.0.0.0',
local_ip_addr => '192.85.1.3');
Sample Output:
$VAR1 = 'handle';
$VAR2 = 'host3'
$VAR3 = 'port_handle';
$VAR4 = 'port1';
$VAR5 = 'status';
$VAR6 = '1';
End of Procedure Header
sth::emulation_mstp_region_config¶
Purpose¶
Creates, modifies, deletes the MSTP region configurations, and creates the default MSTI. This function only works when STP type is MSTP.
The Multiple Spanning Tree Protocol (MSTP), originally defined in IEEE 802.1s and later merged into IEEE 802.1Q-2005, defines an extension to RSTP to further develop the usefulness of virtual LANs (VLANs). This Per-VLAN Multiple Spanning Tree Protocol configures a separate Spanning Tree for each VLAN group and blocks all but one of the possible alternate paths within each Spanning Tree.
If there is only one Virtual LAN (VLAN) in the network, single (traditional) STP works appropriately. If the network contains more than one VLAN, the logical network configured by single STP would work, but it is possible to make better use of the alternate paths available by using an alternate spanning tree for different VLANs or groups of VLANs.
MSTP allows formation of MST regions that can run multiple MST instances (MSTI). Multiple regions and other STP bridges are interconnected using one single common spanning tree (CST).
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_mstp_region_config -mode create|modify|delete} M] [-port_handle <port_handle>] [-handle <MSTP region handle>] [-mstp_region_name] [-mstp_version_num <0-65535>] [-mstp_instance_count <1-64>] [-mstp_instance_vlan_list <list of numbers>] [-mstp_instance_num_list <list of numbers>]
Arguments¶
-
-mode
¶
Specifies the action(s) to be taken. Possible values are create, modify and delete. This argument is Mandatory . The modes are described below:
create - Creates one MSTP region on the port specified by the -port_handle argument. You must specify the -port_handle argument. Note that a port can only belong to one region. modify - Changes the configuration for the MSTP region(s) identified by the -handle argument. You must specify the -handle argument. delete - Removes the MSTP region(s) identified by the -handle argument. You must specify the -handle argument.
-
-port_handle
¶
Specifies the port on which to create MSTP region(s). The value can be a list of port handles. This parameter is Mandatory for mode create.
-
-handle
¶
Specifies an MSTP region handle returned from this procedure. This parameter is Mandatory for modes modify and delete.
-
-mstp_region_name
¶
Specifies the region name that the MSTP instance belongs to. The name can include up to 32 alphanumeric characters.
-
-mstp_version_num
¶
Specifies the version number of the created MSTP region. Possible values range from 0 to 65535. The default value is 1.
-
-mstp_instance_count
¶
Specifies the number of MST instances (MSTI) in the region. Possible values range from 1 to 64. The default value is 1.
-
-mstp_instance_vlan_list
¶
Specifies an array of VLAN IDs corresponding to the instance numbers. The default value is 1.
-
-mstp_instance_num_list
¶
Specifies an array of MSTI instance numbers. The default value is 1.
Arguments Unsupported by Save as HLTAPI¶
None
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
reg_handle An MSTP region configured by
sth::emulation_mstp_region_config.
msti_handle A list of handles of MSTIs configured by
sth::emulation_mstp_region_config.
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_mstp_region_config creates, modifies, and deletes MSTP region(s) on the specified port. Use the -mode argument to specify the action to perform. (See the -mode argument description for information about the actions.)
Before using this function, you must specify -stp_type to mstp.
After an MSTP region is configured, an MSTP region handle is created, which can be used to modify the parameters.
Examples¶
#### HLTAPI for Tcl ####
The following example creates and configures a new MSTP region:
# A port with handle hltport1 must already exist.
set status [sth::emulation_mstp_region_config -mode create
-port_handle {$hltport1, $hltport2} \
-mstp_region_name reg1\
-mstp_version_num 1\
-mstp_instance_count 1\
-mstp_instance_vlan_list {1,3}\
-mstp_instance_num_list 2]
keylget RStatus reg_handle mstpRegionHdl
keylget RStatus msti_handle mstiHdlList
The following example modifies an existing MSTP region:
set returnKlist [::sth::emulation_mstp_region_config -handle $ mstpRegionHdl \
-mode modify\
-mstp_instance_count 2 \
-mstp_instance_vlan_list {1-2 3-5}\
#### HLTAPI for Python ####
The following example creates and configures a new MSTP region:
device_ret0mstp = sth.emulation_mstp_region_config (
mode = 'create',
port_handle = port_handle[0],
mstp_instance_count = '1',
mstp_version_num = '1',
mstp_instance_num_list= '1',
mstp_instance_vlan_list= '1',
mstp_region_name = ['Region','1']);
#### HLTAPI for Perl ####
The following example creates and configures a new MSTP region:
my %device_ret0mstp = sth::emulation_mstp_region_config (
mode => 'create',
port_handle => "$hport[1]",
mstp_instance_count => '1',
mstp_version_num => '1',
mstp_instance_num_list=> '1',
mstp_instance_vlan_list=> '1',
mstp_region_name => 'Region 1 ');
Note
- The instance_num_list and instance_vlan_list should contain the same number of elements. The VLANs will map to the MSTI instance number. The VLAN list should be comma delimited in each element.
- At least one CIST and one MSTI must be configured on each port. Ports on the same CCPU must be configured in the same MSTP region.
End of Procedure Header
sth::emulation_msti_config¶
Purpose¶
Modifies the default MSTIs that are created when the function sth::emulation_mstp_region_config is called.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_msti_config [-port_handle <port_handle>] [-handle <MSTI handle>] [-mstp_region_name] [-msti_instance_num] [-msti_bridge_priority <0-65535>] [-msti_port_priority <0-255>] [-msti_root_bridge_type {custom| self}] [-msti_region_root_priority <0-65535>] [-msti_region_root_mac_address <aa:bb:cc:dd:ee:ff>] [-msti_region_root_path_cost <0-200000000>] [-msti_remaining_hops <1-255>]
Arguments¶
-
-port_handle
¶
Specifies the port on which to modify the MSTIs.
-
-handle
¶
Identifies the handle on which to modify the MSTI configuration. If this parameter is called, there is no need to use -port_handle, -mstp_region_name and -msti_instance_num.
-
-mstp_region_name
¶
Identifies the region to modify MSTI instance configurations.
-
-msti_instance_num
¶
Specifies the number of MSTIs for which to modify configurations. The default value is 1.
-
-msti_bridge_priority
¶
Specifies the priority of the bridge in the MSTI. It must be a multiple of 4096. Possible values range from 0 to 65535. The default value is 32768.
-
-msti_port_priority
¶
Specifies the priority of the port in the MSTI. It must be a multiple of 16. Possible values range from 0 to 255. The default value is 128.
-
-msti_root_bridge_type
¶
Specifies the type of the initial root bridge in the MSTI. Possible values are:
self - Current bridge is the root bridge. custom - Identify a different bridge as the root bridge.
The default value is self.
-
-msti_region_root_priority
¶
Specifies the bridge priority of the root bridge in the region for this MSTI. It must be a multiple of 4096. Possible values range from 0 to 65535. The default value is 32768. This argument is available when msti_root_bridge_type is set to custom.
-
-msti_region_root_mac_address
¶
Specifies the MAC address of the MSTI. The default value is 00:00:10:00:10:00. This argument is available when msti_root_bridge_type is set to custom.
-
-msti_region_root_path_cost
¶
Specifies the cost to reach the root bridge in the MSTI. Possible values range from 0 to 200000000. The default value is 0. This argument is available when - msti_root_bridge_type set to custom.
-
-msti_remaining_hops
¶
Specifies the remaining hops in the MSTI instance. Possible values range from 1 to 255. The default value is 16. This argument is available when msti_root_bridge_type set to custom.
Arguments Unsupported by Save as HLTAPI¶
None
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
handles A list of handles that identify the MSTIs modified by the
``sth::emulation_msti_config`` function.
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_msti_config modifies the default MSTI(s) created in the MSTP regions on the specified port. You must specify one or more MSTP regions when you call this function.
To modify an existing MSTI, you can either specify the MSTI handle and MSTI-related arguments, or specify -port_handle, -mstp_region_name, -msti_instance_num and other related arguments (without specifying -handle).
Examples¶
#### HLTAPI for Tcl ####
The following example modifies the default MSTI configuration:
# A port with handle hltport1 must already exist.
sth::emulation_msti_config -port_handle $hltport1\
-mstp_region_name reg1\
-msti_instance_num 1\
-msti_bridge_priority 4096\
-msti_port_priority 16\
#### HLTAPI for Python ####
The following example modifies the default MSTI configuration created by function sth.emulation_mstp_region_config:
device_ret0msti = sth.emulation_msti_config (
port_handle = port_handle[0],
msti_region_root_mac_address= '00:00:10:00:10:00',
msti_region_root_priority= '32768',
msti_instance_num = '1',
msti_root_bridge_type= 'self',
msti_port_priority = '128',
msti_bridge_priority= '32768',
msti_remaining_hops = '16',
msti_region_root_path_cost= '0');
#### HLTAPI for Perl ####
The following example modifies the default MSTI configuration created by function sth::emulation_mstp_region_config:
my %device_ret0msti = sth::emulation_msti_config (
port_handle => "$hport[1]",
msti_region_root_mac_address=> '00:00:10:00:10:00',
msti_region_root_priority=> '32768',
msti_instance_num => '1',
msti_root_bridge_type=> 'self',
msti_port_priority => '128',
msti_bridge_priority=> '32768',
msti_remaining_hops => '16',
msti_region_root_path_cost=> '0');
End of Procedure Header
sth::emulation_stp_control¶
Purpose¶
Starts or stops the STP device on the specified port, or initializes a topology change.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_stp_control [-action {start|stop|init_topo_change} M] [-port_handle <port handle>] [-handle <device handle>] [-type {bridge_port|cist| msti}]
Arguments¶
-
-action
¶
Specifies the action(s) to be performed on the STP message. This argument is Mandatory . Possible values are:
start - Starts the configured STP device/topology on the specified port. stop - Stops the configured STP device/topology on the specified port. init_topo_change - Initiates the topology change and sends the Topology Change Notification (TCN) BPDU. The Topology Change Notification (TCN) provides a means to notify all bridges on a network of a topology change, and then limit the network down time associated with forwarding table updates.
-
-port_handle
¶
Identifies the port handle on which to perform the action.
-
-handle
¶
Identifies the STP device handle on which to perform the action.
-
-type
¶
The type of the emulated STP message for which to perform the action. Possible values are bridge_port, cist and msti. The default value is bridge_port.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
status Success (1) or failure (0) of the operation.
log An error message (if the operation failed).
Description¶
The sth::emulation_stp_control
function starts or stops the emulated STP
device/topology on the specified port. You can also use this function to
initiate the topology change and send the TCN BPDU .
Examples¶
#### HLTAPI for Tcl ####
The following example starts the STP device:
sth::emulation_stp_control -mode start -handle $stpDeviceHandle
The following example stops the STP router on the specified port:
sth::emulation_stp_control -mode stop -handle $stpDeviceHandle -type msti
Sample Output:
{handle router1} {status 1}
#### HLTAPI for Python ####
The following example starts the STP device:
ctrl_ret1 = sth.emulation_stp_control (
handle = device_list,
action = 'start');
Sample Output::
{'status': '1'}
#### HLTAPI for Perl ####
The following example starts the STP device:
my %ctrl_ret1 = sth::emulation_stp_control (
handle => "$device_list",
action => 'start');
Sample Output:
$VAR1 = 'status';
$VAR2 = '1';
sth::emulation_stp_stats¶
Purpose¶
Retrieves information on results on the specified port or STP handle.
Synopsis¶
Note
M indicates that the argument is Mandatory .
sth::emulation_stp_stats [-port_handle <port handle>] [-handle <STP device handle>] [-mode {both|stp| msti}]
Arguments¶
-
-port_handle
¶
Specifies the port for which you want information.
-
-handle
¶
Identifies the STP device handle from which to retrieve statistics. It is returned from the sth::emulation_stp_config function.
-
-mode
¶
Specifies the kind of information you want to see. Possible values are:
stp - Returns STP statistics msti - Returns MSTI statistics both - Returns both
Note
MSTI statistics are only available when you specify the STP type to mstp.
Return Values¶
Depending on the specific language that HLTAPI uses, the function returns a keyed list/dictionary/hash (See Introduction for more information on return value formats) using the following keys (with corresponding data):
port_id
Port ID
bridge_id
Bridge ID
root_id
Root bridge ID
designated_bridge_id
Designated bridge ID
tx_bpdus
Number of BPDUs transmitted
rx_bpdus
Number of BPDUs received
tx_bpdu_flag
Last transmitted BPDU flag value
rx_bpdu_flag
Last received BPDU flag value
tx_tc_bit_set
Number of topology change bit sets transmitted
rx_tc_bit_set
Number of topology change bit sets received
tx_tc_ack
Number of topology change acknowledgements transmitted
rx_tc_ack
Number of topology change acknowledgements received
tx_proposals
Number of BPDUs transmitted with proposal bit set
(RSTP only)
rx_proposals
Number of BPDUs received with proposal bit set
(RSTP only)
tx_tc_agree
Number of topology change agreements transmitted
rx_tc_agree
Number of topology change agreements received
tx_port_role
Transmit port role
rx_port_role
Receive port role
tx_port_state
Transmit port state
rx_port_state
Receive port state
regional_root_id
Regional root ID (MSTP only)
tx_tcns
Number of TCN messages transmitted
rx_tcns
Number of TCN messages received
vlan_id
STP bridge port starting VLAN ID
instance_num
Instance number of the MSTI (MSTP only)
Description¶
The sth::emulation_stp_stats
function provides information about both STP and
MSTI (when STP type is MSTP)
This function returns the requested data (STP or MSTI information or both) and a status value (1 for success). If there is an error, the function returns the status value (0) and an error message. Function return values are formatted as a keyed list (supported by the Tcl extension software - TclX). Use the TclX function keylget to retrieve data from the keyed list. (See Return Values for a description of each key.)
Examples¶
#### HLTAPI for Tcl #####
Sample Input:
::sth::emulation_stp_stats -mode all \
-handle $stpDeviceHandle]
Sample Output:
{stp {{host3 {{tx_tc_ack 0} {root_id 10-00-00-00-00-00-00-01} {regional_root_id
10-00-00-00-00-00-00-01} {tx_port_role {Designated Port}} {rx_tcns 0}
{port_id 0x1002} {tx_tcns 0} {instance_num 0} {vlan_id NA} {rx_bpdu_flag 0x78}
{rx_port_state Forwarding} {rx_bpdus 82} {tx_bpdu_flag 0x7e} {tx_port_state
Forwarding} {designated_bridge_id 20-00-00-00-10-00-00-00} {rx_tc_bit_set 6}
{bridge_id 20-00-00-00-10-00-00-00} {tx_bpdus 44} {rx_tc_agree 82}
{tx_tc_bit_set 5} {rx_proposals 2} {tx_tc_agree 44} {tx_proposals 44}
{rx_tc_ack 0} {rx_port_role {Root Port}}}} {host4 {{tx_tc_ack 0}
{root_id 10-00-00-00-00-00-00-01} {regional_root_id 10-00-00-00-00-00-00-01}
{tx_port_role {Root Port}} {rx_tcns 0} {port_id 0x4003} {tx_tcns 0}
{instance_num 0} {vlan_id NA} {rx_bpdu_flag 0x7e} {rx_port_state Forwarding}
{rx_bpdus 44} {tx_bpdu_flag 0x78} {tx_port_state Forwarding}
{designated_bridge_id 20-00-00-00-10-00-00-00} {rx_tc_bit_set 5}
{bridge_id 10-00-00-00-11-00-00-00} {tx_bpdus 82} {rx_tc_agree 44}
{tx_tc_bit_set 6} {Designated Port}}}}}} {msti {{host3 {{bridgeportresults2
{{tx_tc_ack 0} {root_id NA} {regional_root_id 80-00-00-00-10-00-00-00}
{tx_port_role {Designated Port}} {rx_tcns 0} {port_id 0x8002} {tx_tcns 0}
{instance_num 2} {vlan_id NA} {rx_bpdu_flag 0x78} {rx_port_state Forwarding}
{rx_bpdus 19} {tx_bpdu_flag 0x7e} {tx_port_state Forwarding}
{designated_bridge_id 80-00-00-00-10-00-00-00} {rx_tc_bit_set 3}
{bridge_id 80-00-00-00-10-00-00-00} {tx_bpdus 10} {rx_tc_agree 19}
{tx_tc_bit_set 2} {rx_proposals 1} {tx_tc_agree 10} {tx_proposals 10}
{rx_tc_ack 0} {rx_port_role {Root Port}}}} {bridgeportresults3 {{tx_tc_ack 0}
{root_id NA} {regional_root_id 10-00-00-00-11-00-00-00} {tx_port_role {Root
Port}} {rx_tcns 0} {port_id 0x8002} {tx_tcns 0} {instance_num 5} {vlan_id NA}
{rx_bpdu_flag 0x7c} {rx_port_state Forwarding} {rx_bpdus 19} {tx_bpdu_flag 0x78}
{tx_port_state Forwarding} 80-00-00-00-10-00-00-00} {tx_bpdus 10} {rx_tc_agree
19} {tx_tc_bit_set 2} {rx_proposals 1} {tx_tc_agree 10} {tx_proposals 0}
{rx_tc_ack 0} {rx_port_role {Designated Port}}}}}} {host4 {{bridgeportresults5
{{tx_tc_ack 0} {root_id NA} {regional_root_id 80-00-00-00-10-00-00-00}
{tx_port_role {Root Port}} {rx_tcns 0} {port_id 0x8003} {tx_tcns 0}
{instance_num 2} {vlan_id NA} {rx_bpdu_flag 0x7e} Forwarding}
{designated_bridge_id 80-00-00-00-10-00-00-00} {rx_tc_bit_set 2}
{bridge_id 80-00-00-00-11-00-00-00} {tx_bpdus 19} {rx_tc_agree 10}
{tx_tc_bit_set 3} {rx_proposals 10} {tx_tc_agree 19} {tx_proposals 1}
{rx_tc_ack 0} {rx_port_role {Designated Port}}}} {bridgeportresults6 {{tx_tc_ack 0}
{root_id NA} {regional_root_id 10-00-00-00-11-00-00-00} {tx_port_role
{Designated Port}} {rx_tcns 0} {port_id 0x4003} {tx_tcns 0} {instance_num 5}
{vlan_id NA} {rx_bpdu_flag 0x78} {rx_port_state Forwarding} {rx_bpdus 10}
{tx_bpdu_flag 0x7c} {tx_port_state Forwarding}
{designated_bridge_id 80-00-00-00-11-00-00-00} {rx_tc_bit_set 2}
{bridge_id 80-00-00-00-11-00-00-00} {tx_bpdus 19} {rx_tc_agree 10} {tx_tc_bit_set 3}
{rx_proposals 0} {tx_tc_agree 19} {tx_proposals 1} {rx_tc_ack 0} {rx_port_role
{Root Port}}}}}}}} {status 1}
#### HLTAPI for Python ####
Sample Input:
$device = "$device_ret0{handle}[0]";
my %results_ret1 = sth::emulation_stp_stats (
handle => "$device",
mode => 'both');
Sample Output:
{'status': '1', 'stp': {'host3': {'tx_tc_ack': '0', 'rx_tc_agree': '0',
'tx_port_role': 'NONE', 'tx_tc_agree': '0', 'root_id': 'NA', 'instance_num': '0',
'tx_bpdu_flag': '0x00', 'rx_tcns': '0', 'rx_port_state': 'NONE',
'regional_root_id': 'NA', 'rx_port_role': 'NONE', 'port_id': '0x8001',
'vlan_id': 'NA', 'tx_tc_bit_set': '0', 'tx_proposals': '0',
'designated_bridge_id': '00-00-00-00-00-00-00-00', 'rx_bpdus': '0',
'tx_port_state': 'NONE', 'rx_bpdu_flag': '0x00',
'bridge_id': '80-00-00-00-10-00-10-00', 'tx_tcns': '0', 'rx_proposals': '0',
'rx_tc_bit_set': '0', 'tx_bpdus': '0', 'rx_tc_ack': '0'}}}
#### HLTAPI for Perl ####
Sample Input:
$device = "$device_ret0{handle}[0]";
my %results_ret1 = sth::emulation_stp_stats (
handle => "$device",
mode => 'both');
Sample Output:
$VAR1 = 'stp';
$VAR2 = {
'host3' => {
'rx_tc_bit_set' => '0',
'root_id' => 'NA',
'instance_num' => '0',
'port_id' => '0x8001',
'tx_tc_ack' => '0',
'tx_bpdu_flag' => '0x00',
'rx_proposals' => '0',
'tx_port_role' => 'NONE',
'rx_bpdu_flag' => '0x00',
'rx_port_role' => 'NONE',
'designated_bridge_id' => '00-00-00-00-00-00-00-00',
'rx_tcns' => '0',
'tx_bpdus' => '0',
'rx_port_state' => 'NONE',
'tx_tc_bit_set' => '0',
'rx_bpdus' => '0',
'regional_root_id' => 'NA',
'rx_tc_agree' => '0',
'tx_tcns' => '0',
'tx_port_state' => 'NONE',
'tx_tc_agree' => '0',
'vlan_id' => 'NA',
'bridge_id' => '80-00-00-00-10-00-10-00',
'rx_tc_ack' => '0',
'tx_proposals' => '0'
}
};
$VAR3 = 'status';
$VAR4 = '1';
End of Procedure Header