ieee 802.1d: spanning tree algorithm and the filtering database

52
IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database Ben Schultz Bridge Functions Consortium UNH InterOperability Lab July, 2000

Upload: stefan

Post on 06-Feb-2016

55 views

Category:

Documents


0 download

DESCRIPTION

IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database. Ben Schultz Bridge Functions Consortium UNH InterOperability Lab July, 2000. Presentation Overview. Filtering Database general concepts history the learning Bridge. Presentation Overview. Spanning Tree Algorithm - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Ben Schultz

Bridge Functions Consortium

UNH InterOperability Lab

July, 2000

Page 2: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Presentation Overview

Filtering Database– general concepts– history– the learning Bridge

Page 3: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Presentation Overview

Spanning Tree Algorithm– general concepts– overview of procedures– operation at bridge boot time– operation during LAN topology

reconfiguration

Page 4: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Bridging: The Filtering Database

• The Transparent Bridge– history and alternatives– the learning bridge– how this relates to VLANs and

the spanning tree algorithm

Page 5: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Some terms before we start.

• LAN: Local Area Network. – It could be a ring (in the sense of Token Ring or

FDDI). – It could be a shared network (such as legacy or

repeated Ethernet).– It could be a point to point link (like full duplex

Ethernet)

Page 6: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

More terms

• Bridge: a layer 2 device that allows 2 separate LANs to exchange traffic.

• Switch: another name for Bridge.

• I’m not sure what other terms I’ll cover that you have not heard of or do not understand, but please feel free to interrupt me if you need clarification on something.

Page 7: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

History

Back in the days before Ethernet was the clear winning technology on the LAN, Token Ring and FDDI were popular.

There were 2 competing technologies for bridging.

• Source Route Bridging

Used with Token Ring and FDDI

• Transparent Bridging

Used with Ethernet

Page 8: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Source Route Bridging

A bridging mechanism to route frames through a multi-LAN bridged network. The route each frame will transverse is specified in a routing information field.

These routes are discovered by an All Routes Explorer frame, which is sent out by all end stations that support source routing. Because there are sometimes multiple paths in a network, the explorer frames could have varying information.

Page 9: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Source Route Bridging

A benefit of the Source Route method is that a network has the possibility of implementing load balancing to avoid congestion. This is done by routing packets over two or more routes to a destination.

Switch 3

Switch 1Switch 2Source LAN

Server

Page 10: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Transparent Bridging

The transparent bridging method follows the plug and play philosophy.

Each bridge contains one (or more) Filtering Databases that learn and remember MAC addresses on its networks.

Forwarding decisions are then made with consultation of the Filtering Database. If a destination MAC address has been learned, the packet is then forwarded out of that port.

These addresses then will be cleared from the Filtering Database if they are not active for a specific amount of time. This range is defined by Aging Time, which can be set in the management.

Page 11: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Learning of addresses

The Filtering Database learns a station’s location from the source address on an incoming frame.

Switch

Frame with source address002222333344 is received on Port 1.

Frame with destination address002222333344 is received on Port 4.

Port 1

Port 4

Frames with the destination address 002222333344 are only forwarded on port 1

Since this is not learned, it isFLOODED out all of the other ports.

Frame with destination address002222333344 is received on Port 4.

This source address is“learned” by the filteringdatabase. All future frames destined for this MAC addresswill be forwarded ONLY out of this Port.

Page 12: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Multicast Frames originate from one source and have the possibility of going to more than one destination. An example of this is the Spanning Tree BPDU.

Multicast Frames

Switch 4

Switch 1

Shared LAN

Switch 3Switch 2

Page 13: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

The Permanent Database

Upon Bridge Initialization, a reserved block of Multicast Addresses is transferred to the Filtering Database.

Assignment ValueBridge Group Address 01-80-C2-00-00-00IEEE Std. 802.3, Full Duplex PAUSE operation 01-80-C2-00-00-01Slow Protocols Multicast Address 01-80-C2-00-00-02Reserved for future standardization 01-80-C2-00-00-03

To01-80-C2-00-00-0F

Currently only 3 of these multicast addresses are standardized. The rest are reserved for future use. Frames containing these addresses in the source are never learned or forwarded.

Page 14: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Basic Filtering Services

Switches filtering frames from the Permanent Database are said to support Basic Filtering Services.

Bridges that support Basic Filtering Services can dynamically learn all MAC addresses except those from the Permanent Database.

These addresses can also be statically configured so that they do not age out.

Extended Filtering Services are implemented by devices that support advanced features like GARP

Page 15: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Aging Time

Aging time is defined as a range of 10 to one million seconds

One million seconds is 11 days 13 hours 46 minutes and 40 seconds

The default time is 300 seconds

The Filtering Database starts aging time when an address is learned and resets it whenever another frame arrives on that port.

Why is aging time important?

When aging time expires, the address and port are discarded from the Filtering Database.

Page 16: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

The Learning Bridge

That was a bit fast and complex. Let’s review.

