Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

You can find a lot of materials about the RSTP protocol on the net. As part of this article, I propose to compare the RSTP protocol with a proprietary protocol from Phoenix Contact – Extended Ring Redundancy.

RSTP Implementation Details

Overview

Convergence time – 1-10 s
Possible topologies - any

It is widely believed that RSTP allows you to combine switches only in a ring:

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy
But RSTP allows you to connect switches in an arbitrary way. For example, RSTP will cope with such a topology.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Operating principle

RSTP reduces any topology to a tree. One of the switches becomes the center of the topology - the root switch. The root switch passes through itself the largest amount of data.

The principle of operation of RSTP is as follows:

  1. power is supplied to the switches;
  2. the root switch is selected;
  3. the remaining switches determine the fastest path to the root switch;
  4. the remaining channels are blocked and become redundant.

Choosing a Root Switch

Switches with RSTP exchange BPDU packets. BPDU is a service packet that contains RSTP information. BPDUs are of two types:

  • configuration BPDU.
  • Topology Change Notification.

The Configuration BPDU is used to build the topology. It is sent only by the root switch. Configuration BPDU contains:

  • sender ID (Bridge ID);
  • root switch ID (Root Bridge ID);
  • identifier of the port from which this packet was sent (Port ID);
  • the cost of the route to the root switch (Root Path Cost).

Topology Change Notification can be sent by any switch. They are sent when the topology changes.

Once enabled, all switches consider themselves to be root switches. They start sending BPDUs. Once a switch receives a BPDU with a lower Bridge ID than its own, it no longer considers itself the root.

Bridge ID consists of two values ​​- MAC address and Bridge Priority. We cannot change the MAC address. The default Bridge Priority is 32768. If Bridge Priority is not changed, then the switch with the lowest MAC address will become the root switch. The switch with the lowest MAC address is the oldest and may not be the best performer. It is recommended that you manually define the topology root switch. To do this, you need to configure a small Bridge Priority (for example, 0) on the root switch. You can also define a redundant root switch by setting it to a slightly higher Bridge Priority (for example, 4096).

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy
Selecting the path to the root switch

The root switch broadcasts BPDU packets to all active ports. The BPDU has a Path Cost field. Path Cost refers to the cost of a path. The higher the cost of the path, the longer the packet is transmitted along it. When a BPDU passes through a port, a cost is added to the Path Cost field. The added number is called Port Cost.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Adds a certain value to Path Cost when a BPDU passes through a port. The value that adds is called Port Cost and can be determined either manually or automatically. Port Cost can be determined either manually or automatically.

When a non-root switch has several alternative paths to the root, it chooses the fastest one. It compares the Path Cost of these paths. The port from which the BPDU with the lowest Path Cost came is the Root Port.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

The cost of ports that are assigned automatically can be viewed in the table:

Port baud rate
Port cost

10 Mbps
2 000 000

100 Mbps
200 000

1 Gb / s
20 000

10 Gb / s
2 000

Roles and statuses of ports

Switch ports have several statuses and port roles.

Port statuses (for STP):

  • Disabled - inactive.
  • Blocking - listens to BPDUs but does not transmit. Does not transmit data.
  • Listening - Listens and transmits BPDUs. Does not transmit data.
  • Learning - Listens and transmits BPDUs. Prepares for data transfer - fills in the MAC address table.
  • Forwarding - transmits data, listens and transmits BPDUs.

STP convergence time is 30-50 seconds. After switching on the switch, all ports go through all statuses. The port stays in each status for several seconds. Because of this principle of operation, STP has such a long convergence time. RSTP has fewer port states.

Port statuses (for RSTP):

  • Discarding - inactive.
  • Discarding - Listens to BPDU but does not transmit. Does not transmit data.
  • Discarding - Listens and transmits BPDUs. Does not transmit data.
  • Learning - Listens and transmits BPDUs. Prepares for data transfer - fills in the MAC address table.
  • Forwarding - transmits data, listens and transmits BPDUs.
  • In RSTP, the Disabled, Blocking and Listening statuses are combined into one - Discarding.

Port roles:

  • Root port - the port through which data is transmitted. It serves as the fastest path to the root switch.
  • Designated port - the port through which data is transmitted. Defined for each LAN segment.
  • Alternate port - port through which data is not transmitted. It is an alternate path to the root switch.
  • Backup port - port through which data is not transmitted. It is a fallback path for a segment that already has one RSTP-enabled port connected. The backup port is used if two switch channels are connected to the same segment (read as a hub).
  • Disabled port - RSTP is disabled on this port.

The choice of Root Port is described above. How is the Designated port selected?

First of all, let's define what a LAN segment is. The LAN segment is the collision domain. For a switch or router, each port forms a separate collision domain. A LAN segment is a channel between switches or routers. If we talk about the hub, then the hub has all the ports in the same collision domain.

Only one Designated Port is assigned per segment.

In the case of segments where there are already Root Ports, everything is clear. The second segment port becomes the Designated Port.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

