当前位置:网站首页>Basic principles of spanning tree protocol

Basic principles of spanning tree protocol

2022-06-24 22:30:00 Zhuge iron and steel cloud

Basic principles of spanning tree protocol   

One . What is called a spanning tree protocol

  1>.STP(Spanning Tree Protocol, Spanning tree protocol ) It is a protocol used to eliminate the physical loop of data link layer in LAN ;

    2>. By switching between bridges BPDU(Bridge Protocol Data Unit, Bridge protocol data unit ), To ensure that the device completes the calculation process of the spanning tree .

                

expand :

  BPDU The type of :

        1>. Ordinary BPDU : A message used to compute and maintain a spanning tree

        2>.BPDU  TCN: When the network topology changes , It will send a message to inform other devices that the network topology has changed .

Two .STP The role of

  1>. By blocking redundancy (rong) To eliminate the possible path loopback in the bridge network ;

  2>. When the current path fails , Activate the redundant backup link , Restore network connectivity .

   

3、 ... and . To configure BPDU Generate and pass

1. To configure BPDU Contains the following important information , Complete the spanning tree calculation

  a>. Root bridge ID(RootID)

  b>. And path overhead (RootPathCost)

  c>. Specify the bridge ID(DesignatedBridgeID)

  d>. Designated port ID(DesignatedPortID)

2. Each device initially generates its own root bridge (Root Bridge) Configuration messages for , Send out your own configuration messages

3. After the network converges , The root bridge sends the configuration out BPDU, Other devices are not required for this configuration BPDU Forward

4. Root bridge election

  a>. Bridge ID There are bridge priorities (BridgePriority) And the bridge MAC Address (BridgeMacAddress) form

  b>. Bridge ID The small bridge north is elected as the root bridge

 

 5. Root path overhead

  a>. Root path overhead (RootPathCost) Is the cost of all links on the path to the root (Cost) Algebra and ;【 General 100m link cost yes 19, Gigabit link cost yes 10】

  b>. When the non root bridge elects the root port , The port with the least root path overhead is the following port ;

  c>. When the physical end elects the designated bridge , The bridge with the least path overhead is the designated bridge .

6. Through the bridge ID Determine port roles

  a>. At the same path cost , The connected network segment specifies the bridge ID The smallest port is the root port ;

  b>. At the same root path cost , Bridge ID The smallest bridge is selected as the designated bridge on the physical segment , The port connecting the specified bridge is the specified port .

 7. Through the port ID Determine port roles

   At the root path , Specify the bridge ID In the same situation , All specified ports ID The small port is the root port

 8. Port status

H3C experiment :

Configure the spanning tree

【 The experiment purpose 】

l  master STP Principle and function of

l  master STP Election of root bridge and port roles

l  master STP Basic configuration

【 The experimental requirements 】

At the switch SW1 and SW2 The system of tried to enable STP, And set up SW1 The priority of 0, In order to make SW1 Is the root bridge ; And configure the connection PC The port of is edge port .

【 Experimental equipment 】

Two switches 、PC Machine 1 、 Two network cables 、console Cable

【 The topology 】

【 Experimental process 】

1、 Configure for the host IP Address

host

IP Address

Pc1

192.168.1.1

Pc2

192.168.1.2

2、 To configure SW1

<SW1>system-view

Turn on STP function

[SW1]stp enable

Set up SW1 The priority of 0

[SW1]stp priority 0

Enter the interface and try to configure the port as an edge port

[SW1]interface e0/4/2

[SW1-Ethernet0/4/2]stp edged-port enable[w1] 

3、 To configure SW2

<SW2>system-view

[SW2]stp enable

[SW2]stp priority 0

[SW2]interface e0/4/2

[SW2-Ethernet0/4/2]stp edged-port enable

【 Experimental tests 】

1、 see SW1 STP Information

 

 

With    It can be seen from the above information that SW1 It's the root bridge , All ports on it are designated ports (DESI), In forwarding state .

2、 see SW2 STP Information

 

   As can be seen from the above information ,SW2 Right and wrong root bridge , port e/4/0 Is the root port , In forwarding state , Responsible for forwarding data between switches ; port e/4/1 Is the backup root port , In a blocking state ; Connect PC Of e/4/2 Is the specified port , In forwarding state .

【 Think and expand 】

If not in the switch E0/4/2 Port configuration edge port (undo stp edged-port), Then disconnect the port e/4/2 The cable , Reconnect , And in SWA View port on e/4/0 The state of , Note that the command is executed every few seconds to view , View the migration process of port status .


The purpose of edge ports is to speed up STP The rate of convergence

When your talent can't support your ambition , You should calm down to learn . When your ability can't control your goal , You should settle down and experience . Ask yourself , What kind of life do you want . Welcome to infrastructure automation operation and maintenance :598432640, big data SRE Advanced road :959042252,DevOps Advanced road :526991186

Reference resources STP Spanning tree protocol foundation _ Disciplined and studious , To ensure that you don't fall into cynicism .-CSDN Blog _stp agreement

原网站

版权声明
本文为[Zhuge iron and steel cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211233395484.html