Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

EnTel - EETAC - UPC nov.

-21

Redundant links vs
broadcast storms 
virtual loop-free topology

TOPIC 5

SPANNING TREE PROTOCOL


(STP)

TOPIC 5
Nov-21

SPANNING TREE PROTOCOL
 1.1. Problem statement
Network Interconnection Techniques (IX) - Topic 5

 1.2. STP: How it works


 1.3. STP messages (BPDU)
 1.4. Topology change
 1.5. Other concepts

Interconnexió de Xarxes – Topic 5 1


EnTel - EETAC - UPC nov.-21

1.1 – Problem statement

Nov-21
PROBLEM STATEMENT

Redundant links  increased network reliability

Network Interconnection Techniques (IX) - Topic 5



• Another link is available in case one breaks down
 BUT: broadcast storms
• Switches/bridges automatically learn and retransmit
based on their SAT
 Solution: virtual tree topology (loop-free) over any
physical network topology with redundant links
• Use a given link unless there is a problem, then
• Use the back-up link

1.1 – Problem statement


Nov-21

EXAMPLE. REDUNDANT LINKS
E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 Source Address Tables (SATs) are empty


 E1 sends a frame to E5 4

Interconnexió de Xarxes – Topic 5 2


EnTel - EETAC - UPC nov.-21

1.1 – Problem statement

Nov-21
EXAMPLE. REDUNDANT LINKS
E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3

E7 SAT SW1 1
SAT SW3
E1 #1 E1 #1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 SW1 and SW3 add an entry for the source address (E1) in the SAT
 SW1 and SW3 resend the frame over all the other ports 5

1.1 – Problem statement


Nov-21

EXAMPLE. REDUNDANT LINKS
E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 SAT SW1 1
SAT SW3
E1 #1 E1 #1
SW3 2
1
2 SW1 3
SAT SW2 E5
E1 #2

E8 1 SW2 2
E6
E4

 Frame sent by SW3 reaches E5 and SW2


 SW2 adds an entry for the source address (E1) in the SAT, then will resend 6

Interconnexió de Xarxes – Topic 5 3


EnTel - EETAC - UPC nov.-21

1.1 – Problem statement

Nov-21
EXAMPLE. REDUNDANT LINKS
E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3

E7 SAT SW1 1
SAT SW3
E1 #1 E1 #1
SW3 2
1
2 SW1 3
SAT
SAT SW2
SW2 E5
E1
E1 #2
#1

E8 1 SW2 2
E6
E4

 Frame sent by SW1 reaches SW2


 SW2 adds an entry for the source address (E1) in the SAT and resends 7

1.1 – Problem statement


Nov-21

EXAMPLE. REDUNDANT LINKS
E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 SAT SW1 1
SAT SW3
E1 #1 #2
E1 #1
SW3 2
1
2 SW1 3
SAT
SAT SW2
SW2 E5
E1
E1 #2
#1

E8 1 SW2 2
E6
E4

 Frame sent by SW2 reaches E5 (again!!!) and SW3


 SW3 adds an entry for the source address (E1) in the SAT and resends 8

Interconnexió de Xarxes – Topic 5 4


EnTel - EETAC - UPC nov.-21

1.1 – Problem statement

Nov-21
EXAMPLE. REDUNDANT LINKS

Network Interconnection Techniques (IX) - Topic 5


 The frame sent by E1 circulates in two loops = BROADCAST STORM
 E5 continuously receives the same frame, over and over again 9

 SATs become unstable

1.1 – Problem statement


Nov-21

A POSSIBLE SOLUTION...
E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 Eliminate redundancy by unplugging one or more link


 In case of link failures in the network, we may loose connection! 10

Interconnexió de Xarxes – Topic 5 5


EnTel - EETAC - UPC nov.-21

1.1 – Problem statement

Nov-21
THE SOLUTION
 Spanning Tree Algorithm (STA)

Network Interconnection Techniques (IX) - Topic 5


• Developed in 1985 by Radia Perlman at DEC 1
 IEEE 802.1d standard in 1990, then 802.1d-2004
• IEEE 802.1: standard focused on interconnection,
maintainance and security in LAN and MAN
• Spanning Tree Protocol (STP) is part of this standard
 STP runs on any layer 2 connecting device
• Switches, bridges, ...
 The word bridge is used in this topic and refers to both
• Final stations or hubs are not involved in the tree
configuration

11
1Perlman, R.. “An algorithm for distributed computation of a spanningtree in an extended LAN.” 
SIGCOMM 1985 (1985). 

TOPIC 5
Nov-21

SPANNING TREE PROTOCOL
 1.1. Problem statement
Network Interconnection Techniques (IX) - Topic 5

 1.2. STP: How it works


 1.3. STP messages (BPDU)
 1.4. Topology change
 1.5. Other concepts

12

Interconnexió de Xarxes – Topic 5 6


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

Nov-21
ALGORHYME
I think that I shall never see

Network Interconnection Techniques (IX) - Topic 5


a graph more lovely than a tree.
A tree whose crucial property
is loop-free connectivity.
A tree that must be sure to span
so packet can reach every LAN.
First, the root must be selected. STEP1 – Root selection 
By ID, it is elected.
Least-cost paths from root are traced. STEP2 – Root ports
In the tree, these paths are placed. STEP3 – Designated ports
A mesh is made by folks like me, Virtual tree (no loops) over
then bridges find a spanning tree. physical loops (reliability) 13

Radia Perlman

1.2 – STP: How it works


Nov-21

