0% found this document useful (0 votes)
16 views26 pages

Buoi 16 - Spanning Tree

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views26 pages

Buoi 16 - Spanning Tree

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Spanning Tree Protocol

© 2004 - iPMAC Informatics Technology J.S.C


Objectives

ƒ Describe the problem of looping data


frame in a switched network
ƒ Operation of STP to solve the problem
ƒ Operation of RSTP to solve the problem

IPMAC
Networking Academy
Spanning Tree Protocol

Broadcast
Storm !!!

ƒ Without the Spanning Tree Protocol (STP), frames would loop


for an indefinite period of time in networks with physically
redundant links.
ƒ To prevent looping frames, STP blocks some ports from
forwarding frames so that only one active path exists between
any pair of LAN segments (collision domains).

IPMAC
Networking Academy
The Good, the Bad, and the Happy

ƒ The Good: the frames do not loop infinitely, which makes


the LAN usable.
ƒ The Bad: some traffics travel a longer path through the
network, because a shorter physical path is blocked.
ƒ The Happy: the net result is good.

IPMAC
Networking Academy
How Spanning Tree Works
ƒ The Spanning Tree Algorithm places each bridge or switch port int
either a forwarding state or a blocking state.
ƒ Forwarding means that the interface CAN forward or receive data
frames.
ƒ Blocking means that the interface CAN NOT forward or receive
data frames.

ƒ The collective set of forwarding ports creates a single path over


which frames are sent between Ethernet segments.
IPMAC
Networking Academy
Spanning Tree Operation

ƒ STP’s job is to figure out how to put the correct interfaces into
blocking and forwarding states to prevent loops but allow
frames to be sent between every segment.
1. STP select a root brigde, STP put all interfaces on it in
forwarding state.
2. On each nonroot brigde, STP places the port receiving
lowest-cost BPDU from the root, called root port, in
forwarding state.
3. The bridge forwarding the lowest-cost BPDU onto
segment is the designated bridge for that segment. And
the port attached to segment, designated port, is placed
in forwarding state.
4. All other interfaces are placed in blocking state.
IPMAC
Networking Academy
Electing the Root …

ƒ STP begins with each bridge claiming to be the root bridge


by sending STP messages, which are called hello bridge
protocol data units (BPDUs).
ƒ The BPDUs contain the following:
ƒ The root bridge’s bridge ID – The bridge ID consists of the
bridge’s priority and a MAC address on that bridge. At the
beginning of the root-election process, each bridge claims to be
root, so each bridge advertises itself as root using its own bridge
ID. The lower the priority, the better chance of being root.
ƒ The cost to reach the root from this bridge – each bridge
claims to be root, so the value is set to 0, which is this bridge’s
cost to reach itself. The lower the cost, the better the path.
ƒ The bridge ID of the sender of this BPDU – regardless of
whether the bridge sending the BPDU is the root.

IPMAC
Networking Academy
… and Discovering Root Ports …

ƒ The bridges elect a root bridge based on the bridge IDs in


the BPDUs.
ƒ If a bridge hears of a better candidate, it stops advertising
itself as root and starts forwarding the hello sent by the
better candidate.
ƒ Eventually someone wins.
ƒ The root bridge is the bridge with the lowest numeric value
for the bridge ID.
ƒ Each switch has one root port, which is the port receiving the
least-cost BPDU from the root.
ƒ STP places the root port int forwarding state.

IPMAC
Networking Academy
… and Discovering Designated Ports

ƒ If an interface advertises the lowest-cost hello onto a LAN


segment, STP places it in forwarding state.
ƒ That interface is called designated port.
ƒ The cost is calculated by adding the cost in the received hello
to the cost of the interface on which the hello was received.
ƒ If the cost were the same, the lower bridge ID of the switch
sending the BPDUs to the segment would become the
designated bridge.
ƒ The bridge has the designated port becomes the designated
bridge.
ƒ All other port are in blocking state.

IPMAC
Networking Academy
Spanning Tree Operation (The result)
ƒ One root bridge per network (Forwarding)
ƒ One root port per nonroot bridge (Forwarding)
ƒ One designated port per segment (Forwarding)
ƒ Nondesignated ports are unused (Blocking)

IPMAC
Networking Academy
Default Port Costs

ƒ Port costs can be configured, or you can use the default


values.
ƒ The IEEE revised the cost values because the original
values did not anticipate the growth of Ethernet to
support 10-Gigabit Ethernet.

Ethernet Speed Original IEEE Cost Revised IEEE Cost


10 Mbps 100 100
100 Mbps 10 19
1 Gbps 1 4
10 Gbps 1 2

IPMAC
Networking Academy
Reacting to Changes in the Network

ƒ The STP topology does not change unless the network topology
changes.
The root bridge sends a new hello
BPDU every 2 seconds by default.

Each bridge uses this repetitive hearing


of hello as a way to know that its path
to the root is still working.
IPMAC
Networking Academy
Topology Change Notification (TCN)

ƒ Each bridge uses the repetitive hearing of hello BPDU as a way


to know that its path to the root is still working.
ƒ When a bridge ceases to receive the hellos for an entire
MaxAge time, something has failed, so it reacts and starts the
process of changing the spanning tree.
ƒ This bridge flushes its address table because the location of
MAC addresses might have changed.
ƒ When a bridge needs to signal a topology change, it starts to
send TCN BPDUs on its root port.
ƒ The designated bridge receives the TCN, acknowledges it,
remove the MAC table entries, and generates another one for
its own root port.

