概述:

     backbonefast是用于增强生成树的,因为传统的生成树协议,如果要由block状态转换到forwarding状态需要50s。这对于一个大型网络来说,时间太长了。所以,cisco发明了三个对生成树增强的协议。就是portfast,uplinkfast,backbonefast。protfast是对于接入端口来说的,也就是使用了portfast的端口直接就进入传输状态,而不需要经过中间的其他状态。uplinkfast一般是用在接入层的。也就是说当有两条上行链路连向上层的时候,传统的生成树会把其中一条置为block状态,如果一条链路实效了,另一条也要经过50秒才能变为传输状态,而使用uplinkfast不需要经过block状态。backbonefast和uplinkfast的作用是一样的,只不过用于不同的情况。而且backbonefast是要配置在所有的交换机上。backbonefast是可以快速诊断非直连链路的故障,并且使生成树快速收敛。对backbonefast工作方式举个例子:假设有A,B,C三个交换机。B与A相连,C也与A相连,C与B也相连,也就是说三台交换机两两相连。A是根桥,所以B和C相连的两个端口要有一个端口是block状态的。他们之间是不通的(你可以用纸画一下,不然很抽象)。这个时候A和B之间的链路down掉了。那么B就和根桥失去了联系,所以B就开始发出BPDU,宣布自己是根桥。这个BPDU只能是发到C(因为和A的链路down掉了)。C接收到这个BPDU,发现和自己之前的根桥不同,C就会发出一个“root link query”的查询,查询以前的根桥是否还是有效的。A收到了这个查询包就会回复给C一个应答,说自己仍然有效。C收到这个应答后,就会通知B根桥仍然还在,并且打开B和C相连的两个端口中的那个block状态的端口。B就开始从C到达根桥了。整个过程也省略了由block状态到listen状态的20秒时间。

 

Portfast(端口快速)和UplinkFast(上行快速)是两个极其类似的技术,都是可以使端口从阻塞状态迅速恢复到转发状态,以达到快速收敛的目的。但Portfast技术可应用于所有阻塞端口,而UplinkFast只能应用于接入层交换机的阻塞上行端口(也就是用于级联的端口,但不一定是专门的Uplink端口)。
  缺省情况下,假定交换机的所有端口都将与交换机或者网桥连接,所以所有端口都运行STP算法,即如果网络发生了变化,在端口发送数据之前要等待50s,即20s的由Blocking(阻塞)状态转为Listening(侦听)状态,加上15的Listening过程,再加上15s的由Learning(学习)状态转变为Forwarding(转发)状态。而事实上许多端口会直接连接工作站或者服务器。采用PortFast和UplinkFast技术可以让这些端口节省Listening和Learning状态的时间,立即由Blocking进入Forwarding状态。切换时间可以在2s~4s之间。
PortFas和UplinkFast技术都是针对在启用STP技术后出现的一些问题(如收敛速度慢)的解决方案。它们所要解决的就是由于在端口中启用STP技术后,网络结构发生变化时,需要等待一定的链路侦测、学习时间,而这个时间可能导致网络不通,网络服务器工作不正常。有了PortFast和UplinkFast技术后,这些端口就可以快速地进入数据转发状态,不用等待,确保了网络的正常通信。
  【注意】PortFast仅适用于阻塞状态端口,让阻塞端口在网络环境变化的情况下直接进入Forwarding状态。而该端口仍然运行STP协议,所以如果检测到环路,端口仍将由Forwarding状态变成Blocking状态。而UplinkFast技术只适用于交换机中呈阻塞状态的上行级联端口,而且在而且该交换机上必须启动了UplinkFast功能,至少有一个上行级联端口处于Blocking的端口(即有冗余链路),链路失效也必须发生在Root Port上。交换机启动了UplinkFast后,由于提高了交换机上所有端口的路径开销,所以不适合作为根桥。

 

Portfast:
Portfast是用在access layer中的交换机上的而且用在有阻断端口的交换机上,当RP失效,马上启动阻断端口保持通信。这样收敛时间很快,不用从新进行STP运算,直接从blocking跳到fowarding。
缺省情况下,假定交换机的所有端口都将与交换机或者网桥连接,所以所有端口都运行STP算法,即如果网络发生了变化,在端口发送数据之前要等待50s,而事实上许多端口会直接连接工作站或者服务器。所以我们采用PortFast可以让这些端口节省Listening和Learning状态的时间,立即进入Forwarding状态。需要注意的是:PortFast仅仅让端口在网络环境变化的情况下直接进入Forwarding状态。而端口仍然运行STP协议,所以如果检测到环路,端口仍将由Forwarding状态变成Blocking状态。

Portfast快速端口是一个Catalyst的一个特性,能使交换机或中继端口跳过Listening、Learning状态而进入STP转发状态,在基于IOS交换机上,PortFast 只能用于连接到终端工作站的接入端口上。
当一个设备连接到一个端口上时,端口通常进入侦听状态。当转发延迟定时器超时后,进入学习状态,当转发延迟定时器第二次超时,端口进入到转发或者阻塞状态,当一个交换机或中继端口启用PortFast后,端口立即进入转发状态,但交换机检测到链路,端口就进入转发状态(插电缆后的2s) 。如果端口检测到一个环路同时又启用了PortFast 功能。它就进入阻塞状态。重要的是要注意到PortFast 值在端口初始化的时候才生效。如果端口由于某种原因又被迫进入阻塞状态,随后又需要回到转发状态,仍然要经过正常的侦听。
启用PortFast的主要原因是防止启动周期小于30s的PC需要和交换机端口从未连接状态进入到转发状态,一些网卡直到 MAC 层软件驱动被实际加载之后才会启动链路。这种情况下就会导致一些故障,例如DHCP环境下,这可能会出现一些问题。


命令:在SW1的F0/1端口上启用Portfast

     sw1(config)#int f 0/1
       sw1(config)#no shut
       sw1(config-if)#spanning-tree portfast
    

Uplinkfast:
背景资料:STP确保了在拓扑变化的情况下没有环路产生,但收敛速度慢。一些实时以及对带宽敏感的网络应用是不能接受的。STP收敛速度慢的原因是收敛算法需要化时间确定一条可替代的链路,缺省时间是50s,即20s(Blocking→Listening)+15s(Listening→Learning)+15s(Learning→Forwarding)。解决的方法是一旦发现了线路down,马上把Blocking的port切换到Forwarding,不要经过Listening和Learning阶段。这就是UplinkFast,切换时间可以在2s~4s。UplinkFast被设计应用在接入层交换机。一般应用两条上行链路连接到分布层,一条是冗余链路。

UplinkFast激活一个快速重新配置的条件:

A.    在交换机上必须启动了UplinkFast功能;
B.    至少有一个处于Blocking的端口(即有冗余链路);
C.    链路失效必须发生在Root Port上。

交换机启动了UplinkFast后,由于提高了交换机上所有端口的路径开销,所以不适合作为根桥。The spanning tree port cost and port-VLAN cost of all ports on the switch is increased by 3000.The spanning tree bridge priority for all VLANs is set to 49152. This makes it unlikely that the switch will become the root switch.

具体来说,一个上行链路组由根端口和除自环端口之外的一组阻断端口组成,上行速链路使交换机上的一个阻断端口几乎立刻进行转发。很重要的一点就是:上行链路只能配置在接入层交换机上,因为从根端口到其非指定备份端口的快速转发只能在生成树拓扑结构的根端口上被确定性的完成。

 

命令:在SW1上启用Portfast

     sw1(config)#spanning-tree uplinkfast

 

Backbonefast:
backbonefast用在distribution layer中的交换机上。而且要求所有交换机都得启动backbonefast。当一台交换机的RP坏掉的时候,失去了和RB的连接,它向他的其他端口,包括阻塞端口(如果有的话)发送下级BPDU。收到下级BPDU的交换机有3种情况:

1,如果收到下级BPDU的端口是阻塞端口,那么阻塞端口和根端口都作为候选端口(用来到达根桥用的);

2,如果收到下级BPDU的端口是根端口,那么阻塞端口被作为候选端口,因为只能通过它到达根桥了;

3,如果收到下级BPDU的端口是根端口,并且这个交换机上没有阻塞端口,那么证明这台交换机失去了到根桥的连接,需要从新进行STP运算。交换机中只要有一台处于第三种状态,就要从新进行STP运算。除此之外,只需花去max age delay的时间(就是最初的20s)就可以收敛完毕。


642-811的英文原版书说:BackboneFast能使交换机在收到inferior BPDU后,根据接收该BPDU端口的状态,来决定通向Root Bridge的alternate Path,并通过Blocking端口来发送Root Link Query,根据应答,判断哪个端口为Newly Current Root Bridge Port,并将其马上进行状态转换,无需等待Max Age Timer计时器到时。


原文如下:


--------------------------
原文开始
--------------------------
BackboneFast: Redundant Backbone Paths

In the network backbone, or core layer, a different method is used to shorten STP convergence. BackboneFast works by having a switch actively determine if alternate paths exist to the Root Bridge in the event that the switch detects an indirect link failure. Indirect link failures occur when a link not directly connected to a switch fails. A switch detects an indirect link failure when it receives inferior BPDUs from its Designated Bridge on either its Root Port or a Blocked Port. (Inferior BPDUs are sent from a Designated Bridge that has lost its connection to the Root Bridge, making it announce itself as the new Root.)

Normally, a switch must wait for the Max Age timer to expire before responding to the inferior BPDUs. However, BackboneFast begins to determine if other alternate paths to the Root Bridge exist according to the type of port that received the inferior BPDU. If the inferior BPDU arrives on a port in the Blocking state, the switch considers the Root Port and all other blocked ports to be alternate paths to the Root Bridge. If the inferior BPDU arrives on the Root Port itself, the switch considers all blocked ports to be alternate paths to the Root Bridge. If the inferior BPDU arrives on the Root Port and no ports are blocked, however, the switch assumes it has lost connectivity with the Root Bridge. In this case, the switch assumes that it has become the Root Bridge and, BackboneFast allows it to do so before the Max Age timer expires.

Detecting alternate paths to the Root Bridge also involves an interactive process with other bridges. If the local switch has blocked ports, BackboneFast begins to use the Root Link Query (RLQ) protocol to see if upstream switches have stable connections to the Root Bridge. RLQ Requests are sent out. If a switch receives an RLQ Request and is either the Root Bridge or has lost connection to the Root, it sends an RLQ Reply. Otherwise, the RLQ Request is propagated on to other switches until an RLQ Reply can be generated. On the local switch, if an RLQ Reply is received on its current Root Port, the path to the Root Bridge is intact and stable. If it is received on a non-Root Port, an alternate Root Path must be chosen. The Max Age Timer is immediately expired so that a new Root Port can be found.

BackboneFast is simple to configure and operates by short-circuiting the Max Age Timer when needed. Although this function shortens the time a switch waits to detect a Root Path failure, ports still must go through full-length Forward Delay Timer intervals during the Listening and Learning states. Where PortFast and UplinkFast enable immediate transitions, BackboneFast can only reduce the maximum convergence delay from 50 to 30 seconds.

To configure BackboneFast, use the following global configuration command:

Switch(config)# spanning-tree backbonefast

When used, BackboneFast should be enabled on all switches in the network because BackboneFast requires the use of the RLQ Request and Reply mechanism to inform switches of Root Path stability. The RLQ protocol is active only when BackboneFast is enabled on a switch. By default, BackboneFast is disabled.
--------------------------
原文结束
--------------------------