• No results found

Bridge learning and the spanning tree protocol. Rui Valadas

N/A
N/A
Protected

Academic year: 2021

Share "Bridge learning and the spanning tree protocol. Rui Valadas"

Copied!
37
0
0

Loading.... (view fulltext now)

Full text

(1)

Bridge learning and the

spanning tree protocol

(2)

Bridge learning and the spanning tree protocol

Bridge learning

• The way bridges build and maintain the forwarding tables

Spanning Tree Protocol (STP)

• Protocol that builds and maintains a logical routing structure for a network of bridges - a spanning tree

Bridges and switches are usually synonyms

(3)

Networks of bridges and spanning tree routing

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 20 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets active port inactive port

(4)

Forwarding tables

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 20 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E A i2 B i1 C i1 D i1 E i2 A i1 B i1 C i1 D i2 E i1 A i1 B i1 C i1 D i1 E i2 Bridge B1 Router D to other subnets to other subnets

(5)

Bridge learning

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 30 10 20 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets B i1 B i1

(6)

Bridge learning

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 30 10 20 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets E i2 E i2 B i1 B i1

(7)

Spanning Tree Protocol

Builds and maintains a logical routing structure for a network of

bridges - a spanning tree

Two aspects:

• What are the rules that define the configuration of the spanning tree?

(8)

Port costs and bridge identifiers

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets Bridge ID Port cost

(9)

Bridge ID

priority MAC address

2 bytes 6 bytes

most significant field

configurable by network manager

one of the MAC addresses of the bridge (typically the lowest one)

(10)

Spanning tree configuration

Root bridge: bridge with lowest ID

Cost of path from LAN to root bridge: sum of costs of ports that transmit packets towards root bridge

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets Root bridge Cost of path = 15 Cost of path = 30 Cost of path = 35 Cost of path = 30

(11)

Spanning tree configuration

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets Root bridge Cost of path = 15 Cost of path = 10 Cost of path = 25

Root bridge: bridge with lowest ID

Cost of path from LAN to root bridge: sum of costs of ports that transmit packets towards root bridge

(12)

Spanning tree configuration

Root path cost: cost of shortest (least cost) path from LAN to root

All bridge ports that belong to the shortest paths from each LAN to the root bridge will

become part of the spanning tree… some other ports will also belong Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets

Root path cost from L4 = 15

Root path cost from L3 = 10 Root path cost

from L2 = 0 Root path cost from L1 = 0

(13)

Spanning tree configuration

All bridge ports that belong to the shortest paths from each LAN to the root bridge will

become part of the spanning tree… some other ports will also belong

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets

(14)

Spanning tree configuration

Designated bridge: bridge that provides lowest cost from LAN to root; root bridge is designated in all LANs it is directly attached to

Designated port: port that provides lowest cost from LAN to root

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets Root bridge Designated bridge @ L1 & L2 Designated bridge @ L4 Designated bridge @ L3 Designated port @ L4 Designated port @ L3 Designated port @ L2 Designated port @ L1

(15)

Spanning tree configuration

Root port: bridge port that provides lowest cost to root

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets Root port @ B4 Root port @ B2 Root port @ B3

(16)

Spanning tree configuration

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets active port inactive port

Active ports (forwarding state): all designated ports and all root ports Inactive ports (blocking state): all other ports

(17)

Spanning tree configuration

The inactive ports “are not there” for routing purposes!

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 PC B PC C PC E Bridge B1 Router D to other subnets to other subnets

(18)

Spanning tree configuration (bad spanning

tree)

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 10 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 Bridge B1 Router D to other subnets to other subnets Server PC PC PC PC PC

lots of local traffic in L2

L2 has lots of local traffic. Traffic must be deviated from L2. Here L2 is used as a transit LAN for traffic between L1 or L4 and L3

(19)

Spanning tree configuration (good spanning

tree)

