Tuesday, July 10, 2012

CCIE Written: Spanning Tree Protocol


CCIE Written: STP

 STP Variations
                - 802.1d: Common Spanning Tree (CST)
                - PVST / PVST+: Cisco Per-VLAN Spaning-Tree
                - 802.1W: Rapid Spanning Tree (RSTP)
                -802.1S: Multiple Spanning Tree (MSTP)

How 802.1d STP works
                - Elect one Root Bridge
                - Elect one Root Port per bridge/switch
                - Elect Designated Ports

Root Bridge Election
* Switch with lowest Bridge ID in the network becomes Root Bridge
* Bridge ID contains:

  • Bridge Priority: 0~61440 in increments of 4096. 0 is the most preferable and 32768 is the default value.
  • System ID Extension: 0~4095 Used to encode the VLAN number of the Spanning Tree Instance
  • MAC Address: Lowest MAC address is more preferable
* Only Root Bridge is in charge of generate for the BPDU packets (802.1d only)
* Once elected, BPDUs flow down from root of the tree to the the leaves

Rot Port Election
* RP is upstream facing towards Root Bridge
* Elected based on lowest Root Path Cost
                - Cumulative cost of all links to get to the root
* Cost based on inverse bandwidth
                - i.e. higher bandwidth, lower cost, not linear.
                - 10Mbps=100, 100Mbps=19, 1000Mbps=1
* If tie in cost
                - Choose lowest upstream BID
                - Choose lowest upstream Port ID

Designated Port Election
* DPs are downstream away from the Root Bridge
* Like Root Port, elected based on
                - Lowest Root Path Cost
                - Lowest BID
                - Lowest Port ID
* All other ports go into blocking mode
                - Receive BPDUs
                - Discard all other traffic
                - Cannot Send Traffic

802.1d Convergence
* CST convergence based on timers set on Root Bridge
                - Hello Timer: How often to send the BPDU
                - Forward Delay Timer:
                   To control transition from blocking – listening – learning- forwarding stages
                - Max Age Timer:
                  How long we wait for the upstream device to send the BDPU packet before
                  we declare them down. It consider as dead interval.
* Default Hello is 2 seconds, Forward delay is 15 seconds (listening 15s, learning 15s) and total is 30s, Max Age is 20s
* The minimum value for the Forward delay is 7s
 * Convergence time will be forward delay + max age
* TCN BPDUs used to notify Root Bridge of changes
                - Flows up the tree to root, root replies with ACK
                - CAM aging time set to Forward Delay to flush MAC addresses

PVST/PVST+

Per VLAN STP (PVST)
* One instance of Legacy STP per VLAN
* Cisco ISL support

Per VLAN STP Plus (PVST+)
* One instance of Legacy STP per VLAN
* Cisco ISL and 802.1Q support
* Provides interoperability between CST and PVST
* Default mode on most Catalyst platforms
* Allows root bridge / port placement per VLAN

Cisco’s STP Enhancement ( to speed up the convergence)
* Port Fast
                - Edge ports shouldn’t be subject to Forwarding Delay or generate TCNs
                - It allow the port that is port-fast enable jump from disable to forwarding

* Uplink Fast
                - Direct Root Port failure should re-converge immediately if Alternate Port
                  available
                - Used when multiple link from one switch to another switch
                - Cisco Doc          
                - When enable, it will increase the bridge priority to 49152 and increase by 3000
                   for port priority
                - Reason of the increase is to make sure the bridge won’t elect as Root Bridge
                  and the port wouldn’t elect to designated port. The uplink fast is make sure of 
                  the Alternate port and enable in the global mode

* Backbone Fast
                - Indirect failures should start recalculating immediately
                - Inferior BDPU sent from the upper edge switch to determine the original path
                   to root bridge is down
                - It needs to wait the Max Age if the neighbor link is not down but the upper link
                  is down            
                - If backbone fast Is enable in the switch, it will skip the Max Age timers
                - Cisco Doc             
* Port fast saves Max Age + Forward Delay timers
* Uplink Fast saves Forward Delay timers
* Backbone Fast saves Max Age timers

Other Cisco’s STP Features
* BPDU Filter
                - Filter BDPUs in and out

* BPDU Guard
                - If BPDU is received shut port down

* Root Guard
                - If superior BPDU is received shut port down

* Loop Guard & UDLD (Uni Direction Link Detection) (same features)
                - Prevent unidirectional links
                - Loop Guard is using the STP BPDU to detect
                - UDLD using its own lightweight L2 keep alive

802.1w RSTP

Rapid Spanning Tree Protocol
* Faster convergence compare to legacy 802.1d
* Rapid convergence based on sync process or proposal process
* Allow for faster initial convergence
* Announce itself as root bridge when startup and start sending the proposal
* Switches will agree on the proposal on who is the root bridge in sub second method
* RSTP simplified the port state to 3 stages: Discarding, learning, forwarding.
* All bridges generate BPDUs
                - Send out all every Hello Interval which by default 2s
                - If three Hellos are missed neighbor is declared down and CAM is immediately
                   flushed
                - Three Hello timers is greater than Max Age which 6s vs 20s
                - Allows for faster re-convergence
* Runs backward compatibility with 802.1d

802.1s MSTP

Multiple Spanning Tree Protocol
* User defined instances are separate from VLANs
* PVST+ uses one instance per VLAN
* Uses 802.1w for rapid convergence
* Highly scalable
                - Switches with same instances, configuration revision number and name form
                   a “region”
                - Different regions see each other as virtual bridges

No comments:

Post a Comment