当前位置:网站首页>Spanning tree protocol summary
Spanning tree protocol summary
2022-06-10 00:46:00 【xnasda】
Spanning tree protocol :
Enterprise network three-tier architecture —》 redundancy ----》 Line redundancy —》 Second floor bridging loop
Cause problems :
1、 Broadcast storm
2、 MAC The address table scrolls — On a switch , The same MAC Addresses can only map unique interfaces ; But the same interface can map multiple different MAC Address ;
3、 Duplicate copies of the same data frame
4、 above 3 Two conditions eventually lead to the overload of the equipment , Causes restart protection
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 ;
There are algorithms : 802.1D PVST PVST+(CISCO) RSTP(802.1w) MSTP(802.1S)
One 、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 ; All non root bridges 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 aging time of the table is modified to 15s( default , Forwarding delay )
The election — Root bridge Root port Designated port Non specified port ( Blocking port )
【1】 Root bridge – In a spanning tree instance , There is only one switch for root;
BPDU Medium Bridge ID To decide
Bridge ID= Bridge priority (0-65535 public ) Default 32768 + MAC Address ( Only exist svi The switch with the interface has mac Address , If there are multiple mac The selected value is the smallest )
The election of the root bridge Compare priorities first , Xiaoyou ; If the priority is the same , Compare mac, The value is small and excellent ;
【2】 Root port — On every non root bridge , There is and only one interface ; The local interface closest to the root bridge ( The shortest 、 Star type ), Receive from the root bridge BPDU, Forward user traffic ( The interface is not blocked )
The rules :
1、 Compare after sending from root bridge , Minimum when entering through this interface cost value ;
2、 Entry direction cost Same value , Compare the end-to-end equipment of the interface BID, Xiaoyou
3、 Opposite end BID Also the same , Compare the interfaces of the end-to-end devices PID; First, the priority is small , If the priorities are consistent , Small number
4、 Connected to opposite end PID Also the same , More local PID, Xiaoyou ;
PID= port ID Interface priority (0-240, step 16, Default 128) Interface number
【3】 Designated port , In every segment there is STP On the physical link of , There is and only one ; Forward from the root bridge BPDU, At the same time, it can forward user traffic ( Don't block ); By default, all interfaces on the root bridge are the specified ports ;
1、 Compare after sending from root bridge , When entering this link through this interface cost Minimum value ( Go out )
2、 If out to cost Same value , Must be local BID, Xiaoyou ;
3、 Local BID identical , More local PID;
4、 Local PID, identical , Block the port directly ;
【4】 Non specified port ( Blocking port ) When all the above roles are elected , The remaining interfaces without any roles are unspecified ;
The interface logic is blocked , You can actually receive information , But don't forward ;
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
In the generation protocol , At least the root bridge should interfere with the convergence layer ;
Interface status :
down: No, BPDU Send and receive , Once you can BPDU The transceiver enters the next state
Listen : mandatory 15s; All switches perform BPDU Send and receive , Vote for all the characters ; The role of the interface is to enter the blocking state directly without the specified port ;
If the specified port and root port enter the next state ;
Study : mandatory 15s; Specify the port and root port to learn all the interfaces connected to the device MAC Address , Generate MAC surface ; Then enter the next state
state ;
forward : Refers to the entry of the end port and the root port , Can forward user message ;
Blocking : Logical blocking ;
notes : Only after the interface enters the forwarding state , To forward data messages for users , Previous 30s No data can be forwarded ;
Convergence time :
Initial convergence —30s = 15 Listen +15s Study
Structural changes :
Direct connection detection exists : There is a local blocking port , If other ports are disconnected , The blocking port immediately enters 15 It's listening ( The election ); If the result is
Enable , Then it will go back to 15s Study — total 30s
No direct connection detection : There are no blocking ports locally , If a port is disconnected , Will send suboptimal BPDU( Take the local as the root ) Switch to other neighbors , Other switches ignore this data , Conduct 20s hold time timing , At that time, block the interface to enter 15s Listen ,15s Study = total 50s
802.1D shortcoming :
1、 Slow convergence
2、 Low link utilization
802.1 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
Two 、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 in priority ;
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 )
3、 ... and 、PVST + stay PVST The basis of , compatible 802.1q Of trunk encapsulation ; And some acceleration ;
Port acceleration ( Enter the layer to connect the user interface ) Uplink acceleration - For direct connection detection Backbone acceleration — For suboptimal BPDU
shortcoming :1、 Slow convergence ( Incomplete acceleration ) 2、 There are many trees ( only cisco There are separate chips , Friends can't load )
Four 、 Fast spanning tree
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 allowed 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
5、 ... and 、MSTP/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 group
[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
https://blog.csdn.net/xieyunc/article/details/82785340
边栏推荐
- Composition and configuration of Beidou clock synchronization system in power system
- [vscode] the problem that the vscode SFTP plug-in cannot be used after upgrading to version 1.59
- Minimum toll
- BGP协议实验
- 试题 历届真题 完全二叉树的权值【第十届】【省赛】【B组】
- js 逻辑空分配双问号语法 、双竖杠语法 与 可选链语法
- 最低通行费
- If function selection when determining whether it is empty
- BGP实验
- if判斷是否為空時的函數選擇
猜你喜欢

go配置文件管理-viper
力扣 旋转字符串 C语言 题解

rip實驗

Conversion between radiance and apparent reflectance

Go zero micro Service Practice Series (II. Service splitting)

Masao Kudo: how to publish 5 SCI articles a year

Mind map - 3. SQL injection vulnerability

Benders decompositon学习笔记记录

Typera basic use and change the theme style of typera

Syntaxe des points d'interrogation doubles, syntaxe des barres verticales doubles et syntaxe des chaînes optionnelles pour l'attribution logique de l'espace JS
随机推荐
试题 历届真题 成绩分析【第十一届】【省赛】【B组】
浅谈Cookie 和 Session——含案例及详细注解
1049大盗阿福
BGP协议实验
How WPS merges cells with different sizes
Binary search (half search) summary
flutter pub get failed (66; Could not find a file named “pubspec.yaml“
C language solution of the longest substring of Li Kou without repeated characters
if判斷是否為空時的函數選擇
ps标尺调精确位置在哪
FlinkSQL 之乱序问题
Rhcsa premier jour
1049 robber Ah Fu
Deep and shallow copy of mat data
pycharm 2022永久激活版下载,亲测有效
Rhcsa day 3
Apply the latest ad and Txk patches
界面控件DevExpress WinForms——全新的WXI皮肤抢“鲜”看
Niuke.com: median in data flow
Analysis on the scores of previous real questions [11th] [provincial competition] [group B]