stp and three-layer exchange


Preface

The three-layer switching function is similar to single-arm routing, which realizes communication between different VLANs and network segments, but it is more practical than single-arm routing when three-layer switching is available. Single-arm routing is not recommended when there is three-layer switching. stp means Spanning Tree Protocol, which can avoid loops causing broadcast messages in a multi-switch network environment.

1. Definition and configuration of Layer 3 switching

1. Definition

The three-layer switch is a switch with some router functions, and it works on the third layer of the OSI network standard model: the network layer. The most important purpose of the three-layer switch is to speed up the data exchange within a large LAN. The routing function it has is also to serve this purpose. It can be routed once and forwarded many times. Regular processes such as packet forwarding are implemented by hardware at high speed, while functions such as routing information update, routing table maintenance, routing calculation, and routing determination are implemented by software.

2. Configuration method

You can also configure the address on the physical interface for the three-layer switch. You need to enter the logical interface. The specific configuration is as follows:
vlan bat 10 20 Create vlan
int vlan 10 Enter the logical interface
ip add 192.168.10.2 Configure the address on the virtual interface
Three-tier exchange

Two STP spanning tree

1 Definition
STP (Spanning Tree Protocol) is the English abbreviation of Spanning Tree Protocol. It can be applied to the establishment of tree topology in computer networks. Its main function is to prevent redundant links in the bridge network from forming loops. However, certain factors can cause STP to fail, and it may be very difficult to troubleshoot, depending on the network design. The spanning tree protocol is suitable for the network equipment of all manufacturers. There are differences in configuration and functional strength, but the principles and application effects are the same.
2 Working Principle
The basic principle of STP is to determine the topology of the network by passing a special protocol message, the Bridge Protocol Data Unit (BPDU) between switches. There are two types of BPDUs, configuration BPDU (Configuration BPDU) and TCN BPDU. The former is used to calculate an acyclic spanning tree, and the latter is used to shorten the refresh time of MAC entries when the Layer 2 network topology changes (shortened from the default 300s to 15s).
The Spanning Tree Protocol (STP) is defined in the IEEE 802.1D document. The principle of the protocol is to construct the network topology according to the tree structure, eliminate loops in the network, and avoid broadcast storm problems due to the existence of loops.
The basic idea of ​​Spanning Tree Protocol (STP) is to construct the network topology according to the structure of "tree". The root of the tree is a bridge device called the root bridge. The establishment of the root bridge is determined by the BID (Bridge ID) of the switch or bridge. ) Definitely, the device with the smallest BID becomes the root bridge in the Layer 2 network. BID is composed of bridge priority and MAC address. The number of bytes of bridge priority may be different for devices of different manufacturers. Starting from the root bridge, a tree is formed level by level. The root bridge regularly sends configuration BPDUs, and non-root bridges receive configuration BPDUs, refresh the best BPDUs and forward them. The best BPDU here refers to the BPDU sent by the current root bridge. If a lower-level BPDU is received (the newly connected device will send a BPDU, but the BID of the device is larger than the current root bridge), the device that receives the lower-level BPDU will send the best BPDU stored by itself to the newly connected device. To inform the root bridge in the current network; if the received BPDU is better, the spanning tree topology will be recalculated. When the non-root bridge has not received the best BPDU since the last time it received the best BPDU (Max Age, default 20s), the port will enter the listening state, and the device will generate TCN BPDUs, and The root port is forwarded, and the upper-level device that receives the TCN BPDU from the designated port will send an acknowledgment, and then send the TCN BPDU to the upper-level device. This process continues until the root bridge, and then the root bridge will carry a mark in the configuration BPDU sent thereafter It indicates that the topology has changed. After all devices in the network receive it, the refresh time of the MAC table entry is shortened from 300s to 15s. The entire convergence time is about 50s.
3 Configuration method
Please
stp enadle Enable stp (default is on)
stp mode mstp stp mode is set to mstp
stp region-configuration enter mstp setting mode
region-name 1 Set the region name to 1 (you can set it yourself)
revision-level 1 Set the version to 1
instance 1 vlan 10 defines vlan10 as instance 1
instance 2 vlan 20 defines vlan20 as instance 2
active region-configuration saves the mstp configuration

stp topology diagramThe instructions of LSW1 and LSW2 are the same as those of LSW3. Two more commands,
stp instance 1 root primary, become the root of instance 1.
stp instance 2 root secondary becomes the backup of instance 2. The
reverse in LSW3.
STP only backs up links, not devices.

Guess you like

Origin blog.csdn.net/weixin_49172531/article/details/112167788