资源描述
Postfast\Uplinkfast\Backbonefast
portfast特性是思科在PVST中提出的快速收敛特性。
针对连接终端的端口,由于这些端口不会形成环路,配置了PortFast特性后,此端口直接从Blocking进入Forwarding状态(跳过Listening和Learning状态),收敛时间为0秒。
若未配置portfast特性,则这些连接终端的端口收敛时间为30秒(即2个转发延迟)
在RSTP中,借鉴思科的PortFast特性,引入边缘端口(egde-port)的概念。
在思科设备上,为了命令的一致性,因此还是沿用portfast的配置命令。
【配置】
方式1:全局启用portfast
SW(config)#spanning-tree portfast default
针对本交换机的所有Access端口都启用PortFast特性
int f0/1
spanning-tree portfast disable 关闭此端口的portfast特性
方式2:接口下启用portfast
SW(config)#int f0/1
SW(config-if)#switchport mode access
SW(config-if)#spanning-tree portfast
接口下启用portfast
SW(config)#int f0/1
SW(config-if)#switchport mode trunk
SW(config-if)#spanning-tree portfast trunk
若希望一个Trunk端口具备portfast特性,必须在接口下启用并明确带上trunk参数。
注:当此trunk端口连接到路由器时,可以启用portfast特性;但是交换机互连的trunk端口,若启用portfast特性可能造成交换环路。
【查看】
1)使用命令show spanning-tree int f0/1
Switch#show spanning-tree int f0/1
Vlan Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001 Desg FWD 19 128.1 P2p Edge
注:edge表示此端口启用了PortFast特性(在PVST中)或Edge-Port(在Rapid-PVST和MST中)
2)使用命令show spanning-tree int f0/1 detail
a)如果PortFast特性是在接口下使用spanning-tree portfast命令启用的,则显示如下:
Switch#show spanning-tree int f0/1 detail
Port 1 (FastEthernet0/1) of VLAN0001 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.1.
Designated root has priority 32769, address 000a.b71c.6c00
Designated bridge has priority 32769, address 000b.be3d.0980
Designated port id is 128.1, designated path cost 19
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
The port is in the portfast mode
Link type is point-to-point by default
BPDU: sent 1085, received 1
b)如果PortFast特性是在全局下使用spanning-tree portfast default命令启用的,则显示如下:
Switch#show spanning-tree int f0/1 detail
Port 1 (FastEthernet0/1) of VLAN0001 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.1.
Designated root has priority 32769, address 000a.b71c.6c00
Designated bridge has priority 32769, address 000b.be3d.0980
Designated port id is 128.1, designated path cost 19
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
The port is in the portfast mode by default
Link type is point-to-point by default
BPDU: sent 1085, received 1
c)如果该端口是Trunk端口,并且在接口下使用spanning-tree portfast trunk命令启用的,则显示如下:
Switch#show spanning-tree int f0/1 detail
Port 1 (FastEthernet0/1) of VLAN0001 is designated forwarding
Port path cost 19, Port priority 128, Port Identifier 128.1.
Designated root has priority 32769, address 000a.b71c.6c00
Designated bridge has priority 32769, address 000b.be3d.0980
Designated port id is 128.1, designated path cost 19
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
The port is in the portfast mode by portfast trunk configuration
Link type is point-to-point by default
BPDU: sent 1085, received 1
3)使用命令show spanning-tree summary
查看本交换机是否在全局启用PortFast特性。
Switch#show spanning-tree summary
Switch is in pvst mode
Root bridge for: none
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is disabled
BackboneFast is disabled
Configured Pathcost method used is short
4)使用命令show spanning-tree int f0/1 portfast
查看本端口是否具有PortFast特性。
SW#show spanning-tree int f0/1 portfast
VLAN0001 enabled
Uplinkfast
针对接入层交换机有多个上行链路,正常情况下一个上行端口为RP(根端口),处于forwarding状态;而其他的上行端口为AP(替换端口),处于blocking状态。
若开启uplinkfast,当此交换机旧的RP故障,它会从AP中选出最优的端口作为新的RP,并且此RP无需经过2个forward_delay,直接进入转发状态。
当生成树选出新的RP后,将从各个端口发出组播数据帧(每个组播数据帧的源MAC地址为此端口学习到的MAC地址)来刷新网络中其他交换机的MAC地址表;通过max-update-rate参数你可以控制这些组播流量(默认为每秒150个报文);如果你将该值设置为0,则不会发出上述的组播帧,那么网络中交换机MAC地址表必须要利用生成树的拓扑改变通知机制来快速老化,这样网络的收敛时间将变长。
注(原理如下):STP中交换机发现拓扑改变后,将从自己的根端口(RP)发出TCN BPDU,上游交换机收到后回复TCA进行确认,并且继续从RP端口发出,直到该消息送到根桥;根桥收到拓扑改变通知后,在接下来的Max_Age+Forward_Delay(默认为20+15=35秒)内发出的Configuration BPDU报文中会将TC比特位置为1,网络中的交换机收到TC比特为1的Configuration BPDU时,会将自己的MAC地址表的老化时间缩短为Forward_Delay(默认为15秒),其目的是保证在生成树收敛前,交换机MAC地址表中的旧条目能够老化掉(因为在拓扑变化后这些条目可能是错误的)。
UplinkFast主要应用在接入层交换机上,用于实现直连链路故障时的快速收敛。
图1:交换机C的2条上行链路正常时,阻塞右边的端口
图2:交换机C左边上行链路故障时,UplinkFast使得右边的端口直接进入Forwarding状态(无需经过Listening和Learning状态)
在RSTP中,借鉴了思科的uplinkfast特性;当一台交换机的旧的RP故障,将从AP中选择最优的端口作为新的RP,如果此新的RP的对端端口已经处于Forwarding状态,则本端口也立即转发,收敛时间为几百ms级别。在RSTP中此特性无需做任何配置。
【配置】
通常在接入层交换机上配置
SW1(config)#spanning-tree uplinkfast 在接入层交换机上启用uplinkfast特性
SW1(config)#spanning-tree uplinkfast max-update-rate 200 设置uplinkfast刷新MAC地址表时发送的组播帧的速率为每秒钟发送200个报文(默认为150)
【查看】
1)使用命令show spanning-tree uplinkfast
SW#show spanning-tree uplinkfast
UplinkFast is enabled
Station update rate set to 200 packets/sec.
UplinkFast statistics
-----------------------
Number of transitions via uplinkFast (all VLANs) : 10
Number of proxy multicast addresses transmitted (all VLANs) : 0
Name Interface List
-------------------- ------------------------------------
VLAN0001 Fa0/23(fwd), Fa0/21 注:该交换机上行端口为Fa0/23(根端口,AP)和Fa0/21(替换端口,AP)
2)使用命令show spanning-tree summary
SW#show spanning-tree summary
Switch is in pvst mode
Root bridge for: none
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is enabled
BackboneFast is disabled
Configured Pathcost method used is short
BackboneFast特性用于检测核心网络中的非直连故障,与UplinkFast检测直连链路故障不同。
图1:发生非直连链路故障前 图2:发生非直连链路故障后
在上图中原理如下,若链路L1发生故障,交换机C是无法检测到的(因为链路L1不是交换机C的直连链路)。但是,由于交换机B是通过链路L1到达根桥,它检测到该链路故障,接着它选择自己作为根桥,并发送BPDU报文给交换机C。当交换机C收到来自交换机B发来的更差的BPDU报文,交换机C推断出网络中发生了非直连链路的故障。此时交换机C会往根桥方向发出RLQ请求(Root Link Query),如果根桥正常,交换机C将收到RLQ应答;如果交换机C发现它可以到达根桥,那么BackboneFast特性能够让交换机C直接将收到更差BPDU报文的端口的BPDU消息老化,这个端口重新计算新的角色(上图中应该为DP角色),并进入到Listening状态,而无需等待Max_Age(20秒)时间来老化旧的BPDU消息,这样交换机C为交换机B到达交换机A提供了一条新的路径,收敛时间为2个forward_delay(约为30秒);如果不采用BackboneFast特性,则收敛时间为Max_Age + forward_delay(约为50秒)。
精辟实例:在下图中新增一台交换机,此交换机发出BPDU报文,当交换机C从自己的阻塞端口收到这个更差的BPDU时,BackboneFast不会有任何动作,因为这个BPDU报文并非是该网段的DP端口发出的(注:此网段的DP端口是交换机B的端口)
【配置】
需要在核心网络中的所有交换机上配置
SWA/SWB/SWC(config)#spanning-tree backbonefast
【查看】
1)使用命令show spanning-tree backbonefast
SW#show spanning-tree backbonefast
BackboneFast is enabled
BackboneFast statistics
-----------------------
Number of transition via backboneFast (all VLANs) : 0
Number of inferior BPDUs received (all VLANs) : 0
Number of RLQ request PDUs received (all VLANs) : 0
Number of RLQ response PDUs received (all VLANs) : 0
Number of RLQ request PDUs sent (all VLANs) : 0
Number of RLQ response PDUs sent (all VLANs) : 0
2)使用命令show spanning-tree summary
SW#show spanning-tree summary
Switch is in pvst mode
Root bridge for: none
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is disabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is disabled
BackboneFast is enabled
Configured Pathcost method used is short
展开阅读全文