2.6 Configure, verify, and troubleshoot STP protocols

2.6.a STP mode (PVST+ and RPVST+)

STP or Spanning Tree Protocol allows for redundant links to be installed in switched networks without create switching loops where the same packet is forwarded again and again around the network.

PVST and RPVST refer to Per VLAN Spanning Tree Protocol and Rapid Per VLAN Spanning Tree Protocol.

Screenshot_2018-05-06_15-30-58.png

Consider the above topology. First we must configure VTP to distrubute the VLAN database. Here will make IOU1 the server and the rest clients:

IOU1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
IOU1(config)#vtp mode server 
Device mode already VTP Server for VLANS.
IOU1(config)#vtp domain clinetworking
Domain name already set to clinetworking.
IOU1(config)#vtp password supasecret
Password already set to supasecret
IOU1(config)#^Z
IOU1#

Perform the above config on each switch substituting “server” for client.

Next configure trunk ports (do this on each switch):

IOU1(config)#int range e0/0-2
IOU1(config-if-range)#switchport trunk encapsulation dot1q 
IOU1(config-if-range)#switchport mode trunk 
IOU1(config-if-range)#^Z
IOU1#

Next configure STP mode to be PVST.

IOU1(config)#spanning-tree mode pvst

2.6.b STP root bridge selection

Electing the root bridge

Spanning Tree Protocol begins with the Spanning Tree Alogorithm choosing  a root bridge. To do this each bridge sends a Hello BPDU (Bridge Protocol Data Unit) containing the bridge’s BID and it’s root cost. Below is a packet capture from IOU1 containing the Hello BPDU sent to IOU4 on e0/2. Notice the this frame is for VLAN 30.

superiorhello.png

This is a Hello BPDU and is a superior hello as the priority + mac address is lower than the corresponding Hello BPDU send by IOU4 just moments earlier on the same link:

inferior hello.png

IOU4 receives IOU1’s Hello packet on it’s e0/2 interface and immediately stops transmitting it’s BID as IOU1 has a superior hello.

Root bridge’s are elected based on:

  1. Lowest priority (all switches have the default 32768 + VLAN id)
  2. Lowest mac address (IOU1 has the lowest)

Now IOU4 will retransmit IOU1’s BID packet until it receives a superior hello. See packet capture from IOU4 on e0/1 interface. This process continues until only the superior hello’s from IOU1 are forwarded.

rxsuphello.png

Notice in this packet capture that the root bridge is listed as IOU1 but the bridge identifier is listed as IOU4. This is simply IOU4 retransmitting the bid from IOU1 with it’s cost added (called the root cost).

Choosing the root ports

Each non-root switch must then choose it’s only root port. This is done by choosing the port with the lowest root cost (to the root switch/bridge).

In the case of IOU4 it chooses it’s e0/2 as it’s root port as it has the lowest root cost to the root bridge IOU1.

IOU4#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     aabb.cc00.0100
             Cost        100
             Port        3 (Ethernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     aabb.cc00.0300
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Altn BLK 100       128.1    Shr 
Et0/1               Desg FWD 100       128.2    Shr 
Et0/2               Root FWD 100       128.3    Shr 


IOU4#

 Choosing the Designated Port

The Designated Port is the port which forwards traffic into a LAN segment. To choose the Designated Port switches battle it out and choose the switch with the lowest BID.

If this is a tie (ie the switch is connected to a hub with several links and hears it’s own hello packets) the lowest interface STP priority if that fails the lowest interface number.

So here are the steps:

  1. Lowest bid
  2. Lowest interface STP priority
  3. Lowest interface number

Let look at IOU2 and IOU4:

IOU2#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     aabb.cc00.0100
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     aabb.cc00.0400
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr 
Et0/1               Altn BLK 100       128.2    Shr 
Et0/2               Altn BLK 100       128.3    Shr 


IOU2#

IOU4#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     aabb.cc00.0100
             Cost        100
             Port        3 (Ethernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     aabb.cc00.0300
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Altn BLK 100       128.1    Shr 
Et0/1               Desg FWD 100       128.2    Shr 
Et0/2               Root FWD 100       128.3    Shr 


IOU4#

IOU2 and IOU4 share link e0/1. IOU4 has the lowest bid (32798 + aabb.cc00.0300) vs (32798 + aabb.cc00.0400) so it wins the bid to have it’s DP on this link.

Now lets look at IOU3:

IOU3#show spanning-tree vlan 30

VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     aabb.cc00.0100
             Cost        100
             Port        2 (Ethernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     aabb.cc00.0200
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr 
Et0/1               Root FWD 100       128.2    Shr 
Et0/2               Desg FWD 100       128.3    Shr 


IOU3#

IOU3 has a lower bid than IOU2 on e0/2 so it wins the bid to have it’s DP on this link.

2.6.a STP mode (PVST+ and RPVST+)

Rapid Per VLAN SPT works similar to PVST:

  1. it elects a root switch using bids and tie breakers
  2. it elects the root port on each non root switch with the same rules
  3. it elects designated ports the same
  4. it places ports in a forwarding or blocking state (discarding state)

To configure RPVST:

IOU4(config)#spanning-tree mode rapid-pvst

RPVST introduces a few new port roles:

  1. Alternate port (backup root port)
  2. Backup port (backup designated port)

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s