Showing posts with label stp. Show all posts
Showing posts with label stp. Show all posts

Thursday, December 25, 2008

Cisco CCNP / BCMSN Exam Tutorial: Changing Root Bridge Election Results

Your BCMSN and CCNP studies will include mastering the details of Spanning Tree Protocol (STP). While you learned some of these details in your CCNA studies, quite a bit of it may be new to you. Before going on to the intermediate and advanced STP features, let's review the root bridge election process and learn how to change these results.

Each switch will have a Bridge ID Priority value, more commonly referred to as a BID. This BID is a combination of a default priority value and the switch's MAC address, with the priority value listed first. For example, if a Cisco switch has the default priority value of 32,768 and a MAC address of 11-22-33-44-55-66, the BID would be 32768:11-22-33-44-55-66. Therefore, if the switch priority is left at the default, the MAC address is the deciding factor.

Switches are a lot like people - when they first arrive, they announce that they are the center of the universe! Unlike some people, the switches will soon get over it. BPDUs will be exchanged until one switch is elected Root Bridge, and it's the switch with the lowest BPDU that will end up being the Root Bridge.

If STP is left totally alone, a single switch is going to be the root bridge for every single VLAN in your network. Worse, that single switch is going to be selected because it has a lower MAC address than every other switch, which isn't exactly the criteria you want to use to select a single root bridge.

The time will definitely come when you want to determine a particular switch to be the root bridge for your VLANs, or when you will want to spread the root bridge workload. For instance, if you have 50 VLANs and five switches, you may want each switch to act as the root bridge for 10 VLANs each. You can make this happen with the spanning-tree vlan root command.

SW1(config)#spanning-tree vlan 1 ?

forward-time Set the forward delay for the spanning tree

hello-time Set the hello interval for the spanning tree

max-age Set the max age interval for the spanning tree

priority Set the bridge priority for the spanning tree

root Configure switch as root


In this example, we've got two switches, and SW1 has been elected the root bridge for VLANs 10, 20, and 30. We'll use the spanning-tree vlan root command on SW2 to make it the root bridge for VLANs 20 and 30.

SW2(config)#spanning-tree vlan 20 root primary

SW2(config)#spanning-tree vlan 30 root primary

SW2#show spanning vlan 20

VLAN0020

Spanning tree enabled protocol ieee

Root ID Priority 24596

Address 000f.90e2.1300

This bridge is the root

SW2#show spanning vlan 30

VLAN0030

Spanning tree enabled protocol ieee

Root ID Priority 24606

Address 000f.90e2.1300

This bridge is the root

SW 2 is now the root bridge for both VLAN 20 and 30. Notice that the priority value has changed from the default of 32768.

In the next CCNP / BCMSN tutorial, we'll take a look at more STP features.

Cisco CCNP / BCMSN Exam Tutorial: The Four (Or Five) STP Port States

As a CCNP candidate and a CCNA, you may be tempted to skip or just browse the many details of Spanning Tree Protocol. After all, you learned all of that in your CCNA studies, right? That's right, but it never hurts to review STP for a switching exam! Besides, many of us think of the four STP port states - but officially, there's a fifth one!

Disabled isn't generally thought of as an STP port state, but Cisco does officially consider this to be an STP state. A disabled port is one that is administratively shut down.

Once the port is opened, the port will go into blocking state. As the name implies, the port can't do much in this state - no frame forwarding, no frame receiving, and therefore no learning of MAC addresses. About the only thing this port can do is accept BPDUs from neighboring switches.

A port will then go from blocking mode into listening mode. The obvious question is "listening for what?" Listening for BPDUs - and this port can now send BPDUs as well. The port still can't forward or receive data frames.

When the port goes from listening mode to learning mode, it's getting ready to send and receive frames. In learning mode, the port begins to learn MAC addresses in preparation for adding them to its MAC address table.

Finally, a port can go into forwarding mode. This allows a port to forward and receive data frames, send and receive BPDUs, and place MAC addresses in its MAC table.

To see the STP mode of a given interface, use the show spanning-tree interface command.

SW1#show spanning-tree interface fast 0/11

Vlan Role Sts Cost Prio.Nbr Type

---------------- ---- --- --------- -------- ----------