But reserve channels remain, where there will be one Designated Port and one Alternate Port. How will they be chosen? The Designated Port will become the port with the lowest Path Cost to the root switch. If the Path Costs are equal, then the Designated Port will be the port that is hosted on the switch with the lowest Bridge ID. If and Bridge ID are equal, then the Designated Port becomes the port with the lowest number. The second port will be Alternate.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

The last point remains: when is the port assigned the Backup role? As mentioned above, the Backup port is used only when two switch channels are connected to the same segment, that is, to the hub. In this case, the Designated Port is chosen according to exactly the same criteria:

  • Lowest Path Cost to Root Switch.
  • The smallest Bridge ID.
  • Lowest Port ID.

Maximum number of devices in the network

The IEEE 802.1D standard does not impose strict requirements on the number of devices on a LAN with RSTP. But the standard recommends using no more than 7 switches in one branch (no more than 7 hops), i.e. no more than 15 in the ring. When this value is exceeded, the network convergence time begins to increase.

Implementation details of ERR.

Overview

Convergence time

ERR convergence time - 15 ms. With the maximum number of switches in the ring and the presence of pairing of rings - 18 ms.

Possible topologies

ERR does not allow devices to be freely paired as RSTP. ERR has clear topologies that can be used:

  • Ring
  • Duplicate ring
  • Pairing up to three rings

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy
Ring

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

When all switches are combined into one ring in ERR, then on each switch it is necessary to configure the ports that will participate in building the ring.

double ring
Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Switches can be combined into a double ring, which greatly increases the reliability of the ring.

Dual Ring Limitations:

  • A double ring cannot be used to pair switches with other rings. To do this, you need to use Ring Coupling.
  • A double ring cannot be used for a mating ring.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy
Conjugation of rings

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

When pairing, there can be a maximum of 200 devices on the network.

Conjugation of rings involves the union of the remaining rings into another ring.

If the ring is connected to the pairing ring through one switch, then this is called pairing of rings through one switch. If two switches from the local ring are connected to the link ring, then this will be pairing through two switches.

When pairing through a single switch, both ports are used on the device. The convergence time in this case will be approximately 15-17 ms. With such an interface, the interface switch will be a point of failure, because If this commutator is lost, the entire ring is lost at once. Pairing through two switches avoids this.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

It is possible to match duplicated rings.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Path Control
Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

The Path Control function allows you to configure the ports through which data will be transmitted in normal operation. If the link fails and the network rebuilds to the backup topology, then after the link is restored, the network will rebuild back to the specified topology.

This feature saves on redundant cable. Moreover, the topology used for troubleshooting will always be known.

The main topology switches to the backup in 15 ms. Switching back when the network is restored will take about 30 ms.

Limitations:

  • Cannot be used with Dual Ring.
  • The feature must be enabled on all switches in the network.
  • One of the switches is configured as the Path Control master.
  • Automatic transition to the main topology after recovery occurs after 1 second by default (this parameter can be changed using SNMP in the range from 0 s to 99 s).

Operating principle

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

How ERR works

For example, consider six switches - 1-6. Switches are combined into a ring. Each switch uses two ports to connect to the ring and stores their statuses. Switches forward port statuses to each other. These device data are used to set the initial state of the ports.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy
Ports have only two roles - blocked ΠΈ Forwarding.

The switch with the highest MAC address is blocking its port. All other ports in the ring transmit data.

If a Blocked port fails, then the next port with the highest MAC address becomes Blocked.

After booting, the switches start sending Ring Protocol Data Unit (R-PDU). The R-PDU is transmitted using multicast. The R-PDU is a service message, just like a BPDU in RSTP. The R-PDU contains the switch port statuses and its MAC address.

Algorithm of actions in case of channel failure
When a link fails, the switches send an R-PDU to notify the port status change.

Algorithm of actions when restoring a channel
When a failed link comes online, the switches send an R-PDU to notify the port status change.

The switch with the highest MAC address becomes the new root switch.

The failed channel becomes a backup.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

After restoration, one of the ports of the channel remains blocked, and the second is transferred to the forwarding state. The port with the highest speed becomes the blocked port. If the speeds are equal, then the switch port with the highest MAC address will become blocked. This principle allows you to block a port that will transition from the blocked state to the forwarding state at maximum speed.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Maximum number of devices in the network

The maximum number of switches in an ERR ring is 200.

Interaction between ERR and RSTP

RSTP can be used in conjunction with ERR. But the RSTP ring and the ERR ring must only cross through one switch.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Summary

ERR is great for organizing generic topologies. For example, a ring or a duplicated ring.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

Such topologies are often used for redundancy in industrial facilities.

Moreover, with the help of ERR, the second topology can be implemented less reliably, but more budget. This can be done with a duplicated ring.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

But it is not always possible to apply ERR. There are quite exotic schemes. With one of our customers, we tested the following topology.

Implementation details of RSTP protocols and proprietary Extended Ring Redundancy

In this case, ERR cannot be applied. For such a scheme, we used RSTP. The customer had a strict requirement for convergence time - less than 3 s. To achieve this time, it was necessary to clearly define the root switches (primary and backup), as well as the cost of the ports in manual mode.

As a result, ERR noticeably wins in terms of convergence time, but does not provide the flexibility that RSTP provides.

Source: habr.com

Add a comment