Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spanning Tree Algorithm

Similar presentations


Presentation on theme: "Spanning Tree Algorithm"— Presentation transcript:

1 Spanning Tree Algorithm
Autumn Sept 14, 2004 Spanning Tree Algorithm Network Protocols and Standards Autumn Sept 14, 2004 CS573: Network Protocols and Standards CS573: Network Protocols and Standards

2 CS573: Network Protocols and Standards
Topologies with Loops Problems Frames proliferate Learning process unstable Multicast traffic loops forever A LAN 1 B1 B2 B3 LAN 2 Sept 14, 2004 CS573: Network Protocols and Standards

3 CS573: Network Protocols and Standards
Topologies with Loops Solutions Require that the topologies be loop-free through careful deployment of segments and bridges Design Bridges to detect loops and complain and, perhaps, stop working Not a good idea because loops provide redundancy Design into the bridges an algorithm that prunes the topology into a loop-free subset (a spanning tree) Blocking of some ports may be required Automatically adapt to the changes in topology Sept 14, 2004 CS573: Network Protocols and Standards

4 Reconfiguration Algorithm
Configures an arbitrary topology into a spanning tree Automatic reconfiguration in case of topology changes The algorithm should converge for any size LAN; the stability should be achieved within a short, bounded time Active topology should be reproducible and manageable Transparency to end-stations is required Must not use a lot of bandwidth Sept 14, 2004 CS573: Network Protocols and Standards

5 Spanning Tree Algorithm
A distributed Algorithm Elects a single bridge to be the root bridge Calculates the distance of the shortest path from each bridge to the root bridge (cost) For each LAN segment , elects a “designated” bridge from among the bridges residing on that segment The designated bridge for a LAN segment is the one closest to the root bridge And… Sept 14, 2004 CS573: Network Protocols and Standards

6 Spanning Tree Algorithm
For each bridge Selects ports to be included in spanning tree The ports selected are: The root port --- the port that gives the best path from this bridge to the root The designated ports --- ports connected to a segment on which this bridge is designated Ports included in the spanning tree are placed in the forwarding state All other ports are placed in the blocked state Sept 14, 2004 CS573: Network Protocols and Standards

7 CS573: Network Protocols and Standards
Forwarding frames along the spanning tree Forward and Blocked States of Ports Data traffic (from various stations) is forwarded to and from the ports selected in the spanning tree Incoming data traffic is always discarded (this is different from filtering frames. Why?) and is never forwarded on the blocked ports Sept 14, 2004 CS573: Network Protocols and Standards

8 Root Selection: Bridge ID
Each port on the Bridge has a unique LAN address just like any other LAN interface card. Bridge ID is a single bridge-wide identifier that could be: A unique 48-bit address Perhaps the LAN address of one of its ports Root Bridge is the one with lowest Bridge ID B Port Address Sept 14, 2004 CS573: Network Protocols and Standards

9 CS573: Network Protocols and Standards
Path Length (Cost) Path length is the number of hops from a bridge to the root While forming a spanning tree, we are interested in the least cost path to the root Cost can also be specified based on the speed of the link Not fair to treat a 10Mb/s link the same as a 1Gb/s link A guideline for cost selection is in Table 8.5 of the latest IEEE 802.1D standard Sept 14, 2004 CS573: Network Protocols and Standards

10 CS573: Network Protocols and Standards
Path cost guidelines Source: IEEE 802.1D standard Sept 14, 2004 CS573: Network Protocols and Standards

11 CS573: Network Protocols and Standards
Example Topology 1 4 5 7 8 6 10 11 2 Sept 14, 2004 CS573: Network Protocols and Standards

12 After algorithm execution
DP 1 RP DP BP BP 4 5 7 RP RP RP RP DP DP 8 6 10 DP RP RP BP DP 11 2 RP RP RP: Root Port DP: Designated Port BP: Blocked Port DP DP Sept 14, 2004 CS573: Network Protocols and Standards

13 Configuration Message (BPDU)
Configuration Bridge Protocol Data Unit Transmitted by Bridges to implement the spanning tree algorithm Just like any other data link layer frame Destination Adderss: Special Multicast Address 01-8-c Source Address: MAC address of the port DSAP = SSAP = 6 octets 6 octets 2 octets 2 octets Data Field destination source length DSAP SSAP Configuration Message Sept 14, 2004 CS573: Network Protocols and Standards

14 Configuration BPDU Contents
The Data Field of Config BPDU contains: Root ID ID of the Bridge known to be root Cost to Root Cost of the known least cost path to the root Transmitting Bridge ID ID of the bridge transmitting this message Representation <RootID>.<CostToRoot>.<TransmittingBridgeID> Sept 14, 2004 CS573: Network Protocols and Standards

15 BPDU: Transmission and Processing
When a bridge is first booted up: It assumes it is the root Transmits on each port: <ownID>.<0>.<ownID> BPDUs are received on each port For each port, every bridge saves the best BPDU received Best among the ones received or transmitted on that port Sept 14, 2004 CS573: Network Protocols and Standards

16 CS573: Network Protocols and Standards
Comparing two BPDUs Given two BPDUs containing configuration messages C1 and C2: C1 is better than C2 if rootID in C1 is lower than the rootID in C2 In case of a tie above, C1 is better than C2 if cost in C1 is lower than the cost in C2 In case of a tie above, C1 is better than C2 if transmitting bridge ID in C1 is lower than the transmitting bridge ID in C2 Can we still get a tie? Consider a bridge with two ports on same segment!!! Sept 14, 2004 CS573: Network Protocols and Standards

17 CS573: Network Protocols and Standards
Port Identifier Each bridge has an internal numbering of its ports These numbers are unique only for a bridge Bridge 1 2 3 Sept 14, 2004 CS573: Network Protocols and Standards

18 CS573: Network Protocols and Standards
Port Identifier Port IDs are useful when rootID, cost, and transmittingBridgeID are the same in two configuration messages In such situations, Port IDs are used as tie-breakers and the BPDU with lower portID is better Sept 14, 2004 CS573: Network Protocols and Standards

19 CS573: Network Protocols and Standards
Comparing BPDUs Message C1 <Root>.<Cost>.<Tx> <29>.<15>.<35> <35>.<80>.<39> <35>.<15>.<80> Message C2 <Root>.<Cost>.<Tx> <31>.<12>.<32> <35>.<80>.<40> <35>.<18>.<38> (a) (b) (c) In all cases above, C1 is “better” than C2 Sept 14, 2004 CS573: Network Protocols and Standards

20 CS573: Network Protocols and Standards
Designated Bridge If a bridge receives better BPDU on a port than the one it would transmit, it will no longer transmit BPDUs on that port As a result, only one bridge called the “designated bridge” transmits configuration BPDUs on each LAN Sept 14, 2004 CS573: Network Protocols and Standards

21 Root ID and Cost: determining
Consider B with bridge ID 18 Best BPDUs on each of its ports are: <RootID>.<Cost>.<TransmitterID> Port 1 <12>.<93>.<51> Port 2 <12>.<85>.<47> Port 3 <81>.<0>.<81> Port 4 <15>.<31>.<27> Root bridge ID is determined as 12 Least cost is determined as 85+1 = 86 Port 2 is regarded as the Root port …cont… Sept 14, 2004 CS573: Network Protocols and Standards

22 Root ID and Cost: determining
At next opportunity, B will transmit <12>.<86>.<18> Better than the best BPDUs on all ports Ports 1, 3, and 4 are designated B considers itself designated for the segments connected to ports 1, 3, and 4 B continues transmitting BPDUs on those segments (through respective ports) Sept 14, 2004 CS573: Network Protocols and Standards

23 CS573: Network Protocols and Standards
Spanning Tree Ports For each bridge, what ports are “included” in the spanning tree? Root Port On which best of the best BPDUs is received Designated Port Connected to segments on which B is designated Ports selected in the spanning tree are placed in the forwarding state B will forward data packets to and from those ports Sept 14, 2004 CS573: Network Protocols and Standards

24 CS573: Network Protocols and Standards
Ports Blocked Bridge B will block a port if it receives a better BPDU on that port than the one it would transmit (except for the root port) Bridge B will no longer transmit BPDUs on either root port or blocked ports Data packets are not forwarded to and received from the blocked ports Sept 14, 2004 CS573: Network Protocols and Standards

25 CS573: Network Protocols and Standards
Example Bridge ID 92 Port 1 Port 2 Port 3 Port 4 Port 5 Root Bridge is selected as 41 Least cost to root is 12+1 = 13  Port 4 is selected as root Now B92 will transmit a BPDU What does it do with the ports? Sept 14, 2004 CS573: Network Protocols and Standards

26 How the Ports are treated?
Remember: B92 will transmit a BPDU Port 1: <  DP Port 2: <  DP Port 3: >  BP Port 4:  Root Port Port 5: >  BP Sept 14, 2004 CS573: Network Protocols and Standards


Download ppt "Spanning Tree Algorithm"

Similar presentations


Ads by Google