STP step by step
1. Select one of the switches/bridges (SW/B) as the root bridge
Network Interconnection Techniques (IX) - Topic 5

 The one with the highest priority (smallest number) Best-SW/B


 The one with the lowest ID (MAC address of the bridge) logic

2. For each other SW/B, select one of its ports as the root port
 The port of the SW/B with the lowest Root Path Cost (RPC)
 In case needed, the port connected to the best-SW/B is selected

3. For each link, select one of the ports as the designated port
 The port of the link with the lowest RPC
 In case needed, the port connected to the best-SW/B is selected

4. All the remaining ports need to be blocked


 They are virtually “shut off”: they do not process users’ traffic
 They are available as back-up ports

14
5. The spanning tree is periodically refreshed
 Every Hello Time, the Root Bridge sends a refresh message

Interconnexió de Xarxes – Topic 5 7


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS

Nov-21
STEP1 – Root selection 

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3

E7 1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 All the SWs have same priority


 All the links have cost equal to 1 15

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS
Nov-21

STEP2 – Root port selection 

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 All the SWs have same priority


 All the links have cost equal to 1 16

Interconnexió de Xarxes – Topic 5 8


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS

Nov-21
STEP3 – Designated port selection 

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3
RPC=1
E7 1
SW3 2
1
2 SW1 3 E5

RPC=1
E8 1 SW2 2
E6
E4

 All the SWs have same priority


 All the links have cost equal to 1 17

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS
Nov-21

STEP4 – Block all the other ports

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3
RPC=1
E7 1
SW3 2
1
Only one
2 SW1 3
of these E5
two
RPC=1
E8 1 SW2 2
E6
E4

 All the SWs have same priority


 All the links have cost equal to 1 18

Interconnexió de Xarxes – Topic 5 9


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS

Nov-21
STEP4 – Block all the other ports

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3
RPC=1
E7 1
SW3 2
1
Only one
2 SW1 3
of these E5
two
RPC=1
E8 1 SW2 2
E6
E4

 Now, only ports that are active (i.e., root ports and designated ports) can
process and resend users’ frames 19

1.2 – STP: How it works

STP SOLUTION TO REDUNDANT LINKS
Nov-21

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
SW3 2
1
2 SW1 3 E5

E8 1 SW2 2
E6
E4

 Source Address Tables (SATs) are empty


 E1 sends a frame to E5 20

 Only active ports process and resend users’ frames

Interconnexió de Xarxes – Topic 5 10


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

EXAMPLE. REDUNDANT LINKS

Nov-21
SW3#2 does not 
E2

Network Interconnection Techniques (IX) - Topic 5


resend the frame
E1 E3 SW3#2 does not 
process incoming 
E7 SAT SW1 1
frame
SAT SW3
E1 #1 E1 #1
SW3 2
1
2 SW1 3 SAT SW2 E5
E1 #1

E8 1 SW2 2
E6
E4

 SW1 and SW3 learn source address (E1) over the incoming port
 SW1 resends the frame over all its other ports 21

 SW2 learns source address (E1) over the incoming port and resends

1.2 – STP: How it works


Nov-21

Bridge configuration and STP 
 Each bridge spreads the information about its own topology
Network Interconnection Techniques (IX) - Topic 5

to its neighbours
• Learning from its neighbours, the bridge can reconfigure
accordingly
 Special STP frames carry such info  Bridge Protocol Data Unit
(BPDU)
• The updated information will span from the root till the leafs of
the tree
 Each bridge configures itself locally
 After some time, all the bridges converge to the final topology
 In the meanwhile, we need to make sure there are no loops  port
states
 Once the STP is configured
• SW/B only learn @MAC and resend users’ frames over root
and/or designated ports
22
• Users’ frames received on blocked ports are discarded by the
SW/B

Interconnexió de Xarxes – Topic 5 11


EnTel - EETAC - UPC nov.-21

1.2 – STP: How it works

Nov-21
(1) When a management BPDU is received
PORT STATES (2) When a management BPDU is received
after a failure
(3) Port is selected as root or designated
(4) Port is not root or designated anymore
(5) Forward delay timer expires

Network Interconnection Techniques (IX) - Topic 5


Disable

(2)
(1) (2) (4)

(2)
(2) Blocking (4)

(4) (3)

(5) (5)
Listening Learning Forwarding

23
23
These two states guarantee no loops
during the configuration phase!

1.2 – STP: How it works


Nov-21

STP maintenance and reconfiguration
 The topology must be maintained
Network Interconnection Techniques (IX) - Topic 5

• In case a segment/bridge fails, a new path must be used


 Every hello time, the root bridge sends its BPDU
• Its neighbours refresh its topology and send its BPDU over
its designated ports
• Their neighbours refresh their topology and send their
BPDUs over their designated ports
• …
 In case of a failure, the bridges involved automatically
reconfigure themselves
• STP information is updated locally and span over the whole
topology!
• BUT: we need to refresh Source Address Tables 24
accordingly

Interconnexió de Xarxes – Topic 5 12


EnTel - EETAC - UPC nov.-21

TOPIC 5

Nov-21
SPANNING TREE PROTOCOL
 1.1. Problem statement

Network Interconnection Techniques (IX) - Topic 5


 1.2. STP: How it works
 1.3. STP messages (BPDU)
 1.4. Topology change
 1.5. Other concepts

25

1.3 – BPDU
Nov-21

BRIDGE PROTOCOL DATA UNITS


 Bridges use special messages to autoconfigure
Network Interconnection Techniques (IX) - Topic 5

their ports and converge to a tree topology


• Configuration BPDU
• Topology change BPDU

 STP is a protocol that relies on LLC services