L2 has lots of local traffic. Traffic must be deviated from L2. Here L2 is not used as a transit LAN (it is on a leaf of the spanning tree)

Good spanning tree

Bridge B4 Bridge B3 Bridge B2 L2 Router A L1 L4 L3 10 10 20 10 15 10 10 20 20 i1 i1 i2 i2 i2 i1 i2 i3 i1 Bridge B1 Router D to other subnets to other subnets Server PC PC PC PC PC

(20)

Spanning Tree Protocol

Is a distance vector protocol, with a single distance

the distance

to the root bridge

Distance vectors are carried in BPDUs (Bridge Protocol Data Units)

• Two types: Configuration BPDUs and Topology Change Notification BPDUs

• Transmitted on multicast address 01:80:c2:00:00:00

BPDUs are also used to elect the root bridge

Unlike RIP

• Bridges transmit their BPDUs in response to BPDUs sent by other bridges; only the root bridges transmits on its own

(21)

Format of control messages

protocol identifier version message type root ID TCA reserved TC

root path cost bridge ID port ID message age max age hello time forward delay

2 octets protocol identifier version message type 1 octet 1 octet 1 octet 8 octets 8 octets 4 octets 2 octets 2 octets 2 octets 2 octets 2 octets 2 octets 1 octet 1 octet Conf - BPDU TCN - BPDU

(22)

Configuration BPDUs

Message used to configure the spanning tree

More important fields:

➢ Root ID (RID): estimate of the root bridge (may be wrong)

➢ Root Path Cost (RPC): estimate of cost of the shortest path to the root bridge (may be wrong) ➢ Bridge ID (BID): bridge that sends the BPDU ➢ Port ID (PID): port that sends the BPDU

(23)

Steady-state operation

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (1.0.1) (1.10.3) (1 .0 .1 ) (1.20.2) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3

 Configuration Vector = (RID, RPC, BID)

 Root sends periodically (RID,0,RID) on all ports; other bridges, upon receiving CV on root port, transmit their own CVs on their designated ports

(24)

Transient operation

Bridges store “best” CVs received so far (called port CVs)

Port CVs have a lifetime (called max age)

“Best” means lowest RID first, lowest RPC second, lowest BID

third, and lowest PID fourth

(25)

Transient operation

When there is a change in one port CV, bridge estimates RID and

RPC and recalculates root port and designated ports

• RID: lowest among RIDs of port CVs and its own BID

• RPC: for each port, such that the port RID coincides with the one obtained in previous step, sum the port cost with the RPC of port CV; RPC is the lowest among these values

• Root port: the one that provides the RPC of previous step; if there are several, the one with lowest BID first and lowest PID second wins

• Designated ports: ports where the bridge CV (RID of step 1, RPC of step 2, BID) is better than the port CV

With no stored CVs, bridge assumes itself being the root bridge,

(26)

Transient operation

RID = 19

RPC = 20 (via i1 or i2)

Root port = i1 (lower BID on port CV) Bridge CV = (19,20,35)

Designated ports = i3 and i4 What are the bridge estimates

and selected ports?

B35 i4 i1 i3 i2 (78,0,78) 10 10 5 10 L2 (19,10,55) (19,15,33) (19,30,81)

(27)

Transient operation

RID = 19

RPC = 20 (via i2) Root port = i2

Bridge CV = (19,20,35)

Designated ports = i1, i3 and i4 What are the bridge estimates

and selected ports?

B35 i4 i1 i3 i2 (78,0,78) 10 10 5 10 L2 (19,10,55) (19,15,33) (19,30,81) port CV of i1 reached max age

(28)

Transient operation

RID = 19

RPC = 40 (via i3) Root port = i3

Bridge CV = (19,40,35)

Designated ports = i1, i2, and i4 What are the bridge estimates

and selected ports?

B35 i4 i1 i3 i2 (78,0,78) 10 10 5 10 L2 (19,10,55) (19,15,33) (19,30,81) port CVs of i1 and i2 reached max age

(29)

Transient operation

RID = 35 RPC = 0

Bridge CV = (35,0,35) Designated ports = all What are the bridge estimates

and selected ports?

B35 i4 i1 i3 i2 (78,0,78) 10 10 5 10 L2 (19,10,55) (19,15,33) (19,30,81)

port CVs of i1, i2 and i3 reached max age

(30)

Spanning tree protocol

transient operation

(cold start)

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (4.0.4) (4.0.4) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (2.0.2) (2.0.2) (2.0.2) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (4.0.4) (4.0.4) (4.0.4)

(31)

Spanning tree protocol

transient operation

(cold start)

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (2.10.3) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (2.0.2) (2.0.2) (2.0.2) (2.0.2) (4.0.4) (4.0.4) Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (1.0.1) (1 .0 .1 ) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (2.10.3) (2.0.2) (2.0.2) (2.0.2) (2.0.2) (4.0.4) (4.0.4)

(32)

Spanning tree protocol

transient operation

(cold start)

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (1.20.2) (1.20.2) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (1.0.1) (1.0.1) (2.10.3) (2.0.2) (2.0.2) (2.0.2) (2.0.2) (4.0.4) (4.0.4) Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 (1.10.3) Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (1.0.1) (1.0.1) (2.10.3) (1.20.2) (1.20.2) (1.20.2) (2.0.2) (4.0.4) (4.0.4)

(33)

Spanning tree protocol

transient operation

(cold start)

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 20 20 Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 (1.0.1) (1.0.1) (2.10.3) (1.20.2) (1.10.3) (1.20.2) (2.0.2) (4.0.4) (1.10.3) (1.20.2)

(34)

Topology change notification process

Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 5 20 Conf-BPDU, TCA=1, TC=1 Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 TCN-BPDU TCN-BPDU Conf-BPDU, TCA=1 Bridge B2 L2 L1 L4 L3 10 10 10 10 20 10 10 5 20 Conf-BPDU, TC=1 Conf-BPDU, TC=1 C o n f-B P D U , T C = 1 Bridge B1 Bridge B3 Bridge B4 i1 i2 i1 i2 i1 i1 i2 i2 i3 Conf-BPDU, TC=1

(35)

Port states

FORWARDING

LISTENING

LEARNING BLOCKING

• Going from Blocking to Forwarding is delayed to avoid temporary loops (2×forward delay)

• Blocking and Listening: bridge learning and bridge forwarding inhibited

• Learning: bridge learning allowed, bridge forwarding inhibited

(36)

Algorhyme

Radia Perlman

I think that I shall never see

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 packets can reach every LAN.

First the root must be selected.

By ID, it is elected.

Least-cost paths from root are traced.

In the tree, these paths are placed.

A mesh is made by folks like me,

Then the bridge finds a spanning tree.

(37)

Bibliography

References

Related documents

It can be said that this study has created a new standard for South Africa to follow when it comes to the design of stabilisation of road pavement materials when using

In the following section, speed data demand for travel time estimation has been chosen to explain how to formulate demand functions based on network analysis... detection is

Also from the ANOVA table, it shows that the p-value from the F test for the whole equation is 0.001219, which means it is significant at 0.01 significant level, the linear

Sub-optimal Graph Matching by Node-to-node Assignment Classification 5 edit cost is the distance between attributes.. In the center of Figure 1 the cost matrix computed in the

Es probable que tales factores, además de otros que a continuación explicitaremos, hayan consti- tuido indicios de algunas transformaciones estructurales; así, el

a Upon whichever is the earliest of the winding up of the Trust, it ceasing to be a Public ancillary fund, or the revocation of the Trust’s endorsement as a deductible gift

This political formula would mean greater autonomy for the elite under a weak state, accom- panied by the “super-elite’s” loss of its key position and a broader incor- poration

You must protect and keep confidential all Personally Identifiable Information provided by Capital One or Capital One consumers or otherwise obtained by you in the performance