当前位置:网站首页>STP spanning tree protocol Foundation
STP spanning tree protocol Foundation
2022-06-24 22:34:00 【Zhuge iron and steel cloud】
1、 Spanning tree technology background
Switch single line uplink , There is a single point of failure , Neither uplink nor equipment has redundancy , Once the link or uplink equipment fails , Business will be interrupted . To make the network more robust 、 More redundancy , Modify the topology as shown in the following figure . The access layer switch is connected to two convergence devices through dual links , Constitute a layer-2 environment with physical link redundancy , It solves the problem of single link and single equipment failure .
But it also brings a big problem , There is a loop in the layer-2 physical environment .
The harm of the second floor loop is serious , It may lead to a broadcast storm 、 Multi frame copy 、MAC Address drift and so on . Even if the loop is not caused by building a redundant physical environment , The network may also have a fault caused by the layer-2 loop for various reasons , So is there any way to solve the loop problem ? Make trees (Spanning-tree) The protocol is used to solve this problem .
2、 Problems caused by the loop – Broadcast storm
• If there is a layer 2 loop in the network , Once the broadcast data frame appears , These data frames will be continuously flooded by the switch , So as to cause broadcast storm in the network .
• The broadcast storm is very harmful to the network , It will seriously consume equipment resources and network bandwidth , Eventually, the network will be paralyzed , It is a problem that needs special attention .
1.PC Send data frame to Server;
2.SW3 Of MAC There is no matching purpose in the address table MAC Table items of , So the data frame is flooded ;
3.SW1 And SW2 Will receive this data frame and learn the source MAC, At the same time, the data frame is further flooded ;SW1 And SW2 The data frame is received from another interface , therefore MAC The table has changed again , So back and forth .
3、Spanning-tree Basic concepts of
• By deploying the spanning tree in the switched network (Spanning-tree) technology , It can prevent layer 2 loops in the network .STP After operation , If there is a loop in the network , that STP Through blocking (Block) Specific interfaces to break the loop , And when the network topology changes, it converges in time , To ensure the redundancy of the network .
4、Spanning-tree Basic concepts of ( When the network fails )
When the topology changes , The spanning tree protocol can detect these changes , And automatically adjust the interface status in time , So as to adapt to the changes of network topology , Achieve link redundancy .
5、 Spanning tree protocol
5.1 stp Election rules
1. Each switching network elects a root bridge (Root Bridge);
2. Select a root port on each non root bridge (Root Port);
3. Each segment elects a specified port (Designated Port);
4. Blocking non specified ports (NonDesignated Port).
5.2 BPDU message
•STP Your normal work depends on BPDU Message flooding (Bridge Protocol Data Unit, Bridge protocol data unit ) .
STP Network devices are required to exchange messages with each other to detect bridging loops , This message is called the bridge protocol data unit BPDU.STP The reason why it can work well and build a loopless network , It depends on BPDU Message flooding , And according to the calculation results of relevant fields in the message . To understand STP Working process of , It is very important to understand BPDU The meaning of each field in , Because these are STP The foundation of work .
5.3 To configure BPDU Important parameters in
Comparison order :Root Identifier > Root Path Cost> Bridge Identifier>Port Identifier
The smaller the value, the higher the priority
5.4 Bridge ID
• Bridge ID(Bridge ID) It's a switch STP Identifier , altogether 8 Bytes , from 2 Priority of bytes and 6 Bytes of MAC Address structure :
• The bridge priority defaults to 32768, It can be modified by hand .
•MAC The address is the backplane of the switch MAC.
• In the network Bridge ID The smallest switch will be the root bridge .
5.5 Path Cost
• The path cost is a port quantity , yes STP/RSTP The protocol is used to select the reference value of the link .
• The default value and value range of port path cost are determined by the selected path cost algorithm , The path overhead is inversely proportional to the bandwidth of the port .
• The path cost calculation standard supported by Huawei network devices :802.1d-1998、802.1t、legacy etc. .
5.6 Port ID
• port ID (2 byte )= Port priority (1 byte )+ Port number (1 byte )
• Default priority 128, Range 0-255, The smaller the better .
6. The election process
The following is an example to illustrate :
As you can see from the above figure , After running the spanning tree algorithm ,S4 Select block F0/0,S5 Select block F0/2, You should see the non root bridge forwarding BPDU The choice made after
6.1 Not forwarded by the root bridge BPDU:
In the traditional spanning tree, only the root bridge can generate configuration BPDU, The non root bridge is only generated by the forwarding root bridge BPDU. Imagine just forwarding the root bridge BPDU, incorrect BPDU Make any changes , Just like forwarding regular data frames . In this case S4 and S5 How to judge the blocked port , Why should I block my port . This leads to the key points —— Not forwarded by the root bridge BPDU.
It can be seen that the non root bridge forwards the root bridge BPDU The following changes have been made :
1. Root path overhead
2. Sender bridge ID
3. Port identification
Decompose in three steps S4 and S5 The process of blocking ports .
l First step :S2 and S3 What you see BPDU:
S2 and S3 After seeing the message , self-discovering MAC Address is inferior to others , He gave up running for the root bridge , I have to choose the root port , As long as no smaller BID, Then I will quickly determine the root port , The root path cost in the message determines S2 and S3 Root port of .
The second step :S4 What you see BPDU:
When S4 notice BPDU Later I found myself and genbashi ID Than , Not as good as others , Then I have to decide the root port ,S2 Tell me to S1 The cost of 19,S3 Tell me to S1 The cost is also 19, Of course, the choice is S2 That way ,S3 This road can only be blocked .
bridge ID To determine the S4 Root port of , The path cost determines the blocking port
The third step :S5 What you see BPDU:
When S5 See... In the picture BPDU After that, I didn't have any ideas ,MAC The address is much larger than that of Gen bridge , I have to choose the root port .S5 Of F0/3 and F0/2 received S4 It's from BPDU The only difference in the message is the port ID, Then there is only comparison port ID 了 , Which port receives the port ID Large blocks the port .
port ID To determine the S5 Root port of , The path cost determines the blocking port .
7、STP Port status of
8、 Fault handling
But the line is out of order , The disconnected port is activated , Resume communication , Play the role of backup line
The switch needs to wait for startup 30 Seconds to start forwarding data
When a link in use is broken , Blocked ports require 50 Seconds to start forwarding data
All right. , This is it. STP The basics of the agreement , As for deeper knowledge , After that, I'll feel it slowly ~
————————————————
Copyright notice : This paper is about CSDN Blogger 「 The spring river and the bright moon 」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/qq_18649781/article/details/85616517
Spanning tree foundation
https://www.cnblogs.com/yinzhengjie/p/6696676.html
https://blog.csdn.net/qq_18649781/article/details/85616517
边栏推荐
- AQS source code analysis
- 【软件工程】期末重点
- 为什么有的程序员能力一般却能拿到好offer?
- Process communication mode
- How to compare two or more distributions: a summary of methods from visualization to statistical testing
- 零代码即可将数据可视化应用到企业管理中
- Description of transparent transmission function before master and slave of kt6368a Bluetooth chip, 2.4G frequency hopping automatic connection
- 字符串习题总结2
- CA Zhouji - the first lesson in 2022 rust
- 问题求解——嵌套列表
猜你喜欢
socket(1)
Heavyweight! Fada is listed as a "specialized and new" enterprise
零代码即可将数据可视化应用到企业管理中
Find the maximum value in each tree row [extension of one of the hierarchical traversals]
中国SSD行业企业势力全景图
The ktp900f mobile download program of the fail safe mobile panel prompts that the download cannot be performed, and the target device is running or not in the transmission mode
EasyBypass
Servlet details
Servlet详解
CA Zhouji - the first lesson in 2022 rust
随机推荐
Heavyweight! Fada is listed as a "specialized and new" enterprise
软件设计的七大原则
NiO, bio, AIO
Huada 04A operating mode / low power consumption mode
无心剑汉英双语诗003. 《书海》
零代码即可将数据可视化应用到企业管理中
嵌入式开发:技巧和窍门——干净地从引导加载程序跳转到应用程序代码
Filtered data analysis
New features of go1.18: efficient replication, new clone API for strings and bytes standard library
Genesis public chain and a group of encryption investors in the United States gathered in consensus 2022
树莓派初步使用
Cache control of HTTP
Pinduoduo updates the merchant live broadcast service agreement and strictly punishes the illegal merchants
In the era of full programming, should I give up this road?
如何比较两个或多个分布:从可视化到统计检验的方法总结
String exercise summary 2
ansible基本配置
YGG 近期游戏合作伙伴一览
In the era of industrial Internet, there is no Internet in the traditional sense
Structure du disque