You are on page 1of 11

University

(Rapid) Spanning Tree Protocol

Alcatel-Lucent University Antwerp


1

Alcatel-Lucent University Antwerp

During class please switch off your mobile, pager or other that may interrupt.
Course objectives:
After attending this section, youll be able to:
> describe the need for a spanning tree protocol in a bridged network
> describe how a spanning tree is calculated
> describe the improvements of RSTP compared to STP
Entry level requirements:
You must have a basic knowledge of bridging (Ethernet networks).
Suggested duration:
1 hour

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

IEEE 802.1D (STP) & IEEE 802.1W (RSTP)


802.1D Bridge Protocol
Interconnection of IEEE 802 LANs
Includes Spanning Tree Protocol (STP)

802.1W Rapid Bridge Protocol


Amendment to IEEE Std 802.1D
Rapid Spanning Tree Protocol (RSTP)

> The current 802.1d Spanning Tree Protocol (STP) standard was designed at a time where
recovering connectivity after an outage within a minute or so was considered adequate
performance. With the advent of Layer 3 (L3) switching in LAN environments, bridging now
competes with routed solutions where protocols such as Open Shortest Path First (OSPF) and
Enhanced Interior Gateway Routing Protocol (EIGRP) are able to provide an alternate path in
less time.
> Rapid Spanning Tree Protocol (RSTP; IEEE 802.1w) can be seen as an evolution of the 802.1d
standard. The 802.1d terminology remains primarily the same, and most parameters have been
left unchanged so users familiar with 802.1d can rapidly configure the new protocol
comfortably. 802.1w is also capable of reverting back to 802.1d in order to interoperate with
legacy bridges (thus dropping the benefits it introduces) on a per-port basis.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

Without STP, redundant paths cause loops


Multiple active paths between hosts cause loops

end stations receive duplicate messages


switches learn host MAC addresses on multiple
interfaces.
This results
network
LOOP! in an unstable
Phys MAC addr. Port nbr
6
3

P1
P1

P1

P2
P2

1
1

P1

P2

Phys1

Phys2
2

1
P1

Phys MAC addr.

Port nbr

P1

P1

P2

> In order to have a more reliable network, redundant paths are needed. But redundant paths in
an Ethernet network cause loops:
Traffic in a loop might circulate indefinitely (theres no hop-limiting parameter (Time to
live or Hop Count) in an Ethernet network!)
In case of broadcast messages causing endless broadcast storms, the impact on the
network might be huge!
> STP can prevent this by blocking connections that might cause loops.
STP calculates a forwarding tree without loops.
If theres a failure in the network, STP will calculate a new spanning tree which will use
certain bridge ports that were blocked in the previous spanning tree.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

STP prevents loops


In bridged networks, redundant paths can cause loops
Spanning Tree Protocol (STP) prevents loops:
STP allows only one single path between any pair of hosts

STP relies on BPDU messages: Bridged Protocol Data Units


Key functions:

find an active topology without loops


block and unblock ports
discover failures

> Redundant links may be interesting for reliability reasons, but we cannot afford to have loops in
the bridged network. Therefore STP will block certain links in order to have only one way to go
from node A to node B.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

STP Spanning Tree Protocol


IEEE 802.1d bridge protocol
Spanning tree: loop-free subset of a network topology
Select root bridge
Calculate loop-free path from root to every bridge
Block ports to put redundant paths in standby
In case of failure, a new spanning tree will be calculated and
activated.

Operation of STP is transparent to hosts

> How does the STP protocol work?