VLAN0001 Desg FWD 19 128.11 P2p

To see these states in action, shut a port down in your CCNA / CCNP home lab and continually run the show spanning interface command. Once you see this in action on real Cisco equipment, you'll have no problem with BCMSN exam questions. Just don't practice this or any other Cisco command on a production network!

Cisco CCNP / BCMSN Exam Tutorial: Spanning Tree Protocol (STP) Timers

In your BCMSN / CCNP exam study, it's easy to overlook some of the details of Spanning Tree Protocol (STP). After all, you learned all of that in your CCNA studies, right? Not necessarily! While some of the BCMSN material will be a review for you, there are some details regarding familiar topics that you need to learn. That includes the timers for STP - Hello Time, MaxAge, and Forward Delay.

You may remember these timers from your CCNA studies as well, and you should also remember that these timers should not be changed lightly. What you might not have known is that if you decide to change any and all of these timers, that change must be configured on the root bridge! The root bridge will inform the nonroot switches of the change via BPDUs.

Hello Time is the interval between BPDUs, two seconds by default.

Forward Delay is the length of both the listening and learning STP stages, with a default value of 15 seconds.

Maximum Age, referred to by the switch as MaxAge, is the amount of time a switch will retain a BPDU's contents before discarding it. The default is 20 seconds.

The value of these timers can be changed with the spanning-tree vlan command shown below. Verify the changes with the show spanning-tree command.

SW1(config)#spanning-tree vlan 1 ?

forward-time Set the forward delay for the spanning tree

hello-time Set the hello interval for the spanning tree

max-age Set the max age interval for the spanning tree

priority Set the bridge priority for the spanning tree

root Configure switch as root


SW1(config)#spanning-tree vlan 1 hello-time 5

SW1(config)#spanning-tree vlan 1 max-age 30

SW1(config)#spanning-tree vlan 1 forward-time 20

SW1(config)#^Z

SW1#show spanning-tree vlan 1

VLAN0001

Spanning tree enabled protocol ieee

Root ID Priority 32769

Address 000f.90e1.c240

This bridge is the root

Hello Time 5 sec Max Age 30 sec Forward Delay 20 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)

Address 000f.90e1.c240

Hello Time 5 sec Max Age 30 sec Forward Delay 20 sec

Aging Time 300

Interface Role Sts Cost Prio.Nbr Type

---------------- ---- --- --------- -------- --------------------------------

Fa0/11 Desg FWD 19 128.11 P2p

Fa0/12 Desg FWD 19 128.12 P2p

Again, you should always take great care in changing these timers. Those defaults are set for a reason - helping to prevent switching loops!

Cisco CCNP / BCMSN Exam Tutorial: BPDU Skew Detection

You may look at that feature's name and think, "What is a BPDU Skew, and why do I want to detect it?" What we're actually attempting to detect are BPDUs that aren't being relayed as quickly as they should be.

After the root bridge election, the root bridge transmits BPDUs, and the non-root switches relay that BPDU down the STP tree. This should happen quickly all around, since the root bridge will be sending a BPDU every two seconds by default ("hello time"), and the switches should relay the BDPUs fast enough so every switch is seeing a BPDU every two seconds.

That's in a perfect world, though, and there are plenty of imperfect networks out there! You may have a busy switch that can't spare the CPU to relay the BDPU quickly, or a BPDU may just simply be lost in transmission. That two-second hello time value doesn't give the switches much leeway, but we don't want the STP topology recalculated unnecessarily either.

BDPU Skew Detection is strictly a notification feature. Skew Detection will not take action to prevent STP recalculation when BDPUs are not being relayed quickly enough by the switches, but it will send a syslog message informing the network administrator of the problem. The amount of time between when the BDPU should have arrived and when it did arrive is referred to as "skew time" or "BPDU latency".

A busy CPU could quickly find itself overwhelmed if it had to send a syslog message for every BPDU delivery that's skewed. The syslog messages will be limited to one every 60 seconds, unless the "skew time" is at a critical level. In that case, the syslog message will be sent immediately with no one-per-minute limit.

And what is "critical", according to BDPU Skew Detection? Any value greater than 1/2 of the MaxAge value, making the critical skew time level 10 seconds or greater.