当前位置:网站首页>1.3 Rapid Spanning Tree Protocol RSTP
1.3 Rapid Spanning Tree Protocol RSTP
2022-08-02 12:08:00 【& #36153;】
前面我们了解到,STPThe convergence rate is very slow.需要调节STP计时器参数.但是STPThe problem of slow default convergence time causes when the network topology changes,Too long waiting time seriously affects business efficiency.快速生成树协议(Rapid Spanning Tree Protocol,RSTP)The convergence time of the network is shortened,RSTPThe fastest convergence rate can be shortened to 1s之内,The connectivity of the network can be quickly restored when the topology changes.
RSTP在STP的基础上增加了2种端口角色:替代端口(Alternate)、备份端口(Backup),RSTP中共有4种端口角色:根端口、指定端口、替代端口、备份端口.
下图所示,交换机S1为根桥,对于交换机S3而言,There are two ports connected to the network, S3的G0/0/1到达根桥的RPCRoot path overhead is less,So this port is the root port of the device,其G0/0/2The port is due to receive the switchS2所发送的BPDU网桥协议数据单元,and through the switchS3After the calculation decides to block,becomes an alternate port for this port.
在交换机S3上执行 display stp brief 命令
[S3]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 ROOT FORWARDING NONE
0 GigabitEthernet0/0/2 ALTE DISCARDING NONE
可以看到G0/0/2The port role of the interface is ALTE 即表示 Alternate(替代端口)
1、RSTP的端口状态:
STP定义了5种端口状态,而RSTPsimplifies port status in ,将STP的禁用、Blocking and listening states are simplified to discard(Discarding)状态、学习状态(Learning)、转发状态(Forwarding).
(1)Ports do not forward user traffic,也不学习MAC地址,Then the port is in the discard state.
(2)Ports do not forward user traffic,但是学习MAC地址,Then the port is the learning state.
(3)Ports are forwarding traffic,也学习MAC地址,Then the port is in forwarding state.
2、边缘端口:
运行了STP的交换机,Its port is after initial startup,会进入阻塞状态.If the port is elected as the root port or designated port,Then it needs to go through the listening and learning state,最终进入转发状态.It is necessary for the ports on the switch that are connected to the switched network to go through the above process,After all, the port is at risk of creating a loop.但是,当用户PCAfter connecting to the switch, you want to be able to connect to the network immediately,而不是等待STP的收敛.毕竟PCOr the risk of a server being connected to the switch causing a loop is very low.
在 RSTP中,The ports of the switch can be configured as edge ports(Edge Port),Edge ports do not participate in spanning tree calculations by default,When the edge port is activated,It can immediately switch to the forwarding state and start sending and receiving business traffic,Activation or deactivation of edge ports does not triggerRSTP拓扑变更.实际项目中,Ports connecting end devices are usually configured as edge ports. 下面进行实验;将交换机SW2connected to threePC的端口配置为边缘端口.
[SW2]interface ethernet 0/0/1
[SW2-Ethernet0/0/1]stp edged-port enable
[SW2]interface ethernet 0/0/2
[SW2-Ethernet0/0/2]stp edged-port enable
[SW2]interface ethernet 0/0/3
[SW2-Ethernet0/0/3]stp edged-port enable
3、BPDU保护:
Edge ports may be misconnected to switching devices,Once the switching device is connected to the edge port,A loop hazard will be introduced.When the edge port is connected to a switching device,并且收到了BPDU,The port immediately becomes a normal spanning tree port,In the process is thrown in the networkRSTP重计算.在华为交换机上,可以通过激活BPDU保护(BPDU Protection)function to solve the above problem.When the switch activates this function,如果边缘端口收到BPDU,The switch will immediately shut down the port(即置为Error-Down),Also trigger a warning.Executed in the switch system view stp bpdu-protection Can be activated on all edge portsBPDU保护功能.
[SW2]stp bpdu-protection
查看交换机的RSTP状态
[SW2]display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/2 DESI FORWARDING BPDU
0 GigabitEthernet0/0/3 DESI FORWARDING BPDU
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
可以看到G0/0/1、G0/0/2、G0/0/3All ports are configured as edge ports,These ports will be activatedBPDU保护功能(Protection 列显示为BPDU),而G0/0/24Not an edge port,不会激活BPDU保护功能.
We now put the switchSW2的G0/0/3The interface is connected to a switch,看看会发生什么变化.
查看RSTP的端口状态
<SW2>display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING BPDU
0 GigabitEthernet0/0/2 DESI FORWARDING BPDU
0 GigabitEthernet0/0/24 DESI FORWARDING NONE
可以看到SW2并没有显示G0/0/3的端口状态,This is because of the switchSW2激活了BPDU保护功能后,如果边缘端口收到BPDU,The switch will immediately shut down the port.使用命令 display curr 命令显示当前配置.可以看到交换机SW2的G0/0/3为 shutdown 关闭状态.
interface GigabitEthernet0/0/1
stp edged-port enable
#
interface GigabitEthernet0/0/2
stp edged-port enable
#
interface GigabitEthernet0/0/3
shutdown
stp edged-port enable
If the edge port is due to receiveBPDU而关闭,By default, it will not be automatically restored,It can be executed manually in the interface view undo shutdown command to restore the port.
It can also be executed in system view [SW2]error-down auto-recover cause bpdu-protection interval 30 The command configures the port auto-recovery function.interval The time specified by the keyword(30~86400s)后自动恢复.
边栏推荐
- 解决anaconda下载pytorch速度极慢的方法
- 运行yum报错Error: Cannot retrieve metalink for reposit
- DTG-SSOD:最新半监督检测框架,Dense Teacher(附论文下载)
- Metaverse "Drummer" Unity: Crazy expansion, suspense still exists
- 8大软件供应链攻击事件概述
- 网站自动翻译-网站批量自动翻译-网站免费翻译导出
- LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之一
- 数据湖(一):数据湖概念
- Create a devops CI/CD process using the kubesphere GUI
- go源码之sync.Waitgroup
猜你喜欢
npm run dev 和 npm run serve区别
翻译英语的软件-免费翻译软件-各种语言互相翻译
7种最常用数据分析思维,解决95%的分析难题
用位运算为你的程序加速
基于threejs的商品VR展示平台的设计与实现思路
DTG-SSOD: The latest semi-supervised detection framework, Dense Teacher (with paper download)
使用mosquitto过程中的问题解决
Crack detection technology based on deep learning
自己如何做小程序呢?
[email protected] This version of tar is no longer supported, and will not receive"/>
npm WARN deprecated [email protected] This version of tar is no longer supported, and will not receive
随机推荐
基于深度学习的裂缝检测技术
喜迎八一 《社会企业开展应聘文职人员培训规范》团体标准出版发行会暨橄榄枝大课堂上线发布会在北京举行
npm install报错npm ERR Could not resolve dependency npm ERR peer
手撸架构,网络 面试36问
Failure Analysis | A SELECT statement crashes MySQL, what happened?
Problem solving in the process of using mosquitto
使用mosquitto过程中的问题解决
npm run dev 和 npm run serve区别
QListView的使用
网站自动翻译-网站批量自动翻译-网站免费翻译导出
npm WARN deprecated [email protected] This version of tar is no longer supported, and will not receive
MySQL主从复制几个重要的启动选项
受邀出席Rust开发者大会|Rust如何助力量化高频交易?
Create an application operation process using the kubesphere GUI
numpy&pands 中的unique
【云驻共创】数据工坊平台,0代码开发数据处理业务“快”人一步
Lexicon 27 - Remove Elements - Simple Questions
如何在 UE4 中制作一扇自动开启的大门
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之一
阿苹的思考