Every bridge has a table called a Filtering Database.Entries in this table are updated upon receipt of frames,the source addresses and the ports they arrive on are learned.

Once a MAC address is associated with a port, framescontaining that destination address are only forwardedout of that port.

In the real switches these tables vary in size, most have thecapability of holding several thousand MAC addresses. I’ve seen one that has the capacity for more than 150,000 addresses.

Page 17: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Spanning Tree

Why a tree?

If you have 2 switches that are connected in parallel, it could create a loop.

A B

LAN Connection

Incoming broadcast frame

Page 18: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

More Reasons

Spanning Tree Disables one of these connections.

It also keeps track of each of these connections. If the active connection becomes disconnected, it will reactivate it.

How does it do this?

Page 19: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

General Concepts

Upon Initialization all Bridges assume that they are root.

Bridges share information through Bridge Protocol Data Units or BPDUs.

Two important parameters that are passed in the BPDUs are the Bridge Identifier and the Root Identifier.

The Bridge Identifier and the Root Identifier are thus equal upon initialization.

Each Identifier value is composed of a Bridge Priority and the Bridge MAC address. The Bridge Priority is settable in management so that Spanning Tree can be configured.

Page 20: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

How does Spanning Tree Work?

Root

BA

D EC F

Page 21: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Port States

Bridge ports operate the Spanning Tree algorithm using the following states:

Blocking - incoming frames are discarded.

Listening - incoming frames are discarded, but the port is in theprocess of transitioning to Learning.

Learning - incoming frames are discarded, but their source addresses and ports are placed in the Filtering Database.

Forwarding - Incoming frames are forwarded, source addresses arelearned.

Disabled - The port is disabled by management.

Page 22: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Path Cost

Varying networking technologies have a path cost associated with their speed.

Link Speed Recommendedvalue

Recommendedrange

Range

4 Mb/s 250 100–1000 1–65 53510 Mb/s 100 50–600 1–65 53516 Mb/s 62 40–400 1–65 535100 Mb/s 19 10–60 1–65 535

1 Gb/s 4 3–10 1–65 53510 Gb/s 2 1–5 1–65 535

Page 23: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Initialization Procedure

• Used by all bridges on startup to make each bridge think that it is the root bridge.

• Root ID set to Bridge ID for each bridge.

• Root Path Cost set to zero for each bridge.

• All Ports on each bridge become designated ports.

• Configuration BPDU transmitted on each designated port on each bridge.

• The Hello Timer is started for each bridge.

Page 24: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Transmit Configuration BPDU

• If the Hold Timer is active we set the config_pending flag for the transmitting port. This Configuration BPDU will then be transmitted upon expiration of the Hold Timer for this Port. This ensures that no more than one

Configuration BPDU is transmitted per Hold Time period.

• Otherwise, we build a Configuration BPDU and if the Message Age for the BPDU we are about to transmit is

less than Max Age, then we transmit the BPDU.

• After transmission, the topology_change_acknowledge and config_pending flags held for the port are set to False, and the Hold Timer is started for the transmitting port.

Page 25: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Transmit Configuration BPDU

Forward Delay

Hello Time

Max Age

Message Age

Port Identifier

Bridge Identifier

Root Path Cost

Root Identifier

BPDU Type

Protocol Version Identifier

Protocol Identifier

• Protocol Identifier set to 0x0000

• Protocol Version Identifier and BPDU Type set to 0x00

• If the transmitting bridge is the root bridge, Message Age is set to zero, otherwise it is set to the value of the root port’s Message Age timer plus the Message_age_increment.

• All other fields are set to the information stored for the transmitting port and bridge

TCA Reserved TC

Page 26: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Receive Configuration BPDU

If the receiving port’s state is not Disabled:

• If the information in the received BPDU supersedes the information currently stored for the receiving port:

• Record the information from the BPDU.

• Update the bridge and port configuration by selecting a root port and designated ports.

• Select states for all ports on the receiving bridge.

• If we were the root bridge prior to the configuration update but aren’t now:

• stop the Hello Timer.

Page 27: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Receive Configuration BPDU

• If the receiving bridge’s topology_change_detected flag is set:

• Stop the topology_change_timer.

• Transmit a Topology Change Notification BPDU.

• Start the tcn_timer.

• If the receiving port is the root port:

• Record the timer values from the BPDU.

• Transmit Configuration BPDUs on all the designated ports on the receiving bridge.

Page 28: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Receive Configuration BPDU

•If the information received in the BPDU doesn’t supersede that stored for the receiving bridge and port but the receiving port is a designated port, generate a reply on the receiving port.

•Reset the topology_change_detected flag and stop the tcn_timer.

If the received BPDU was a topology change acknowledgment:

Page 29: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Supersedes Port Info

• If the value of the Root Identifier, Root Path Cost, or Bridge Identifier fields received in the Configuration BPDU is less than the value stored for the receiving port for the designated_root, designated_cost, or designated_bridge parameter respectively, return True.

