Читать книгу CCNP Enterprise Certification Study Guide: Implementing and Operating Cisco Enterprise Network Core Technologies - Ben Piper, David Higby Clinton - Страница 63

Calculating the Root Ports

Оглавление

The root bridge always has all of its ports in a forwarding state, so it's up to the non-root bridges to prevent bridging loops. Each non-root bridge must determine its root port—the port that has the lowest-cost path to the root bridge. For switches connected directly to the root, this is easy. If a non-root bridge has only one interface to the root, that interface becomes the root port. On the other hand, if a bridge has multiple connections to the root, only the one with the lowest cost to the root will become the root port. All other ports leading back to the root bridge are blocked, thus preventing a loop.

For a switch connected directly to the root, the root port will be the port with the lowest cost. If the costs are equal, the root port will be the one with the lowest designated port ID. To see how this works, refer to Figure 2.5. SW3 is the root for VLAN 1. SW1 has two direct links to the root: Gi1/0 and Gi1/1. The port with the lowest cost to the root will become the root port. The port cost is based on interface bandwidth, as shown in Table 2.1.

Table 2.1 STP port costs by speed

Speed Cost
10 Mbps 100
100 Mbps 19
1 Gbps 4
10 Gbps 2

Figure 2.5 VLAN 1 topology with SW3 as root

Because Both of SW1's interfaces facing SW3 are 1 Gbps interfaces, they each have a cost of 4, as shown in the following output from SW1:

SW1#show spanning-tree vlan 1 VLAN0001 Spanning tree enabled protocol rstp Root ID Priority 32769 Address 0015.fa83.e900 Cost 4 Port 5 (GigabitEthernet1/0) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 36865 (priority 36864 sys-id-ext 1) Address 0015.f9fb.1e80 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/0 Desg FWD 4 128.1 P2p Gi0/1 Desg FWD 4 128.2 P2p Gi0/2 Desg FWD 4 128.3 P2p Gi0/3 Desg FWD 4 128.4 P2p Gi1/0 Root FWD 4 128.5 P2p Gi1/1 Altn BLK 4 128.6 P2p ! Output truncated

STP must block one port, and the output shows that Gi1/0 is the root port. Why was Gi1/0 selected instead of Gi1/1? Here's where confusion sets in for a lot of people. You might assume that Gi1/0 was selected because the port ID—listed in the Prio.Nbr column—is lower for Gi1/0 than Gi1/1. But this is not the reason. Observe the following output from SW1:

SW1#show spanning-tree interface gigabitEthernet 1/0 detail Port 5 (GigabitEthernet1/0) of VLAN0001 is root forwarding Port path cost 4, Port priority 128, Port Identifier 128.5. Designated root has priority 32769, address 0015.fa83.e900 Designated bridge has priority 32769, address 0015.fa83.e900 Designated port id is 128.5, designated path cost 0 Timers: message age 16, forward delay 0, hold 0 Number of transitions to forwarding state: 1 Link type is shared by default BPDU: sent 38, received 293 SW1#show spanning-tree interface gigabitEthernet 1/1 detail Port 6 (GigabitEthernet1/1) of VLAN0001 is alternate blocking Port path cost 4, Port priority 128, Port Identifier 128.6. Designated root has priority 32769, address 0015.fa83.e900 Designated bridge has priority 32769, address 0015.fa83.e900 Designated port id is 128.6, designated path cost 0 Timers: message age 16, forward delay 0, hold 0 Number of transitions to forwarding state: 0 Link type is shared by default BPDU: sent 4, received 295

Notice that for each port there are two slightly different references to a port ID:

 Gi1/0Port ID: 128.5Designated port ID: 128.5

 Gi1/1Port ID: 128.6Designated port ID: 128.6

The port ID is what SW1 has configured on its interface, whereas the designated port ID is what SW3 has configured on its facing interface. SW1's STP instance uses the designated port ID to select the root port. How does SW1 know SW3's port ID? It's transmitted in the BPDU from SW3. In other words, the root port is determined by the port ID on the opposite end of the link.

CCNP Enterprise Certification Study Guide: Implementing and Operating Cisco Enterprise Network Core Technologies

Подняться наверх