LAYER2-RSTP and MSTP

Source: Internet
Author: User
Tags emit

Session 1 RSTP
1. Overview of STP
Public: 802.1dSTP (General stp), 802.1wRSTP (new rapid STP), 802.1sMSTP (the latest practical multi-instance STP, support for multi-vendor device Mix)
Cisco private: Pvst, pvst+, r-pvst+ (corresponds to above, but no multi-instance)
Rstp:rapid Spanning Tree Protocol (RSTP) fast spanning trees, the common STP convergence speed is fast, up to 6s complete, the general need 15s convergence.
About the 5 port 3 status of RSTP
The 5 ports of the RSTP are: Root port (RP), specified port (DP), alternate port (backup-port), backup port (alternate-port), Disable ports (Disable-port) (three of the three ports that are categorized by the block status port in STP cannot forward data but are different from block)
3 states of RSTP: Discard status (discarding), Learning State (learning) forwarding status (Forwarding)
Backup port in RSTP + disabled+blocking+listening in DISCARDING=CTP in Replace Port =CTP in non-specified port RSTP

Alternate port: Also known as an alternative root port, which is a port that receives root bpdus from other bridges

Backup port: Also called backup specified port, if one port receives better BPDUs for the same bridge, then the port becomes the backup port
Alternative ports and backup ports are non-designated ports in the STP, but will be replaced in RSTP

The generation port and the backup port are separated from the non-specified port.
The replacement port and the backup port are in the discarding state in the stable state
Disable ports: No role in the fast Spanning tree network, which is plainly the shutdown port
On the change of BPDU message in RSTP
1, version changed to 2
2. Change the type to 2
3. Flag field:

Only 7th and No. 0 positions were used in the STP, and all of the RSTP were used in the
On the change of operating principle of RSTP
1.BPDU Send the same:
In 802.1D, a non-root switch generates BPDUs only when it receives bpdus on the root port------passive generation

In 802.1W, even if the switch does not receive bpdus from the root switch, it sends BPDUs containing the current information every Hello time period (by default, 2s)


2. Differences in fault detection capabilities:
In 802.1D, if the non-specified port in 20s did not receive the root bridge sent over the BPDUs, then it will produce a topological change, into a listening state filter to forwarding state, but also through two forward delay time total 30 seconds, So CST has 50 seconds to enable block ports in the event of a network failure

In 802.1W, if the port does not receive BPDUs within 3 consecutive hello intervals, it is assumed that the connection to the discarding state is enabled immediately after the loss of connectivity to the Network Bridge, RSTP the root switch fails, and does not import the full STP calculation, where the alternate port is enabled is enabled immediately, so the network converges faster and RSTP will recover the network in less than 1 seconds.


3. Fast transition to forwarding state mechanism:
In 802.1D, the convergence of the network depends on the timer, and the Generation tree algorithm passively waits for the network to converge.
In 802.1W, the convergence of the network does not depend on the timer, the new RSTP can proactively confirm
Whether the port is already in the forwarding state
(1) Edge Port =portfast
(2) Proposal and agreement Process

(3) alternate root port and backup designated port


4. The topology change mechanism is not the same:
In 802.1D, when the bridge detects a topology change, he first notifies the root bridge, the root bridge, and then notifies the entire network, so that the entire Network bridge changes the aging time of the cam table
802.1W, each device will adjust its own port status for the calculation, only the port connected to other SW and root, and then send BPDUs to the other SW, so that each SW only calculate their own without notifying the root bridge and not wait for the root bridge to release the topological changes of BPDUs, speed up the convergence speed.

Note: In RSTP, only the non-edge port transitions to the forwarding state can cause topological changes, which means that the connection loss is not considered a topological change (a port in 802.1D becomes blocking state and TCN BPDUs are also generated). When RSTP detects a topology change, do 2 things:
(1) Turn on the TC while timer (the default is twice times the Hello time) to emit TCN BPDUs from the root port during this time.
(2) Clear all MAC addresses that do not connect to these ports
The switches along the way also do two things:
(1) Clear all the MAC addresses of all ports except the ports that receive the topology change

(2) Turn on the TC while timer to emit TCN BPDUs from the root port and the specified port


About Edge Ports
The edge port in 1.RSTP is equivalent to the Portfast port in STP
2. Requires manual configuration, command and configuration Portfast port is the same: Spanning-tree Portfast
3. As with the Portfast port, changes in the edge ports do not cause changes in the topology

4. If the edge port receives BPDUs, it discards the state of the edge port and becomes a normal spanning-tree port


About the compatibility of RSTP
If the port continues to receive the bpdus within twice times the Hello time and does not correspond to the current mode of operation, then it automatically switches to STP mode about proposal and agreement processproposal and agreement Process: Specifies that the port can go directly to the forwarding state on the point-to link

First, let's talk about the RSTP link type.
The link type in RSTP is related to duplex
If the port is working in full-duplex mode, it is considered to be a point-to-dot sharing link type
If the port is operating in half-duplex mode, then it is considered to be a shared link type
The interface can be changed manually: Spanning-tree link-type point-to-point



1> proposing. This variable is placed when a specified port is in the discarding or learning state. And the downstream exchange passes the proposal bit to the bpdus that are placed
2> proposed. When a port receives a BPDU that carries proposal to the specified port on the end. The variable is placed. This indicates that the specified port on this network segment wants to be busy import into the forwarding state.
3>sync. When proposed is set, the root port that receives the proposal information is placed in turn for the other port of its own sync variable. If the port is a non-edge, the specified port is import into the discarding state.
4>synced. When the port finishes go to discarding, it sets its own synced variable. The Alternate, Backup, and Edge ports set the variable immediately. The root port monitors the synced of other ports, and when all other port synced are set, the root port sets its own synced, which is then passed back to the BPDU, where the agreement bit is set.
5>agreed. When a specified port receives a BPDU, the variable is set if the agreement bit in the BPDU is placed and the port role segment is "root port". Once the agreed variable is set, the specified port is immediately transferred to the forwarding state. The whole process is this, if a switch is added between the root and switch A, this
1. Root switch sends BPDUs with proposal markings to a
2. Switch a performs synchronization: Blocking non-edge specified port
3. Switch A sends BPDUs carrying agreement tokens to the root switch
At this point between switch A and the root switch is in the forwarding State, the following procedure is switch A does not switch B again proposal and agreement process, so reciprocating to the edge of the network



Session 2 MSTP
Mstp:multiple Spanning Tree Protocol (MSTP) Multi-instance spanning trees
MSTP, also known as MST, the protocol number is 802.1s, is the most practical STP technology, and is the public agreement, the use of STP convergence rules and RSTP the same, the message structure is the same as RSTP, but more than the RSTP of the MST of the relevant information. Because MST is created based on RSTP, the basic algorithm and convergence are the same.
However, MST is characterized by: 1, based on instance (instance), instance is similar to the concept of a VTP domain refers to a running scope, where there is an instance of name, there is an instance of the number, and can be added (mapped) to a number of VLANs in an instance for the STP link load, Up to 65 instances are supported, and Cisco devices support only 16 instances.
2. MST is all backwards compatible with STP to rstp,pvst+ to R-pvst, and the MST package is automatically converted to other low-level STP protocols for the transmission of BPDUs in the process of working together.

The protocol number for the MSTP is IEEE 802.1s, and when multiple VLANs exist on the switch, CST transmits all traffic in a single path, while pvst+ can run an STP instance for each VLAN, because pvst+ can have up to 128 STP instances, pvst+ Can consume system resources extremely. MSTP for this reason, a VLAN that needs to import the same STP calculation is mapped to the same STP instance, that is, no matter how many VLANs are needed, as long as the number of paths that are not exactly required, the same STP instances are maintained according to the required path, thus greatly saving system resources such as:



Take this diagram as an example, because each switch has VLAN 10,vlan 20,vlan 30,vlan 40,pvst+ maintains 4 STP instances, it is not difficult to see that, in fact, there are only two paths in the network, VLAN 10 and VLAN 20 are exactly the same path, VLAN The path to 30 and VLAN 40 is also exactly the same, at this point, MSTP can be mapped to the same STP instance by the same VLAN, a total of only two STP instances, as pvst+ as the effect of load balancing, but also save the system resources. MSTP is run on the basis of RSTP, so it has a fast convergence function, RSTP is automatically opened when the MSTP is turned on. MSTP supports up to 65 STP instances, and Cisco devices support up to 16, but there is no limit to the number of VLANs mapped to instances. By default all VLANs are in instance 0MSTP also need to through the subregion management, namely region, the switch wants to be in the same area import line the same STP computation, must the region name and revision number consistent, most important is the VLAN and the instance mapping also must be consistent, Otherwise, the network that the STP calculates will not be the network you want, a VLAN can only be mapped to an instance, and a network may have multiple MSTP revision, which is convenient for each individual. Specific implementations of MST


Configure MSTP


1. Configure MSTP
(1) Change the STP mode for all switches to MSTP
Sw1 (config) # Spanning-tree mode MST
(2) All switches map VLAN to instance
SW1 (config) #spanning-tree MST configuration
SW1 (config-mst) #name CCIE (initially empty, used to differentiate the MST region.)
SW1 (config-mst) #revision 1 (Sets the configuration version number of the MST, which defaults to 0, and each change increases by 1.)
SW1 (config-mst) #instance 1 VLAN 10,20 (Default all VLANs belong to Instance0)
SW1 (config-mst) #instance 2 vlan 30,40
SW1 (config-mst) #show current (displays the present MST configuration)
SW1 (CONFIG-MST) #show pending (displays the MST configuration that has not been applied and, if you use the Abort command, discard the configuration change, enter the end command to save the MST configuration)
Description: Must region name and revision Number is exactly the same, otherwise it belongs to the different region. You can use the command to check the switch#show spanning-tree MST configuration
(3) to configure SW1 as the root switch for instance 1 and instance 2
SW1 (config) #spanning-tree MST 1 root Primary
(4) control SW4 in instance 1 SW2 port path cost value is
Sw4 (config) #int range f0/19-20
SW4 (config-if-range) # Spanning-tree MST 1 cost

Note: You can see that instance 1 and instance 2 traffic has been divided into two different paths, not pvst+ the same load effect, but also save the system resources, because there are only two STP instances, and pvst+ to 4 STP instances.


LAYER2-RSTP and MSTP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.