IPMAC
Networking Academy
Optional STP Features

ƒ EtherChannel combines from two to eight parallel Ethernet


trunks between the same pair of switches, bundled into an
EtherChannel.
ƒ STP treats an EtherChannel as a single link, so if at least one of
the links is up, STP convergence does not have to occur.
ƒ Without EtherChannel, if you have multiple parallel links
between two switches, STP blocks all the links except one.
ƒ With EtherChannel, all the parallel links can be up and working
at the same time, while reducing the number of times STP must
converge, which in turn makes the network more available.

IPMAC
Networking Academy
Optional STP Features (cont)

ƒ PortFast allows a switch to place a port in forwarding state


immediately when the port active physically.
ƒ The only ports on which you can safely enable PortFast are
ports on which you know that no bridges, switches, or other
STP-speaking devices are connected.
ƒ PortFast is most appropriate for connections to end-user
devices.
ƒ If you turn on PortFast for end-user devices, when an end-user
PC boots, as soon as the Ethernet card is active, the switch port
can forward traffic.
ƒ Without PortFast, each port must wait MaxAge plus twice
Forwarding Delay, which is 50 seconds by default.

Coming up ... RSTP >>


IPMAC
Networking Academy
Rapid Spanning Tree

ƒ RSTP (802.1w) works just like STP (802.1d) in several


ways:
ƒ It elects the root switch using the same parameters
and tiebreakers.
ƒ It elects the root port on nonroot switches with the
same rules.
ƒ It elects designated ports on each LAN segment with
the same rules.
ƒ It places each port in either forwarding or blocking
state – although RSTP calls blocking state “discarding”.
ƒ RSTP can be deployed alongside traditional 802.1d STP
bridges and switches.
IPMAC
Networking Academy
RSTP Link and Edge Types
ƒ Link-type point-to-point
ƒ Link-type shared
ƒ Edge-type

ƒ RSTP reduces convergence time for link-type point-to-point and


edge-type connections.
ƒ It does not improve convergence over link-type shared
connections.
IPMAC
Networking Academy
RSTP Port Roles

ƒ RSTP designates ports that receive suboptimal BPDUs as


alternate ports.
ƒ If a switch has two links to the same segment, it places one of
two ports in forwarding state and the other, backup port, in
discarding state.
IPMAC
Networking Academy
RSTP Convergence

ƒ Edge-Type Behavior and PortFast


ƒ RSTP improves convergence for edge-type connections
by immediately placing the port in forwarding state
when the link is physically active.
ƒ Link-Type Shared
ƒ RSTP doesn’t do anything differently from STP on link-
type shared links.
ƒ Link-Type Point-to-Point
ƒ RSTP improves convergence over full-duplex links
between switches – the links that RSTP calls “link-type
point-to-point.”

IPMAC
Networking Academy
RSTP Convergence

ƒ RSTP recognizes the loss of the path to the root bridge in


3 times the hello timer – 6 seconds.
ƒ RSTP removes the need for listening state and reduces
the time required for learning state by actively discovering
the network’s new state.
ƒ STP passively waits on new BPDUs, and reacts to them,
during the listening and learning states.
ƒ With RSTP, the switches negotiate with neighboring
switches.
ƒ When ports that can be transitioned immediately to
forwarding state are discovered, they are transitioned
immediately.

IPMAC
Networking Academy
RSTP Convergence Example
ƒ Step 1: the network has no redundancy.
ƒ Step 2: SW4 realizes that it is receiving a better BPDU than the one
that entered from SW3.

IPMAC
Networking Academy
RSTP Convergence Example

ƒ Step 3: RSTP on SW4


temporarily blocks all other link-
type ports to prevent the
possibility of introducing loops.
Then SW4 negotiates with its
neighbor on the new root port
using RSTP Proposal and
Agreement message.
ƒ SW4 and SW1 agree that
they can each place their
respective ends of the
new link into forwarding
state immediately.

IPMAC
Networking Academy
RSTP Convergence Example

ƒ Step 4: SW4 and SW3 repeat


the same process that SW1 and
SW3 just performed. SW4 still
blocks, preventing loops. SW4
forwards the new root BPDU to
SW3.

ƒ Assume that SW3 thinks that


BPDU from SW4 is better
than the one received from
SW2 – which makes SW3
repeat the same process that
SW4 just performed.

IPMAC
Networking Academy
RSTP Convergence Example
Step 6

Old BPDU
ƒ Step 5: SW3 repeat the same SW1
is better
than One
process that SW4 just performed. from SW3

ƒ Step 6: SW3 stills blocks on its


upper interface at this point. SW2 is
now receiving two BPDUs, but the SW2 Not as
same old BPDU it had been receiving good as
BPDU
all along is still the better BPDU. from SW3

So SW2 takes no action.


SW3

RSTP is finished converging.

SW4

IPMAC
Networking Academy
Summary

ƒ The key elements of a redundant networking topology


ƒ The benefits and risks of a redundant topology
ƒ The role of spanning tree in a redundant-path switched
network
ƒ The key elements of spanning-tree operation
ƒ The process for root bridge election
ƒ Spanning-tree states
ƒ Rapid Spanning-Tree Protocol

IPMAC
Networking Academy
Stop here!

It’s time for questioning.

IPMAC
Networking Academy

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy