CN111585886B - Self-loop processing method, device, equipment and storage medium based on spanning tree protocol - Google Patents

Self-loop processing method, device, equipment and storage medium based on spanning tree protocol Download PDF

Info

Publication number
CN111585886B
CN111585886B CN202010341473.3A CN202010341473A CN111585886B CN 111585886 B CN111585886 B CN 111585886B CN 202010341473 A CN202010341473 A CN 202010341473A CN 111585886 B CN111585886 B CN 111585886B
Authority
CN
China
Prior art keywords
state
port
self
spanning tree
tree protocol
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010341473.3A
Other languages
Chinese (zh)
Other versions
CN111585886A (en
Inventor
熊伟
柳亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
3onedata Co ltd
Original Assignee
3onedata Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 3onedata Co ltd filed Critical 3onedata Co ltd
Priority to CN202010341473.3A priority Critical patent/CN111585886B/en
Publication of CN111585886A publication Critical patent/CN111585886A/en
Application granted granted Critical
Publication of CN111585886B publication Critical patent/CN111585886B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/18Loop-free operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions

Abstract

The invention discloses a self-loop processing method, a device, equipment and a storage medium based on a spanning tree protocol, wherein the method comprises the following steps: starting a spanning tree protocol of a first equipment port, and detecting whether a second equipment port has a self-loop circuit or not through the spanning tree protocol; if the self-loop is detected to exist, setting the state of the spanning tree protocol as a defined state, and setting the state of the first equipment port as a speed-limiting transmission state; and detecting the receiving state of the returned message in the first equipment port, and adjusting the definition state and the speed-limiting transmission state according to the receiving state. The invention realizes the detection of whether the second equipment port has the self-loop through the spanning tree protocol, if the self-loop exists, the definition state of the spanning tree protocol and the speed-limiting transmission state of the first equipment port are set, and then the definition state and the speed-limiting transmission state are adjusted according to the receiving state of the returned message, thereby realizing the port self-loop detection and solving the problem of port self-loop.

Description

Self-loop processing method, device, equipment and storage medium based on spanning tree protocol
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method, an apparatus, a device, and a storage medium for self-loop processing based on a spanning tree protocol.
Background
The method for preventing the network from generating the loop is mainly realized based on a spanning tree protocol at present, the network can be prevented from generating the self-loop based on the spanning tree protocol only when the spanning tree protocol of the equipment is in an open state, and the network can be caused to generate the self-loop to form a broadcast storm when the spanning tree protocol of the equipment is in a closed state, so that the equipment port of opposite-end equipment connected with the equipment with the spanning tree protocol in the closed state cannot be normally discarded, and the spanning tree protocol of the opposite-end equipment cannot normally work. Therefore, the existing spanning tree protocol-based network self-loop prevention can not carry out port self-loop detection and can not process the problems caused by port self-loop.
Disclosure of Invention
The invention mainly aims to provide a self-loop processing method, a self-loop processing device, terminal equipment and a storage medium based on a spanning tree protocol, and aims to solve the technical problems that the existing self-loop processing method based on the spanning tree protocol can not perform port self-loop detection and can not process the problems generated by the port self-loop when preventing the self-loop of a network from being generated.
In order to achieve the above object, the present invention provides a self-loop processing method based on a spanning tree protocol, which includes the steps of:
starting a spanning tree protocol of a first equipment port, and detecting whether a second equipment port has a self-loop circuit or not through the spanning tree protocol;
if the self-loop is detected to exist, setting the state of the spanning tree protocol as a defined state, and setting the state of the first equipment port as a speed-limiting transmission state;
and detecting the receiving state of a returned message in the first equipment port, and adjusting the definition state and the speed-limiting transmission state according to the receiving state.
Optionally, the step of detecting a receiving state of a returned packet in the first device port, and adjusting the definition state and the speed-limited transmission state according to the receiving state includes:
detecting whether the first equipment port receives the return message or not;
if the return message is not received, adjusting the definition state to a preset definition state, and adjusting the speed-limiting transmission state to a preset bandwidth transmission state;
and if the return message is received, adjusting a definition state and the speed-limiting transmission state according to the message type in the return message.
Optionally, if the return packet is received, the step of adjusting the definition state and the speed-limited transmission state according to the packet type in the return packet includes:
if the return message is received, detecting whether a local message sent by the first equipment port exists in the return message;
if the fact that the local message does not exist in the return message is detected, the definition state is adjusted to the preset definition state, and the speed-limiting transmission state is adjusted to the preset bandwidth transmission state.
Optionally, if the return packet is received, the step of detecting whether a local packet sent by the first device port exists in the return packet includes:
if the return message is received, detecting whether a message port bridge in the return message is consistent with a port bridge of the first equipment port;
if the message port bridge is detected to be consistent with the port bridge of the first equipment port, determining that a local message sent by the first equipment port exists in the return message;
and if the message port bridge is detected to be inconsistent with the port bridge of the first equipment port, determining that the local message does not exist in the return message.
Optionally, if it is detected that the self-loop exists, the step of setting the state of the spanning tree protocol to a defined state and setting the state of the first device port to a rate-limited transmission state includes:
and if the self-loop is detected to exist, setting the defined state as a discarding state, and setting the bandwidth transmission state of the first equipment port as a speed-limiting transmission state.
Optionally, the starting a spanning tree protocol of the first device port, and the step of detecting whether a self-loop exists in the second device port through the spanning tree protocol includes:
starting a spanning tree protocol of the first equipment port, and detecting whether a message data flow loop exists in the second equipment port through the spanning tree protocol;
if the message data flow loop does not exist, determining that the self-loop does not exist at the second equipment port;
and if the message data flow loop is detected to exist, determining that the self-loop exists in the second equipment port.
Optionally, after the step of detecting a receiving state of a returned packet in the first device port and adjusting the definition state and the speed-limited transmission state according to the receiving state, the method further includes:
detecting whether the port state of the second equipment port is abnormal or not at intervals of preset duration;
and if the port state of the second equipment port is detected to be not abnormal, carrying out message communication with the second equipment through the first equipment port.
In addition, to achieve the above object, the present invention further provides a self-loop processing device based on a spanning tree protocol, which includes a memory, a processor and a self-loop processing program based on the spanning tree protocol, stored in the memory and running on the processor, wherein the self-loop processing program based on the spanning tree protocol implements the steps of the self-loop processing method based on the spanning tree protocol when being completed by the processor.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which a self-loop processing program based on a spanning tree protocol is stored, and when the self-loop processing program based on the spanning tree protocol is completed by a processor, the steps of the self-loop processing method based on the spanning tree protocol are implemented.
The invention realizes that whether a self-loop exists in the second equipment port is detected through the spanning tree protocol of the first equipment port, if the self-loop exists, the state of the spanning tree protocol is set to be a defined state, the state of the first equipment port is set to be a speed-limiting transmission state, and then the defined state and the speed-limiting transmission state are adjusted according to the receiving state of the returned message. Therefore, when the device performs message communication through the spanning tree protocol, whether a self-loop exists in a device port of opposite-end equipment connected with the device is detected through a software layer in the spanning tree protocol, and therefore port self-loop detection is achieved. If the device detects that the self-loop exists, the device sets a definition state of a spanning tree protocol and a speed-limiting transmission state of a device port, limits the receiving rate of a return message through the speed-limiting transmission state, discards the return message in the self-loop through the definition state when the receiving rate is exceeded, reduces the number of the return messages in the self-loop, and then adjusts the definition state of the spanning tree protocol and the speed-limiting transmission state of the device port according to the detected receiving state of the return message, thereby solving the problem caused by the self-loop of the port.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a spanning tree protocol-based loopback processing method according to the present invention;
FIG. 2 is a schematic diagram of a preferred structure of a self-loop processing apparatus based on spanning tree protocol according to the present invention;
fig. 3 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a self-loop processing method based on a spanning tree protocol, and referring to fig. 1, fig. 1 is a flow diagram of a first embodiment of the self-loop processing method based on the spanning tree protocol.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than that shown or described.
The self-loop processing method based on the spanning tree protocol comprises the following steps:
step S10, starting a spanning tree protocol of the first device port, and detecting whether the second device port has a self-loop through the spanning tree protocol.
After the first device is powered on, a spanning tree protocol of a port of the first device is started, then a port state of a port of the second device is detected through an application module of a software layer in the spanning tree protocol, and whether a self-loop exists in the port of the second device is judged.
The spanning tree protocol is a communication protocol of a data link layer in an OSI (Open System Interconnection) network model. The port status of the second device port includes the presence and absence of a self-loop. The software layer of the spanning tree protocol has a plurality of application modules, and the different modules have different functions, and the application modules include, but are not limited to, a detection application module, a receiving application module and a sending application module.
It should be noted that the self-loop circuit includes an open loop circuit and a dark loop circuit, where the open loop circuit refers to a circuit generated by connecting the device ports through solid lines, and the dark loop circuit refers to a circuit generated by a message data stream at the device ports, and the embodiment does not limit the form of the self-loop circuit.
Further, the step S10 includes:
step a, starting a spanning tree protocol of a first equipment port, and detecting whether a message data flow loop exists in a second equipment port or not through the spanning tree protocol;
b, if the message data flow loop does not exist, determining that the self-loop does not exist at the second equipment port;
and c, if the message data flow loop is detected to exist, determining that the self-loop exists at the second equipment port.
Specifically, the first device starts a spanning tree protocol of a first device port, detects whether a second device port repeatedly sends and receives the same message within a preset time through a detection application module of the spanning tree protocol, if the second device port repeatedly sends and receives the same message within the preset time, the second device port is indicated to have a message data flow loop, the first device determines that a self-loop exists at the second device port, if the second device port does not repeatedly send and receive the same message within the preset time, the second device port is indicated to not have the message data flow loop, and the first device determines that the self-loop does not exist at the second device port.
The message is a Data Unit exchanged and transmitted in the network, and the message types include, but are not limited to, a BPDU (bridge protocol Data Unit) message, an LSP (Link State PUD) message, and a SNP (Sequence Number PUD) message. The message sent from the second device port returns to the second device port in a very short time, and the message data flow is formed by the process of repeated circulation of the message at the second device port. The preset time is a millisecond time unit, which can be set according to the requirement, and this embodiment is not limited.
In this embodiment, for example, the preset time is 1 millisecond, 100 messages sent by the second device port are A1 to a100, within 1 millisecond, A1 to a50 messages in the 100 messages return to the second device port, after the second device receives the returned A1 to a50 messages, the second device sends the returned A1 to a50 messages, and the messages from A1 to a50 return to the second device port, and the process is repeated, so that A1 to a50 message data flow loop is formed.
Step S20, if it is detected that the self-loop exists, setting the state of the spanning tree protocol as a defined state, and setting the state of the first device port as a speed-limited transmission state.
And if the first equipment detects that the second equipment port has a self-loop circuit, setting the original definition state of the spanning tree protocol as a new definition state, and setting the original speed-limiting transmission state of the first equipment port as a new speed-limiting transmission state.
The defined states of the spanning tree protocol include a Discarding state, a Blocking state, a Listening state, a Learning state, and a Forwarding state. The discard state is to discard all messages of the first device port, the blocking state is to receive messages but not send messages by the first device port, the listening state is to receive and send messages by the first device port, the learning state is to receive and send messages and learn an MAC (media Access Control Address) Address, and the forwarding state is to receive and send messages by the first device port and learn the MAC Address.
Further, the step S20 includes:
and d, if the self-loop is detected to exist, setting the defined state as a discarding state, and setting the bandwidth transmission state of the first equipment port as a speed-limiting transmission state.
Specifically, if the first device detects that the second device port has a self-loop, the original definition state in the spanning tree protocol and the original bandwidth transmission state in the first device port are cancelled, the original definition state in the spanning tree protocol is set to be a discard state, the original bandwidth transmission state of the first device port is set to be a speed-limiting transmission state, and the original port flag state of the first device port is set to be a loop port flag.
The loopback port mark is prompt information indicating that the first device port detects that a self-loop is arranged at the second device port. The speed limit transmission state is a state that the data transmission speed of the hardware bandwidth in the first device port is limited within a certain range. The speed-limited transmission state is determined by the capability of the switching chip and the capability of a Central Processing Unit (CPU) of the first device, and the speed-limited transmission states of different devices are different, which is not limited in this embodiment.
In this embodiment, for example, the original defined state of the spanning tree protocol is a forwarding state, the original port flag state of the first device port is a loopback-free port flag, the original bandwidth transmission state of the first device port is 100Mbps, and when the first device detects that the second device port has a self-loop, the forwarding state is set to a discarding state, the loopback-free port flag is set to a loopback port flag, and 100Mbps is set to 30 Mbps.
Step S30, detecting a receiving state of a return packet in the first device port, and adjusting the definition state and the speed-limited transmission state according to the receiving state.
The first device detects the receiving state of the returned message in the first device port, adjusts the current definition state and the current speed limit transmission state according to the receiving state, and can switch the current definition state and the current speed limit transmission state to the original definition state and the original speed limit transmission state or continuously maintain the current definition state and the current speed limit transmission state.
The return message includes many messages, including native message and non-native message. The receiving state may be that a return message is received or that no return message is received.
Further, the step S30 includes:
step e, detecting whether the first equipment port receives the return message;
step f, if the return message is not received, adjusting the definition state to a preset definition state, and adjusting the speed-limiting transmission state to a preset bandwidth transmission state;
and g, if the return message is received, adjusting a definition state and the speed-limiting transmission state according to the message type in the return message.
Specifically, the first device detects whether the first device port receives a return message of the second device, and if the return message is not received, the first device adjusts the current definition state to a preset definition state and adjusts the current speed-limiting transmission state to a preset bandwidth transmission state. If the return message is received, judging the type of the return message, correspondingly adjusting the current definition state and the current speed limit transmission state according to the type of the return message, switching the current definition state and the current speed limit transmission state to a preset definition state and a preset bandwidth transmission state, or keeping the current definition state and the current speed limit transmission state.
The preset definition state comprises a discarding state, a listening state, a learning state and a forwarding state. The return message types include a native message and a non-native message, and the preset bandwidth transmission state is not limited to the preset definition state and the return message form in this embodiment. The preset bandwidth transmission state is determined by the capability of the switch chip and the capability of the CPU of the first device, the speed-limited transmission states of different devices are different, and this embodiment is not limited.
Further, the step g includes:
step h, if receiving the return message, detecting whether a local message sent by the first equipment port exists in the return message;
step i, if detecting that the local message does not exist in the return message, adjusting the definition state to the preset definition state, and adjusting the speed-limiting transmission state to the preset bandwidth transmission state.
Specifically, if the first device receives a return message, comparing a message port address in the return message with a port address of a first device port, if the message port address is the same as the port address of the first device port, determining that a local message sent by the first device port exists in the return message, and if the message port address is different from the port address of the first device port, determining that the local message sent by the first device port does not exist in the return message. If the local message is detected to exist in the returned message, the first device correspondingly adjusts the current definition state and the current speed limit transmission state, keeps the current definition state as a discarding state, keeps the current bandwidth transmission state of the port of the first device as a speed limit transmission state, and if the local message does not exist in the returned message, the first device correspondingly adjusts the current definition state and the current speed limit transmission state, switches the current definition state to a preset definition state, and switches the current speed limit transmission state to a preset speed limit transmission state.
The message port address format includes, but is not limited to, decimal addresses, network endian addresses, and host endian addresses. The message port address is in the same expression form as the port address of the first device port, namely the message port address is corresponding to the port address of the first device port. In this embodiment, for example, if the message port address is a decimal address, the port address of the first device port is the same as the decimal address.
Further, the step h includes:
step j, if receiving the return message, detecting whether the message port bridge in the return message is consistent with the port bridge of the first equipment port;
step k, if the port bridge of the message port is detected to be consistent with the port bridge of the first equipment port, determining that a local message sent by the first equipment port exists in the returned message;
step i, if it is detected that the port bridge of the message port is inconsistent with the port bridge of the first device port, it is determined that the local message does not exist in the return message.
Specifically, after receiving a return message, the first device determines whether key information such as a bridge root, an appointed bridge, and an appointed end in a port bridge of a port of the first device port in the return message is consistent, detects whether a root bridge of the port of the return message is consistent with a root bridge of a port bridge of the first device port, whether an appointed bridge of a port bridge in the return message is consistent with an appointed bridge of a port bridge in the first device port, and whether an appointed end of a port bridge in the return message is consistent with an appointed end of a port bridge in the first device port, determines that a local message sent by the first device port exists in the return message if the root bridge, the appointed bridge, and the appointed end of the port bridge in the return message are all consistent with the root bridge, the appointed bridge, and the appointed end of the port bridge in the first device port, and detects that the root bridge, the appointed bridge, and the appointed end of the port of the return message are all consistent with each other, Any one of the designated bridge and the designated end is not consistent with the root bridge, the designated bridge and the designated end of the port bridge in the first equipment port, and the first equipment determines that the local message sent by the first equipment port does not exist in the return message.
The invention realizes that whether a self-loop exists in the second equipment port is detected through the spanning tree protocol of the first equipment port, if the self-loop exists, the state of the spanning tree protocol is set to be a defined state, the state of the first equipment port is set to be a speed-limiting transmission state, and then the defined state and the speed-limiting transmission state are adjusted according to the receiving state of the returned message. Therefore, when the device performs message communication through the spanning tree protocol, the device port of the opposite device connected with the device is detected to be a self-loop through a software layer in the spanning tree protocol, so that the port self-loop detection is realized. If the existence of the self-loop circuit is detected, setting a definition state of a spanning tree protocol and a speed-limiting transmission state of an equipment port, limiting the receiving rate of a return message by the equipment port through the speed-limiting transmission state, discarding the return message in the self-loop circuit through the definition state when the receiving rate is exceeded, so as to reduce the number of the return messages in the self-loop circuit, and then adjusting the definition state of the spanning tree protocol and the speed-limiting transmission state of the equipment port according to the detected receiving state of the return message, so that the problem generated by the self-loop of the port is solved.
Furthermore, a second embodiment of the self-loop processing method based on the spanning tree protocol is provided.
The second embodiment of the self-loop processing method based on the spanning tree protocol is different from the first embodiment of the self-loop processing method based on the spanning tree protocol in that the self-loop processing method based on the spanning tree protocol further comprises the following steps:
m, detecting whether the port state of the second equipment port is abnormal or not at intervals of preset duration;
and n, if the port state of the second equipment port is detected to be not abnormal, performing message communication with the second equipment through the first equipment port.
Specifically, the first device detects the port state of the second device port at a preset time interval through the spanning tree protocol of the first device port, and determines whether the port state is abnormal, that is, whether a self-loop circuit exists, if the self-loop circuit exists, the steps of the first embodiment are executed, and if the self-loop circuit does not exist, the first device performs normal message communication with the second device through the first device port.
It should be noted that the preset time period may be set according to a requirement, and the embodiment is not limited. The detection may be real-time detection or timing monitoring, and this embodiment is not limited.
In this embodiment, a preset time interval is used to detect whether the port state of the port of the second device is abnormal, and if it is detected that the port state of the port of the second device is not abnormal, message communication is performed with the second device through the port of the first device. Therefore, in the process of message communication of the equipment, the port state of the first equipment port is continuously detected by the first equipment port, so that normal message communication can be carried out between the equipment in the whole process, and the efficiency of message communication of the equipment is improved.
In addition, the present invention also provides a self-loop processing apparatus based on a spanning tree protocol, and referring to fig. 2, the self-loop processing apparatus based on the spanning tree protocol includes:
a starting module 10, configured to start a spanning tree protocol of a first device port;
a detecting module 20, configured to detect whether a self-loop exists at a second device port through the spanning tree protocol;
a setting module 30, configured to set the state of the spanning tree protocol to a defined state and set the state of the first device port to a speed-limited transmission state if it is detected that the self-loop exists;
a detecting module 40, configured to detect a receiving state of a return packet in the first device port;
and the adjusting module 50 is used for adjusting the definition state and the speed-limited transmission state according to the receiving state.
Further, the detecting module 40 is further configured to detect whether the first device port receives the return packet;
the adjusting module 50 is further configured to adjust the definition state to a preset definition state and adjust the speed-limited transmission state to a preset bandwidth transmission state if the return message is not received; and if the return message is received, adjusting a definition state and the speed-limiting transmission state according to the message type in the return message.
Further, the detecting module 20 is further configured to detect whether a local packet sent by the first device port exists in the return packet if the return packet is received;
the adjusting module 50 is further configured to adjust the definition state to the preset definition state and adjust the speed-limiting transmission state to the preset bandwidth transmission state if it is detected that the local packet does not exist in the return packet.
Further, the detecting module 20 is further configured to detect whether a packet port bridge in the return packet is consistent with a port bridge of the first device port if the return packet is received.
Further, the detection module 20 further includes:
a first determining unit, configured to determine that a local packet sent by the first device port exists in the return packet if it is detected that the packet port bridge is consistent with the port bridge of the first device port; and if the message port bridge is detected to be inconsistent with the port bridge of the first equipment port, determining that the local message does not exist in the return message.
Further, the setting module 30 is further configured to set the defined state to a discard state and set the bandwidth transmission state of the first device port to a speed-limited transmission state if it is detected that the self-loop exists.
Further, the starting module 10 is further configured to start a spanning tree protocol of the first device port;
the detecting module 20 is further configured to detect whether a packet data flow loop exists at the second device port through the spanning tree protocol.
Further, the detection module further comprises:
a second determining unit, configured to determine that the self-loop does not exist at the second device port if it is detected that the packet data flow loop does not exist; and if the message data flow loop is detected to exist, determining that the self-loop exists in the second equipment port.
Further, the detecting module 20 is further configured to detect whether the port state of the second device port is abnormal at a preset time interval.
Further, the self-loop processing apparatus based on spanning tree protocol further includes:
and the communication module is used for carrying out message communication with the second equipment through the first equipment port if the port state of the second equipment port is detected to be not abnormal.
The specific implementation of the self-loop processing apparatus based on the spanning tree protocol according to the present invention is substantially the same as that of the above-mentioned self-loop processing method based on the spanning tree protocol, and is not described herein again.
In addition, the invention also provides self-loop processing equipment based on the spanning tree protocol. As shown in fig. 3, fig. 3 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 3 is a schematic structural diagram of a hardware operating environment of a self-loop processing device based on a spanning tree protocol.
As shown in fig. 3, the self-loop processing device based on the spanning tree protocol may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may comprise a Display screen (Display), an input unit such as a keyboard (board), and the optional user interface 1003 may also comprise a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the self-loop processing device based on the spanning tree protocol may further include an RF (Radio Frequency) circuit, a sensor, a WiFi module, and the like.
Those skilled in the art will appreciate that the spanning tree protocol based self-loop processing device architecture shown in fig. 3 does not constitute a limitation of the spanning tree protocol based self-loop processing device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 3, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a self-loop handler based on a spanning tree protocol. The operating system is a program for managing and controlling hardware and software resources of the self-loop processing device based on the spanning tree protocol, and supports the running of the self-loop processing program based on the spanning tree protocol and other software or programs.
In the illustrated self-loop processing device based on the spanning tree protocol, the user interface 1003 is mainly used for the first device, so that a user can view a defined state of the spanning tree protocol in a port of the first device and a message communication state of the first device; the network interface 1004 is mainly used for spanning tree protocol, and the port state of the port of the second device is detected by the first device through the spanning tree protocol; the processor 1001 may be configured to call the self-loop processing program based on the spanning tree protocol stored in the memory 1005 and complete the steps of the control method of the self-loop processing apparatus based on the spanning tree protocol as described above.
The specific implementation of the self-loop processing device based on the spanning tree protocol of the present invention is substantially the same as that of each embodiment of the self-loop processing method based on the spanning tree protocol, and is not described herein again.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a self-loop processing program based on a spanning tree protocol is stored on the computer-readable storage medium, and when the self-loop processing program based on the spanning tree protocol is completed by a processor, the steps of the self-loop processing method based on the spanning tree protocol are implemented.
The specific implementation manner of the computer-readable storage medium of the present invention is substantially the same as that of each embodiment of the self-loop processing method based on the spanning tree protocol, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation manner in many cases. Based on such understanding, the technical solution of the present invention may be embodied in the form of software goods, which are stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk), and include instructions for enabling a self-loop processing device based on spanning tree protocol to perform the method according to the embodiments of the present invention.

