Beruflich Dokumente
Kultur Dokumente
INFRASTRUCTURE:
SPANNING-TREE PROTOCOLS (STP)
The slides are modified from the course: Cisco CCNP SWITCH.
1
SPANNING TREE
PROTOCOLS (STP)
2
SPANNING TREE PROTOCOL
(STP)
• STP is a loop-prevention protocol.
3
REDUNDANCY CREATES
LOOPS
4
L2 LOOPS
• Broadcasts
and Layer 2 loops can be a
dangerous combination.
• After
an Ethernet frame starts to loop, it will
probably continue until someone shuts off
one of the switches or breaks a link.
5
L2 LOOPS
Where’s Where’s
Host B? Host B?
FLOOD FLOOD
Uh oh.
6
L2 LOOPS
• Theprevious slide shows the creation of a
feedback loop, which will bring down the
network.
• Also, each switch ends up receiving the frame
(originally from Host A) on two different
ports.
• The switches will flip flop the bridging table
entry for Host A (creating extremely high
CPU utilization). 7
STP PREVENTS LOOPS
• The purpose of STP is to avoid and eliminate
loops in the network by negotiating a loop-
free path through a root bridge.
• If
more than two paths exists, STA picks the
best path and blocks the rest
9
BPDUS
• All
switches using STP must exchange Bridge
Protocol Data Units with other switches.
10
BPDUS
The exchange of BPDU messages results in
the following:
Source: 00:D0:C0:F5:18:D1
LLC Length: 38
Protocol Identifier: 0
12
Flags: %00000000
BPDUS
13
WHAT’S A BID?
14
BID
• Consists of two components:
• If
all devices have the same priority, the bridge with the lowest
MAC address becomes the root bridge.
15
ELECTING A ROOT BRIDGE
• At startup, a switch assumes that it is the root
bridge and sets the Bridge ID equal to the
Root ID in its BPDUs
16
ELECTING A ROOT BRIDGE
17
HOOKING UP WITH THE
ROOT
18
HOOKING UP WITH THE
ROOT
• In
order to choose which ports will forward
data and which ports will block data, the
switch looks at three components of the
BPDU:
20
PATH COST
21
PATH COST
22
BRIDGE IDS
• If
the path costs of the received BPDUs are
equal, the switch looks at the Bridge ID to
determine which port should forward.
23
PORT COST/PORT ID
• Ifthe path cost and bridge IDs are equal (as in the case of
parallel links), the switch goes to the port priority as a
tiebreaker.
• If
all ports have the same priority, the port with the lowest
port number forwards frames.
24
PORT ID
0/2
0/1
25
RESULTS OF BPDU
EXCHANGE
• One switch is elected root
Designated Switch
Switch A
Root
27
RESULTS OF BPDU
EXCHANGE
•A root port for each switch is selected.
• This is the port that provides the best path
from the switch to the root switch (usually
the lowest-cost path).
• Portsthat will not be forwarding are placed in
the blocked state.
• These ports will continue to send and
receive BPDU information but will not be
allowed to send or receive data.
28
SPANNING-TREE PORT
STATES
29
SPANNING-TREE PORT
STATES
30
SPANNING-TREE PORT
STATES
• Listen: Theport transitions from the blocked
state to the listen state
33
SPANNING-TREE PORT
STATES
34
SPANNING-TREE PORT
STATES
35
STP TIMERS
36
STP TIMERS
The default value of the forward delay (15
seconds) was originally derived assuming a
maximum network size of seven bridge hops,
a maximum of three lost BPDUs, and a hello-
time interval of 2 seconds.
• Forward delay is used to determine the
length of:
• Listening state
• Learning state 37
STP TIMERS
Max Age is the time that a bridge stores a
BPDU before discarding it.
45
CONFIGURING STP (IOS)
Enable Spanning Tree (Enabled by default)
46
CONFIGURING STP (IOS)
Configuring Port Cost (to tweak Path Cost)
47
VERIFYING STP (IOS)
48