Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Layer 2 switching Technology of Cisco equipment-- detailed explanation of STP Protocol

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

In the network design of enterprises, redundant topological structures are generally designed. Because a single link will lead to a single point of failure, which increases the probability of failure. The larger the network, the higher the demand for redundancy. However, when the network is redundant, some problems will arise, such as:

1. Broadcast storm

When a broadcast frame passes through the switch, the switch generates the broadcast frame exponentially (the switch forwards the broadcast frame from all ports except the broadcast frame). This kind of broadcast frame will become more and more, and finally form a broadcast storm, leading to the paralysis of the network.

This broadcast storm can only stop when the physical loop disappears.

two。 Multi-frame replication

Unicast data frames are copied and transmitted to the receiver many times, and many protocols only need to transmit one copy at a time. Multi-frame replication will cause the receiver to receive multiple copies of data frames, which will not only waste the host resources of the receiver, but also cause the upper layer protocols to be unable to choose when dealing with these data frames, and may lead to irrecoverable errors in serious cases.

3.MAC address table disorder

It will cause the switch to learn the same MAC address through the two interfaces, resulting in a disorder of the MAC address table and affecting the forwarding of packets.

Although there are some problems with redundant links, ring physical lines can provide backup lines for the network and enhance the reliability of the network, which is necessary in network design. Therefore, a solution is needed, which can ensure the reliability of the network on the one hand and solve a series of problems caused by redundant links on the other hand.

STP is used to solve this problem. STP does not break the physical loop, but logically disconnects the loop to prevent some problems of redundant links.

STP (spanning Tree Protocol) is to change a ring structure into a tree structure.

STP is used to create a logical tree structure by blocking some ports logically through an algorithm that physically exists a loop in the network.

For the network in which three switches form a loop, after using STP, a port connected by switch SW2 and SW3 on the link is logically blocked, that is, the line cannot transmit data. When the normal communication line fails, the logically blocked line will be reactivated to enable data to be transmitted normally from this line.

The process of running STA (spanning Tree algorithm) in STP is complicated. It is roughly divided into three steps:

(1) Select the root bridge (switch)

According to:

1. The bridge is unique.

two。 Select the switch with the lowest bridge ID in the switched network as the root bridge.

(2) Select the root port

The port closest to the root bridge (there is and only one root port on a non-root bridge)

The root port is selected based on:

1. The lowest path cost to the root bridge

two。 The directly connected bridge ID is the smallest

3. The directly connected port ID is the smallest.

The sum of the costs of all links on the path from the bridge to the root bridge

The relationship between bandwidth and path cost

(3) Select designated port

In order to eliminate the possibility of loop formation, STP makes the final calculation by selecting a designated port on each network segment and the basis for selecting the designated port:

1. The root path cost is lower.

two。 The bridge ID of the switch is smaller.

3. The port ID value is low.

Unlike selecting a root port, when comparing a port ID, you compare its own port ID value.

Next, let's take a brief look at how to view the status of the spanning tree.

Both ports of the root bridge are designated ports, not root ports!

Layer 2 switches exchange bridge ID, root path cost and other information through BPDU (Bridge Protocol data Unit).

The BPDU package includes:

1. Root Bridge ID

two。 Root path cost

3. Send Bridge ID

4. Port ID

5. Timer

The selection of the root bridge is a continuous and iterative process, which is triggered every 2s to check whether the ID of the root bridge of the BPDU has changed and whether a switch with a lower bridge ID has been added to the network.

STP runs automatically in the switch. When the switch is powered on, you can see that the indicator light of the switch is × × ×, and the data cannot be forwarded for about 30 seconds. This is the switch doing STP calculation.

Port status of spanning Tr

(for reference only)

Spanning tree timer

1.HEIIO time: the default time specified by IEEE802.1d is 2s

two。 Forwarding and delay: the default value is 15s each

3. Maximum aging time: the default value is 20s.

Typical port transition:

1. From blocking to listening for 20s

two。 From listening to learning 15s

3. From learning to forwarding for 15s.

(the time of the STP timer can be adjusted using the command, but it is not recommended to modify it in general.)

The relationship between STP and VLAN:

CST of IEEE: regardless of vlan, all vlan share a spanning tree

Cisco's PVST: every vlan has a spanning tree root

Cisco's PVST+: enhances each vlan spanning tree

MST of IEEE: multiple spanning trees.

Next, let's explain how to configure spanning tree based on a simple topology experiment:

1.Cisco devices have spanning tree enabled by default, (command to enable spanning tree)

two。 Specify the root bridge

3. If in the real environment, the server connected to an interface of the switch, it is impossible for us to let it work after 30s, we can configure the fast port, command

These are the commands for spanning tree. If anything else is used in the future, they will be updated from time to time!

-this is the end of this article. Thank you for reading-

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.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report