No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Principles of STP/RSTP

Principles of STP/RSTP

This section describes principles of STP/RSTP.

Background

STP is used to prevent loops in the LAN. The switching devices running STP discover loops on the network by exchanging information with one another, and block certain interfaces to cut off loops. Along with the growth of the LAN scale, STP has become an important protocol for the LAN.

Figure 5-82 Networking diagram for a typical LAN

On the network shown in Figure 5-82, the following situations may occur:
  • Broadcast storms render the network unavailable.

    Loops lead to broadcast storms, which causes network breakdown. Broadcast storms In Figure 5-82, assume that STP is not enabled on the switching devices. If Server A broadcasts a request, the request is received by port 1 and forwarded by port 2 on S1 and S2. Then, again on S1 and S2, port 2 receives the request broadcast by the other and port 1 forwards the request. As such transmission repeats, resources on the entire network are exhausted, causing the network unable to work.

  • Flapping of MAC address tables damages MAC address entries.

    Even update of MAC address entries upon the receipt of unicast packets damages the MAC address table.

    Assume that no broadcast storm occurs on the network. Server A unicasts a packet to Server B. If Server B is temporarily removed from the network at this time, the MAC address entries of Server B on S1 and S2 are deleted. The packet unicast by Server A to Server B is received by port 1 on S1. S1, however, does not have associated MAC address entries. Therefore, the unicast packet is forwarded to port 2. Then, port 2 on S2 receives the unicast packet from port 2 on S1 and sends it out through port 1. As such transmission repeats, port 1 and port 2 on S1 and S2 continuously receive unicast packets from Server A. Therefore, S1 and S2 modify the MAC address entries continuously, causing the MAC address table to flap. As a result, MAC address entries are damaged.

Basic Concepts

One Root Bridge

A tree topology must have a root. Therefore, the root bridge is introduced by STP.

There is only one root bridge on the entire STP-capable network. The root bridge is the logical center of but is not necessarily at the physical center of the entire network. The root bridge changes dynamically with the network topology.

After the network converges, the root bridge generates and sends out configuration BPDUs at specific intervals. Other devices process the configuration BPDUs so that the configuration BPDUs are advertised to the entire network, ensuring a stable network.

Two Types of Measurements

The spanning tree is calculated based on two types of measurements: ID and path cost.

  • ID

    IDs are classified into Bridge IDs (BIDs) and Port IDs (PIDs).

    • BID

      IEEE 802.1D defines that a BID is composed of a 16-bit bridge priority and a bridge MAC address. The bridge priority occupies the leftmost 16 bits and the MAC address occupies the rightmost 48 bits.

      On an STP-capable network, the device with the smallest BID is selected to be the root bridge.

    • PID

      The PID is composed of a 4-bit port priority and a 12-bit port number. The port priority occupies the leftmost 4 bits and the port number occupies the rightmost 12 bits.

      The PID is used to select the designated port.

      NOTE:

      The port priority affects the role of a port in a specified spanning tree instance. For details, see STP Topology Calculation.

  • Path cost

    The path cost is a port variable and is used to select a link. STP calculates the path cost to select a robust link and blocks redundant links to trim the network into a loop-free tree topology.

    On an STP-capable network, the accumulative cost of the path from a certain port to the root bridge is the sum of the costs of all the segment paths into which the path is separated by the ports on the transit bridges. This value is also called root path cost.

Three Elements

There are generally three elements used when a ring topology is to be trimmed into a tree topology: root bridge, root port, and designated port. Figure 5-83 shows the three elements.

Figure 5-83 STP network architecture

  • Root bridge

    The root bridge is the bridge with the smallest BID. The smallest BID is discovered by exchanging configuration BPDUs.

  • Root port

    The root port is the port with the smallest root path to the root bridge, and is responsible for forwarding data to the root bridge. The root port is determined based on the path cost. Among all STP-capable ports on a network bridge, the port with the smallest root path cost is the root port. There is only one root port on an STP-capable device, but there is no root port on the root bridge.

  • Designated port

    For description of the designated bridge and designated port, see Table 5-25.

    Table 5-25 Description of the designated bridge and designated port

    Object

    Designated Bridge

    Designated Port

    Device

    Device that forwards configuration BPDUs to a directly connected device

    Designated bridge port that forwards configuration BPDUs to a device

    LAN

    Device that forwards configuration BPDUs to a network segment

    Designated bridge port that forwards configuration BPDUs to a network segment.

    As shown in Figure 5-84, AP1 and AP2 reside on S1; BP1 and BP2 reside on S2; CP1 and CP2 reside on S3.

    • S1 sends configuration BPDUs to S2 through AP1. S1 is the designated bridge of S2, and AP1 on S1 is the designated port.

    • Two devices, S2 and S3, are connected to the LAN. If S2 is responsible for forwarding configuration BPDUs to the LAN, S2 is the designated bridge of the LAN and BP2 on S2 is the designated port.

    Figure 5-84 Networking diagram of the designated bridge and designated port

After the root bridge, root port, and designated port are selected successfully, the entire tree topology is set up. When the topology is stable, only the root port and the designated port forward traffic. All the other ports are in the Blocking state and receive only STP protocol packets instead of forwarding user traffic.

Four Comparison Principles

STP has four comparison principles that form a BPDU priority vector { root BID, total root path costs, sender BID, port ID }.

Table 5-26 shows the port information that is carried in the configuration BPDUs.

Table 5-26 Four important fields

Field

Brief Description

Root BID

Each STP-capable network has only one root bridge.

Root path cost

The distance between the port sending configuration BPDUs to the root bridge determines the path cost to the root bridge.

Sender BID

BID of the device sending configuration BPDUs.

Port ID

PID of the port sending configuration BPDUs.

After a device on the STP-capable network receives configuration BPDUs, it compares the fields shown in Table 5-26 with that of the configuration BPDUs on itself. The four comparison principles are as follows:

NOTE:

During the STP calculation, the smaller the value, the higher the priority.

  • Smallest BID: used to select the root bridge. Devices running STP select the smallest BID as the root BID shown in Table 5-26.
  • Smallest root path cost: used to select the root port on a non-root bridge. On the root bridge, the path cost of each port is 0.
  • Smallest sender BID: used to select the root port when a device running STP selects the root port between two ports that have the same path cost. The port with a smaller BID is selected as the root port in STP calculation. Assume that the BID of S2 is smaller than that of S3 in Figure 5-83. If the path costs in the BPDUs received by port A and port B on S4 are the same, port B becomes the root port.
  • Smallest PID: used to block the port with a greater PID but not the port with a smaller PID when the ports have the same path cost. The PIDs are compared in the scenario shown in Figure 5-85. The PID of port A on S1 is smaller than that of port B. In the BPDUs that are received on port A and port B, the path costs and BIDs of the sending devices are the same. Therefore, port B with a greater PID is blocked to cut off loops.
    Figure 5-85 Topology to which PID comparison is applied

Five Port States

Table 5-27 shows the port status of an STP-capable device.

Table 5-27 STP Port states

Port State

Purpose

Description

Forwarding

A port in Forwarding state can forward user traffic and process BPDUs.

Only the root port and designated port can enter the Forwarding state.

Learning

When a device has a port in the Learning state, the device creates a MAC address table based on the received user traffic but does not forward user traffic.

This is a transitional state, which is designed to prevent temporary loops.

Listening

All ports are in the Listening state when STP calculation is being implemented to determine port roles.

This is a transitional state.

Blocking

A port in the Blocking state receives and forwards only BPDUs, not user traffic.

This is the final state of a blocked port.

Disabled

A port in Disabled state does not process BPDUs or forward user traffic.

The port is Down.

Figure 5-86 shows the process of the state transition of a port.

Figure 5-86 STP State transition of a port

A Huawei datacom device uses MSTP by default. After a device transitions from the MSTP mode to the STP mode, its STP-capable port supports the same port states as those supported by an MSTP-capable port, including the Forwarding, Learning, and Discarding states. For details, see Table 5-28.

Table 5-28 MSTP Port status

Port Status

Description

Forwarding

A port in Forwarding state can forward user traffic and process BPDUs.

Learning

A port in Learning state learns MAC addresses from user traffic to construct a MAC address table.

In Learning state, the port can send and receive BPDUs, but does not forward user traffic.

Discarding

A port in the Discarding state can only receive BPDUs.

The following parameters affect the STP-capable port states and convergence.

  • Hello time

    The Hello timer specifies the interval at which an STP-capable device sends configuration BPDUs and Hello packets to detect link faults.

    When the network topology becomes stable, the change made on the interval takes effect only after a new root bridge takes over. The new root bridge adds certain fields in BPDUs to inform non-root bridges of the change in the interval. After a topology changes, TCN BPDUs will be sent. This interval is irrelevant to the transmission of TCN BPDUs.

  • Forward Delay

    The Forward Delay timer specifies the delay for interface status transition. When a link fault occurs, STP recalculation is performed, causing the structure of the spanning tree to change. The configuration BPDUs generated during STP recalculation cannot be immediately transmitted over the entire network. If the root port and designated port forward data immediately after being selected, transient loops may occur. Therefore, an interface status transition mechanism is introduced by STP. The newly selected root port and designated port do not forward data until an amount of time equal to twice the forward delay has past. In this manner, the newly generated BPDUs can be transmitted over the network before the newly selected root port and designated port forward data, which prevents transient loops.

    NOTE:

    The Forward Delay timer specifies the duration of a port spent in both the Listening and Learning states. The default value is 15 seconds. This means that the port stays in the Listening state for 15 seconds and then stays in the Learning state for another 15 seconds. The port in the Listening or Learning state is blocked, which is key to preventing transient loops.

  • Max Age

    The Max Age time specifies the aging time of BPDUs. The Max Age time can be manually configured on the root bridge.

    Configuration BPDUs are transmitted over the entire network, ensuring a unique Max Age value. After a non-root bridge running STP receives a configuration BPDU, the non-root bridge compares the Message Age value with the Max Age value in the received configuration BPDU.
    • If the Message Age value is smaller than or equal to the Max Age value, the non-root bridge forwards the configuration BPDU.
    • If the Message Age value is larger than the Max Age value, the configuration BPDU ages and the non-root bridge directly discards it. In this case, the network size is considered too large and the non-root bridge disconnects from the root bridge.
    NOTE:

    If the configuration BPDU is sent from the root bridge, the value of Message Age is 0. Otherwise, the value of Message Age indicates the total time during which a BPDU is sent from the root bridge to the local bridge, including the delay in transmission. In real world situations, each time a configuration BPDU passes through a bridge, the value of Message Age increases by 1.

Table 5-29 shows the timer values defined in IEEE 802.1D.

Table 5-29 Values of STP parameters (in centisecond)

Parameter

Default Value

Value Range

Hello time

200

100-1000

Max Age

2000

600-4000

Forward Delay

1500

400-3000

BPDU Format

The BID, path cost, and PID that are described in the previous sections are all carried in BPDUs.

  • Configuration BPDUs are heartbeat packets. STP-enabled designated ports send BPDUs at intervals specified by the Hello timer.
  • TCN BPDUs are sent only after the device detects network topology changes.

A BPDU is encapsulated into an Ethernet frame. Its destination MAC address is a multicast MAC address 01-80-C2-00-00-00. The value of the Length/Type field is the MAC data length. The Length/Type field is followed by the LLC header and BPDU header. Figure 5-87 shows the Ethernet frame format.

Figure 5-87 Format of an Ethernet frame

Configuration BPDU

Configuration BPDUs are most commonly used.

During initialization, each bridge actively sends configuration BPDUs. After the network topology becomes stable, only the root bridge actively sends configuration BPDUs. Other bridges send configuration BPDUs only after receiving configuration BPDUs from upstream devices. A configuration BPDU is at least 35 bytes long, including the parameters such as the BID, path cost, and PID. A BPDU is discarded if both the sender BID and Port ID field values are the same as those of the local port. Otherwise, the BPDU is processed. In this manner, BPDUs containing the same information as that of the local port are not processed.

A configuration BPDU is generated in one of the following scenarios:
  • Once the ports are enabled with STP, the designated ports send configuration BPDUs at intervals specified by the Hello timer.
  • When a root port receives configuration BPDUs, the device where the root port resides sends a copy of the configuration BPDUs to the specified ports on itself.
  • When receiving a configuration BPDU with a lower priority, a designated port immediately sends its own configuration BPDUs to the downstream device.

Table 5-30 shows the format of a BPDU.

Table 5-30 BPDU format

Field

Byte

Description

Protocol Identifier

2

Always 0

Protocol Version Identifier

1

Always 0

BPDU Type

1

Indicates the type of a BPDU. The value is one of the following:
  • 0x00: configuration BPDU
  • 0x80: TCN BPDU

Flags

1

Indicates whether the network topology is changed.

  • The rightmost bit is the Topology Change (TC) flag.
  • The leftmost bit is the Topology Change Acknowledgment (TCA) flag.

Root Identifier

8

Indicates the BID of the current root bridge.

Root Path Cost

4

Indicates the cumulative cost of all links to the root bridge.

Bridge Identifier

8

Indicates the BID of the bridge sending a BPDU.

Port Identifier

2

Indicates the ID of the port sending a BPDU.

Message Age

2

Records the time since the root bridge originally generated the information that a BPDU is derived from.

If the configuration BPDU is sent from the root bridge, the value of Message Age is 0. Otherwise, the value of Message Age indicates the total time during which a BPDU is sent from the root bridge to the local bridge, including the delay in transmission. In real world situations, each time a configuration BPDU passes through a bridge, the value of Message Age increases by 1.

Max Age

2

Indicates the maximum time that a BPDU is saved.

Hello Time

2

Indicates the interval at which BPDUs are sent.

Forward Delay

2

Indicates the time spent in the Listening and Learning states.

Figure 5-88 shows the Flags field. Only the leftmost and rightmost bits are used in STP.

Figure 5-88 Format of the Flags field
TCN BPDU

The contents of TCN BPDUs are quite simple, including only three fields: Protocol ID, Version, and Type, as shown in Table 5-30. The value of the Type field is 0x80, four bytes in length.

TCN BPDUs are transmitted by each device to its upstream device to notify the upstream device of changes in the downstream topology, until they reach the root bridge. A TCN BPDU is generated in one of the following scenarios:
  • Where the port is in the Forwarding state and at least one designated port resides on the device
  • Where a designated port receives TCN BPDUs and sends a copy to the root bridge

STP Topology Calculation

After all devices on the network are enabled with STP, each device considers itself the root bridge. Each device only transmits and receives BPDUs but does not forward user traffic. All ports are in the Listening state. After exchanging configuration BPDUs, all devices participate in the selection of the root bridge, root port, and designated port.

BPDU Exchange

As shown in Figure 5-89, the quadruple marked with {} indicates a set of ordered vectors: root BID (S1_MAC and S2_MAC indicates the BIDs of two devices), total path costs, sender BID, and Port ID. Configuration BPDUs are sent at intervals set by the Hello timer.

Figure 5-89 Exchange of initialization messages

STP algorithm implementation
  1. Initialization

    As each bridge considers itself the root bridge, the value of the root BID field in the BPDU sent by each port is recorded as its BID. The value of the Root Path Cost field is the accumulative cost of all links to the root bridge; the sender BID is the ID of the local bridge; the Port ID is the PID of the local bridge port that sends the BPDU.

  2. Root bridge selection

    During network initialization, every device considers itself as the root bridge and the root bridge ID as the device ID. Devices exchange configuration BPDUs to compare the root bridge IDs. The device with the smallest BID is elected as the root bridge.

  3. Root port and designated port selection

    Table 5-31 lists the process of selecting the root port and designated port.

    Table 5-31 Selecting the root port and designated port
    No. Procedure
    1 The non-bridge device uses the port that receives the optimal configuration BPDU as the root port. Table 5-32 lists the process of selecting the optimal configuration BPDU.
    2 The device calculates a BPDU for each designated port based on the BPDU and path cost of the root port.
    • The root bridge ID is replaced with the root bridge ID of the BPDU on the root interface.
    • The root path cost is replaced with the root path cost in the BPDU on the root interface plus the path cost of the root interface.
    • The sender BID is replaced with the device ID.
    • The designated port ID is replaced with the port ID.
    3 The device compares the calculated BPDU with the BPDU on the port:
    • If the calculated BPDU is of higher priority, the port is selected as the designated port and its BPDU is replaced by the calculated BPDU. The port periodically sends the calculated BPDU.
    • If the BPDU of the port is of higher priority, the BPDU on the port is not updated and the port is blocked. The port only receives BPDUs, and does not forward data or send BPDUs.
    Table 5-32 Selecting the optimal BPDU
    No. Procedure
    1 Each port compares the received BPDU with its BPDU:
    • If the received BPDU has a lower priority, the port discards the received BPDU and does not process its BPDU.
    • If the received BPDU has a higher priority, the port replaces its BPDU with the received BPDU.
    2 The device compares BPDUs on all the ports and selects the optimal BPDU.
STP Calculation Example

When the root bridge, root port, and designated port are selected successfully, the whole tree topology is set up. The following example describes STP calculation.

Figure 5-90 STP networking and topology after calculation

As shown in Figure 5-90, priorities of DeviceA, DeviceB, and DeviceC are 0, 1, and 2, and the path costs between DeviceA and DeviceB, between DeviceA and DeviceC, and between DeviceB and DeviceC are 5, 10, and 4 respectively.

  1. Initial state of each device

    Table 5-33 lists the initial state of each device.

    Table 5-33 Initial state of each device
    Device Port Name BPDU
    DeviceA Port A1 {0, 0, 0, Port A1}
    Port A2 {0, 0, 0, Port A2}
    DeviceB Port B1 {1, 0, 1, Port B1}
    Port B2 {1, 0, 1, Port B2}
    DeviceC Port C1 {2, 0, 2, Port C1}
    Port C2 {2, 0, 2, Port C2}
  2. Comparison and result

    Table 5-34 lists the comparison and result.

    NOTE:
    The fields in the BPDU represent {root bridge ID, accumulative root path cost, sender BID, transmit port ID PID}.
    Table 5-34 Topology calculation and result
    Device Comparison BPDU After Comparison
    DeviceA
    • Port A1 receives the BPDU {1, 0, 1, Port B1} from Port B1 and finds that its BPDU {0, 0, 0, Port A1} has higher priority than the BPDU {1, 0, 1, Port B1} from Port B1 , so Port A1 discards the BPDU {1, 0, 1, Port B1}.
    • Port A2 receives the BPDU {2, 0, 2, Port C1} from Port C1 and finds that its BPDU {0, 0, 0, Port A2} has higher priority than the BPDU {2, 0, 2, Port C1} than so Port A2 discards the BPDU {2, 0, 2, Port C1}.
    • After finding that both the root and the designated switches are itself in the BPDU on each port, DeviceA considers itself as the root. Switch A then sends BPDUs from each port periodically without modifying the BPDUs.
    • Port A1: {0, 0, 0, Port A1}
    • Port A2: {0, 0, 0, Port A2}
    DeviceB
    • Port B1 receives the BPDU {0, 0, 0, Port A1} from Port A1 and finds that its BPDU {0, 0, 0, Port A1} has higher priority than the BPDU {1, 0, 1, Port B1}, so Port B1 updates its BPDU.
    • Port B2 receives the BPDU {2, 0, 2, Port C2} from Port C2 and finds that its BPDU {1, 0, 1, Port B2} has higher priority than the BPDU {2, 0, 2, Port C2}, so Port B2 discards the BPDU {2, 0, 2, Port C2}.
    • Port B1: {0, 0, 0, Port A1}
    • Port B2: {1, 0, 1, Port B2}
    • DeviceB compares the BPDU on each port and finds that the BPDU on Port B1 has the highest priority, so Port B1 is used as the root port and the BPDU on Port B1 remains unchanged.
    • DeviceB calculates the BPDU {0, 5, 1, Port B2} for Port B2 based on the BPDU and path cost of the root port, and compares the BPDU {0, 5, 1, Port B2} with its BPDU {1, 0, 1, Port B2} on Port B2. Device B finds that the calculated BPDU has higher priority, so Port B2 is used as the designated port, and its BPDU is replaced by the calculated BPDU and the calculated BPDU is sent periodically.
    • Root port (Port B1): {0, 0, 0, Port A1}
    • Designated port (Port B2): {0, 5, 1, Port B2}
    DeviceC
    • Port C1 receives the BPDU {0, 0, 0, Port A2} from Port A2 and finds that the BPDU {0, 0, 0, Port A2} has higher priority than its BPDU {2, 0, 2, Port C1}, so Port C1 updates its BPDU.
    • Port C2 receives the BPDU {1, 0, 1, Port B2} from Port B2 and finds that the BPDU {1, 0, 1, Port B2} has higher priority than its BPDU {2, 0, 2, Port C2}, so Port C2 updates its BPDU.
    • Port C1: {0, 0, 0, Port A2}
    • Port C2: {1, 0, 1, Port B2}
    • DeviceC compares the BPDU on each port and finds that the BPDU on Port C1 has the highest priority, so Port C1 is used as the root port and the BPDU on Port C1 remains unchanged.
    • DeviceC calculates the BPDU {0, 10, 2, Port C2} for Port C2 based on the BPDU and path cost of the root port, and compares the BPDU {0, 10, 2, Port C2} with its BPDU {1, 0, 1, Port B2} on Port C2. DeviceC finds that the calculated BPDU has higher priority, so Port C2 is used as the designated port and its BPDU is replaced by the calculated BPDU.
    • Root port (Port C1): {0, 0, 0, Port A2}
    • Designated port (Port C2): {0, 10, 2, Port C2}
    • Port C2 receives the BPDU {0, 5, 1, Port B2} from Port B2 and finds that the BPDU {0, 5, 1, Port B2} has higher priority than its BPDU {0, 10, 2, Port C2}, so Port C2 updates its BPDU.
    • Port C1 receives the BPDU {0, 0, 0, Port A2} from Port A2 and finds that the BPDU {0, 0, 0, Port A2} is the same as its BPDU, so Port C1 discards the received BPDU.
    • Port C1: {0, 0, 0, Port A2}
    • Port C2: {0, 5, 1, Port B2}
    • DeviceC finds that the root path cost of Port C1 is larger than the root patch cost of Port C2, so the BPDU on Port C2 has higher priority than that on Port C1. Port C2 is used as the root port and its BPDU remains unchanged. The root path cost of Port C1 is 10 (root path cost 0 in the BPDU plus the link patch cost 10), and the root path cost of Port C2 is 9 (root path cost 5 in the BPDU plus the link patch cost 4).
    • DeviceC calculates the BPDU {0, 9, 2, Port C1} for Port C1 based on the BPDU and path cost of the root port, and compares the BPDU {0, 9, 2, Port C1} with its BPDU {0, 0, 0, Port A2} on Port C2. DeviceC finds that its BPDU has higher priority, so Port C1 is blocked and its BPDU remains unchanged. Port C1 does not forward data until STP recalculation is triggered. For example, when the link between DeviceB and DeviceC is Down, STP recalculation is triggered.
    • Blocked port (Port C1): {0, 0, 0, Port A2}
    • Root port (Port C2): {0, 5, 1, Port B2}

After the topology becomes stable, the root bridge still sends configuration BPDUs at intervals set by the Hello timer. Each non-root bridge forwards the received configuration BPDUs by using its designated port. If the priority of the received BPDU is higher than that on the non-root bridge, the non-root bridge updates its own BPDU based on the information carried in the received BPDU.

STP Topology Changes

Figure 5-91 shows the packet transmission process after the STP topology changes.

Figure 5-91 Diagram of packet transmission after the topology changes

  1. After the network topology changes, a downstream device continuously sends TCN BPDUs to an upstream device.
  2. After the upstream device receives TCN BPDUs from the downstream device, only the designated port processes them. The other ports may receive TCN BPDUs but do not process them.
  3. The upstream device sets the TCA bit of the Flags field in the configuration BPDUs to 1 and returns the configuration BPDUs to instruct the downstream device to stop sending TCN BPDUs.
  4. The upstream device sends a copy of the TCN BPDUs to the root bridge.
  5. Steps 1, 2, 3 and 4 are repeated until the root bridge receives the TCN BPDUs.
  6. The root bridge sets the TC bit of the Flags field in the configuration BPDUs to 1 to instruct the downstream device to delete MAC address entries.
NOTE:
  • TCN BPDUs are used to inform the upstream device and root bridge of topology changes.
  • Configuration BPDUs with the TCA bit being set to 1 are used by the upstream device to inform the downstream device that the topology changes are known and instruct the downstream device to stop sending TCN BPDUs.
  • Configuration BPDUs with the TC bit being set to 1 are used by the upstream device to inform the downstream device of topology changes and instruct the downstream device to delete MAC address entries. In this manner, fast network convergence is achieved.

Evolution from STP to RSTP

In 2001, IEEE 802.1w was published to introduce an extension of the Spanning Tree Protocol (STP), namely, Rapid Spanning Tree Protocol (RSTP). RSTP is developed based on STP but outperforms STP.

Disadvantages of STP

STP ensures a loop-free network but has a slow network topology convergence speed, leading to service deterioration. If the network topology changes frequently, the connections on the STP-capable network are frequently torn down, causing frequent service interruption. Users can hardly tolerate such a situation.

Disadvantages of STP are as follows:

  • Port states or port roles are not subtly distinguished, which is not conducive to the learning and deployment for beginners.

    A network protocol that subtly defines and distinguishes different situations is likely to outperform the others.

    • Ports in the Listening, Learning, and Blocking states do not forward user traffic and are not even slightly different to users.

    • The differences between ports in essence never lie in the port states but the port roles from the perspective of use and configuration.

      It is possible that the root port and designated port are both in the Listening state or Forwarding state.

  • The STP algorithm determines topology changes after the time set by the timer expires, which slows down network convergence.

  • The STP algorithm requires a stable network topology. After the root bridge sends configuration BPDUs, other devices process the configuration BPDUs so that the configuration BPDUs are advertised to the entire network.

    This also slows down topology convergence.

Advantages of RSTP over STP

RSTP deletes three port states and adds two port roles, and decouples port attributes based on the port status and role. In addition, RSTP provides enhanced features and protection measures to implement network stability and fast convergence.

  • More port roles are defined to simplify the knowledge and deployment of STP.

    Figure 5-92 Diagram of port roles

    As shown in Figure 5-92, RSTP defines four port roles: root port, designated port, alternate port, and backup port.

    The functions of the root port and designated port are the same as those defined in STP. The alternate port and backup port are described as follows:
    • From the perspective of configuration BPDU transmission:
      • An alternate port is blocked after learning the configuration BPDUs sent by other bridges.
      • A backup port is blocked after learning the configuration BPDUs sent by itself.
    • From the perspective of user traffic
      • An alternate port backs up the root port and provides an alternate path from the designated bridge to the root bridge.
      • A backup port backs up the designated port and provides an alternate path from the root bridge to the related network segment.

      After all RSTP-capable ports are assigned roles, topology convergence is completed.

  • Port states are redefined in RSTP.

    Port states are simplified from five types to three types. Based on whether a port forwards user traffic and learns MAC addresses, the port is in one of the following states:

    • If a port neither forwards user traffic nor learns MAC addresses, the port is in the Discarding state.
    • If a port does not forward user traffic but learns MAC addresses, the port is in the Learning state.
    • If a port forwards user traffic and learns MAC addresses, the port is in the Forwarding state.

    Table 5-35 shows the comparison between port states in STP and RSTP.

    NOTE:

    Port states and port roles are not necessarily related. Table 5-35 lists states of ports with different roles.

    Table 5-35 Comparison between states of STP ports and RSTP ports with different roles

    STP Port State

    RSTP Port State

    Port Role

    Forwarding

    Forwarding

    Root port or designated port

    Learning

    Learning

    Root port or designated port

    Listening

    Discarding

    Root port or designated port

    Blocking

    Discarding

    Alternate port or backup port

    Disabled

    Discarding

    Disabled port

  • Configuration BPDUs in RSTP are differently defined. Port roles are described based on the Flags field defined in STP.

    Compared with STP, RSTP slightly redefined the format of configuration BPDUs.
    • The value of the Type field is no longer set to 0 but 2. Therefore, the RSTP-capable device always discards the configuration BPDUs sent by an STP-capable device.
    • The 6 bits in the middle of the original Flags field are reserved. Such a configuration BPDU is called an RST BPDU, as shown in Figure 5-93.
    Figure 5-93 Format of the Flags field in an RST BPDU

  • Configuration BPDUs are processed in a different manner.
    • Transmission of configuration BPDUs

      In STP, after the topology becomes stable, the root bridge sends configuration BPDUs at an interval set by the Hello timer. A non-root bridge does not send configuration BPDUs until it receives configuration BPDUs sent from the upstream device. This renders the STP calculation complicated and time-consuming. In RSTP, after the topology becomes stable, a non-root bridge sends configuration BPDUs at Hello intervals, regardless of whether it has received the configuration BPDUs sent from the root bridge. Such operations are implemented on each device independently.

    • BPDU timeout period

      In STP, a device has to wait a Max Age period before determining a negotiation failure. In RSTP, if a port does not receive configuration BPDUs sent from the upstream device for three consecutive Hello intervals, the negotiation between the local device and its peer fails.

    • Processing of inferior BPDUs

      In RSTP, when a port receives an RST BPDU from the upstream designated bridge, the port compares the received RST BPDU with its own RST BPDU.

      If its own RST BPDU is superior to the received one, the port discards the received RST BPDU and immediately responds to the upstream device with its own RST BPDU. After receiving the RST BPDU, the upstream device updates its own RST BPDU based on the corresponding fields in the received RST BPDU.

      In this manner, RSTP processes inferior BPDUs more rapidly, independent of any timer that is used in STP.

  • Rapid convergence

    • Proposal/agreement mechanism

      When a port is selected as a designated port, in STP, the port does not enter the Forwarding state until a Forward Delay period expires; in RSTP, the port enters the Discarding state, and then the proposal/agreement mechanism allows the port to immediately enter the Forwarding state. The proposal/agreement mechanism must be applied on the P2P links in full duplex mode.

      For details, see Details About RSTP.

    • Fast switchover of the root port

      If the root port fails, the most superior alternate port on the network becomes the root port and enters the Forwarding state. This is because there must be a path from the root bridge to a designated port on the network segment connecting to the alternate port.

      When the port role changes, the network topology accordingly changes. For details, see Details About RSTP.

    • Edge ports

      In RSTP, a designated port on the network edge is called an edge port. An edge port directly connects to a terminal and does not connect to any other switching devices.

      An edge port does not receive configuration BPDUs, so it does not participate in the RSTP calculation. It can directly change from the Disabled state to the Forwarding state without any delay, just like an STP-incapable port. If an edge port receives bogus configuration BPDUs from attackers, it is deprived of the edge port attributes and becomes a common STP port. The STP calculation is implemented again, causing network flapping.

  • Protection functions

    Table 5-36 shows protection functions provided by RSTP.

    Table 5-36 Protection functions

    Protection Function

    Scenario

    Principle

    BPDU protection

    On a switching device, ports that are directly connected to a user terminal such as a PC or file server are configured as edge ports.

    Usually, no RST BPDU will be sent to edge ports. If a switching device receives bogus RST BPDUs on an edge port, the switching device automatically sets the edge port to a non-edge port, and performs STP calculation again. This causes network flapping.

    After BPDU protection is enabled on a switching device, if an edge port receives an RST BPDU, the switching device shuts down the edge port without depriving of its attributes, and notifies the NMS of the shutdown event.

    Root protection

    Due to incorrect configurations or malicious attacks on the network, the root bridge may receive RST BPDUs with a higher priority. Consequently, the valid root bridge is no longer able to serve as the root bridge, and the network topology incorrectly changes. This also causes the traffic that should be transmitted over high-speed links to be transmitted over low-speed links, leading to network congestion.

    If a designated port is enabled with the root protection function, the port role cannot be changed. Once a designated port that is enabled with root protection receives RST BPDUs with a higher priority, the port enters the Discarding state and does not forward packets. If the port does not receive any RST BPDUs with a higher priority before a period (generally two Forward Delay periods) expires, the port automatically enters the Forwarding state.
    NOTE:

    Root protection can take effect on only designated ports.

    Loop protection

    On an RSTP-capable network, the switching device maintains the status of the root port and blocked ports by continually receiving BPDUs from the upstream switching device.

    If ports cannot receive BPDUs from the upstream switching device due to link congestion or unidirectional link failures, the switching device re-selects a root port. Then, the previous root port becomes a designated port and the blocked ports change to the Forwarding state. As a result, loops may occur on the network.

    After loop protection is configured, if the root port or alternate port does not receive RST BPDUs from the upstream switching device for a long time, the switching device notifies the NMS that the port enters the Discarding state. The blocked port remains in the Blocked state and does not forward packets. This prevents loops on the network. The root port or alternate port restores the Forwarding state after receiving new RST BPDUs.
    NOTE:

    Loop protection can take effect on only the root port and alternate ports.

    TC BPDU attack defense

    After receiving TC BPDUs, a switching device will delete its MAC entries and ARP entries. In the event of a malicious attack by sending bogus TC BPDUs, a switching device receives a large number of TC BPDUs within a short period, and busies itself deleting its MAC entries and ARP entries. As a result, the switching device is heavily burdened, rendering the network rather unstable.

    After the TC BPDU attack defense is enabled, the number of times that TC BPDUs are processed by the switching device within a given time period is configurable. If the number of TC BPDUs that the switching device receives within the given time exceeds the specified threshold, the switching device processes TC BPDUs only for the specified number of times. Excess TC BPDUs are processed by the switching device as a whole for once after the specified period expires. In this manner, the switching device is prevented from frequently deleting its MAC entries and ARP entries.

Details About RSTP

The Proposal/Agreement (P/A) mechanism helps a designated port to enter the Forwarding state as soon as possible. As shown in Figure 5-94, a new link is established between the root bridges S1 and S2. On S2, p2 is an alternate port; p3 is a designated port in the Forwarding state; p4 is an edge port.

Figure 5-94 Schematic diagram for the P/A negotiation

The P/A mechanism works in the following process:
  1. p0 and p1 become designated ports and send RST BPDUs.
  2. After receiving an RST BPDU with a higher priority, p1 determines that it will become a root port but not a designated port. p1 then stops sending RST BPDUs.
  3. p0 enters the Discarding state, and sends RST BPDUs with the Proposal field being 1.
  4. After receiving an RST BPDU with the Proposal field being 1, S2 sets the sync variable to 1 for all its ports.
  5. As p2 has been blocked, its status keeps unchanged; p4 is an edge port, and does not participate in calculation. Therefore, only the non-edge designated port p3 needs to be blocked.
  6. After p2, p3, and p4 enter the Discarding state, their synced variables are set to 1. The synced variable of the root port p1 is then set to 1, and p1 sends an RST BPDU with the Agreement field being 1 to S1. Except for the Agreement field, which is set to 1, and the Proposal field, which is set to 0, the RST BPDU is the same as that was received.
  7. After receiving this RST BPDU, S1 identifies it as a reply to the proposal that it just sent, and p0 immediately enters the Forwarding state.

This P/A negotiation process finishes, and S2 continues to perform the P/A negotiation with its downstream device.

Theoretically, STP can quickly select a designated port. To prevent loops, STP has to wait for a period of time long enough to determine the status of all ports on the network. All ports can enter the Forwarding state at least one forward delay later. RSTP is developed to eliminate this bottleneck by blocking non-root ports to prevent loops. By using the P/A mechanism, the upstream port can rapidly enter the Forwarding state.

NOTE:

To use the P/A mechanism, ensure that the link between the two devices is a P2P link in full-duplex mode. Once the P/A negotiation fails, a designated port can be selected by performing the STP negotiation after the forwarding delay timer expires twice.

RSTP Topology Change

In RSTP, if a non-edge port changes to the Forwarding state, the topology changes.

After a switching device detects the topology change (TC), it performs the following procedures:
  • Start a TC While Timer for every non-edge port. The TC While Timer value doubles the Hello Time value.

    All MAC addresses learned by the ports whose status changes are cleared before the timer expires.

    These ports send RST BPDUs with the TC field being 1. Once the TC While Timer expires, they stop sending the RST BPDUs.

  • After another switching device receives the RST BPDU, it clears the MAC addresses learned by all ports excluding the one that receives the RST BPDU. The device then starts a TC While Timer for all non-edge ports and the root port, the same as the preceding process.

In this manner, RST BPDUs flood the network.

Interoperability Between RSTP and STP

When RSTP switches to STP, RSTP loses its advantages such as fast convergence.

On a network where both STP-capable and RSTP-capable devices are deployed, STP-capable devices ignore RST BPDUs; if a port on an RSTP-capable device receives a configuration BPDU from an STP-capable device, the port switches to the STP mode after two Hello intervals and starts to send configuration BPDUs. In this manner, RSTP and STP are interoperable.

After STP-capable devices are removed, Huawei RSTP-capable datacom devices can switch back to the RSTP mode.

Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 58054

Downloads: 3621

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next