In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Network construction of small and medium-sized enterprises
1. Spanning Tree algorithm (STP)
1. Broadcast storm
(1) working principle of the switch
-- forward data frames according to the MAC address table, or broadcast if the address is unknown
If the switch receives a broadcast frame, it will also send it to all ports.
(2) when there is a physical loop in the network, a broadcast storm will occur.
(3) the broadcast storm will eventually lead to the depletion of network resources and the crash of the switch.
2. Overview of STP
(1) STP-Spanning Tree Protocol (spanning Tree Protocol) is used to eliminate data link layer loops in the local area network.
Logically disconnect the loop to prevent broadcast storms
When the line fails, the blocking interface is activated and the communication is restored, which acts as a backup line.
(2) spanning tree algorithm is divided into three steps.
-- each broadcast domain selects a root bridge (Root Bridge) bridge, also known as a switch
-- Select the root port (Root Ports) for each non-root bridge
-- Select a designated port (Designated Ports) on each network segment
(3) Select the root bridge (root switch) there is only one root bridge in the whole network.
-- Bridge ID (BID)
The bridge ID is unique, and the switch with the lowest BID value is selected as the root bridge in the network.
(4) the election process of the root bridge
-- first compare the priorities in the BID in the BPDU messages sent by the two switches. The priority ranges from 0 to 61440, and the default value is 32768.
The step size is 4096. If the priority is the same, the MAC addresses of the two machines are compared, and the switch with the lower MAC address is used as the switch.
(5) Select the root port
There is one and only one root port on each non-root bridge
-- the basis for electing the root port:
Lowest root path cost from ① to root bridge (path cost, 20000 by default for gigabit links and 200000 for 100 megabit links)
② directly connected bridge ID minimum
Minimum ③ Port ID (Port Identifier)
-- the smaller the port ID, the higher the priority, which consists of the port priority and the port number.
-- Port priority is configurable. Values range from 0 to 240, step size is 16, and default value is 128.
(6) Select designated port
-- there is only one designated port on each network segment
-- the ports on the bridge are all designated ports
-on each network segment, select a designated port
-- designated port on non-root bridge, select order
The cost of the path from a certain network segment to the root in ① is low.
When ② receives data, the bridge ID of the sender (that is, the bridge at the opposite end of the link) is minimum.
The ③ sender port ID is the smallest.
-- the last remaining port is a blocking port
(7) the result of spanning tree algorithm
-- finally form a logical structure acyclic topology
II. Bridge Protocol data Unit
1 、 BPDU
-- Bridge Protocol Date Unit Bridge Protocol data Unit
-- use multicast to send BPDU.
2. There are two types of BPDU
-- configure BPDU
-- Topology change Notification (TCN) BPDU
3. Key fields contained in BPDU
Field byte function
Protocol ID 2
Version number 1
Message type 1 identifies whether to configure BPDU or TCN BPDU
Tag Field 1
Root bridge ID 8 is used to advertise the ID of the root bridge
Root path cost 4 indicates how far the BPDU is transmitted from the root and how much it costs.
Send Bridge ID 8 sends the ID of this BPDU bridge
Port ID 2 ID of the port on which the message is sent
Message aging time 2 timer value, which indicates how long it takes the spanning tree to complete each of its functions
Maximum aging time 2
Access time 2
Forwarding delay 2
4. BPDU selects the root bridge
(1) when the switch starts, assume that you are the root bridge
-- enter your own bridge ID in the ID field of the root bridge in the BPDU sent out
After receiving the BPDU from other switches, compare the bridge ID and select the smaller one to add to the root bridge ID.
5. Convergence of STP
-- Port status in 5 of switch port
Status and use
Disable (Disable) at this time, the port cannot forward not only BPDU messages, but also user traffic. Port status is Down
Blocking) at this time, the port can only receive and process BPDU messages, but does not forward user traffic
Listening) the device is determining the port role at this time, and the root bridge, root port, and designated port will be elected, which is a transitional state.
Learning (learning) at this time, the device will build a MAC address table based on the received user traffic, but does not forward user traffic, which is also a transitional state; this state is added to prevent temporary layer 2 loops.
Forwarding (forwarding) at this time the port forwards both user traffic and BPDU messages. Only the root port and the designated port can enter this state.
6. Spanning tree timer
(1) three kinds of timers of STP
-- Hello time (Hello timer)
The Hello timer refers to the interval at which devices running the STP protocol send BPDU, that is, the device sends a configuration message BPDU to the surrounding devices every Hello Time time to confirm whether the link is down. The time interval is 2s
-- forwarding delay (Forward Delay)
Forwarding delay is the delay time for a device to make a state transition, which refers to the respective duration of a port in Listening and Learning states. The default is 15s. That is, the Listening state lasts for 15s, then enters the Learning state, and then lasts for 15s.
-- maximum survival time (Max Age)
The maximum lifetime refers to the aging time of the port's BPDU packets, which can be artificially changed on the root bridge. When the configuration BPDU sends out the Message age value in the Times article from the root bridge to 0, each time the configuration BPDU message passes through the bridge, the Message Age increases by 1, and the maximum survival time is
20s .
III. STP configuration
-- enable or disable the STP function of the global or port of the switch, and the STP function of the switch is on by default.
System-view
[Huawei] stp enable (on) or disable (management)
-- Select the STP operation mode of the switch. By default, the operation mode of switch STP is MSTP
System-view
[Huawei] stp mode {stp | rstp | mstp}
-- configure the priority (Priority) of switch STP. Values range from 0 to 61440, with a step size of 4096. The default is 32768.
System-view
[Huawei] stp priority followed by a number
-- change the STP cost of the switch port and turn the STP function on / off on the port
System-view
[Huawei] interface gigabitethernet0/0/1
[Huawei-gigabitethernet0/0/1] stp cost + number
[Huawei-gigabitethernet0/0/1] stp {enable | disable}
4. Multi-instance spanning Tree (MSTP)
1. Overview of MSTP
MSTP multiprocess is an enhanced technology based on STP protocol.
-- bind the ports on layer 2 switching devices to different processes, and calculate the STP protocol on a process-by-process basis
-- ports that are not in the same process do not participate in the MSTP protocol calculation in this process, so that the spanning tree calculations in each process are independent of each other and do not affect each other.
The MSTP network contains one or more MST domains (MST Region), and each MST Region contains one or more MSTI. What makes up MSTI is running
Spanning Tree Protocol switching equipment
-- MSTP compatible with STP-- not only converges quickly, but also provides multiple redundant paths for data forwarding
-achieve load balancing of VLAN data in the process of data forwarding.
2. MSTP configuration command
-- enter the spanning Tree Protocol area configuration
-- name the area
System-view
[Huawei] stp region-configuration
[Huawei-mst-region] redion-name + name
-- Open the spanning tree instance and add VLAN
-- activate zone configuration
System-view
[Huawei] stp region-configuration
[Huawei-mst-region] instance 1 + VLAN to join
[Huawei-mst-region] active region-configuration
-- modify the priority of the instance to achieve the STP identity of the same switch in different VLAN
System-view
[Huawei] stp instance 1 priority 4096
3. View the regional configuration
-- View the spanning tree information of the current instance
System-view
[Huawei] stp region-configuration
[Huawei-mst-region] display this
-- View the spanning tree information of an instance
System-view
[Huawei] display stp instance 1
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Https://www.zybuluo.com/wyjgd/note/1540446
© 2024 shulou.com SLNews company. All rights reserved.