Tuesday, August 4, 2015

7 - SPANNING TREE PROTOCOL

HOW STP WORKS
- Elect one root bridge
- Elect one root port per bridge
- Elect designated ports

ROOT BRIDGE ELECTION
- Switch with the lowest bridge ID in the network becomes the root bridge
- Bridge id contains:
  - Bridge Priority: 0-61440 in increments of 4096
  - System ID Extension 0-4095 (default is the vlan number)
  - MAC Address

CHANGE THE ROOT BRIDGE ELECTION
- Manually change BID priotity
  - spanning-tree vlan (vlan) priority
  - Lower is better
- Use root bridge macro
  - spanning-tree vlan (vlan) root (primary|secondary)
  - sets local priority based on current root bridge
- Verification
  -show spanning-tree vlan (vlan)
  -show spanning-tree root

ROOT PORT ELECTION

- Root port is upstream facing towards root bridge
- Elected based in the lowest root path cost
  - Cumulative cost of all links to get to the root
  - Higher bandwidth - lower the cost
- If tie in cost
  - choose lowest upstream BID
  - chosse lowest upstream port ID

DESIGNATED PORT ELECTION

- Designated port are downstream facing away fron root bridge
- Like root port, election based on
  - Lowest root path cost
  - Lowest BID
  - Lowest port ID
- All other ports go into blocking mode
  - Receive BPDU
  - Discard all other traffic
  - Cannot send traffic

CHANGING THE PORT'S ROLE

- Modify the port's cost
  - spanning-tree (vlan) cost
  - bandwidth
- Modify the bridge ID
  - spanning-tree vlan (vlan) priority
- Modify the port ID
  -spanning-tree val (vlan) port-priority
- Verification
  - show spanning-tree interface (int) detail
  - show spanning-tree vlan (vlan) detail

STP TIMERS

- Timers affect the transition between port states
  - Set only on the root bridge
- Hello
  - How often configuration BPDU's are sent
  - Default 2 seconds
- MaxAge
  - How long to wait in blocking state without hearing a BPDU
  - Default to 20 seconds
- Forward Delay
  - how long to wait in each the listening and learning phases
  - Default 15 seconds

CHANGING STP TIMERS

- Configuration
  - spanning-tree vlan (vlan) hello-time
  - spanning-tree vlan (vlan) forward-time
  - spanning-tree vlan (vlan) max-age
- Verification
  - show spanning-tree vlan (vlan)

Notes
- What ever root bridge is elected for vlan1 will also be the root brifdge for the others stp instances (vlans)
  cause when we advertise the bridge id, we offset the vlan number but the mac adddress remains the same. that means
  if the bridges have the default configuration then the switch with the lowest mac address will become the root bridge

- the root bridge will have all its ports in designated and forwarding state and it will not have root ports,
  we can check that with the command
                                     show spanning-tree

- Designated ports are downstream ports, away fromt the root bridge

- The root bridge set the timer in spanning tree, to check the timers use the command show spanning-tree detail


No comments:

Post a Comment