资源预览内容
第1页 / 共13页
第2页 / 共13页
第3页 / 共13页
第4页 / 共13页
第5页 / 共13页
第6页 / 共13页
第7页 / 共13页
第8页 / 共13页
第9页 / 共13页
第10页 / 共13页
亲,该文档总共13页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
stp生成树(STP spanning tree)一、STP(生成树协议)PVST、PVST+、RSTP、MSTPIEEE 802.1D STPIEEE 802.1Q VLANIEEE 802.1p QoSIEEE 802.1x dot1xIEEE 802.1w RSTPIEEE 802.1s MSTP1。作用:防止二层交换环路1)为什么交换网络会形成环路?(原因:为了提高网络的可靠性,增加冗余设备,从而导致交换网络环路)2)如何防止二层交换环路?生成树协议2。生成树协议(生成树协议)1)STP如何选举一)选举根桥每个交换机(网桥)都拥有一个bridgeid(= bridgepriority +桥MAC地址)0 65535,缺省32768b)在每个非根桥上选举根端口我到达根桥的路径费用最小)米100100m 191410g 2二)发送方网桥ID最小三)发送portid最小(portid =端口优先级+端口号)0 255,缺省123四)自身的portid最小(portid =端口优先级+端口号)C)为每个网段(二层网段)选择一个指定端口(指定端口)我到达根桥的路径费用最小)米100100m 191410g 2二)发送方网桥ID最小三)发送portid最小(portid =端口优先级+端口号)0 255,缺省123四)自身的portid最小(portid =端口优先级+端口号)2)报文BPDU(桥协议数据单元)桥协议数据单元在STP中,BPDU报文由根桥产生,其他交换机中转该BPDU报文3)假设网络中的交换机设备刚启动,每个交换机都认为自己是根桥,发送BPDU报文经过一段时间的交互,最终选择根桥/同时可以确定每个交换机上的不同端口的角色(根端口和指定端口),被选择为RP或DP的端口必须经过2个前锋Delay时间后,才能进入向前状态。问题1:刚启动的时候,所有交换机的端口处于块状态。被选择成RP或DP的端口先进入听,再经过学习状态,最后进入向前状态其他端口(没有被选举为RP或DP)继续停留在块状态。问题2:为什么RP / DP需要经过2个转发延迟才进入向前状态?为了防止STP收敛过程中的临时环路,当然引入转发延迟后,在STP收敛过程中,将导致网络的临时中断。3:问题转发延迟为什么等于15秒2秒发送一次BPDU报文每隔,通常网络的直径为74)STP端口的角色:RP / DP /其他的统称为NDP,反相/ DP最终进入转发状态,NDP(非指定端口)为阻断状态STP端口的状态:阻塞(稳定状态):不会学习MAC地址,不能转发数据帧Listening (transition state): will not learn MAC address, can not forward data frameLearning (transition state): learn MAC address, cannot forward data frameForwarding (stable state): learning MAC address, forwarding data frameIn what case does STP become convergent? All ports are Forwardig or Blocking States5) the type of BPDU message in STPA) Configuration BPDU (configuration BPDU): only by Root Bridge, other switches to this BPDUB) TCN BPDU (topology change notification BPDU): switches generated by the issuing topology changes6) the mechanism of topological changeIn an exchange network, if a switch changes its topology, it will generate TCN BPDU and send it along the direction of root bridge,(from the RP port, you must get the confirmation TCA of the upstream switch, if you dont receive the TCA, send TCN BPDU again)Until the TCN BPDU message reaches root bridge.After root bridge receives the TCN BPDU, the configuration BPDU is sent over a subsequent period (Max-AGE+Forward_Delay)In the TC flag bit =1, all switches receive this Configuration BPDU with TC bit, and will be present in the MAC address table of this switchThe aging time of the item is set to Forward_delay 15 seconds7) PVSTP (Per VLAN)A) advantagesComputing a STP instance in each VLAN can realize the traffic sharing of different VLAN and improve the utilization ratio of link.B) BridgeIDDifferent VLAN needs to calculate a STP instance, how to set up BridgeID?Implementation mode:I. there is a MAC address pool on a switch. In different VLAN computing STP, select an MAC address from it,Thus ensuring the unique BridgeID of different STP instances.Ii. uses extended system ID.The original 16bit priority is divided into 2 parts, the former 4bit is still used as priority, and later 12bit maps the VLAN ID into it.VLAN 1 BridgeID (assuming the priority of the switch is default 32768)32769.MACVLAN 2 BridgeID (assuming the priority of the switch is default 32768)32770.MACSince the post 12bit is used as the mapping of VLAN ID, the switch priority of configuring PVST must be 4096Switch priority: 0/4096/8192C) PVST+ configurationSwitch (config) #spanning-tree VLAN VLAN_ID priority prioritySpanning-tree portfast (interface command) trunkSpanning-tree portfast default (global command)Interface range fa0/1, f0/5-10Define interface-range ALD fa0/1, fa0/5-10Interface range macro ALDIEEE 802.1d STPIEEE 802.1Q VLANIEEE 802.1w RSTPIEEE 802.1s MSTPTwo, RSTP (Rapid Spanning Tree Protocol)PVRST+1. election principle: exactly the same as STPThe difference between 2.RSTP and STP1) port rolesSTP:RP/DP/NDPRSTP:RP/DP/NDP (AP:Alternate Port, BP:Backup Port)Where AP (replace port) is used to replace Root PortBP (backup port), using backup Designated PortAP: if a port is due to receive BPDU message of other switches and enter blocking, then the port is AP;BP: if a port is entered into blocking by receiving the BPDU message of this switch, then the port is BP;2) port stateSTP: Blocking/Listening/Learning/ForwardingRSTP:Discarding/Learning/Forwaring3) the method of improving convergence speed of RSTPA) introduces Hello mechanism (similar to neighbor mechanism)If the Hello message is not received continuously for 3 times, it is considered that the neighbor fault will be aging from the BPDU message obtained by the neighborB) a switch C (one port is RP, the rest port is AP, in a blocking state), if the switch C RP fault, then AP becomes RP, the port can be directly forwarded(40
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号