STP GARP BPDU

LLC SAP 0x42

0x42 | 0x42 | Ctrl| BPDU


LLC
MAC 01-80-C2-00-00-00 | SMAC | … LLC PDU 26
Físic
Multicast DMAC “all the bridges”

Interconnexió de Xarxes – Topic 5 13


EnTel - EETAC - UPC nov.-21

1.3 – BPDU

CONFIGURATION BPDU (I)

Nov-21
BPDU of 35 bytes
Protocol ID (0)
(2 bytes)

Network Interconnection Techniques (IX) - Topic 5


Version (0)
(1 bytes)
Message type (0)
Configuration BPDU
(1 bytes)
“00000000” Flags – Topology change Advice
(1 bytes)
ID of the ROOT bridge elected by “Bridge ID” Root ID
2 bytes PRIORITY | 6 bytes @MAC (8 bytes)
Root Path Cost
(4 bytes)
ID of the bridge sending this BPDU Bridge ID
2 bytes PRIORITY | 6 bytes @MAC (8 bytes)
Port ID
(2 bytes)
Message Age
This is the info we use in the exercises! (2 bytes)
Maximum Age
ROOT_ID | RPC | Bridge_ID | (Port_ID) (2 bytes)
Hello Time
(2 bytes)
Forward Delay 27
(2 bytes)

1.3 – BPDU

CONFIGURATION BPDU (II)
Nov-21

BPDU of 35 bytes
Protocol ID (0)
There are several parameters on which all (2 bytes)
Network Interconnection Techniques (IX) - Topic 5

bridges must agree Version (0)


(1 bytes)
Message type (0)
Configuration BPDU
(1 bytes)
“00000000” Flags – Topology change Advice
(1 bytes)
Root ID
(8 bytes)
Root Path Cost
(4 bytes)
Bridge ID
(8 bytes)
It sets a global clock for all the bridges in the network. When Port ID
(2 bytes)
this timer expires, the bridge has to recalculate the STP based
Message Age
on the valid infromation he still receives from its neighbours. (2 bytes)
Maximum Age
The 802.1d recommends 20 seconds.
(2 bytes)
The 802.1d recommends 2 seconds. Hello Time
(2 bytes)
Transition time from one state to the other for a root or for Forward Delay 28
(2 bytes)
a designated port. The 802.1d recommends 15 seconds.

Interconnexió de Xarxes – Topic 5 14


EnTel - EETAC - UPC nov.-21

1.3 – BPDU

TOPOLOGY CHANGE NOTIFICATION BPDU

Nov-21
(TCN_BPDU)
BPDU of 4 bytes

Network Interconnection Techniques (IX) - Topic 5


Protocol ID (0)
(2 bytes)
Version (0)
(1 bytes)
Message type (128)
(1 bytes)

Topology Change
Notification BPDU
“10000000”

29

1.3 – BPDU

BPDU sent and STP configuration 
Nov-21

 All the Bridges have same priority


 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3
B3.0.B3.1

E7 1 B3.0.B3.2
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B2.0.B2.1
B2.0.B2.2

E8 1 B2 2
E6
E4
When STP begins:
 None has STP info of its neighbours 30
 All the SW/B declare themselves as the Root Bridge

Interconnexió de Xarxes – Topic 5 15


EnTel - EETAC - UPC nov.-21

1.3 – BPDU

BPDU sent and STP configuration 

Nov-21
 All the Bridges have same priority
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3
B3.0.B3.1

E7 1 B3.0.B3.2
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B2.0.B2.1
B2.0.B2.2

E8 1 B2 2
E6
E4
B1 compares the BPDU received with its own BPDU:
 B1 is the best SW/B  Root Bridge (it has no root port ) 31
 Port 1, 2 and 3 send a better BPDU wrt the one received 
Designated ports

1.3 – BPDU

BPDU sent and STP configuration 
Nov-21

 All the Bridges have same priority


 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3
B3.0.B3.1

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2
1
2 B1 3 B3.0.B3.2
E5
B2.0.B2.1
B2.0.B2.2
B1.1.B2.2
B1.0.B1.3
E8 1 B2 2
E6
E4
B2 compares the BPDU received with its own BPDU:
 B1 is the best SW/B  B2 selects port 1 as it root port with RPC=1 32
 BPDU from B2 on port 2 changes to B1.1.B2.2, which is better than the
one received  Port 2 is designated

Interconnexió de Xarxes – Topic 5 16


EnTel - EETAC - UPC nov.-21

1.3 – BPDU

BPDU sent and STP configuration 

Nov-21
 All the Bridges have same priority
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


B1.0.B1.1

E1 E3
B3.0.B3.1

E7 1 B3.0.B3.2
B1.1.B3.2
B3 2
B1.0.B1.2 B1.0.B1.3
1 B1.1.B2.2
2 B1 3 E5

E8 1 B2 2
E6
E4
B3 compares the BPDU received with its own BPDU:
 B1 is the best SW/B  B3 selects port 1 as it root port with RPC=1 33
 BPDU from B3 on port 2 changes to B1.1.B3.2, which is worst than the
one received  Port 2 is blocked

1.3 – BPDU

BPDU sent and STP configuration 
Nov-21

 All the Bridges have same priority


 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B1.1.B2.2

E8 1 B2 2
E6
E4
Every Hello Time:
 Root Bridge (B1) sends its BPDU on its designated ports
34
 B2 and B3 receive it on their root port and refresh the info
 B2 sends its own BPDU on its designated port

Interconnexió de Xarxes – Topic 5 17


EnTel - EETAC - UPC nov.-21

TOPIC 5

Nov-21
SPANNING TREE PROTOCOL
 1.1. Problem statement

Network Interconnection Techniques (IX) - Topic 5


 1.2. STP: How it works
 1.3. STP messages (BPDU)
 1.4. Topology change
 1.5. Other concepts

35

1.4 – Topology Change

TOPOLOGY CHANGE (I)


Nov-21

 After a failure, one or more bridges do not receive the


expected BPDU on one (or more) port
Network Interconnection Techniques (IX) - Topic 5

• The STP info expires (Max Age in the BPDU!!) on that (those)
port
• A new route is calculated with the information they have
 If they get no info (i.e., they do not have a blocked port), they declare
themselves as the root bridge until a new path is found
 If they receive info on several ports, they select the best one
• The reconfiguration is automatic
 No need to send TCN_BPDU!
 Who sends a TCN_BPDU?
• Every SW/B whose port enters/exits the blocking state
• TCN_BPDU is sent through the root port, so to reach the Root
Bridge
 Intermediate SW/B resends the TCN_BPDU on their root port
• In this case, we need to reconfigure the SATs
 Root Bridge receives a TCN_BPDU 36

Interconnexió de Xarxes – Topic 5 18


EnTel - EETAC - UPC nov.-21

1.4 – Topology Change

TOPOLOGY CHANGE (II)

Nov-21
 Root Bridge receives a TCN_BPDU on one (or more) of its
ports

Network Interconnection Techniques (IX) - Topic 5


• In the next Configuration BPDU (i.e., the next Hello Time)
 It activates the TC (Topology Change) flag on all its ports
 It activates the TCA (Topology Change Acknowledgment) flag on the port
(ports) where it has received the TCN_BPDU
 When a SW/B receives a Config_BPDU with TC flag ON
• It resets the timer in the SAT so that all the entries expires
 It is needed, since the new topology may have changed the path to
reach a station!
• It maintains the TC flag activated in the next Config_BPDU that
it sends on its designated ports
 When a SW/B receives a Config_BPDU with TCA flag ON
• It maintains the TCA flag activated in the next Config_BPDU that
it sends only on the designated ports where it received the
TCN_BPDU previously 37

1.4 – Topology Change

STP reconfiguration 
Nov-21

 All the Bridges have same priority


The link on B3 port 1 fails
 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B1.1.B2.2

E8 1 B2 2
E6
E4
Every Hello Time:
 Root Bridge (B1) sends its BPDU on its designated ports
38
 B2 and B3 receive it on their root port and refresh the info
 B2 sends its own BPDU on its designated port

Interconnexió de Xarxes – Topic 5 19


EnTel - EETAC - UPC nov.-21

1.4 – Topology Change

STP reconfiguration 

Nov-21
 All the Bridges have same priority
The link on B3 port 1 fails
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


B1.0.B1.1

E1 E3

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1 B1.1.B2.2
2 B1 3 E5

E8 1 B2 2
E6
E4
B3 stops receiving the BPDU from B1 on port 1
 Port 1 is designated (it’s the best, as it does not receive other BPDU!) 39
 B3 has a blocked port (port 2) where it still receives a BPDU

1.4 – Topology Change

STP reconfiguration 
Nov-21

 All the Bridges have same priority


The link on B3 port 1 fails
 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3
B1.2.B3.1

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1 B1.1.B2.2
2 B1 3 E5

E8 1 B2 2
E6
E4
B3 stops receiving the BPDU from B1 on port 1
 B1 is the best SW/B  B3 selects port 2 as its root port with RPC=2 40
 Port 2 exits the blocking state!  B3 needs to send a TCN_BPDU to B1

Interconnexió de Xarxes – Topic 5 20


EnTel - EETAC - UPC nov.-21

1.4 – Topology Change

STP reconfiguration 

Nov-21
 All the Bridges have same priority
The link on B3 port 1 fails
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3
B1.2.B3.1

E7 1 TCN_BPDU
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
TCN_BPDU B1.1.B2.2

E8 1 B2 2
E6
E4
B3 stops receiving the BPDU from B1 on port 1
 Port 2 exits the blocking state!  B3 needs to send a TCN_BPDU to B1 41
 Designated ports receive the TCN_BPDU

1.4 – Topology Change

STP reconfiguration 
Nov-21

 All the Bridges have same priority


 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3
B1.2.B3.1
B1.0.B1.1 TC
E7 TC 1

B1.0.B1.2 B1.0.B1.3
B3 2
TC TC+TCA
1
2 B1 3 E5
B1.1.B2.2
TC+TCA
E8 1 B2 2
E6
E4
In the next Hello Time, B1 sends the Config_BPDU
 With TC flag ON on port 1 and 2 42
 With TC and TCA flags ON on port 3 ( )
B2 sends its Config_BPDU with TC+TCA flags ON on port 2 ( )

Interconnexió de Xarxes – Topic 5 21


EnTel - EETAC - UPC nov.-21

1.4 – Topology Change

STP reconfiguration – Case 2

Nov-21
 All the Bridges have same priority
The link on B2 port 2 fails
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3

E7 1
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B1.1.B2.2

E8 1 B2 2
E6
E4
Every Hello Time:
 Root Bridge (B1) sends its BPDU on its designated ports
43
 B2 and B3 receive it on their root port and refresh the info
 B2 sends its own BPDU on its designated port

1.4 – Topology Change

STP reconfiguration – Case 2
Nov-21

 All the Bridges have same priority


 All the links have cost equal to 1

E2
Network Interconnection Techniques (IX) - Topic 5

E1 E3

E7 1 B1.1.B3.2
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1 B1.1.B2.2
2 B1 3 E5
B1.1.B2.2

E8 1 B2 2
E6
E4
B3 stops receiving the BPDU on port 2:
 B1 is the best SW/B  B3 selects port 2 as its designated port 44

Interconnexió de Xarxes – Topic 5 22


EnTel - EETAC - UPC nov.-21

1.4 – Topology Change

STP reconfiguration – Case 2

Nov-21
 All the Bridges have same priority
 All the links have cost equal to 1

E2

Network Interconnection Techniques (IX) - Topic 5


E1 E3

E7 1 B1.1.B3.2
B1.0.B1.1
B3 2
B1.0.B1.2 B1.0.B1.3
1
2 B1 3 E5
B1.1.B2.2

E8 1 B2 2
E6
E4
B3 stops receiving the BPDU on port 2:
 B1 is the best SW/B  B3 selects port 2 as its designated port 45
 Port 2 exits the blocking state!  B3 needs to send a TCN_BPDU to B1
 ...

nov.-21

TOPIC 5
PROTOCOL D'ARBRE D'EXPANSIÓ
 1.1. Problem statement
 1.2. STP: How it works
Interconnexió de Xarxes – Topic 5

 1.3. STP messages (BPDU)


 1.4. Topology change
 1.5. Other concepts

46

Interconnexió de Xarxes – Topic 5 23


EnTel - EETAC - UPC nov.-21

1.5 – Others concepts

Nov-21
PROBLEMS ASSOCIATED WITH STP
 STP Latency

Network Interconnection Techniques (IX) - Topic 5


• Solution: RSTP (first as IEEE802.1w, now it has been
integrated to IEEE 802.1d-2004)
 Insensitivity to VLANs
• Solutions: PVSTP, MSTP, GVRP
 New standard IEEE 802.1aq (2011)
• Shortest Path Bridging
 Instead of using STP
• We do not study it in this course

47

1.5 – Others concepts


Nov-21

STP LATENCY
 STP algorithm takes around 50 segonds in calculating a given
topology. Each state transition takes:
Network Interconnection Techniques (IX) - Topic 5

• From blocking to listening: 20 seconds


• From listening to learning: 15 seconds
• From learning to forwarding: 15 seconds
 STP latency adds on top to the regular operational latency of the
bridge/switch
• While the port is in other states rather than forwarding, data frames
are reteined (cannot be transmitted!)
 This may happen at any topology change process, during topology
refreshening, ...
• The higher the number of ports in the LAN, the longer the STP
latency
 STP reconfiguration latency after a failure: 30-60 seconds
• RSTP (Rapid Spanning Tree) tries to reduce it
48

Interconnexió de Xarxes – Topic 5 24


EnTel - EETAC - UPC nov.-21

1.5 – Others concepts

Nov-21
RSTP – IEEE802.1D‐2004 
 What changes compared to the original STP

Network Interconnection Techniques (IX) - Topic 5


• Two more ports
 Alternate port – substitute of the root port
 Back-up port – substitute of the designated port (on P2P links, only)
• Three states only: discarding, learning and forwarding
 Disable, blocking and listening states are grouped together into
discarding state
• New BPDU format
 Version 2 type 2
 It uses all the flags
 Information of the port’s type and state
 Management of the proposal/agreement mechanism
• Any bridge can send a configuration BPDU every Hello Time
 In the original STP, only the Root Bridge (every 2 seconds, default) 49

1.5 – Others concepts


Nov-21

RSTP –IEEE802.1D‐2004 
 Faster convergence to a new topology
Network Interconnection Techniques (IX) - Topic 5

• On P2P links, only: 2-3 seconds


 RSTP compatible with the original STP
• In case a bridge/switch receives a BPDU indicating the
original STP (i.e., version 0), it changes from RSTP to
original STP
 The advantages associated with the RSTP are lost on that link!

50

Interconnexió de Xarxes – Topic 5 25


EnTel - EETAC - UPC nov.-21

1.5 – Others concepts

Nov-21
RSTP –IEEE802.1D‐2004 

STP RSTP Included in the Does the port learn

Network Interconnection Techniques (IX) - Topic 5


Port state Port state active topology? MAC addresses?

Deshabilitat Discarding No No
Bloqueig Discarding No No
Escolta Discarding Sí No
Aprenentatge Learning Sí Sí
Forwarding Forwarding Sí Sí

Topology change ACK


5th byte in the
configuration BPDU 0 1 2 3 4 5 6 7
Agreement

Learning Forwarding
Proposal Rol del port (00: Unknown; 01: Alternatiu/backup; 51
10: Arrel; 11: Designat)
Topology change

1.5 – Others concepts


Nov-21

VLAN AND STP
 VLANs are defined on top of the changing STP topology
Network Interconnection Techniques (IX) - Topic 5

• Frames are not sent out of blocked ports


• In a complex LAN, STP may partition VLANs
 Due to blocked ports after a topology change
 A blocked port that is elected root or designated should be able to
configure the necessary VLANs that may be communicating on that
port
• The VLAN configuration should be mapped with the STP
topology at any time
 Each VLAN should be guaranteed a loop-free topology
• Traffic may be split on different paths
• Several proposals exist
 PVSTP
 MSTP 52
 GVRP

Interconnexió de Xarxes – Topic 5 26


EnTel - EETAC - UPC nov.-21

1.5 – Others concepts

Nov-21
VLAN AND STP: PER‐VLAN STP
 A single STP for each VLAN  spanning forest

Network Interconnection Techniques (IX) - Topic 5


• Better use of the links
 Propietary solution from CISCO (no standard)
 Increase of the number of BPDUs in the network
• There is a root bridge in each VLAN
• Each root bridge will periodically send the configuration BPDU!
 Increase in the use of the bridges’ CPU

53

1.5 – Others concepts


Nov-21

VLAN AND STP: MSTP (I)
 Multiple STP
Network Interconnection Techniques (IX) - Topic 5

• Extension of the Rapid STP


• Compatible with STP and RSTP
 Defined in the 802.1Q-2011 standard
 Identify VLANs groups where the same STP topology may be used
• They form a Common Spanning Tree Region (CST)
 Define Multiple Spanning Tree Regions (MST)
• MST region: group of bridges that are connected among them and for
which one STP per VLAN is needed
• Each STP topology inside the MST region follows its own MST process
• The MST configuration table holds inside the MST region, only
 All the bridges in the MST region use the same table
 Mapping between the frames of a given VLAN and its MST process
• From the outside, the MST region appears as a virtual CST bridge
 BPDUs of the MST are not sent out of the region
54

Interconnexió de Xarxes – Topic 5 27


EnTel - EETAC - UPC nov.-21

1.5 – Others concepts

Nov-21
VLAN AND STP: MSTP (II)
 Common and Internal ST (CIST)

Network Interconnection Techniques (IX) - Topic 5


• Unique tree that connects all the bridges (STP, RSTP, MSTP)
through a single active topology
• BPDUs created by CIST carry information of the common
regions and MST
 Outside the MST regions, a BPDU is seen as a BPDU from RSTP
 Inside the MST regions, the specific information for the MST region is also
taken into account
 Optimize the number of STP topologies
• Load balancing on each link
• Reduction in the CPU usage

55

Nov-21

CONCLUSIONS
 STP defines a tree topology (NO loops)
1. Select one root bridge
Network Interconnection Techniques (IX) - Topic 5

2. For each bridge (apart from the root), select one root port
3. For each segment, select one designated port
4. Block all the other ports (no root, no designated)
 Bridges learn all this information through the exchange of
configuration BPDUs
• End stations do not process BPDUs
• Topology change notification BPDUs do have a different format
 Main goal: avoid loops
• Intermediate states: listening and learning
 Reconfiguration afer a failure
• Root port timer expires  the bridge recalculates the STP internally
 If it has a blocked port, it has an alternate path to the root bridge!
 Correspondance between the tree topology and the paths where
data frames flow
56

Interconnexió de Xarxes – Topic 5 28


EnTel - EETAC - UPC nov.-21

Nov-21
BIBLIOGRAPHY
 S. Feit. Local Area High Speed Networks. Macmillan MTP

Network Interconnection Techniques (IX) - Topic 5


(2000)
• Chapter 13 – Spanning Tree Protocol
 F. Halsall. Comunicación de datos, Redes de Computadores y
sistemas abiertos. Addison-Wesley (1998, 4ed)
• Chapters 7.5 and 7.6 – Transparent bridges and STP
 R. Seifert. The All-new Switch Book: The Complete Guide to
LAN Switching Technology. Wiley Computer (2008) - online
version by Bibliotècnica UPC
• Chapter 5 – Loop control (5.1-5.3, and 5.7)

57

TOPIC 5
Nov-21

SPANNING TREE PROTOCOL
 ANNEX. Examples
Network Interconnection Techniques (IX) - Topic 5

58

Interconnexió de Xarxes – Topic 5 29


EnTel - EETAC - UPC nov.-21

nov.-21
INITIAL TOPOLOGY
Estació A
Hub

Interconnexió de Xarxes – Topic 5


Bridge Bridge

Hub
Hub
Hub

Estació B Bridge

Hub

Bridge
Bridge

Hub 59

nov.-21

EQUIVALENT TOPOLOGY FOR STP ALGORITHM
S1 C=3

1
1

B1 B2
Interconnexió de Xarxes – Topic 5

2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

60

Interconnexió de Xarxes – Topic 5 30


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP TOPOLOGY CONSTRUCTION
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2

Interconnexió de Xarxes – Topic 5


2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

61

Root port

nov.-21

EXAMPLE – STP TOPOLOGY CONSTRUCTION
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2


Interconnexió de Xarxes – Topic 5

2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

62

Root port Designated port

Interconnexió de Xarxes – Topic 5 31


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP TOPOLOGY CONSTRUCTION
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2

Interconnexió de Xarxes – Topic 5


2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

63

Root port Designated port

nov.-21

STP FINAL TOPOLOGY
Estació A
Hub
Interconnexió de Xarxes – Topic 5

Bridge1 Bridge2
#2 #1 #2 #1
Hub
Hub
Hub

Estació B Bridge3
#2 #3 #1

Hub

Bridge5
#2 #3
Bridge4 #1
#1 #2

Hub 64

Interconnexió de Xarxes – Topic 5 32


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP and USERS’ TRAFFIC
• L'estació A
transmet una trama Estació A
Hub @ # AGE
a l'estació B

SAT B2
A 1 10

Interconnexió de Xarxes – Topic 5


Bridge 1 Bridge2
#2 #1 #2 #1
Hub
Hub
• B1 rebrà la trama Hub
pel seu port 1 però
no la processa Estació B Bridge3
#2 #3 #1
(està bloquejat)
• Com queden les
taules SAT dels Hub
ponts?
Bridge5
#2 #3
Bridge4 #1
#1 #2

Hub 65

nov.-21

EXAMPLE – STP and USERS’ TRAFFIC
• L'estació A
transmet una trama Estació A
Hub @ # AGE
a l'estació B
SAT B2

A 1 10
Interconnexió de Xarxes – Topic 5

Bridge 1 Bridge2
#2 #1 #2 #1
Hub
Hub
• B1 rebrà la trama Hub
pel seu port 1 però
no la processa Estació B Bridge3
#2 #3 #1
(està bloquejat)
• Com queden les @ # AGE
SAT B3

taules SAT dels Hub


A 1 10

ponts?
Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE
SAT B5

Hub A 1 10
66

Interconnexió de Xarxes – Topic 5 33


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP and USERS’ TRAFFIC
• L'estació A
transmet una trama Estació A
Hub @ # AGE
a l'estació B

SAT B2
A 1 10

@ # AGE SAT B1

Interconnexió de Xarxes – Topic 5


A 2 10 Bridge 1 Bridge2
#2 #1 #2 #1
Hub
Hub
• B1 rebrà la trama Hub
pel seu port 1 però
no la processa Estació B Bridge3
#2 #3 #1
(està bloquejat)
• Com queden les @ # AGE

SAT B3
taules SAT dels Hub
A 1 10

ponts?
Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE

SAT B5
@ # AGE Hub A 1 10
67
SAT B4

A 2 10

nov.-21

EXAMPLE – STP and USERS’ TRAFFIC
• L'estació A
transmet una trama Estació A
Hub @ # AGE
a l'estació B
SAT B2

A 1 10

@ # AGE
SAT B1

Interconnexió de Xarxes – Topic 5

A 2 10 Bridge 1 Bridge2
#2 #1 #2 #1
Hub
Hub
• B1 rebrà la trama Hub
pel seu port 1 però
no la processa Estació B Bridge3
#2 #3 #1
(està bloquejat)
• Com queden les @ # AGE
SAT B3

taules SAT dels Hub


A 1 10

ponts?
Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE
SAT B5

@ # AGE Hub A 1 10
68
SAT B4

A 2 10

Interconnexió de Xarxes – Topic 5 34


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP and USERS’ TRAFFIC
• Desprès de 2 segons,
l'estació B transmet una Estació A
Hub @ # AGE
trama a l'estació A

SAT B2
A 1 8

@ # AGE SAT B1

Interconnexió de Xarxes – Topic 5


A 2 8 Bridge 1 Bridge2
B 2 10
#2 #1 #2 #1
Hub
Hub
Hub
• Com queden
ara les taules Estació B Bridge3
SAT dels #2 #3 #1

ponts? @ # AGE
AGE

SAT B3
A 1 8
8
Hub
B 2 10

Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE

SAT B5
@ # AGE Hub A 1 8
69
SAT B4

A 2 8

nov.-21

EXAMPLE – STP and USERS’ TRAFFIC
• Desprès de 2 segons,
l'estació B transmet una Estació A
Hub @ # AGE
trama a l'estació A
SAT B2

A 1 8

@ # AGE
B 2 10
SAT B1

Interconnexió de Xarxes – Topic 5

A 2 8 Bridge 1 Bridge2
B 2 10
#2 #1 #2 #1
Hub
Hub
Hub
• Com queden
ara les taules Estació B Bridge3
SAT dels #2 #3 #1

ponts? @ # AGE
SAT B3

A 1 8
Hub
B 2 10

Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE
SAT B5

@ # AGE Hub A 1 8
70
SAT B4

A 2 8 B 1 10

Interconnexió de Xarxes – Topic 5 35


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE – STP and USERS’ TRAFFIC
• Desprès de 2 segons,
l'estació B transmet una Estació A
Hub @ # AGE
trama a l'estació A

SAT B2
A 1 8

@ # AGE
B 2 10
SAT B1

Interconnexió de Xarxes – Topic 5


A 2 8 Bridge 1 Bridge2
B 2 10
#2 #1 #2 #1
Hub
Hub
Hub
• Com queden
ara les taules Estació B Bridge3
SAT dels #2 #3 #1

ponts? @ # AGE

SAT B3
A 1 8
Hub
B 2 10

Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE

SAT B5
@ # AGE Hub A 1 8
71
SAT B4

A 2 8 B 1 10

nov.-21

EXAMPLE –TOPOLOGY CHANGE
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2


Interconnexió de Xarxes – Topic 5

2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

