Автор: Ben Piper
Издательство: John Wiley & Sons Limited
Жанр: Зарубежная компьютерная литература
isbn: 9781119658801
isbn:
P2P Edge
This type is reserved for edge devices that don't run Spanning Tree, such as computers, servers, and phones. An edge port skips over the learning state and transitions instantly to a forwarding state. RSTP still sends BPDUs on edge ports just in case there's a switch on the other end. But if it receives a BPDU, it will change the port type to a normal Spanning Tree port. If you're familiar with PortFast, this is essentially the same thing. In fact, IOS uses the portfast keyword to configure an edge port, as follows:
SW2(config)#int gi1/3 SW2(config-if)#spanning-tree portfast edge ? trunk Enable portfast edge on the interface even in trunk mode <cr> SW2(config-if)#spanning-tree portfast edge trunk %Warning: portfast should only be enabled on ports connected to a single host. Connecting hubs, concentrators, switches, bridges, etc... to this interface when portfast is enabled, can cause temporary bridging loops. Use with CAUTION
Keep in mind that an edge port can be an access port or a trunk port that's connected to multiple devices. If the port is a single-VLAN access port, you should use the spanning-tree portfast edge interface command. But if it's a trunked interface—such as one connected to a server running virtual machines or a computer plugged in behind an IP phone on a separate voice VLAN—you must use the spanning-tree portfast edge trunk interface command.
Shared
The Shared port type is one you shouldn't expect to see very often. It's for a port that may be connected to multiple devices, usually via a hub. RSTP considers any half-duplex link to be shared. In this case, RSTP falls back to timer-based 802.1D behavior and may take up to 50 seconds to converge.
Multiple Spanning Tree
MST is designed as an alternative to PVST+. MST allows you to reduce the number of Spanning Tree instances required when you have a large number of VLANs. In per-VLAN Spanning Tree, you must have one Spanning Tree instance per VLAN. For example, if you have 500 VLANs, you must have 500 instances of Spanning Tree.
MST, on the other hand, lets you map multiple VLANs to a single Spanning Tree instance. To keep track of instances, MST uses instance numbers. Because VLAN-to-instance mappings are arbitrary, all switches in the topology must agree on the mappings. To deal with this, MST uses regions. An MST region is a collection of MST instances that share three common values:
Region name
Revision number
List of VLAN-to-instance mappings
As long as all three parameters match on each switch in the topology, they're considered to be in the same region and will form a stable Spanning Tree topology. When you enable MST, it spawns a default Spanning Tree instance called MST0. By default, MST0 maps to all VLANs (1-4094). MST0 is also known as the Internal Spanning Tree (IST). The following example on SW1 illustrates how you could map VLANs 1, 3, and 5 to instance MST1, and VLANs 2, 4, and 6 to MST2:
! Enable MST SW1(config)#spanning-tree mode mst ! Enter MST configuration mode SW1(config)#spanning-tree mst configuration ! Set the region name to myRegion SW1(config-mst)#name myRegion ! Map VLANs 1, 3, and 5 to instance 1 SW1(config-mst)#instance 1 vlan 1,3,5 ! Map VLANs 2,4 and 6 to instance 2 SW1(config-mst)#instance 2 vlan 2,4,6 ! Configure the revision number SW1(config-mst)#revision 1 ! Display the pending configuration SW1(config-mst)#show Pending MST configuration Name [myRegion] Revision 1 Instances configured 3 Instance Vlans mapped -------- --------------------------------------------------------------------- 0 7-4094 1 1,3,5 2 2,4,6 ------------------------------------------------------------------------------- ! Remember to issue the exit command to save the MST configuration to the running config SW1(config-mst)#exit ! Exit global configuration mode, then save the running configuration SW1(config)#exit SW1#write memory
When you map multiple VLANs to an instance, at least one of those VLANs must be active and allowed on the trunk between the switches in the topology. This implies that at least one of the VLANs mapped to an instance must also be configured in the switch's local VLAN database. In the preceding example, VLAN 2, 4, or 6 must be allowed and active in order for MST2 to be active.
Behind the scenes, each MST instance uses RSTP.
Root Bridges and Port Priority
Each MST instance has its own root bridge. By having multiple instances with different root bridges, you can distribute the traffic load across all the links. Using Figure 2.7 as an example, you could make SW1 the root for MST1 and SW4 the root for MST2.
Figure 2.7 Multiple Spanning Tree
The command for adjusting the MST bridge priority is almost identical for (R)PVST+. The difference is that instead of specifying a VLAN, you specify the MST instance. For example, to make SW1 the root for MST1, you would do the following:
Enter configuration commands, one per line. End with CNTL/Z. SW1(config)#spanning-tree mst 1 priority 0 SW1(config)#exit SW1#show spanning-tree mst 1 ##### MST1 vlans mapped: 1,3,5 Bridge address 0015.f9fb.1e80 priority 1 (0 sysid 1) Root this switch for MST1 ! Output truncated
In Figure 2.8, SW1 and SW4 are directly connected via two links. To ensure that both links are used, we'll lower the MST1 port priority for Gi2/1 on SW1. This will cause SW4 to use the link for MST1 instead of blocking it. The command for adjusting the port priority is also much the same as in (R)PVST+:
SW1(config)#interface gi2/1 SW1(config-if)#spanning-tree mst 1 port-priority 32
Internal Spanning Tree
MST can interoperate with other Spanning Tree protocols and even other MST regions. When an MST region is connected to switches in another MST region, or simply not running MST at all, it will make the MST region appear as a single RPVST+ or PVST+ topology, depending on what the peer switch is running. This is called PVST simulation. To illustrate, let's change SW2 back to RPVST+ mode:
SW2(config)#spanning-tree mode rapid-pvst SW2(config)#do show spanning-tree vlan 1-10 summary Switch is in rapid-pvst mode Root bridge for VLAN0001 is 32768.0015.f9fb.1e80. Root bridge for VLAN0002 is 32768.0015.f9fb.1e80. Root bridge for VLAN0003 is 32768.0015.f9fb.1e80. Root bridge for VLAN0004 is 32768.0015.f9fb.1e80. Root bridge for VLAN0005 is 32768.0015.f9fb.1e80. Root bridge for VLAN0006 is 32768.0015.f9fb.1e80. Root bridge for VLAN0007 is 32768.0015.f9fb.1e80. Root bridge for VLAN0008 is 32768.0015.f9fb.1e80. Root bridge for VLAN0009 is 32768.0015.f9fb.1e80. Root bridge for VLAN0010 is 32768.0015.f9fb.1e80. ! Output truncated
SW1 advertises itself as the root for all VLANs, even though in the MST topology it's only the root for the MST1 instance. If a switch outside of the MST topology attempts to become root, the MST switches will block the ports, placing СКАЧАТЬ