CCNP Study Notes – Spanning Tree Configuration

By | March 4, 2012

STP Root Bridge

 

Root bridge location should be determined as part of the design process.  Adjustments to the STP configuration can be made for things like using redundant links to load balance in parrallel, or configuring STP to converge quickly and predictably if a major topology change occurs.

 

note – if STP has been disabled for any reason, enable it by issuing the following commands:

 

Switch(config)# spanning-tree vlan vlan-id

Switch(config-if)# spanning-tree vlan vlan-id  (use if disabled for a specific VLAN on a specific port)

 

Root Bridge Placement considerations:

  • switch speed – default settings may result in the slowest switch becoming root and having to handle a lot of traffic
  • redundancy – default settings may result in a switch that isn’t ideal for the job becoming the root
  • location – default settings may result in a switch in a distant location from a large section of the network becoming root, meaning a lot of traffic having too go the long  way round to pass through the root

Root Bridge Configuration – to prevent surpirises

  • always configure one switch as the root bridge in a determined fashion
  • always configure one switch as secondary root bridge in case the primary fails

Generally the root bridge should always be placed near the centre of a layer 2 network.  eg.  a distribution layer switch is a better choice than an access layer switch, and a switch near to a server farm is a good choice as in both cases they would be expected to handle most traffic.

 

There are two ways to manually configure a switch as a root bridge:

  • manually set the bridge priority to a low value, so it wins the election.  Make sure that the bridge priority value of the other is higher.
    • Switch(config)# spanning-tree vlan vlan-list prority bridge piority
  • causing the would be root bridge to choose it’s own priority based on assumptions about other switched in the network
    • Switch(config)# spanning-tree vlan vlan-id root {primary | secondary | diameter diameter}

Spanning Tree Customization

 

Tuning the root path cost – this can be modified from the default value, using the following command:

 

Switch(config-if)# spanning-tree [vlan vlan-id] cost cost   (cost can be 1-65535)

 

To view the port cost of an interface:

 

Switch# show spanning-tree interface type mod/num  [cost]

 

Tuning the port ID – a switch port number is fixed, but it port ID can be changed using the port priority:

 

Switch(config-if)# spanning-tree [vlan vlan-list] port-priority port-prority

 

Tuning Spanning Tree Convergence

 

Manually Modifying STP Timers

 

Switch(config)# spanning-tree [vlan vlan-id ] hello-time seconds

Switch(config)# spanning-tree [vlan vlan-id ] forward-time seconds

Switch(config)# spanning-tree [vlan vlan-id ] max-age seconds

 

Automatically Configuring STP timers

 

Switch(config)# spanning-tree vlan vlan-list root {primary | secondary} [diameter diameter [hello-time hello-time]]

 

The above command adjusts STP timers according to the forumlas specified in 802.1D standard, by only giving the network’s diameter (max number of switches that layer 2 traffic will traverse)., an dan optional hello time.

 

Redundant Link Convergence

 

PortFast

  • enables fast connectivity to be established on access-layer switch ports to workstations that are booting
  • if not configured then delay will be 30 seconds from a port coming up before it is in forwarding mode (15 secs listening to learning + 15 secs learning to forwarding)
  • on ports that only connect to workstations or single devices, bridging loops should never be possible
  • portfast shortens the listening and learning states to a negligible amount of time, meaning the port immediately moves to the forwarding state
  • STP loop detection is still in place though, meaning the port will be put in the blocking state if a loop is detected
  • disabled by default
  • can be configured as a global default, meaning that all ports that are configured for access mode (non trunking) will have portfast automatically enabled:
    • Switch(config)# spanning-tree portfast default
  • can be enabled or disabled on specific switch ports:
    • Switch(config-if)# [no] spanning-tree portfast
  • portfast = TCN BPDU’s are not sent when a switch port in portfast mode goes up or down
  • to display the current portfast status:
    • Switch# show spanning-tree interface type mod/num portfast

UplinkFast

  • enables fast uplink failover on an access layer switch when dual uplinks are connected into the distribution layer
  • gets rid of the up to 50 second delay that would occur if an access layer switch has redundant uplink connections to 2 distribution layers switches and one of the links fails
  • enables switches at the ends of spanning-tree branches to have a functioning root port while keeping one or more redundant or potential root ports in blocking mode.  when the primary root port uplink fails, another port immediately is brought up for use
  • Swtich(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]
  • when enabled, it is for the whole switch and all VLAN’s
  • keeps track of possible paths to the root bridge, so the command cannot be issued on the root bridge
  • modifications are made to the local switch to ensure it doesn’t become the root bridge or a transit switch to the root bridge:
    • bridge priority is raised to 49152
    • port costs of all local switch ports raised by 3000
  • the max-update-rate parameter allows the local switch to notify other upstream switches that stations downstream can be reached over the newly activated link.  this is done by sending the local switch sending dummy multicast frames to destination 0100.0ccd.cdcd on behalf of the stations contained in it’s MAC address table.  These frames are sent out a rate specified by this parameter, to control the amount of bandwidth used.
  • display the current status of STP uplink fast:
    • Switch# show spanning-tree uplinkfast

BackboneFast

  • enables fast convergence in the network backbone or core layer switches after a spanning-tree topology change occurs
  • a switch actively determines whether alternative paths exist to the root bridge, in case the switch detects an indirect link failure (a when a link that is not directly connected to a switch fails
  • indirect link failures are detected when a switch receives inferior BPDU’s from it’s designated bridge on either it’s root port or a blocked port
  • normally a switch must wait for the max-age timer to expire before responding to the inferior BPDU’s
  • simple to configure
  • short-circuits the max-age timer when needed
  • can reduce the maximum convergence delay only from 50 to 30 seconds
  • configure with the following command: Switch(config)# spanning-tree backbonefast
  • should be enabled on all switches in the network because it requires the use of the RLQ request and reply mechanism
  • disabled by default
  • verify with the following command: Switch# show spanning-tree backbone fast

Leave a Reply

Your email address will not be published. Required fields are marked *