当前位置:网站首页>Review notes of RS data communication foundation STP

Review notes of RS data communication foundation STP

2022-06-13 03:02:00 Python's path to becoming a God

STP shortcoming : It converges slowly because of passivity ;STP It can only be passively confirmed by the timer bpdu It's all over the place STP The Internet , Avoid temporary loops .

STP advantage : Broken ring

STP effect

A default logical loop breaking mechanism for LANs with known or unknown loops , The device will use stp The algorithm blocks a port logically

 STP Topology and port status

STP There are root bridges and specified bridges : The root bridge is the whole stp The center of the network , Only the specified port exists ; Specifies that the bridge sends data periodically to downstream devices bpdu The equipment

STP Roles are divided into root ports (root port) And the specified port (designated port)

The root port is the port with the least overhead from the root bridge

The specified port is the periodic transmission from the specified bridge to downstream devices bpdu The port of

The state is 5 Kind of :

disable: Interface down, Do not send bpdu And not handling user traffic

listening: Start stp Calculation , Receive and send bpdu, Do not forward user traffic

learning: Establish acyclic mac Address table , Do not forward user traffic

forwarding:STP Convergence is over , Send periodically bpdu And acceptance bpdu, And forward user traffic , Only the root port and the specified port have this status

blocking: Accept and deal with bpdu, Do not forward user traffic

State convergence process :

1. The device has just been started and enabled stp, Interface by down Change into up state , State by disable Change into blocking.

2. Select the root port or specify the port , State transition bit listening state , Then enable 15s Of Forward Delay Timer

3.Forward Delay After timer timeout , Will enter learning state ,learning The status will also be used 15s Of Forward Delay Timer , Enter after timeout Forwarding

4. When the port loses the root port or the specified port role, it will enter blocking state , And restart the calculation

5. Interface shutdown Will enter disable state

STP Message format :

Between bridges BPDU To deliver the message , Purpose MAC It's a multicast address 01-80-C2-00-00-00

Framed in the picture 4 Parameters , stay STP A network is a principle that elects root bridges and ports , Compare from top to bottom  { Root bridge ID, Root path overhead , Sending device BID, Sending port PID }

 RID: The current equipment thinks that it can be used as a root bridge BID

RPC: The minimum overhead from the current device root port to the root bridge

BID: Of the current device BID,BID front 16 Bit is priority (0-61440, step 4096) after , rest 48 Is it mac Address

PID: The current device sends BPDU Of PID,PID Is determined by priority (0-240, step 16) And port number , The first two digits in the message 80 Represents priority hex , Convert to decimal for 128, The Huawei device port priority is... By default 128

For equipment , adopt LLC To identify BPDU message

STP Timer :

hello timer: Default two seconds

Forward Delay: Default 15s,STP The key to avoiding temporary loops

Max age: Default 20s

message age It's for comparison bpdu How old and new , Add... Through a device 1

  • If Message Age Less than or equal to Max Age, Then the non root bridge device continues to forward the configuration BPDU message .
  • If Message Age Greater than Max Age, Then the configuration BPDU Messages will be aged . The non root bridge device directly discards the configuration BPDU, It can be considered that the network diameter is too large , Causes the root bridge connection to fail

STP Topological convergence calculation

Attention should be paid to during the analysis : Configuration message of its own port 、 Configuration messages calculated by the root port for each port

The election process : Root bridge ---> Root port ---> Specify port or blocking port

The selection process of root port and specified port

step

The process

1

The non root bridge device will receive the optimal configuration message ( The selection process of the optimal configuration message is as follows surface 2 Shown ) Set the port of as the root port

2

The device uses the configuration message of the root port and the path cost of the root port , Calculate a specified port configuration message for each port :

  • Root bridge ID Replace with the root bridge of the configuration message of the root port ID;
  • The root path cost is replaced by the root path cost of the root port configuration message plus the path cost corresponding to the root port ;
  • sender BID Replace with the of your own device ID;
  • Sending port PID Replace with its own port ID.

3

The device compares the calculated configuration message with the configuration message of the role pending port :

  • If the calculated configuration message is better , Then the port is determined as the specified port , The configuration message is also replaced by the calculated configuration message , And periodically send out ;
  • If the port's own configuration message is better , The configuration message of the port is not updated and the port is blocked . This port will no longer forward data , And only receive and do not send configuration messages .

surface 2  The selection process of the optimal configuration message

step

The process

1

Each port compares the received configuration message with its own configuration message :

  • If the received configuration message has a low priority , Then discard it directly , Do not process your own configuration messages ;
  • If the received configuration message has a higher priority , Replace the content of your own configuration message with the content of the configuration message ;
  • If the received configuration message is the same as your own , Then discard it directly .

2

The device compares the configuration messages of all ports , Select the best configuration message

 ( Learn from Huawei documents )

The following figure is in the normal convergence process C The root port will be elected twice , Process diagram

STP Topology change mechanism

Downstream equipment occurs at port down up,

1. It will send a message to the upstream equipment all the time TCN BPDU Tell me that the topology has changed ,

2. The specified port of the upstream device receives TCN BPDU It will be processed after , Reply to one TCA Set as BPDU Tell downstream to stop sending TCN BPDU( Downstream equipment not received TCA It will be sent all the time ), And send a copy to the upstream equipment .

3. repeat 2 step , Until genbashi received TCN BPDU, The root bridge will reply to one at the same time TCA Set and TC Set up

4. After receiving the downstream equipment , because TCA Set to stop sending TCN BPDU, because TC Setting will immediately delete the bridge mac Address ( Not understood here )

 

 

原网站

版权声明
本文为[Python's path to becoming a God]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280535069373.html