当前位置:网站首页>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)后自动恢复.
边栏推荐
- [kali-information collection] (1.9) Metasploit + search engine tool Shodan
- pyqt5连接MYSQL数据库问题
- [kali-information collection] (1.8) ARP reconnaissance tool _Netdiscover
- 【Acunetix-Forgot your password】
- Crack detection technology based on deep learning
- 7种最常用数据分析思维,解决95%的分析难题
- JSP中include指令的功能简介说明
- 【云驻共创】数据工坊平台,0代码开发数据处理业务“快”人一步
- Problem solving in the process of using mosquitto
- Speed up your programs with bitwise operations
猜你喜欢
随机推荐
When not to use () instead of Void in Swift
您应该知道的 Google Sheets 使用技巧
Likou 977-Squaring of ordered arrays - brute force method & double pointer method
Do you really understand the business process service BPass?
中原银行实时风控体系建设实践
SQL function TRIM
手撸架构,Redis面试41问
Taurus.MVC V3.0.3 微服务开源框架发布:让.NET 架构在大并发的演进过程更简单。
Thymeleaf
Technology sharing | Description of the electronic fence function in the integrated dispatching system
JVM简介
企业级数据治理工作怎么开展?Datahub这样做
学习经验分享之七:YOLOv5代码中文注释
【MySQL系列】- LIKE查询 以%开头一定会让索引失效吗
Chapter 14 Manually create a REST service (2)
Swift中什么时候不能用 () 代替 Void 来使用
【kali-信息收集】(1.8)ARP侦查工具_Netdiscover
npm run dev 和 npm run serve区别
力扣209-长度最小的字符串——滑动窗口法
numpy&pands 中的unique