In order to calculate a spanning tree, bridges exchange information using BPDU
messages (Bridged Protocol Data Units).
The first step in the calculation of a spanning tree is to select a root bridge. By default,
this is the bridge with the lowest bridge identifier, but the operator can override this. (The
bridge id is configurable.)
Once a complete spanning tree is calculated, only the bridge ports that are in the spanning
tree are in the forwarding state while other ports are blocked. No frames can pass through
blocked bridge ports! (No loops are possible!)
In case the active link fails, STP will detect this and set up a new spanning tree. A blocked
link will become active.
RSTP (Rapid Spanning Tree Protocol) has a mechanism to recover from failure situations
much quicker than STP: RSTP converges faster than STP.
> The spanning tree protocol is used between bridges in a bridged network, not between hosts
and bridges. The operation of STP is transparent to hosts. Hosts cannot detect whether they
are connected to a single LAN segment or a switched LAN with multiple segments.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

STP Spanning Tree Protocol

Bridges exchange BPDU Bridge Protocol Data Unit


BPDU are used to build the spanning tree :
select root bridge (lowest bridge-id)
calculate shortest path from each bridge to the root based on path cost
define a designated bridge in each LAN that will forward frames to the
root (based on path cost)
on each non-root bridge, select the root port
Only one port can be the designated port.

block ports to be excluded from the spanning tree

the bridge-id is based on one of the MAC addresses


Bridge id and path cost are configurable!

> Tree : hierarchical


> The root bridge is the bridge with the lowest bridge-id (=MAC address). This means that the
root bridge neednt be the bridge with the most links.
A bridge may have different MAC addresses (per port / per LAN segment), but one of them
will be chosen for the bridge-id.
> Each port on a bridge is given a cost, e.g. associated with the bandwidth of that port. Typically,
it is preferable to use high bandwidth ports. Therefore they will have a lower cost.
> On each non-root bridge, the root port is the port that gives the best path towards the root. One
other port on that bridge can be designated port. All others will be blocked.
> Calculation of a spanning tree:
In STP, each bridge assumes its the root and broadcasts its BPDU, containing its bridge
id. The bridges soon find out which one is the real root.
Each bridge calculates the best path (lowest cost) to the root. The resulting paths make
up the spanning tree and the corresponding ports on those paths are enabled (ports are in
the forwarding state). Other ports are blocked (standby).
When a new bridge is added to the network or when theres a failure, a new spanning tree
is calculated. It is possible that ports that were blocked in the previous spanning tree will
be in the forwarding state in the new tree.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

Bridge and port definitions


R

If receiving best BPDU on segment

If sending best BPDU on segment

ROOT
D

Alternate port
(Blocked)

DESIGNATED

D
Take over

Backup port
(Blocked)
Take over

> Spanning tree works in first instance by selecting a root bridge on the LAN. This particular
bridge is elected through the exchange of BPDU. In fact each bridge receives an identifier
made part from its MAC address and part from an arbitrary given value. (Priority).
> When the root bridge is selected, then each other bridge selects one of its ports with the least
path cost to the root bridge. The least cost path is determined by STP looking at the bandwidth
of the link.
> STP continually monitors the network always looking for failures on switch ports or changes in
the network topology. If a change is noticed, STP can quickly make redundant ports available
and close other ports to ensure the network continues to function
> All ports on the root bridge are known as designated ports and are in what is known as
forwarding state. Forwarding state ports can send and receive traffic.
> All of the other bridges present are known as non-root bridges, they choose a port known as a
root port which sends and receives traffic.
> On non-root bridges only one port can be designated, all others are blocked. Designated ports
forward MAC addresses. Designated ports are selected after the bridge determines the lowest
cost path to get to the root bridge.
> By using this method, the redundant links are closed down. They can be opened again if there
is a change in network topology and the link is needed once more.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

Bridge and port definitions


R

If receiving best BPDU on segment

If sending best BPDU on segment

Alternate port
(Blocked)

ROOT
A1

C1

B1

B2
Take over

A2

C2

DESIGNATED

C3 Backup port
(Blocked)

Take over

