User Tools

Site Tools


networking:spanning_tree_protocol

This is an old revision of the document!


SPANNING TREE PROTOCOL

Today's LAN networks require high resistance to failures to ensure availability of network services as close as possible to 100% of the time. This results in the need to find alternative methods to keep the data network stable and thus be able to guarantee the basic services of corporate applications, as well as modern unified communications. For this reason, one of the most widely used technologies to keep the instability of the data network under control due to flood effects (infinite loop that consumes both the network bandwidth and the CPU of the switching devices) by broadcast is the protocol STP (Spanning Tree Protocol), RSTP (Rapid Spanning Tree Protocol) and MSTP (Multiple Spanning Tree Protocol). Which is in layer 2 of the OSI model (data link level), based on the extended tree algorithm designed by Radia Perlman while working for DEC (original version, DEC STP) and which was later standardized by the IEEE standard. .802.1d becoming the most recommended version to work currently.

Its main function is to guarantee that the creation of loops or alternative routes to the same destination, device, or network segment is prevented. Due to the existence of these links, in many uncontrolled cases, the consequence by default is the imminent degradation of network performance in a very short time. This effect is due to the fact that there is no TTL (time to live) field in layer two frames, they are trapped indefinitely until a system administrator breaks the loop. The protocol allows devices interconnection (switches) automatically deactivate the connection links, so that the elimination of loops is guaranteed.

The solution is to allow redundant physical links, but create a logical, loop-free topology. STP calculates a single loop-free path between devices on the network but keeping redundant links down as a reserve, in order to wake them up in case of failure.

If the STP configuration changes, or if a segment in the redundant network becomes unreachable, the algorithm reconfigures the links and re-establishes connectivity, activating one of the spare links. If the protocol fails, both connections may be active simultaneously, which could lead to an infinite traffic loop on the LAN.

The spanning tree remains in effect until a change in the topology occurs, a situation that the protocol is able to detect automatically. The maximum spanning tree lifetime is five minutes. When one of these changes occurs, the current root bridge redefines the spanning tree topology or a new root bridge is chosen.

The algorithm transforms a physical network in the form of a mesh, in which there are loops, into a logical network in the form of a tree (free of loops). Bridges communicate through configuration messages called Bridge Protocol Data Units (BPDU).

STP uses cost minimization rules to be able to generate spanning trees that show the logical routes with which communications will be governed. To understand how the STP works, it is necessary to know some essential terminology associated with it.

- Bridge ID: is the identifier of each switch. It is the result of combining the priority of the switch with its base MAC address.

- Root bridge: it is the focal point of the network and the one that is taken as a reference for STP decisions.

- The RB will be the switch with the lowest bridge ID.

- BPDU (Bridge Protocol Data Unit): these are small data units that carry STP control information. They are used in the first instance to choose the RB and then to detect possible failures in the network.

- Non-root bridges: These are all other bridges in the topology. They participate in the exchange of BPDUs and update their STP database.

- Cost of a port: it is determined based on the bandwidth of the link and will be the value used to decide the shortest path to the RB.

- Cost of the path to the RB: the cost of a path to the RB is the sum of the costs of each link through which it passes. The path chosen by the STP to the RB will be the one with the lowest cost.

- Root port (designated): it is the port of each bridge that is in the minimum path to the RB. There is only one per bridge that will always be in the forwarding state.

- Non-designated port: any port on a bridge with a higher cost than the designated port. It will be put into lock state.

Each port participating in STP can be in one of five of the following states:

1. Blocked (BLK): It does not forward data frames, although it does receive and send BPDUs. It is the default state of the ports when a switch is turned on and its function is to prevent cycles.

2. Listening (LST): Receive, analyze and send BPDUs to make sure there are no loops.

3. Learning (LRN): like the LST state, it receives, analyzes and sends BPDUs, although here it also begins to assemble the CAM table. In this state, data frames are not yet forwarded.

4. Forwarding (FWD): Sends and receives all data frames. Ports designated at the end of LRN status will be marked as FWD.

5. Disabled: It is an administratively disabled port that will not participate in the STP. For STP, a port in this state is as if it did not exist.

The STP protocol complies with a set of standards and guidelines to follow that serve to achieve its stable state (without loops). These steps are:

1. Choose the root bridge:

a. The bridge with the lowest priority is chosen.

b. If one or more switches have the same priority, this being the lowest, the one with the lowest base MAC is chosen among them.

2. The root ports are chosen: each bridge finds the shortest path to the RB and, with it, its designated port.

3. Each of the bridges listens for BPDUs on all its ports and, if it detects a loop on a port, it blocks it. Otherwise it puts it in FWD state. The criteria for deciding which port to block on a switch is as follows:

a. If a switch has two ports connected to two switches (prior knowledge of the existence of a loop and not being a root bridge), it must choose a communication port to block between the two switches, the way to choose it is that switch with the largest bridge ID.

b. If a port must be chosen within the same switch then choose the one with the highest cost. If the cost is the same, the port that is blocked is the one with the highest identifier.

LABORATORY

networking/spanning_tree_protocol.1603646777.txt.gz ยท Last modified: 2020/10/25 12:26 by hvillanueva

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki