...

Friday, February 25, 2011

NETINFRA 07

(Note that this is not an official Basic Draft article. It does not meet Basic Draft standards and will not be listed. If you've arrived through a search engine, please use the search function (top-left) to find a more suitable article).
Redundant network topologies are used to eliminate Single Points of Failure. In case of failure, a network is able to switch to a redundant link, making it more resilient and reliable.

Redundant links, however, lead to serious problems such as Broadcast Storms. A broadcast storm is when a broadcast packet loops around redundant links. As by definition, a switch forwards a broadcast Frame out of all links except the one it received it from, a broadcast frame received from one link will be forwarded back through the other, and it will come back again.

A broadcast storm is a result of a bridging loop.

As frames do not have TTL features unlike IP packets, it will continue to travel around indefinitely. As more broadcast packets are transmitted, more continue to loop and performance will continue to decrease.

A bridging loop may also cause multiple frame transmissions. In this case, if a switch's CAM table is empty, the first frame would be forwarded out of all ports except the one it came from. The second switch would do the same since its CAM table is empty. This problem is pertaining to Unknown Unicasts in bridging loops.

Another problem is the MAC address database instability. In case of multiple frame transmissions, as the second switch received the frame from the wrong port, it would record the source MAC at the wrong port as well. If the switches are connected by a hub, then it would receive the frame on two interfaces at the same time (one correct, and one due to the broadcast).

In large enterprises, redundancy is required, so switches are connected in switch blocks. In this case, a method of maintaining this redundancy, preferably automatic, is desired.

Spanning Tree is designed with the primary goal of maintaining a redundant - yet loop free - topology. It does this by placing redundant links in "blocking" state. Blocked ports can be changed to forwarding when required (e.g. The primary link goes down).

The first step of spanning tree is to elect a root bridge. Each bridge (from now on, switches will be referred to as bridges) possess a bridge-ID. This bridge-ID is formed by appending a priority and its MAC address. The default priority for all bridges is 32768, so by default, the bridge with the lowest MAC address will be the root bridge. This may not be desirable as a lower MAC address typically is assigned to an older bridge.

After the root bridge is elected, all switches calculate the best path back to the root bridge. This cost is a value assigned to links dependent on its media speed. The cost is a cumulative value specified in the BPDU received during the Listening stage. BPDUs also contain the BID and sending port of the originating bridge which is essential for the root bridge election.

This is the breakdown of the BPDU:
Root BID - Who does the originator think is the root bridge?
Root Path Cost - How far is it away from the root bridge?
Sender BID - What is the originator's BID?
Port ID - What port is the originator sending the BPDU out of?

The lowest cost path is the accumulated cost of all link on a specified path. Redundant Links not part of the lowest cost paths are blocked. (The bridge with the worse path back to the root bridge has the blocking port, or in other words, becomes non-designated). In the end, we would have a "tree" similar to an SPF tree with the root bridge as the root of the tree.

Here's a general guideline:
-One root bridge per network (or per VLAN in PVST+)
-One root port per non-bridge
-One designated port per segment

Some tips are:
-All connected ports on a root bridge is designated
-All non-bridge has a root port that is the closest to the root bridge
-On a blocking link, the bridge nearer to the root bridge is designated, while the bridge further away from the root bridge is non-designated.

These are the states a bridge transits when it boots up:
Blocking - All ports are blocking at first. When a switch first boots up, it would think that it is the root bridge and would attempt to switch all ports to designated. However, the ports still must go through the stages.

Listening (15 seconds) - The switch sends and receives BPDUs. This is the time where it finds out whether it is really the root or not. The information used here will be used to elect the root bridge, calculate the lowest cost paths, and so on. If the port is non-designated, it is put back to blocking state.

Learning (15 seconds) - If a port is designated, it will begin to listen out for MAC addresses to perform bindings in the MAC address table.

Forwarding - The port is ready and forwarding.

If a link goes down, the port stays at forwarding for another 20 seconds. This 20 seconds is known as the "max age" timer, which is a hold-down mechanism. This is the longest time a switch port can stay designated without a BPDU. Once this timer passes, the switch believes that there is a topology change and there will be a recalculation of the STP tree.

A new link will take 30 seconds to establish.

A dropped link will take 50 seconds to recover.

A converged STP topology is a topology where all ports are either blocking or forwarding.

No comments :

Post a Comment

<