5.6 spanning tree - ebook.konfigurasi.net filerev 3.20 mellanox technologies 500 mellanox...
TRANSCRIPT
Rev 3.20
Mellanox Technologies 500
Mellanox Technologies Confidential
5.6 Spanning Tree
The operation of Rapid Spanning Tree Protocol (RSTP) provides for rapid recovery of connectiv-ity following the failure of a bridge/bridge port or a LAN. The RSTP component avoids this delay by calculating an alternate root port, and immediately switching over to the alternate port if the root port becomes unavailable. Thus, using RSTP, the switch immediately brings the alternate port to forwarding state, without the delays caused by the listening and learning states. The RSTP component conforms to IEEE standard 802.1D 2004.
RSTP enhancements is a set of functions added to increase the volume of RSTP in Mellanox switches. It adds a set of capabilities related to the behavior of ports in different segments of the network. For example: the required behavior of a port connected to a non-switch entity, such as host, is to converge quickly, while the required behavior of a port connected to a switch entity is to converge based on the RSTP parameters.
Additionally, it adds security issues on a port and switch basis, allowing the operator to deter-mine the state and role of a port or the entire switch should an abnormal event occur. For exam-ple: If a port is configured to be root-guard, the operator will not allow it to become a root-port under any circumstances, regardless of any BPDU that will have been received on the port.
5.6.1 Port Priority and Cost
When two ports on a switch are part of a loop, the STP port priority and port path cost configura-tion determine which port on the switch is put in the forwarding state and which port is put in the blocking state.
To configure port priority use the following command:
switch (config interface etherent <inf>)# spanning-tree port-priority <0-240>
To configure port path cost use the following command:
switch (config interface etherent <inf>)# spanning-tree cost <1-200000000>
5.6.2 Port Type
Port type has the following configuration options:
• edge – is not assumed to be converged by the RSTP learning/forwarding mechanism. It converges to forwarding quickly.
• normal – is assumed to be connected to a switch, thus it tries to be converged by the RSTP learning/forwarding. However, if it does not receive any BPDUs, it is operation-ally moved to be edge.
• network – is assumed to be connected to a switch. If it does not receive any BPDUs, it is moved to discarding state.
Each of these configuration options is mutually exclusive.
Port type is configured using the command spanning-tree port type. It may be applied globally on the switch (Config) level, which configures all switch interfaces. Another option is to configure ports individually by entering the interface’s configuration mode.
It is recommended to configure the port type for all ports connected to hosts as edge ports.
Rev 3.20
Mellanox Technologies 501
Mellanox Technologies Confidential
• Global configuration:
switch (config)# spanning-tree port type {edge , normal , network} default
• Interface configuration:
switch (config interface etherent <inf>)# spanning-tree port type {edge , normal, net-work}
5.6.3 BPDU Filter
Using BPDU filter prevents the CPU from sending/receiving BPDUs on specific ports.
BPDU filtering is configured per interface. When configured, the port does not send any BPDUs and drops all BPDUs that it receives. To configure BPDU filter, use the following command:
switch (config interface etherent <inf>)# spanning-tree bpdufilter {enable , disable}
5.6.4 Loop Guard
Loop guard is a feature that prevents loops in the network.
When a blocking port in a redundant topology transitions to the forwarding state (accidentally), an STP loop occurs. This happens when BPDUs are no longer received by one of the ports in a physically redundant topology.
Loop guard is useful in switched networks where devices are connected point-to-point. A desig-nated bridge cannot disappear unless it sends an inferior BPDU or brings the link down on a point-to-point connection.
If loop guard is enabled and the port does not receive BPDUs, the port is put into an inconsistent state (blocking) until the port starts to receive BPDUs again. A port in the inconsistent state does not transmit BPDUs. If BPDUs are received again, loop guard alters its inconsistent state condi-tion. STP converges to a stable topology without the failed link or bridge after loop guard isolates the failure.
Disabling loop guard moves all loop-inconsistent ports to listening state.
To configure loop guard use the following command:
switch (config interface etherent <inf>)# spanning-tree guard loop
5.6.5 Root Guard
Configuring root guard on a port prevents that port from becoming a root port. A port put in root-inconsistent (blocked) state if an STP convergence is triggered by a BPDU that makes that port a root port. The port is unblocked after the port stops sending BPDUs.
Configuring BPDU filtering on a port connected to a switch can cause bridging loops because the port filters any BPDU it receives and goes to forwarding state.
The loop guard configuration is only allowed on “network” port type.
Rev 3.20
Mellanox Technologies 502
Mellanox Technologies Confidential
To configure loop guard use the following command:
switch (config interface etherent <inf>)# spanning-tree guard root
5.6.6 MSTP
Spanning Tree Protocol (STP) is a mandatory protocol to run on L2 Ethernet networks to elimi-nate network loops and the resulting broadcast storm caused by these loops. Multiple STP (MSTP) enables the virtualization of the L2 domain into several VLANs, each governed by a separate instance of a spanning tree which results in a network with higher utilization of physical links while still keeping the loop free topology on a logical level.
Up to 64 MSTP instances can be defined in the switch. Up to 64 VLANs can be mapped to a sin-gle MSTP instance. MSTP instance 0 (the default instance) may have all possible VLANs (1-4094) mapped to it.
For MSTP network design over Mellanox L2 VMS, please refer to Mellanox Virtual Modular Switch Reference Guide.
Rev 3.20
Mellanox Technologies 503
Mellanox Technologies Confidential
5.6.7 Commands
Globally enables the spanning tree feature.The no form disables the spanning tree feature.
N/A
Spanning tree is enabled.
Config
3.1.0000
admin
switch (config) # no spanning-treeswitch (config) #
show spanning-tree
spanning-tree
spanning-tree no spanning-tree
Syntax Description
Default
Configuration Mode
History
Role
Example
Related Commands
Note
Rev 3.20
Mellanox Technologies 504
Mellanox Technologies Confidential
spanning-tree (timers)
spanning-tree [forward-time <time in secs> | hello-time <time in secs> | max-age <time in secs>]no spanning-tree [forward-time | hello-time | max-age]
Sets the spanning tree timers.The no form of the command sets the timer to default.
Syntax Description forward-time Controls how fast a port changes its spanning tree state from Blocking state to Forwarding state. Parameter range: 4-30 seconds.
hello-time Determines how often the switch broadcasts its hello message to other switches when it is the root of the spanning tree.Parameter range: 1-2 seconds.
max-age Sets the maximum age allowed for the Spanning Tree Protocol information learnt from the network on any port before it is discarded.Parameter range: 6-40 seconds.
Default forward-time: 15 secondshello-time:2 secondsmax-age: 20 seconds
Configuration Mode Config
History 3.1.0000
Role admin
Example switch (config) # spanning-tree forward-timeswitch (config) #
Related Commands show spanning-tree
Note The following formula applies on the spanning tree timers:2*(ForwardTime -1)>=MaxAgeTime >= 2*(Hello Time + 1)
Rev 3.20
Mellanox Technologies 505
Mellanox Technologies Confidential
spanning-tree port type (default global)
spanning-tree port type <port-type> defaultno spanning-tree port type default
Configures all switch interfaces as edge/network/normal ports. These ports can be connected to any type of device.The no form of the command disables the spanning tree operation.
Syntax Description port-type • Edge - Assumes all ports are connected to hosts/servers. • Network - Assumes all ports are connected to
switches and bridges.• Normal - the port type (Edge or Network) deter-
mines according to the spanning tree operational mode.
Default Normal
Configuration Mode Config
History 3.1.0000
Role admin
Example switch (config) # spanning-tree port type edge defaultswitch (config) #
Related Commands show spanning-tree
Note
Rev 3.20
Mellanox Technologies 506
Mellanox Technologies Confidential
spanning-tree priority
spanning-tree priority <bridge-priority>no spanning-tree priority
Sets the spanning tree bridge priority.The no form of the command sets the bridge priority to default.
Syntax Description bridge-priority Sets the bridge priority for the spanning tree. Its value must be in steps of 4096, starting from 0. Only the fol-lowing values are applicable: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, 57344, 61440.
Default 32786
Configuration Mode Config
History 3.1.0000
Role admin
Example switch (config) # spanning-tree priority 4096switch (config) #
Related Commands show spanning-tree
Note
Rev 3.20
Mellanox Technologies 507
Mellanox Technologies Confidential
spanning-tree port-priority
spanning-tree port-priority <priority>no spanning-tree port-priority
Configures the spanning-tree interface priority.The no form of the command returns configuration to its default.
Syntax Description priority Spanning tree interface priority. The possible values are: 0, 16, 32,48, 64, 80, 96, 112, 128,144, 160, 176, 192, 208, 224, 240.
Default 128
Configuration Mode Config Interface EthernetConfig Interface Port ChannelConfig Interface MLAG Port Channel
History 3.1.0000
3.3.4500 Added MLAG port-channel configuration mode
Role admin
Example switch (config) # interface ethernet 1/1switch (config interface ethernet 1/1) # spanning-tree port-priority 16switch (config interface ethernet 1/1) #
Related Commands show spanning-tree
Note
Rev 3.20
Mellanox Technologies 508
Mellanox Technologies Confidential
spanning-tree cost
spanning-tree cost <port cost> no spanning-tree cost
Configures the interface cost of the spanning tree.The no form of the command returns configuration to its default.
Syntax Description port cost Sets the spanning tree cost of an interface. Value range is 0-200000000.
Default The default cost is derived from the speed.1Gbps 2000010Gbps 200040Gbps 50056Gbps 357
Configuration Mode Config Interface EthernetConfig Interface Port ChannelConfig Interface MLAG Port Channel
History 3.1.0000
3.3.4500 Added MLAG port-channel configuration mode
Role admin
Example switch (config) # interface ethernet 1/1switch (config interface ethernet 1/1) # spanning-tree cost 1000switch (config interface ethernet 1/1) #
Related Commands show spanning-tree
Note • LAG default cost is calculated by dividing the port speed by the number of active links in UP state. For example: if there were 4 links in the LAG out of which only two are in UP state, assuming the port speed is 10Gbps, the LAG cost will be 2000/2 = 1000.
• When configuring the cost for a LAG, the cost will be fixed to this configuration, no matter what the number of active links (UIP state) in the LAG is
• Unstable network may cause the LAG cost to change dynamically assuming the cost parameter is not configured for anything else other than default
Rev 3.20
Mellanox Technologies 509
Mellanox Technologies Confidential
spanning-tree port type
spanning-tree port type <port type>no spanning-tree port type
Configures spanning-tree port typeThe no form of the command returns configuration to default.
Syntax Description port type Sets the spanning-tree port type. The port type parame-ter has four options:• Default (globally defined)• Edge• Normal• NetworkIn case there is no change of this parameter, the config-uration will be taken from the global default port type.
Default Globally defined by the command “spanning-tree port type <port-type> default”
Configuration Mode Config Interface EthernetConfig Interface Port ChannelConfig Interface MLAG Port Channel
History 3.1.0000
3.3.4500 Added MLAG port-channel configuration mode
Role admin
Example switch (config) # interface ethernet 1/1switch (config interface ethernet 1/1) # spanning-tree port type edgeswitch (config interface ethernet 1/1) #
Related Commands show spanning-tree
Note
Rev 3.20
Mellanox Technologies 510
Mellanox Technologies Confidential
spanning-tree guard
spanning-tree guard {loop | root} no spanning-tree guard {loop | root}
Configures spanning-tree guard.The no form of the command returns configuration to default.
Syntax Description loop Enables loop-guard on the interface.If the loop-guard is enabled, upon a situation where the interface fails to receive BPDUs the switch will not egress data traffic on this interface.
root Enables root-guard on the interface.If root-guard is enabled on the interface, the interface will never be selected as root port.
Default loop-guard and loop-guard are disabled.
Configuration Mode Config Interface EthernetConfig Interface Port ChannelConfig Interface MLAG Port Channel
History 3.1.0000
3.3.4500 Added MLAG port-channel configuration mode
Role admin
Example switch (config) # interface ethernet 1/1switch (config interface ethernet 1/1) # spanning-tree guard rootswitch (config interface ethernet 1/1) #
Related Commands show spanning-tree
Note
Rev 3.20
Mellanox Technologies 511
Mellanox Technologies Confidential
spanning-tree bpdufilter
spanning tree bpdufilter {disable | enable} no spanning tree bpdufilter
Configures spanning-tree BPDU filter on the interface. The interface will ignore any BPDU that it receives and will not send PDBUs, The STP state on the port will move to the forwarding state.The no form of the command returns the configuration to default.
Syntax Description disable Disables the BPDU filter on this port.
enable Enables the BPDU filter on this port.
Default BPDU filter is disabled.
Configuration Mode Config Interface EthernetConfig Interface Port ChannelConfig Interface MLAG Port Channel
History 3.1.0000
Role admin
Example switch (config) # interface ethernet 1/1switch (config interface ethernet 1/1) # spanning-tree bpdufilter enableswitch (config interface ethernet 1/1) #
Related Commands show spanning-tree
Note This command can be used when the switch is connected to hosts.
Rev 3.20
Mellanox Technologies 512
Mellanox Technologies Confidential
clear spanning-tree counters
clear spanning-tree counters
Clears the spanning-tree counters.
Syntax Description N/A
Default N/A
Configuration Mode Config
History 3.1.0000
Role admin
Example switch (config) # clear panning-tree countersswitch (config) #
Related Commands show spanning tree
Note
Rev 3.20
Mellanox Technologies 513
Mellanox Technologies Confidential
show spanning-tree
show spanning-tree [detail | interface <type> <number>]
Displays spanning tree information.
Syntax Description detail Displays detailed spanning-tree configuration and sta-tistics.
interface <type> <num-ber>
Displays the running state for a specific interface.Options for “type”: ethernet or port-channel.Options for “number”: <slot/port> or <number>.
Default N/A
Configuration Mode Any Command Mode
History 3.1.0000
Role admin
Example switch (config) # show spanning-tree
Switch ethernet-default
Spanning tree protocol is enabled rstp
Spanning tree force version:2Root ID Priority 32768 Address 00:02:c9:5c:61:70 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32768 Address 00:02:c9:5c:61:70 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio Type---- ---- ----- ---- ---- ----switch (config) #
Related Commands clear spanning-tree countersspanning-tree
Note
Rev 3.20
Mellanox Technologies 514
Mellanox Technologies Confidential
spanning-tree mst max-hops
spanning-tree mst max-hops <max-hops>no spanning-tree mst max-hops
Specifies the max hop value inserts into BPDUs that sent out as the root bridge.The no form of the command sets the parameter to its default value.
Syntax Description max-hops Max hop value. The range is 6-40.
Default 20
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst max-hops 20switch (config)#
Related Commands
Note The max hop setting determines the number of bridges in an MST region that a BPDU can traverse before it is discarded.
Rev 3.20
Mellanox Technologies 515
Mellanox Technologies Confidential
spanning-tree mst priority
spanning-tree mst <mst-instance> priority <priority>no spanning-tree mst <mst-instance> priority
Configures the specified instance’s priority number.The no form of the command sets the parameter to its default value.
Syntax Description mst-instance MST instance. Range is 1-64.
priority MST instance port priority. Possible values are: 0, 4096, 8192, 12288, 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152,53248, 57344, 61440
Default 32768
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst 1 priority 32768switch (config)#
Related Commands
Note The bridge priority is the four most significant digits of the bridge ID, which is used by spanning tree algorithms to select the root bridge and choose among redundant links. Bridge ID numbers range from 0-65535 (16 bits); bridges with smaller bridge IDs are elected over other bridges.
Rev 3.20
Mellanox Technologies 516
Mellanox Technologies Confidential
spanning-tree mst vlan
spanning-tree mst <mst-instance> vlan <vlan-range>no spanning-tree mst <mst-instance> vlan <vlan-range>
Maps a VLAN or a range of VLANs into an MSTP instance.The no form of the command unmaps a VLAN or a range of VLANs from MSTP instances.
Syntax Description mst-instance MST instance. Range is 1-64.
vlan <vlan-range> A single VLAN or a a range of VLANs. The format is <vlan> or <from-vlan>-<to-vlan>.
Default N/A
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst 1 vlan 10-20switch (config)#
Related Commands
Note
Rev 3.20
Mellanox Technologies 517
Mellanox Technologies Confidential
spanning-tree mst revision
spanning-tree mst revision <number>no spanning-tree mst revision
Configures the MSTP revision number.The no form of the command sets the parameter to its default value.
Syntax Description number The MST revision number. Range is 0-65535.
Default 0
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst revision 1switch (config)#
Related Commands
Note The revision number is one of three parameters, along with the MST name and VLAN-to-instance map, that identify the switch’s MST region.
Rev 3.20
Mellanox Technologies 518
Mellanox Technologies Confidential
spanning-tree mst name
spanning-tree mst name <name>no spanning-tree mst name
Configures the MSTP name.The no form of the command sets the parameter to its default value.
Syntax Description name MST name: Up to 32 characters.
Default N/A
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst name my-mstswitch (config)#
Related Commands
Note The name is one of three parameters, along with the MST revision number and VLAN-to-instance map, that identifies the switch’s MST region.
Rev 3.20
Mellanox Technologies 519
Mellanox Technologies Confidential
spanning-tree mst root
spanning-tree mst <mst-instance> root <role>no spanning-tree mst <mst-instance> root
Changes the bridge priority for the specified MST instance to the following values:• Primary – 8192• Secondary – 16384The no form of the command sets the parameter to its default value.
Syntax Description mst-instance MSTP instance. Possible range is 1-64.
role Values: “primary” or “secondary”.
Default primary
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mst name my-mstswitch (config)#
Related Commands
Note The root command is a way to automate a system configuration while ‘playing’ with the priority field. The priority field granularity may be too explicit for some users in case you wish to have 2 levels of priority (primary and secondary). So by default all the switches get the same priority and while using the root option you can get the role of master and backup by setting the priority field to a predefined value.
Rev 3.20
Mellanox Technologies 520
Mellanox Technologies Confidential
spanning-tree mode
spanning-tree mode {rst | mst}no spanning-tree mode
Changes the spanning tree mode.The no form of the command sets the parameter to its default value.
Syntax Description mst Multiple spanning tree.
rst Rapid spanning tree.
Default rst
Configuration Mode Config
History 3.3.4150
Role admin
Example switch (config)# spanning-tree mode mstswitch (config)#
Related Commands
Note
Rev 3.20
Mellanox Technologies 521
Mellanox Technologies Confidential
spanning-tree mst port-priority
spanning-tree mst {mst-instance} port-priority <priority>no spanning-tree mode
Changes the spanning tree mode.The no form of the command sets the parameter to its default value.
Syntax Description mst-instance MST instance. Range is 1-64.
priority MST instance port priority. Valid values are: 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224 and 240.
Default rst
Configuration Mode Config Interface Port Channel
History 3.3.4150
Role admin
Example switch (config interface ethernet 1/1)# spanning-tree mst 1 port-priority 32768switch (config interface port-channel 1)# spanning-tree mst 1 port-priority 32768switch (config)#
Related Commands
Note
Rev 3.20
Mellanox Technologies 522
Mellanox Technologies Confidential
spanning-tree mst cost
spanning-tree mst {mst-instance} cost <cost-value>no spanning-tree mode
Configures the cost per MSTP instance.The no form of the command sets the parameter to its default value.
Syntax Description mst-instance MST instance. Range is 1-64.
cost-value MST instance port cost. Range is 0-200000000.
Default 2000 for 10Gb/s, 500 for 40Gb/s, 20000 for 1Gb/s, 357 for 56Gb/s
Configuration Mode Config Interface Port Channel
History 3.3.4150
Role admin
Example switch (config interface ethernet 1/1)# spanning-tree mst 1 cost 4000switch (config interface port-channel 1)# spanning-tree mst 1 cost 4000switch (config)#
Related Commands
Note
Rev 3.20
Mellanox Technologies 523
Mellanox Technologies Confidential
show spanning-tree
show spanning-tree [detail | interface {ethernet <slot>/<port> | port-channel <port-channel>} | mst [<instance> interface {ethernet <slot>/<port> | port-channel <port-channel>} | details | interface {ethernet <slot>/<port> | port-channel <port-channel>}] | root]
Displays spanning-tree information for a switch.
Syntax Description detail Displays detailed spanning-tree information on a switch.
interface {ethernet <slot>/<port> | port-channel <port-channel>}
Displays running state for the specified interface.
mst [<instance> interface {ethernet <slot>/<port> | port-channel <port-chan-nel>} | details | interface {ethernet <slot>/<port> | port-channel <port-chan-nel>}
Displays basic multi-spanning-tree information of a specific switch or a specific interface.
root Displays root multi-spanning-tree information of a spe-cific switch.
Default N/A
Configuration Mode Any Command Mode
History 3.3.4150
Role admin
Example switch (config) # show spanning-tree rootInstance Priority MAC addr Root Cost Hello Time Max Age FWD Dly Root Port------- ------ -------- --------- -------- -------- ------- --------MST0 32768 00:02:c9:71:ed:40 500 2 20 15 Eth1/20MST1 32768 00:02:c9:71:f0:c0 0 2 20 15 -MST2 0 00:02:c9:71:f0:c0 0 2 20 15 -MST3 32768 00:02:c9:71:f0:c0 0 2 20 15 -switch (config) #
Related Commands
Note