> Propagation delays can occur when protocol information passes through a switched LAN. As a
result, topology changes can take place at different times and at different places in a switched
network. When a Layer 2 interface transitions directly from non-participation in the spanning
tree topology to the forwarding state, it can create temporary data loops. Ports must wait for
new topology information to propagate through the switched LAN before starting to forward
frames. They must allow the frame lifetime to expire for frames that have been forwarded under
the old topology.
> Bridge ports running STP can be in one of four (five) states:
Listening - listens to make sure no loops occur before passing frames, the bridge is
computing the spanning tree protocol to see if this port should be blocked or forwarding
Learning - learns MAC addresses but does not forward frames, transitional state between
listening and learning. The port is still not used but the bridge can already learn addresses
from this port.
Forwarding - sends and receives frames on the port, the port is used to carry user traffic
Blocking - listens but will not forward frames, the port is not used by user traffic
(Disabled virtually non-operational)
> RSTP ports can be in only three different states. See further.
> Spanning-Tree information is shared by exchanging BPDU messages.
The Spanning-Tree Protocol calculation requires that bridges communicate with other bridges
in the network that are running the Spanning-Tree Protocol. Each bridge is responsible for
sending and receiving configuration messages called bridge protocol data units (BPDUs).
BPDUs are exchanged between neighboring bridges at regular intervals (typically 1 to 4
seconds) and contain configuration information that identifies the:
Bridge that is presumed to be the main bridge or root (root identifier)
Distance from the sending bridge to the root bridge (called the root path cost)
Bridge and port identifier of the sending bridge
Age of the information contained in the configuration message
If a bridge fails and stops sending BPDUs, the bridges detect the lack of configuration
messages and initiate a spanning-tree recalculation.

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

Spanning tree Example

root

0
2
Bridge
(identifier)

11
4

10
4

12

13

9
19

19

LAN

path cost

19

4
19 5

Path cost

100

100

100
8

10Mbps
100
100Mbps
19
1000Mbps
4
10Gbps
2

> In complex networks, you can configure the bridge-id of a certain bridge which you would prefer
to have as root bridge (bridge-id = 0).
Each time a new bridge is added, the spanning tree must be adapted. Maybe the new
bridge will become the root bridge. In order to avoid this, you can select the root bridge
manually by configuring the bridge-id=0.
> How to calculate the path cost?
Faster links have a lower cost (e.g. a 100 Mbps link has a lower cost than a 10 Mbps link).
Always choose the lowest cost.
In case the cost is equal, the bridge-id will be taken into account (same principle as used
to define the root bridge).

3FL 00327_A AAAA WBZZA Ed 01

2007 Alcatel-Lucent., All rights reserved

RSTP (Rapid Spanning Tree Protocol)


Limitations of IEEE802.1d STP ?
STP recovers connectivity after an outage within 1 minute.
L3 routers need less time for recovery (e.g. OSPF)!
Cisco added proprietary enhancements (configuration needed)

IEEE802.1w RSTP
Evolution of 802.1d STP
Most parameters remain the same
Capable of reverting back to 802.1d on a per port basis

Enhancements
Only 3 port states: discarding, learning and forwarding
All bridges send BPDUs periodically i.s.o relaying root-BPDU
Rapid transition to forwarding state which (faster convergence - sometimes
within hundreds of ms)
New topology change mechanisms

10

> In STP only the root bridge will generate BPDU messages. The designated bridges will only
relay them.
The recovery time from failure can take 1 minute (time needed to calculate a new spanning
tree).
> In RSTP all bridges will send BPDU messages every hello time. This will generate more
overhead traffic, but reduce the take-over time!
The recovery time from failure can be less than a second!
> Port States: There are only three port states left in RSTP:
STP

RSTP

Disabled

Discarding

Blocking

Discarding

Listening

Discarding

Learning

Learning

Forwarding

Forwarding

> CPE-modem: no loops possible, so CPE mustnt be able to receive BPDUs. No STP
implemented.

3FL 00327_A AAAA WBZZA Ed 01

10

2007 Alcatel-Lucent., All rights reserved

www.alcatel-lucent.com

11

3FL 00327_A AAAA WBZZA Ed 01

11

2007 Alcatel-Lucent., All rights reserved

You might also like