In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
STP spanning tree is a two-layer network optimization technology, the main function is to redundancy and prevent the generation of loops.
The role of STP:
V logically disconnect the link to prevent the occurrence of network storm.
V when the line fails, the blocking interface is activated and communication is resumed.
BID: bridge ID,BID= priority + MAC address, switch default priority is 32768.
PID: Port ID,PID= port priority + port number, the default priority of the port is 128.
STP's election algorithm:
V electing the root switch: the root switch is elected according to BID, and the smaller the value is, the root switch is.
V electing the root port (RP): according to the path cost to the root switch, the peer BID and the peer PID elect the root port. The lower the value, the root port.
V elect designated port (DP): according to the path cost to the root switch, the local BID and the local PID elect the designated port. The lower the value, the root port.
V all other interfaces are blocked.
100MB link cost is 19.
1000MB link cost is 4
10000MB link cost is 2.
10MB link cost is 100
16MB link cost is 62
The cost of 45MB link is 39
155MB link cost is 14
622MB link cost is 6
The STP spanning tree uses BPDU bridging data units to communicate.
Type of BPDU:
V configuration BPDU: for spanning tree calculation, updated every 2 seconds.
V Topology change Communication: it is sent only when there is a problem with the network, which is used to notify the network change.
STP interface status:
V blocking (Blocking): the default delay is 20s and only BPDU is received.
V snooping (Listening): the default delay is 15s, the interface is enabled, and the active topology is built.
V learning (Learning): the default delay is 15s to build the MAC address table.
V forwarding (Forwarding): send and receive user data
V disable (Disabled): the interface shuts down Shutdwon.
STP uses three timing methods to ensure the convergence of the network:
V Hello time: the default time is 2s.
V forwarding delay: the default is 30s.
V maximum aging time: the default is 20s.
The relationship between STP and VLAN:
V IEEE CST generic spanning tree: do not consider the existence of VLAN, only generate a single STP in the network.
V IEEE's MST multiple spanning tree: multiple VLAN share a tree.
V CISCO PVST per VLAN spanning tree: one STP per VLAN.
V CISCO's PVST+ adds each VLAN spanning tree: one STP per VLAN, which is compatible with CST spanning tree.
PVST+ spanning tree command for CISCO:
Command
Description
(config) # spanning-tree vlan 10
Enable the STP function of VLAN10
(config) # spanning-tree vlan 10 priority 4096
Configure VLAN10 with a STP priority of 4096
(config) # spanning-tree vlan 10 root primary
Configure STP of VLAN10 as the primary root
(config) # spanning-tree vlan 10 root secondary
Configure STP of VLAN10 as secondary root
(config) # spanning-tree vlan 10 cost 19
Configure STP port cost for VLAN10
(config) # spanning-tree vlan 10 port-priorty 128
Configure the STP port priority of VLAN10 to 128,
(config-if) # spanning-tree portfast
Configure the interface as a fast interface
# show spanning-tree
View spanning tree status
# show spanning-tree blockedports
View spanning tree blocking
# show spanning-tree vlan 10 detail
View spanning tree VLAN10 details
Note: the speed interface is generally used in the PC interface, which can turn off the convergence of STP and achieve rapid communication.
The primary root priority defaults to 8192, and the secondary root priority defaults to 16384.
MSTP spanning tree multiple VLAN can share a spanning tree.
MSTP spanning tree introduces the concept of domain, in which there can be multiple instances in a domain, and one instance can be understood as a tree.
Instance 0 is a special tree that starts by default whenever MST is started, and it maps all VLAN to this instance by default.
BPDU protection: when the switching device starts BPDU protection, if the edge port receives another spanning tree BPDU, the edge port will automatically Shutdown.
Root protection: due to malicious * * in the network, the root bridge receives a higher priority BPDU, and the root port does not forward the message, and returns to normal state when the priority is restored.
Huawei H3C MSTP multiple spanning tree command:
Command
Description
[huawei] stp region-configuration
MSTP domain configuration
[huawei-mst-region] region-name RG1
MSTP domain name is RG1
[huawei-mst-region] instance 1 vlan1 to 10
Add VLAN1 to VLAN10 to instance 1
[huawei-mst-region] active region-configuration
Start domain configuration
[huawei] stp instance 1 priority 0
Configure spanning tree instance 1 with a priority of 0
[huawei] stp pathcost-standard legacy
Configure the port cost as Huawei private computing method
[huawei-Ethernet0/0/1] bpdu enable
Turn on the interface BPDU switch
[huawei-Ethernet0/0/1] stp root-protection
Interface initiates root guard
[huawei-Ethernet0/0/1] stp edged-port enable
Configure an interface as an edge interface (fast interface)
[huawei] stp enable
Open spanning tree
Note: instance: the meaning of an example.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.