当前位置:网站首页>STP summary
STP summary
2022-06-23 05:12:00 【Empty and white】
One 、 Spanning tree protocol
STP The role of ; Solve the problem of using layer-2 network to bridge the loop when the line is redundant
1、 Broadcast storm
2、MAC The address table scrolls — MAC The refresh time of the address in the switch is 5min, One interface can correspond to multiple interfaces MAC; But on the same switch MAC Address can only correspond to one interface ;
3、 Duplicate copies of the same data frame
Spanning tree protocol : In a layer 2 switching network , The blocking part of logic interfaces ;
When the best path fails , Automatically dredge some interfaces to realize link backup ;
Make trees : In a layer 2 switching network , Generate a tree structure , The blocking part of logic interfaces , So that there is only one path from root to all nodes ;
When the best path fails , Automatic opening of partially blocked ports , To realize the function of line backup ;
The spanning tree is in the process of generation , We should try to generate a star structure , And the shortest path tree ;
Two 、 Classification of spanning tree
1、802.1D
There is only one spanning tree instance in a switching network ;
Switch to switch BPDU— Bridge protocol data unit – Data sent and received through communication and interaction between switches 
To configure BPDU— Only the root bridge can send , In the initial state of the switching network , All switches define local as root bridge , Conduct BPDU Sending of ; So that all switches in the network receive BPDU, And then compare based on the parameters in the data , Elect the root bridge ; After that, all non root bridges will no longer send BPDU, It's just receiving and forwarding the root bridge BPDU; cycle 2s send out ,hold time 20s;
TCN— Topology change message ( It's also BPDU): After local switch link failure ,STP Converge again , In order to quickly refresh all switches in the whole network MAC surface , Will be distributed to all local STP Interface send TCN( In the tag bit TCN Location 1), Neighbor exchange received TCN after , First mark it with ACK Bit for reply , For reliable transmission of messages ; After the TCN Forward level by level to the root bridge , Reply by root bridge TC Message to all switches ; Make all switches temporarily MAC The change time of the table is changed to 15s( default , Forwarding delay )
The election — Root bridge Root port Designated port Non specified port ( Blocking port )
【2】 The election
1、 Root bridge : In each spanning tree instance , There is and only one switch as the root bridge ; Responsible for sending BPDU, Calculate and direct the convergence of the whole tree ; As the root of the tree , The central node of the switching network ;
contrast BPDU Bridge in ID; Bridge ID= Bridge priority + MAC Address ( Local backplane pool )
When the switch is used as a bridge device , Pay attention to... In the data frame sent by the terminal device MAC Address ; But there is no local switch MAC;
Need to run STP Protocol switches , It must be carried out by the manufacturer when leaving the factory MAC Writing - Stored in the backplane address pool of the switch
If the switched backplane address pool MAC Addresses are multiple , The address with the lowest value will be selected for election
Compare the bridge priority first (0-65535, Default 32768), Xiaoyou ; If the priorities are consistent , Compare MAC Address , The value is small and excellent ;
2、 Root port : There is only one interface on each non root bridge ; The local interface closest to the root bridge , Used to receive messages from the root bridge BPDU, At the same time, forward the data frame of the terminal ;
1) Compare the messages sent from the root bridge , After that, it is the smallest when entering through this interface cost value ;
2) If the direction is cost identical , Compare the performance of the equipment at the opposite end of the interface BID, Xiaoyou
3) If the end-to-end equipment BID identical , Then compare the of the peer interface PID; Xiaoyou
4) If the end-to-end equipment PID identical , Then compare the local PID, Xiaoyou
PID= port ID = Interface priority (0-240, Default 128 Xiaoyou )+ Interface number Compare priorities first , Xiaoyou ; If the priority is the same, compare the interface number , The value is small and excellent
3、 Designated port : Run in each section STP There is only one interface on the physical link ; Forward from the root bridge BPDU, At the same time, forward the data frame of the terminal ; All interfaces on the root bridge are specified ports ; The opposite end of the root port must be the specified port ;
1) Compare and forward messages from the root bridge BPDU yes , The minimum of the item cost value
2) If out to cost Same value , More local BID, Xiaoyou
3) If local BID identical , More local PID, Xiaoyou
4) If local PID identical , This port will be blocked directly
4、 Non specified port : After all the above roles are elected , The roles of the remaining interfaces ; The interface is blocked ;
Interface blocking is logical , It's not that the interface is closed ; The interface is in a state where data can be received , But no forwarding status ;
【3】 Interface status
Down : Enter the next state after all interfaces are powered on
Listen : Switch transceiver BPDU, Choose all the characters ; Root port 、 Designated port 15s Backward learning state ; Unspecified port entry blocking
Study : Learn the source in the data frame sent by the terminal device mac Address , Generate the MAC surface (CAM surface );15s Backward forwarding status
forward : Root port 、 The specified port can start forwarding the data frame of the terminal
Blocking : Logical blocking , Can't send BPDU , You can receive BPDU , Unable to send and receive data
【4】802.1D The convergence time of :
1、 Initial convergence 30s 15s Listen +15s Study
2、 Structural changes
1) Direct connection detection exists – There is only one local blocking port that can receive messages from the root bridge BPDU; need 30s convergence
2) No direct connection detection — 20s hold time wait for +30s convergence =50s
802.1D Disadvantages of the algorithm :
1、 Slow convergence
2、 Low link utilization – The backup link is normal and does not forward data
notes : In practical engineering ,STP As long as the normal operation will generate a acyclic network structure ; But the role is not in a good position , May lead to network inefficiency ; At least the position of the root bridge should be ensured to be The aggregation layer in the three-tier architecture ; Connect at the switch AP when , We should guarantee AP The interface is not blocked by other physical interfaces ;
cost value : Different bandwidth Different exist cost
802.1d standard : 802.1T standard
10M = 100 1000M= 20000
100M=19 100M=200000
1000M=4
10000M=2
=>100000M=1
[SWA]stp pathcost-standard ? By default, Huawei uses 802.1t standard
dot1d-1998 IEEE 802.1D-1998
dot1t IEEE 802.1T
legacy Legacy
802.1D Configuration command :
[sw1]stp mode stp It is amended as follows 802.1d Algorithm , At present, Huawei defaults to MSTP;
[sw1]stp priority 4096 Modify bridge priority
[sw1-GigabitEthernet0/0/1]stp cost ? Modify interface cost value
INTEGER<1-200000000> Port path cost
[sw1-GigabitEthernet0/0/1]stp port priority ? Modify interface priority
INTEGER<0-240> Port priority, in steps of 16
2、PVST/PVST+(CISCO)
PVST be based on VLAN Spanning tree protocol It's still in use 802.1D The operation rules of ;
The difference lies in , One VLAN There is a tree in the ;
PVST cisco private be based on vlan Spanning tree protocol
At every vlan Inside , There is a tree , The working principle of each tree is the same as 802.1d Agreement ; Different vlan Of BPDU The difference is that the bridge is excellent
First class ;
priority =4096 Multiple +vlan id You can only modify 4096 Multiple backup , And can only be modified to 4096 Integral multiple of
Support only trunk The trunk road is packaged as ISL(cisco Private encapsulation )
PVST + stay PVST The basis of , compatible 802.1q Of trunk encapsulation ; And some acceleration ;
Port acceleration ( The access layer connects the user's interface ) Uplink acceleration - For direct connection detection ( Only the access layer equipment can be configured )
Backbone acceleration — For suboptimal BPDU Leftover 20s Of hold time All switches can be configured
shortcoming :1、 Slow convergence ( Incomplete acceleration ) 2、 There are many trees ( only cisco There are separate chips , Friends can't load )
3、RSTP(CISCO) /802.1W( public )
cisco Of RSTP — be based on vlan Fast spanning trees - One vlan A tree pvst+ The upgrade
public RSTP(802.1w) — The whole switching network is a tree 802.1d The upgrade
The principle of speed :
1、 Canceled the timer , It's when a state is done , Go straight to the next state ;
2、 Segmented synchronization , Step by step convergence between two devices ; Use request and consent tags ; It depends on the second 1 And the 6 position
3、BPDU My life is 6s;hello time 2s;
4、 Speed up the port ( Edge interface )、 Uplink acceleration 、 Backbone accelerated integration
5、 compatible 802.1d and PVST, but 802.1d and PVST The second of the tag bits is not used 1-6 position , So it can't converge quickly ; So if there is a device in the network that doesn't support fast convergence , Then other devices that enable fast convergence can't be fast ;
When tcn When the message appears , There's no need to wait for the root bridge to BPDU, You can refresh the local cam surface ;
Bear in mind : The interface defaults to half duplex , Even if it works RSTP, Still based on slow 802.1D Algorithm to converge ;
[sw1]stp mode rstp
Edge interface — Used to connect to PC The interface of , Once set to edge interface ; There will be no more BPDU Sending of , And don't do it STP Convergence of , Direct forwarding status ; But if the interface receives a peer request BPDU, Will lose edge properties , Normal convergence again ;
[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]stp edged-port enable
[sw1]stp priority ? Modify bridge priority
INTEGER<0-61440> Bridge priority, in steps of 4096
[sw1]stp root ? Quickly define the root bridge role
primary Primary root switch
secondary Secondary root switch
[sw1-GigabitEthernet0/0/1]stp port priority ? Modify interface priority
INTEGER<0-240> Port priority, in steps of 16
[sw1-GigabitEthernet0/0/1]stp cost ? Modify interface cost
INTEGER<1-200000000> Port path cost
4、MST=802.1S Huawei devices use this protocol by default
It inherits the basis of fast spanning tree ; Will be multiple vlan Put in a group , A spanning tree based on each group ;
Differences between different groups BPDU The priority = 4096 Multiple + Group number
[r1]stp mode mstp
Group exists by default 0, And all vlan It is in this group by default ; priority = 32768+0
grouping
[sw1]stp enable
[sw1]stp region-configuration
[sw1-mst-region]region-name a All equipment shall be in one domain
[sw1-mst-region]instance 1 vlan 1 to 5
[sw1-mst-region]instance 2 vlan 6 to 10
[sw1-mst-region]active region-configuration Activate the current configuration ( The command must be configured )
Bear in mind : If a group will be created , But in this group vlan, No... Was created on this switch , At the same time, there is no for this vlan Service Interface ; The group will have no information ; The packet information of all devices in the whole switching network must be completely consistent ;
Define local as group 1 The taproot of , Group 2 The backup root of
stp instance 1 root primary Change the priority to 0
stp instance 2 root secondary Change the priority to 4096
[sw1]stp instance 1 priority ?
INTEGER<0-61440> Bridge priority, in steps of 4096
[sw1]interface GigabitEthernet 0/0/1
[sw1-GigabitEthernet0/0/1]stp instance 1 cost ?
INTEGER<1-200000000> Port path cost
[sw1-GigabitEthernet0/0/1]stp instance 1 port priority ?
INTEGER<0-240> Port priority, in steps of 16
边栏推荐
猜你喜欢

Wechat applet example development: run

MVC three-tier architecture

Separate use of alertmanager alarms and use of Prometheus configuration alarm rules

微信小程序:星际旅行飞船乘坐票制作生成

Thesis reading_ Relation extraction_ CASREL

DO280OpenShift命令及故障排查--常见故障排除和章节实验

Hard core, become a high-quality tester: learn to communicate with products

dolphinscheduler 1.2.1 数据迁移到 dolphinscheduler 2.0.5方法及迁移后数据测试记录

Course design C for freshmen -- clothing management system

JSP entry notes
随机推荐
微信小程序:微信也可以发闪照了闪照制作生成微信小程序源码下载,自定义闪照时间
怎样利用数据讲一个精彩故事?
使用PX4的ECL进行多传感器数据融合的后处理
经济发展由新技术推动着来
go学习记录二(Window)
物体结构图,快速图解物体内部结构
Course design C for freshmen -- clothing management system
UI自动化定位利器-xpath实战
MySQL存储过程
UI automation positioning edge -xpath actual combat
硬核,成为高素质测试人员:学会和产品沟通需求
工作5-8年的外包测试员,平均年薪有多少?
传统意义上的互联网式的平台或将不复存在,一个融合的产业特质和互联网特质的全新产业
微信小程序:未来老婆查询生成器
I have been engaged in software testing for 5 years and have changed jobs for 3 times. I have understood the field of software testing
图片降噪DeNoise AI
prometheus、influxdb2.2安装及flume_export下载编译使用
Cookie session explanation
BGP实验
rtklib2.4.3 b34 单点定位的一个bug