当前位置:网站首页>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
边栏推荐
- Technology Review: what is the evolution route of container technology? What imagination space is there in the future?
- Unable to use the bean introduced into the jar package
- 一个女孩子居然做了十年硬件。。。
- EasyBypass
- Extend your kubernetes API with aggregated apiserver
- 嵌入式开发:技巧和窍门——干净地从引导加载程序跳转到应用程序代码
- 【个人实验报告】
- How to solve the problem that the computer suddenly can't connect to WiFi
- Yyds dry goods inventory junit5 learning II: assumptions class
- Genesis公链与美国一众加密投资者齐聚Consensus 2022
猜你喜欢

电力系统| IEEE论文投稿流程

Docker installs redis-5.0.12. Detailed steps

FANUC机器人_KAREL编程入门学习(1)

How to extract dates from web pages?

How does flutter use the online transcoding tool to convert JSON to model

KT6368A蓝牙芯片的主从机之前透传功能说明,2.4G跳频自动连接

SAP interface debug setting external breakpoints

详细了解关于sentinel的实际应用

关于自动控制原理资料更新
CA Zhouji - the first lesson in 2022 rust
随机推荐
Docker 安装 MySQL 8.0,详细步骤
证件照处理
【个人实验报告】
一个女孩子居然做了十年硬件。。。
How to extract dates from web pages?
Resolving the conflict problem of the flutter Library
Cache control of HTTP
How to compare two or more distributions: a summary of methods from visualization to statistical testing
Yyds dry goods inventory junit5 learning II: assumptions class
揭秘B站,程序员穿女装敲代码,效率更高是真的吗?
A girl has been making hardware for ten years. 。。
Zero code can apply data visualization to enterprise management
堆内存分配的并发问题
Why can some programmers get good offers with average ability?
NIO、BIO、AIO
NIO 零拷贝
Servlet详解
2022-06-10 工作记录--JS-获取到某一日期N天后的日期
In the first year of L2, arbitrum nitro was upgraded to bring more compatible and efficient development experience
Short video mall system, how does scroll view adapt to the remaining height of the page