当前位置:网站首页>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)后自动恢复.
边栏推荐
猜你喜欢
随机推荐
用位运算为你的程序加速
三种实现分布式锁的方式
jvmxmx和xms参数分析(设定优化校准)
npm run serve启动报错npm ERR Missing script “serve“
JSP中include指令的功能简介说明
手撸架构,Redis面试41问
基于深度学习的裂缝检测技术
An example of type3 voltage loop compensator taking Boost as an example
使用kubesphere图形界面创建一个应用操作流程
#夏日挑战赛#【FFH】OpenHarmony设备开发基础(三)编译依赖
Crack detection technology based on deep learning
Chapter 14 Manually create a REST service (2)
【kali-信息收集】(1.8)ARP侦查工具_Netdiscover
7种最常用数据分析思维,解决95%的分析难题
太厉害了,终于有人能把TCP/IP 协议讲的明明白白了
Metaverse "Drummer" Unity: Crazy expansion, suspense still exists
使用mosquitto过程中的问题解决
免费文档翻译-免费批量文档翻译软件推荐
使用kubesphere图形界面创建一个devops的CI/CD流程
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之一