Suposem que B3 deixa de rebre BPDUs (caduca temporitzador del port arrel, #1)
72

Root port Designated port

Interconnexió de Xarxes – Topic 5 36


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE –TOPOLOGY CHANGE
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2

Interconnexió de Xarxes – Topic 5


2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1
B3 ha de escollir un nou port arrel  #3
Pel seu port arrel (#3) envia una BPDU de notificació de canvi de topologia cap al pont arrel (B5) 73

Root port Designated port

nov.-21

EXAMPLE –TOPOLOGY CHANGE
S1 C=3
B1, B2, B3, B4:
BPDU NCT
low priority 1
1

B5: high priority B1 B2


Interconnexió de Xarxes – Topic 5

2
2
S2
S3 C=1
C=1 BPDU NCT
2 B3 1
3

S4
C=3 1

1 2 B5
B4 BPDU NCT
3

S5
C=1
El canvi de port arrel en el pont B3 produeix un canvi de topologia també en B1
Pel seu nou port arrel (#1), B1 envia una BPDU de notificació de canvi de topologia cap al
pont arrel (B5) 74

Root port Designated port

Interconnexió de Xarxes – Topic 5 37


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE –TOPOLOGY CHANGE
S1 C=3
B1, B2, B3, B4:
low priority 1
1

B5: high priority B1 B2

Interconnexió de Xarxes – Topic 5


2
2
S2
S3 C=1
C=1
2 B3 1
3

S4
C=3 1

1 2 B5
B4 3

S5
C=1

B5 envia BPDUs de configuració amb els flags actius  QUINS?


75

Root port Designated port

nov.-21

EXAMPLE –SAT AND TOPOLOGY CHANGE
• Desprès de 5 segons,
l'estació A transmet una Estació A
Hub @ # AGE
nova trama a l'estació B
SAT B2

A 1 3
10

@ # AGE
B 2 5
SAT B1

Interconnexió de Xarxes – Topic 5

A 12 10
3 Bridge 1 Bridge2
B 2 5 #2 #1
#2 #1
Hub
Hub
Hub

Estació B Bridge3
#2 #3 #1

@ # AGE
SAT B3

A 1 3
Hub
B 2 5

Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE
SAT B5

@ # AGE Hub A 1 3
76
SAT B4

A 2 3 B 1 5

Interconnexió de Xarxes – Topic 5 38


EnTel - EETAC - UPC nov.-21

nov.-21
EXAMPLE –SAT AND TOPOLOGY CHANGE
• Desprès de 5 segons,
l'estació A transmet una Estació A
Hub @ # AGE
nova trama a l'estació B

SAT B2
A 1 10

@ # AGE
B 2 5
SAT B1

Interconnexió de Xarxes – Topic 5


A 1 10 Bridge 1 Bridge2
B 2 5 #2 #1
#2 #1
Hub
Hub
Hub
B5 no ha actualitzat la SAT
• Té l'estació B associada al Estació B Bridge3
port 2 #2 #3 #1

• Descarta la trama!!! @ # AGE

SAT B3
A 1 3
La trama no arriba a B! Hub
B 2 5

Bridge5
#2 #3
Bridge4 #1
#1 #2
@ # AGE

SAT B5
@ # AGE Hub A 1 3
10
77
SAT B4

A 2 3 B 1 5

nov.-21

EXAMPLE –SAT AND TOPOLOGY CHANGE
• Desprès de 5 segons,
l'estació A transmet una Estació A
Hub @ # AGE
nova trama a l'estació B
SAT B2

A 1 10

@ # AGE
B 2 5
SAT B1

Interconnexió de Xarxes – Topic 5

A 1 10 Bridge 1 Bridge2
B 2 5 #2 #1
#2 #1
Hub
Hub
Hub
B5 no ha actualitzat la SAT
• Té l'estació B associada al Estació B Bridge3
port 2 #2 #3 #1

• Descarta la trama!!! @ # AGE


SAT B3

A 1 3
La trama no arriba a B! Hub
B 2 5

Bridge5
#2 #3
És fonamental que, Bridge4
quan
un canvi de topologia, hi ha #1

es tornin a aprendre#1les #2
@MAC a les SAT de tots els ponts @ # AGE
SAT B5

@ # AGE Hub A 1 3
10
78
Qui o Aquè2 assegura l'actualització de la SAT quan hi
SAT B4

3 B 1 5
ha un canvi de topologia?

Interconnexió de Xarxes – Topic 5 39


EnTel - EETAC - UPC nov.-21

nov.-21
FASES D'OPERACIÓ
 Llavors, com es posen d'acord els ponts?
 Els ponts llegeixen la informació de les BPDUs de
configuració per formar l'arbre

Interconnexió de Xarxes – Topic 5


• Escullen el millor camí fins a l'arrel
• Algorisme per determinar el millor camí (la millor BPDU)
 B1 i B2 són dues BPDU amb els costos especificats, llavors
if (B1.root_id < B2.root_id)  B1 és el millor
else if (B1.root_id > B2.root_id)  B2 és el millor
else if (B1.root_cost+C1 < B2.root_cost+C2)  B1 és el millor
else if (B1.root_cost+C1 > B2.root_cost+C2)  B2 és el millor
else if (B1.tx_id < B2.tx_id)  B1 és el millor
else if (B1.tx_id > B2.tx_id)  B2 és el millor
else if (B1.port_id < B2.port_id)  B1 és el millor
else if (B1.port_id > B2.port_id)  B2 és el millor
 C1 i C2 són els costos associats als ports on entren B1 i B2, 79
respectivament

nov.-21

FASES D'OPERACIÓ
 Escollir el pont arrel
• El pont compara el seu identificador (i prioritat) amb la informació de les
BPDUs que rep
if (B1.root_id < B2.root_id)  el pont amb root_id transportat en B1 és el pont arrel
Interconnexió de Xarxes – Topic 5

else if (B1.root_id > B2.root_id)  el pont amb root_id transportat en B2 és el pont arrel
 Escollir el port arrel
• Cada pont calcula la seva RPC
if (B1.root_cost+C1 < B2.root_cost+C2)  port on rep B1 és arrel
else if (B1.root_cost+C1 > B2.root_cost+C2)  port on rep B2 és arrel
else if (B1.tx_id < B2.tx_id)  port on rep B1 és arrel
else if (B1.tx_id > B2.tx_id)  port on rep B2 és arrel
else if (B1.port_id < B2.port_id)  port on rep B1 és arrel
else if (B1.port_id > B2.port_id)  port on rep B2 és arrel
• C1 i C2 són els costos associats als ports per on entren B1 i B2,
respectivament
 Escollir els ports designats
• Els ports que reben una BPDU “pitjor” de la que enviarien són designats
• Els ports que reben una BPDU “millor” de la que enviarien es 80
bloquegen

Interconnexió de Xarxes – Topic 5 40

You might also like