Monday, 17 May 2010

STP & RSTP

STP - 802.1d

RSTP - 802.1w



Problems without STP:



  • Broadcast storms

  • MAC table instability

  • Multiple frame transmission


The most important Fields in the STP Hello BPDU:



  • Root switch id

  • Sender switch id

  • Path cost to root switch from sender


Port states of STP



  • Blocked

  • Listening - during this state root switch, root ports and designated ports are elected.

  • Learning - STP leaves the interface in each interim state(listen and learn) for a time equal to the forward delay(15 seconds by default) timer.

  • Forwarding

  • Disabled



Costs

The less cost is the best path is.



  • 10 mbit – 100

  • 100 mbit – 19

  • 1Gbit – 4

  • 10Gbit – 2



Stages in building spanning tree



  • Select a root bridge. The default priority of Cisco switches is 32768. After power on all switches in network start to send BPDUs.If switch recieves BPDU with id less then his own id, then it stops sending it's own BPDU and starts to forward BPDU from switch with less id. It forwards them as Hello timer configured on root switch.

  • Determine the least cost paths to the root bridge

  • Designated ports are choose using bridged ID or port number if many ports of one switch are connected to 1 segment. Segment – part of lan divided by router, switch or bridge. All access ports – designated ports.

  • Disable all other root paths. Any active port that is not a root port or a designated port is a blocked port.


STP requires a waiting period of MaxAge (default 20 seconds) before reacting to some events, whereas RSTP only has to wait 3*Hello (default 6 seconds). Additionally, RSTP eliminates the forward delay (default 15 seconds) time in both Listening and Learning States. Traditional STP convergence has essentially three time periods, each of which RSTP improves upon. These three waiting periods of (by default) 20, 15, and 15 seconds create 802.1d STP’s relatively slow convergence, and the reduction or elimination of these waiting periods makes RSTP convergence occur quickly. RSTP convergence times are typically less than 10 seconds. In some cases, they can be as low as 1 to 2 seconds.




STP features

  • Portfast - switch port immediatly from blocking state to forwarding state.



switchx(config-if)#spanning-tree portfast

switchx(config)#spanning-tree portfast default

switchx# show running-config interface



  • BPDUGuard – turns port to error state if this port with portfast enabled receives BPDU packet.

switchx(config-if)#spanning-tree bpduguard enable


  • BPDUfilter – filtering will immediately take a port out of PortFast if it receives a BPDU and force the port to be part of the STP topology again.

  • Root Guard - when the switch interface with Root Guard enabled receives a superior BPDU from the neighboing switch — a BPDU that has a lower/better bridge ID—the switch with Root Guard reacts. It disables the interface.

  • UplinkFast - allows a switch to find alternate paths to the root bridge before the primary link fails. This means that if the primary link fails, the secondary link would come up more quickly: the port wouldn’t wait for the normal STP convergence time of 50 seconds.


S1(config)#spanning-tree uplinkfast


  • EtherChannel misconfig guard

  • Loopguard Default

  • BackboneFast


S1(config)#spanning-tree backbonefast



Configuration

  • Set priority:

spanning-tree vlan vlan-id priority priority

  • Set switch as root. This command changes the base priority to 24,576:

spanning-tree vlan vlan-id root {primary | secondary}


  • This command sets the switch’s base priority to 28,672 regardless of the current root’s current priority value.

spanning-tree vlan vlan-id root secondary


  • Set cost for vlan interfaces:


spanning-tree vlan vlan-id cost cost

Summary



  • One root bridge per broadcast domain

  • One root port per non root bridge

  • One designated port per segment

  • Nondesignated ports are unused


Some facts about RSTP


  • RSTP calls the Blocking State the Discarding State.

  • RSTP only has to wait 3*Hello (default 6 seconds).

  • RSTP convergence times are typically less than 10 seconds. In some cases, they can be as low as 1 to 2 seconds.

  • Uses special RSTP messages.


RSTP characterizes the types of physical connectivity in a campus LAN into three different types:


  • Link-type point-to-point – switch to switch

  • Link-type shared – switch to hub

  • Edge-type – switch to PC


Port states:


  • Discarding

  • Learning

  • Forwarding


Port roles:



  • Root port

  • Designated port

  • Alternate port - identifies a switch’s best alternative to its current RP

  • Backup port - applies only when a single switch has two links to the same segment (collision domain - hub).



Switch forwards BPDUs out the port in Forwarding State and gets the same BPDU back on the port that is in Discarding State. So SW2 knows it has an extra connection to that segment, called a backup port.



Process of changing root port:



  • Switch recieves BPDU with better root path

  • Switch blocks all other link-type ports - this process is called synchronization.

  • Switch negotiates with other switch, what sends the better BPDU.

  • As a result of negotiation they start forwarding data



Multiple instances of STP and RSTP


  • Per-VLAN Spanning Tree Plus (PVST+) – Cisco proprietary feature for using STP in VLANS. It is possible to use it as load balancing tool, configuring traffic for one VLAN through one trunk and other VLAN for another trunk.

  • Rapid Per-VLAN Spanning Tree (RPVST) or Per-VLAN Rapid Spanning Tree (PVRST). This is cisco feature for using RSTP in vlans. 802.1w

  • The IEEE standard (802.1s) is often called either Multiple Spanning Trees (MST) or Multiple Instances of Spanning Trees (MIST). MIST allows the definition of multiple instances of RSTP, with each VLAN being associated with a particular instance.



(config)#spanning-tree mode {mst | rapid-pvst | pvst}

Etherchannel

Two versions: Cisco’s proprietary Port Aggregation Protocol (PAgP) and IEEE standard Link Aggregation Protocol (LACP).

16 ports max, 1600 Mbps or 16oo Gbps.

All interfaces in each EtherChannel must be the same speed and duplex, and both ends of the channel must be configured as either a Layer 2 or Layer 3 interface.

It is possible to aggregate ports from different switches using Split Multi-Link Trunking (SMLT) or Cisco Virtual Switching System or combine two cisco switches into stack.

The “no switchport” command is required to change interface from layer2 to layer3 mode.



SW1(config)#int fa 0/17

SW1(config-if)#channel-group 1 mode on

SW1#show etherchannel 1 summary



Troubleshooting





show spanning-tree active|interfaces|detail|summary|vlan

debug spanning-tree events
















No comments:

Post a Comment

Ping does not work

Today I would like to discuss a banal situation: host A is directly connected to host B, ping from host A to host B does not work. What are...