Sunday, April 4, 2010


As your switches multiply and start having redundant links, you'll have to rely on spanning tree to make sure that you don't have loops which would result in broadcast storms. Spanning tree's goal is simple - prevent loops - but there are a lot of complexities in its operation.
An ideal design for a network follows the Cisco's 3-Layered Model. At the center of the network you have the core. Redundantly connected to the core are distribution switches. Finally, access switches connect to distribution switches with redundant links. This layered approach allows for easy, manageable growth. The redundant connections are there to avoid SPF (Single-Point of Failure).

Etherchannel can provide more bandwidth on key links. Etherchannel allows grouping of links into a single pipe to improve throughput.

This is the Cisco's Three-Layered Model:

Switches forward broadcast packets out of all ports (in the same VLAN) by design. A broadcast storm is when there are loops in a switched network. A broadcast would be broadcasted into the looping interface which would loop right back. The looping will continue indefinitely.

We can't go around disconnecting redundant links manually because redundant links are important in business networks. Spanning tree is designed to manage your redundant links automatically. Redundant links are blocked until they are actually needed.

The original spanning tree was created to prevent loops. Switches send out "probes" into the network called BPDUs (Bridged Protocol Data Unit) to discover loops. The BPDU probes also help elect the core switch of the network called the Root Bridge. What STP does is to find the best way to reach the root bridge, then block all redundant links.

The worst thing to do is to leave spanning tree as default. By default, spanning tree will elect the oldest (in terms of manufactured date) switch as the root bridge. This is because with all things equal, spanning tree would elect the one with the lowest MAC address.

In the original spanning tree, there are three port types:
Root Port - Used to reach the root bridge
Designated Port - Forwarding port, one per link
Blocking - Blocked port

All devices in a STP network has a bridge ID. The bridge ID is made up by concatenating the priority with the MAC address of the switch. A bridge ID looks like this:

32768 is the default priority. The lower the bridge ID, the likelier the switch becomes the root bridge. We will now observe STP with the following topology:

Here is a table of common link costs:
Ethernet - 100
Fast Ethernet - 19
Gigabit Ethernet - 4
2-Gigabit Ethernet - 3
10-Gigabit Ethernet - 2
100-Gigabit Ethernet - 1

A root bridge have all ports forwarding (designated). On each link between switches, there is one designated port and one blocking port. Access ports with PCs are designated.

On a link not chosen as a root link, the port belonging to a lower bridge ID would be designated, and the one belonging to the higher bridge ID would be blocking. Remember that lower is better. If we leave this topology at its default configuration, R2 will be the root bridge because it has the lowest MAC address. The ports would be as follows:

F0/0 - Designated
F0/1 - Designated

F0/0 - Designated
F0/1 - Root

F0/0 - Root
F0/1 - Blocking

Spanning tree is similar to OSPF in that they deal with path costs. If two paths to the bridge have the same cost, then the bridge with the lower bridge ID would be the way to go to the root bridge. If two links to the same switch are at the same speed, then the lower port will be chosen.

No comments :

Post a Comment