• If the value of the Port Identifier field received in the Configuration BPDU is less than or equal to the designated port value stored for the receiving port, return True.

• Otherwise, return False.

Page 30: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Record Configuration Info

• Updates the designated_root, designated_cost, designated_bridge, and designated_port values stored for the receiving port to the Root Identifier, Root Path Cost, Bridge Identifier, and Port Identifier fields of the received Configuration BPDU, respectively.

• Start the Message Age Timer with the initial timer value being the value contained in the Message Age field of the received Configuration BPDU.

Page 31: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Port State Selection

• All ports on the bridge that are either a root port or a designated port are put into the forwarding state

• All other ports are put into the blocking state

Page 32: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

More on Learning

Thus, address learning for the Filtering Database is dependent upon the state of Spanning Tree.

When a bridge is alerted to a topology change, addresses are aged

out according to the Spanning Tree Forward Delay time.

Page 33: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Make Forwarding

• If the port we wish to make forwarding is currently in the blocking state, then set the port’s state to listening and start the forward delay timer for that port.

Page 34: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Make Blocking

• If the current port state is not disabled or blocking

• If the current port state is forwarding or learning

• If the change_detection_enabled is set to True

• Call Topology Change Detection

• Set the port state to blocking

• Stop the forward delay timer for that port

Page 35: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Topology Change Detection

• If we are the root bridge

• Set the bridge’s topology change flag to True

• Start the topology change timer

• Otherwise, if our topology_change_detected flag is currently set to false

• Transmit a TCN BPDU

• Start the tcn timer

• Set the bridges’ topology_change_detected flag to True

Page 36: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

A Quick Example

Root

BA

D EC F G

Page 37: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Tick

• This is the procedure that checks every clock tick to see whether any of the Spanning Tree Timers have expired. The timers involved are the hello_timer, tcn_timer, topology_change_timer, message_age_timer, forward_delay_timer, and the hold_timer.

Page 38: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Hello Timer Expiry

• Call config_bpdu_generation for this bridge

• Restart the hello timer for this bridge

Page 39: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Message Age Timer Expiry

• Call the become_designated_port procedure for this port

• Call the configuration_update procedure

• Call the port_state_selection procedure

• If we are the root bridge now but weren’t before the message age timer expired

• Update the max_age, hello_time, and forward_delay parameters to those stored on this bridge

• Call topology_change_detection

• Stop the tcn_timer

Page 40: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Message Age Timer Expiry

• Call the config_bpdu_generation procedure

• Start the hello timer for this bridge

Page 41: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Forward Delay Timer Expiry

• If the current port state is Listening

• Set the port state to learning

• Restart the forward_delay_timer for the port

• Otherwise, if the current port state is Learning

• Set the port state to forwarding

• If this bridge has at least one designated port on it

• If the change_detection_enabled flag is set to True

• Call topology_change_detection

Page 42: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

TCN Timer Expiry

• Transmit a TCN BPDU

• Restart the tcn_timer

Page 43: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Topology Change Timer Expiry

• Set the topology_change_detected flag for the bridge to False

• Set the topology_change flag for the bridge to False

Page 44: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Hold Timer Expiry

• If the config_pending flag for the port is set

• Transmit a Configuration BPDU on that port

Page 45: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Initial Bridge Parameters:

Bridge Priority Path Cost

B1 1 20

B2 2 15

B3 2 25

- All Ports on each bridge have the same Path Cost in this example.

- The Max Age, Hello Time, and Forward Delay parameters are left at their default values of 20.0, 2.0, and 15.0 respectively.

Page 46: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

15

Initial Bridged LAN Topology

B3

B1

B2

LAN A

LAN C

LAN B

0

25

Page 47: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

15

Active Bridged LAN Topology after Bootup

B3

B1

B2

LAN A

LAN C

LAN B

0

25

Page 48: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Initial Bridge Parameters:

Bridge Priority Path Cost

B1 1 20

B2 2 15

B3 2 25

- All Ports on each bridge have the same Path Cost in this example.

- The Max Age, Hello Time, and Forward Delay parameters are left at their default values of 20.0, 2.0, and 15.0 respectively.

B4 2 15

Page 49: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

15

Adding An Additional Bridge to an Active Spanning Tree Topology

B3

B1

B2

LAN A

LAN C

LAN B

0

25

4030

NewB4

Page 50: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

30

15

Active Bridged LAN Topology after Spanning Tree Reconfiguration

B3

B1

B2

LAN A

LAN C

LAN B

0

25NewB4

Page 51: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

How does this relate to VLANs?

Maybe a better question is: What is a VLAN?

But first: are there any questions?

Curtis will explain...

Page 52: IEEE 802.1D: Spanning Tree Algorithm and the Filtering Database

Future Additions

The IEEE is currently working on a Rapid Reconfiguration Standard.

This will interoperate with the current Spanning Tree by making the Rapid Reconfiguration network appear to the Spanning Tree network as one bridge.It is currently only a draft, but the next update will clarify some foggy details.