当前位置:网站首页>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)后自动恢复.
边栏推荐
猜你喜欢
CCF paper conference IEEE how to query all articles of a conference journal
太厉害了,终于有人能把TCP/IP 协议讲的明明白白了
#夏日挑战赛#【FFH】OpenHarmony设备开发基础(三)编译依赖
干测试这些年,去过阿里也去过小公司,给年轻测试员们一个忠告...
看我如何用多线程,帮助运营小姐姐解决数据校对系统变慢!
Thymeleaf
When not to use () instead of Void in Swift
【kali-信息收集】(1.9)Metasploit+搜索引擎工具Shodan
MD5详解(校验文件完整性)
面积曲线AUC(area under curve)
随机推荐
第十四章 手动创建 REST 服务(二)
项目监控六大事项
After Effects 教程,如何在 After Effects 中对蒙版进行动画绘制?
[kali-information collection] (1.8) ARP reconnaissance tool _Netdiscover
Create a devops CI/CD process using the kubesphere GUI
SQL function TRIM
基于深度学习的裂缝检测技术
细学常用类,集合类,IO流
npm install报错npm ERR Could not resolve dependency npm ERR peer
力扣58-左旋转字符串
主流跨端技术一览
DTG-SSOD:最新半监督检测框架,Dense Teacher(附论文下载)
simulink PID自动整定
Drools(8): WorkBench uses
商业流程服务BPass你真的了解吗?
雷克萨斯,锁死的安全,挡不住的心寒
Taurus.MVC V3.0.3 微服务开源框架发布:让.NET 架构在大并发的演进过程更简单。
ABAP-OOAVL template program
云原生(三十) | Kubernetes篇之应用商店-Helm介绍
SQL函数 TRIM