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

How STP spanning Tree Protocol

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)05/31 Report--

This article is to share with you about how STP spanning Tree Protocol. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Port negotiation parameters:

Speed-rate

Duplex-duplex mode

Half-duplex-can only be received or sent at the same time

Full duplex-can be received and sent at the same time

Recommendations:

When interconnecting links between different types of devices, you need to manually specify the rate and duplex

Problems with traditional switched networks:

Single point of failure

Solution:

Add redundant links

Add redundant Devic

Figure out how the loop is formed?

The questions that follow:

Data forwarding loop

The data that produces the loop will be continuously transmitted in the network, thus consuming

Link resources and device resources in the network

Solution:

Run the STP protocol on the switch

STP-spanning Tree Protocol; (802.1D)

-effect

Realize the protection of the loop in the presence of redundant links

-implementation

BPDU-bridging Protocol data Unit

-Classification

PVST\ RSTP\ MSTP

Working process:

1. Determine the role of the switch

Root switch

Non-root switch

Principle: compare the BID (bridge ID) of each switch, the smaller the better

Composition:

Priority + MAC

Priority-default is 32768

MAC-MAC of the motherboard of the switch (base MAC)

-View command: show version

2. Determine the port role

Root port-each non-root switch has only one port closest to the root switch

Designated port-there is a port closest to the root switch in each collision domain

Non-designated port-all other ports are called non-designated port

How to express "distance"?

In STP, the distance of a path is represented by cost

For some links, there is a default cost value:

10m-cost 100m

100m-cost 19

1G-cost 4

10g-cost 2

BPDU-

Root-ID / / indicates who is the root switch

Cost / / indicates the distance from the switch that sent the BPDU to the root switch

BID / / indicates the name of the switch that sent the BPDU

Port-ID / / indicates the port on which the sender switch is sent

-composition:

Port priority. Port number

-priority defaults to 128

3. Determine the port status

Disable / / is equivalent to shutdown, and the port cannot be used at this time

Listening / / listening, which listens for BPDU and is used to determine the port role

Learning / / learning, in which the MAC is learned, forming the MAC address table

Forwarding / / forwarding, that is, the final forwarding status of the port

(root port, designated port)

Block / / blocking, the port cannot send data at this time

(non-designated port)

Modify the STP priority of the switch:

SW2 (config) # spanning-tree vlan 1 priority 0

As a result, the "root switch" in the network has changed from SW1 to SW2.

Note:

When we changed the priority of the switch, we found the problem:

SW2 (config) # spanning-tree vlan 1 priority 1

% Bridge Priority must be in increments of 4096.

% Allowed values are:

0 4096 8192 12288 16384 20480 24576 28672

32768 36864 40960 45056 49152 53248 57344 61440

That is, the STP priority of the switch must be a multiple of 4096

Open a STP protocol for VLAN:

By default, the switch has STP turned on for each VLAN

Want to close:

No spanning-tree vlan 200

Verify:

Show spanning-tree

How does the switch distinguish the BPDU of different VLAN:

We use the lower 12 bit of the 2-byte priority in BID as the

Vlan number

As a result, it is concluded that:

The priority field of the first two bytes, which is really used to indicate priority, is only 4.

Bit; for all, there can only be 16 priorities

However, when representing priority values, the following 12bit must be included.

At the same time, must be 0

That is, the priority of the STP for each switch is 0-15 to the power of 2 to 12.

Multiple, that is, a multiple of 4096

=

A problem in LAN

Single point of failure

Solution: add redundant links or devices

STP

-spanning Tree Protocol

-function: prevent LAN loops when there are redundant links in the network

STP is on by default

Ultimate goal:

In LAN, it is guaranteed that there will always be only one shortest ~ acyclic forwarding path between any two communication terminals.

-within the scope of:

STP--- > pvts-- > RSTP-> MSTP

-message:

BPDU-bridging Protocol data Unit

-- working process

1. Determine the switch role

Root switch-A VLAN/LAN has one and only one root

Non-root switch-except the root, all are called non-root switch

Election principles:

Compare BID, the smaller the better; the composition of NID: priority + MAC

Priority-default is 32768

MAC-MAC of the motherboard of the switch (base MAC)

2, determine the port role

Root port-there is one and only one on the non-root switch, the port closest to the root switch

Designated port-in each collision domain, there is one and only one, and there is a port closest to the root switch

Non-designated port-other ports, all non-designated port

Thank you for reading! This is the end of this article on "how to spanning Tree Protocol for STP". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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