Claims (9)

1. A self-loop processing method based on a spanning tree protocol is characterized by comprising the following steps:
starting a spanning tree protocol of a first equipment port, and detecting whether a second equipment port has a self-loop circuit or not through the spanning tree protocol;
if the self-loop is detected to exist, setting the state of the spanning tree protocol as a defined state, and setting the state of the first equipment port as a speed-limiting transmission state;
detecting the receiving state of a returned message in the first equipment port, and adjusting the definition state and the speed-limiting transmission state according to the receiving state;
if the self-loop is detected to exist, the step of setting the state of the spanning tree protocol to be a defined state and setting the state of the first equipment port to be a speed-limited transmission state comprises the following steps:
if the self-loop is detected to exist, setting the defined state as a discarding state, and setting the bandwidth transmission state of the first device port as a speed-limiting transmission state, wherein the speed-limiting transmission state is a state that the data transmission speed of the hardware bandwidth in the first device port is limited within a certain range.
2. The self-loop processing method based on spanning tree protocol according to claim 1, wherein the step of detecting a receiving status of a returned packet in the first device port, and adjusting the definition status and the rate-limited transmission status according to the receiving status comprises:
detecting whether the first equipment port receives the return message or not;
if the return message is not received, adjusting the definition state to a preset definition state, and adjusting the speed-limiting transmission state to a preset bandwidth transmission state;
and if the return message is received, adjusting a definition state and the speed-limiting transmission state according to the message type in the return message.
3. The self-loop processing method based on spanning tree protocol according to claim 2, wherein the step of adjusting the definition state and the speed limit transmission state according to the packet type in the return packet if the return packet is received comprises:
if the return message is received, detecting whether a local message sent by the first equipment port exists in the return message;
if the fact that the local message does not exist in the return message is detected, the definition state is adjusted to the preset definition state, and the speed-limiting transmission state is adjusted to the preset bandwidth transmission state.
4. The self-loop processing method based on spanning tree protocol according to claim 3, wherein the step of detecting whether there is a native packet sent by the first device port in the return packet if the return packet is received comprises:
if the return message is received, detecting whether a message port bridge in the return message is consistent with a port bridge of the first equipment port;
if the message port bridge is detected to be consistent with the port bridge of the first equipment port, determining that a local message sent by the first equipment port exists in the return message;
and if the message port bridge is detected to be inconsistent with the port bridge of the first equipment port, determining that the local message does not exist in the return message.
5. The spanning tree protocol-based self-loop processing method according to claim 1, wherein the step of starting the spanning tree protocol of the first device port and detecting whether the self-loop exists in the second device port through the spanning tree protocol comprises:
starting a spanning tree protocol of the first equipment port, and detecting whether a message data flow loop exists in the second equipment port through the spanning tree protocol;
if the message data flow loop does not exist, determining that the self-loop does not exist at the second equipment port;
and if the message data flow loop is detected to exist, determining that the self-loop exists in the second equipment port.
6. The spanning tree protocol-based loopback processing method according to any one of claims 1 to 5, wherein after the steps of detecting a reception status of a return packet in the first device port and adjusting the definition status and the rate-limited transmission status according to the reception status, further comprising:
detecting whether the port state of the second equipment port is abnormal or not at intervals of preset duration;
and if the port state of the second equipment port is detected to be not abnormal, carrying out message communication with the second equipment through the first equipment port.
7. A spanning tree protocol based loopback processing apparatus, comprising:
the starting module is used for starting a spanning tree protocol of a first equipment port;
the detection module is used for detecting whether a second equipment port has a self-loop through the spanning tree protocol;
the setting module is used for setting the state of the spanning tree protocol as a defined state and setting the state of the first equipment port as a speed-limiting transmission state if the self-loop is detected to exist;
the detection module is used for detecting the receiving state of the returned message in the first equipment port;
the adjusting module is used for adjusting the definition state and the speed-limiting transmission state according to the receiving state;
the setting module is further configured to set the defined state to a discarded state and set the bandwidth transmission state of the first device port to a speed-limited transmission state if the self-loop is detected to exist, where the speed-limited transmission state is a state in which a data transmission speed of a hardware bandwidth in the first device port is limited within a certain range.
8. A spanning tree protocol based self-loop processing apparatus, comprising a memory, a processor and a spanning tree protocol based self-loop processing program stored on the memory and running on the processor, wherein the spanning tree protocol based self-loop processing program when completed by the processor implements the steps of the spanning tree protocol based self-loop processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon a self-loop processing program based on a spanning tree protocol, which when executed by a processor implements the steps of the self-loop processing method based on a spanning tree protocol according to any one of claims 1 to 6.
CN202010341473.3A 2020-04-26 2020-04-26 Self-loop processing method, device, equipment and storage medium based on spanning tree protocol Active CN111585886B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010341473.3A CN111585886B (en) 2020-04-26 2020-04-26 Self-loop processing method, device, equipment and storage medium based on spanning tree protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010341473.3A CN111585886B (en) 2020-04-26 2020-04-26 Self-loop processing method, device, equipment and storage medium based on spanning tree protocol

Publications (2)

Publication Number Publication Date
CN111585886A CN111585886A (en) 2020-08-25
CN111585886B true CN111585886B (en) 2022-03-25

Family

ID=72114958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010341473.3A Active CN111585886B (en) 2020-04-26 2020-04-26 Self-loop processing method, device, equipment and storage medium based on spanning tree protocol

Country Status (1)

Country Link
CN (1) CN111585886B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6304575B1 (en) * 1998-08-31 2001-10-16 Cisco Technology, Inc. Token ring spanning tree protocol

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7778205B2 (en) * 2005-08-30 2010-08-17 Cisco Technology, Inc. System and method for implementing virtual ports within ring networks
CN100369436C (en) * 2005-12-16 2008-02-13 杭州华三通信技术有限公司 Looped network and its protecting method
CN100550770C (en) * 2006-05-25 2009-10-14 杭州华三通信技术有限公司 A kind of method of detection loop and device
CN101707538B (en) * 2009-11-25 2011-09-14 烽火通信科技股份有限公司 Method for detecting and automatically recovering Ethernet loopback
KR20130060170A (en) * 2010-03-26 2013-06-07 록스타 비드코, 엘피 Distributed failure recovery in a routed ethernet network
CN102271063A (en) * 2011-07-22 2011-12-07 中兴通讯股份有限公司 Self loop detecting method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6304575B1 (en) * 1998-08-31 2001-10-16 Cisco Technology, Inc. Token ring spanning tree protocol

Also Published As

Publication number Publication date
CN111585886A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
EP1987682B1 (en) System and method for selectively manipulating control traffic to improve network performance
EP2479925B1 (en) Dynamic power management in a communications device
CN110943998B (en) Signal transmission method, device, equipment and medium
JP2010050857A (en) Route control apparatus and packet discarding method
GB2391765A (en) Physically separate user and control plane processing devices for use in congestion control in a w-cdma system
EP3893448A1 (en) Congestion control method, terminal and readable storage medium
CN111682989B (en) Method, device and system for detecting port link state
EP3905615A1 (en) Pfc frame-based congestion control method, apparatus, system and storage medium
CN111130821B (en) Power failure alarm method, processing method and device
EP3376717A1 (en) Link discovery method and apparatus
CN111130943B (en) Method for realizing fast ring network switching, switch and computer readable storage medium
CN111541688A (en) Embedded system compatible with multiple protocols, data processing method and device
CN111585886B (en) Self-loop processing method, device, equipment and storage medium based on spanning tree protocol
CN111010328A (en) Method and equipment for preventing white board switch from being looped
CN111988776A (en) Network switching method, device, equipment and storage medium
CN101998570B (en) Network switching method and system
CN107528929A (en) The processing method and processing device of arp entry
CN112929065B (en) Electronic equipment control method and device and electronic equipment
Cisco Understanding the User Interface
Cisco Understanding the User Interface
CN114337942A (en) Message retransmission method and device and electronic equipment
JP2002158613A (en) Provider connection device and mobile communication system
US7088682B1 (en) Reducing overhead when using loopback cells for fault detection in bi-directional virtual circuits
Cisco Understanding the User Interface
Cisco Understanding the User Interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant