Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Cisco Press CCNA ICND 2004 - Cisco Press.pdf
Скачиваний:
120
Добавлен:
24.05.2014
Размер:
13.19 Mб
Скачать

42 Chapter 2: Spanning Tree Protocol

The only interface on the three switches that does not forward is SW3’s 0/27 port, which is the same spanning-tree topology shown in Figure 2-1. The process is now complete, with all ports in forwarding state except SW3’s E0/27 interface.

Table 2-3 outlines the state of each port and shows why it is in that state.

Table 2-3

State of Each Interface

 

 

 

 

 

 

Bridge Interface

State

Reason That the Interface Is in Forwarding State

 

 

 

 

 

SW1, E 0/26

Forwarding

The interface is on the root bridge

 

 

 

 

 

SW1, E 0/27

Forwarding

The interface is on the root bridge

 

 

 

 

 

SW2, E 0/26

Forwarding

The root port

 

 

 

 

 

SW2, E 0/27

Forwarding

The designated port on the LAN segment to SW3

 

 

 

 

 

SW3, E 0/26

Forwarding

The root port

 

 

 

 

 

SW3, E 0/27

Blocking

Not the root bridge, not the root port, and not designated port

 

 

 

 

Port costs can be configured, or you can use the default values. Table 2-4 lists the default port costs defined by IEEE; Cisco uses these same defaults. The IEEE revised the cost values because the original values, set in the early 1980s, did not anticipate the growth of Ethernet to support 10-Gigabit Ethernet.

Table 2-4 Default Port Costs According to IEEE

Ethernet Speed

Original IEEE Cost

Revised IEEE Cost

 

 

 

10 Mbps

100

100

 

 

 

100 Mbps

10

19

 

 

 

1 Gbps

1

4

 

 

 

10 Gbps

1

2

 

 

 

Reacting to Changes in the Network

After the STP topology has been set, it does not change unless the network topology changes. This section covers STP, but if you want more information, the Cisco Press book Cisco LAN Switching, by Kennedy Clark and Kevin Hamilton, explains STP in great depth. It is worth the time to think about a single example of how STP changes its topology when reacting to network changes, because you can learn a couple of important terms that you will see in real life when working with STP.

Spanning Tree Protocol 43

The root bridge sends a new hello BPDU every 2 seconds by default. Each bridge forwards the hello, changing the cost to reflect that bridge’s added cost to reach the root. Each bridge uses this repetitive hearing of hellos from the root as a way to know that its path to the root is still working, because the hello follows the same path as all the data frames. When a bridge ceases to receive the hellos, something has failed, so it reacts and starts the process of changing the spanning tree.

The hello BPDU defines the timers used by all the bridges when choosing when to react:

Hello Time—How long the root waits before sending the periodic hello BPDUs, which then are forwarded by successive switches/bridges. The default is 2 seconds.

MaxAge—How long any bridge should wait, after beginning to not hear hellos, before trying to change the STP topology. Usually this is a multiple of the hello time; the default is 20 seconds.

Forward Delay—Delay that affects the time involved when an interface changes from blocking state to forwarding state. A port stays in listening state and then learning state for the number of seconds defined by the forward delay. This timer is covered in more depth shortly.

As a quick review, when the network is stable, the STP process works like this:

1.The root sends a hello BPDU, with a cost of 0, out all its interfaces.

2.The neighboring bridges forward hello BPDUs out their nonroot designated ports, identifying the root, but with their cost added.

3.Each bridge in the network repeats Step 2 as it receives these hello BPDUs.

4.The root repeats Step 1 every hello time.

5.If a bridge does not get a hello BPDU in hello time, it continues as normal. If a bridge fails to receive a hello BPDU for an entire MaxAge time, the bridge reacts.

For example, imagine that the link between SW1 and SW3 fails, as shown in Figure 2-5.

44 Chapter 2: Spanning Tree Protocol

Figure 2-5 Reacting to Link Failure Between SW1 and SW3

 

Larry

 

 

Archie

 

 

 

 

 

I Am Root

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cost = 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0/26

0/26

 

 

 

 

 

 

 

 

 

 

 

 

 

SW1

 

 

SW2

 

0/27

 

 

 

0/27

 

 

 

 

SW1 Is Root

Cost = 100

Blocking

0/27

0/26

SW3

Bob

SW3 reacts to the change, but SW2 does not. SW3 ceases to receive the hello message in its root port, interface 0/26. Remember, when a switch ceases to hear its best hello message after the MaxAge amount of time, it reacts; however, SW2 continues to receive its best hello BPDU, so it does not react.

After MaxAge expires on SW3, SW3 either advertises itself as root again or believes the nextbest claim of who should be root. Because SW2 forwards SW1’s claim to be root and SW1 was already root, SW1 must have a better (lower) priority or better (lower) MAC address than SW3. In other words, in this case, SW3 already knows that it loses compared to SW1, so SW3 does the following:

Decides that its 0/27 interface is now its root port because SW3 is receiving a hello with lower bridge ID. So SW3 places 0/27 in forwarding state.

Interface 0/26 probably has physically failed, so it is in blocking state.

SW3 flushes its address table for those two interfaces because the location of MAC addresses, relative to itself, might have changed. For instance, Larry’s MAC address formerly was reachable out 0/26 and now is reachable out 0/27.

However, SW3 cannot immediately transition from blocking to forwarding on its 0/27 port. If SW3 immediately transitioned to forwarding on 0/27, and other bridges/switches also were converging, loops could occur. To prevent this, STP uses two intermediate interface states.