Loop detection method and system, storage medium and electronic equipment

By setting up a loop detection protocol in the network direct connection port of the device, counting and comparing the packet information, and controlling the status of the network direct connection port, the problem of inability to effectively detect and block loops in the prior art is solved, and efficient loop detection and blocking improve equipment utilization and network stability.

CN119254679AActive Publication Date: 2025-01-03FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411462021.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-03
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

The prior art cannot effectively detect and block loops in the data link layer, resulting in broadcast storms and network paralysis, especially when some devices cannot be configured or do not support the ring-proof protocol.

Method used

By setting up a loop detection protocol on the network direct connection port of the device, comparing the interface index value, system MAC value and detection MAC value in the message to determine whether to count, and block or turn on the network direct based on the sum of counts and the threshold. Connection control.

Benefits of technology

It realizes efficient detection and blocking of loops without setting up a ring-proof protocol for all devices, improves equipment utilization, and adapts to loop detection in different situations, solving loop problems caused by device restart time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254679A_ABST
    Figure CN119254679A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of communication, and provides a loop detection method and system, a storage medium and electronic equipment, and the method comprises the steps: determining a detection period, a packet sending frequency and a counting threshold value of a loop detection protocol, configuring the loop detection protocol at a network direct connection port of the equipment, and configuring a detection MAC value of the equipment; sending a detection message according to the packet sending frequency and the detection period; receiving a protocol message according to the detection period; sequentially comparing the information in all received protocol messages with the information of the device home terminal, determining whether to add one to count according to the comparison result, and determining the sum of counts; and comparing the counting sum with a counting threshold value, and controlling the connection state of the network direct connection port according to a comparison result. According to the equipment and the external network, the packet sending frequency, the detection period and the counting threshold value are set, the loop detection protocol is only set on the network direct connection port, the network direct connection port is blocked when the loop is formed, and the problems that the network forms the loop and the equipment utilization rate is low are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of communication technology, and in particular, relates to a loop detection method, system, storage medium and electronic device. Background Art

[0002] There are a large number of broadcast messages between external networks and devices, and between devices, at the data link layer, which are usually forwarded by interfaces when passing through switches. The data link layer is mainly responsible for direct point-to-point communication. Switches usually do not have intelligent routing at the network layer, and loops are easily generated during direct point-to-point communication. If there is a loop in the network, a broadcast storm will occur, quickly occupying the network bandwidth; thus, affecting the transmission of other normal data, and even a large number of duplicate messages in the loop will cause the network to paralyze.

[0003] Commonly used anti-loop protocols include Rapid Ring Protection Protocol, Spanning Tree Protocol or Rapid Spanning Tree Protocol. The above protocols can only take effect after being configured on all devices. When some devices cannot be configured or do not support the above protocols, the above protocols cannot solve the loop problem. Therefore, a universal and efficient loop detection method is urgently needed. Summary of the invention

[0004] To solve the above problems, the present disclosure provides a loop detection method, system, storage medium and electronic device, wherein a loop detection protocol is set at the network direct connection port of the device, the network direct connection port sends and receives messages, and determines whether to count by comparing the interface index value, system MAC value and detection MAC value in the message; the total count is compared with the count threshold, and the network direct connection port of the device is blocked or opened according to the comparison result.

[0005] The present invention is achieved through the following technical solutions:

[0006] In a first aspect, an embodiment of the present disclosure provides a loop detection method, the method comprising:

[0007] Determine the detection period, packet sending frequency and counting threshold of the loop detection protocol, configure the loop detection protocol on the network direct connection port of the device, and configure the detection MAC value of the device;

[0008] Sending a detection message according to the packet sending frequency and the detection period; receiving a protocol message according to the detection period;

[0009] Compare the information in all the received protocol messages with the information on the device in sequence, determine whether to add one to the count according to the comparison result, and determine the total count;

[0010] The count sum is compared with the count threshold, and the connection state of the network direct connection port is controlled according to the comparison result.

[0011] Furthermore,

[0012] According to the detection period, the packet sending frequency and the counting threshold, the loop detection protocol is configured at a first network direct connection port of a first device and a second network direct connection port of a second device; wherein the first device and the second device are devices directly connected to an external network;

[0013] A first detection MAC value of the first device and a second detection MAC value of the second device are configured so that the first detection MAC value and the second detection MAC value are equal.

[0014] Furthermore,

[0015] According to the packet sending frequency and the detection period, the first network direct connection port of the first device and the second network direct connection port of the second device send a detection message;

[0016] The first network direct connection port of the first device and the second network direct connection port of the second device receive a protocol message, and obtain an interface index value, a system MAC value, and a detection MAC value in the protocol message.

[0017] Furthermore,

[0018] Determine whether the detection MAC value in the protocol message is equal to the detection MAC value of the device. If they are equal, continue to compare the interface index value and the system MAC value;

[0019] The interface index value in the protocol message is compared with the interface index value of the local device. If the comparison result shows that the interface index value of the local device is smaller than the interface index value in the protocol message, the device increments the count.

[0020] If the interface index value of the device is equal to the interface index value in the protocol message, the system MAC value in the protocol message is used to compare with the system MAC value of the device. If the comparison result shows that the system MAC value of the device is less than the system MAC value in the protocol message, the count is increased by one.

[0021] All received protocol messages are compared with the information on the device in turn to determine whether to add one to the count and determine the total count.

[0022] Furthermore,

[0023] The count sum is compared with the count threshold, and if the count sum is less than or equal to the count threshold, the network direct connection port is controlled to be opened; if the count sum is greater than the count threshold, the network direct connection port is controlled to be blocked.

[0024] Furthermore,

[0025] The counting threshold is smaller than the product of the detection period and the packet sending frequency.

[0026] Furthermore,

[0027] The detection period is longer than the device restart time.

[0028] In a second aspect, an embodiment of the present disclosure further provides a loop detection system, the system comprising a configuration module, a message transceiver module, a counting module and a threshold comparison module;

[0029] The configuration module is used to determine the detection period, packet sending frequency and counting threshold of the loop detection protocol, configure the loop detection protocol at the network direct connection port of the device, and configure the detection MAC value of the device;

[0030] The message transceiver module is used to send detection messages according to the packet sending frequency and the detection period; and receive protocol messages according to the detection period;

[0031] The counting module is used to compare the information in all received protocol messages with the information of the device in sequence, determine whether to add one to the count according to the comparison result, and determine the total count;

[0032] The threshold comparison module is used to compare the count sum with the count threshold, and control the connection state of the network direct connection port according to the comparison result.

[0033] In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium storing one or more programs, wherein:

[0034] When the one or more programs are executed, any of the loop detection methods described above can be implemented.

[0035] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, including a processor, a communication interface, the above-mentioned computer-readable storage medium and a communication bus; wherein the processor, the communication interface, and the computer-readable storage medium communicate with each other via the communication bus;

[0036] in,

[0037] The processor is configured to execute a program stored in a computer-readable storage medium.

[0038] Compared with the prior art, the present invention has the following advantages:

[0039] 1. It is not necessary to set relevant protocols to prevent loops on all devices to achieve network loop detection and block network loops.

[0040] 2. Effectively solve the problem of a loop being generated and the external network being unable to be operated by blocking the network direct connection port of the device directly connected to the external network to destroy the loop.

[0041] 3. It is only necessary to block the network direct connection port of a device that is directly connected to the external network to break the loop and improve the utilization rate of the equipment.

[0042] 4. The packet sending frequency, detection cycle and counting threshold can be set according to the device and external network to adapt to loop detection in different situations, effectively solving the problem of periodic loops caused by long device restart time.

[0043] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by implementing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 A flow chart of a loop detection method provided by an embodiment of the present disclosure;

[0046] Figure 2 A schematic diagram of an external network and device structure provided in an embodiment of the present disclosure;

[0047] Figure 3 A flow chart of another loop detection method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0049] First, Figure 1 A flow chart of a loop detection method provided by an embodiment of the present disclosure is as follows: Figure 1 As shown, the loop detection method of the embodiment of the present disclosure includes:

[0050] S1: Determine the detection period, packet sending frequency, and counting threshold of the loop detection protocol. Configure the loop detection protocol on the network direct connection port of the device and configure the detection MAC value of the device.

[0051] Specifically, the detection period, packet sending frequency and counting threshold of the loop detection protocol are determined according to the characteristics or relevant parameters of the external network and equipment, as well as the needs of the customer. The loop detection protocol is configured at the network direct connection port between the device and the network. In the present disclosure, in addition to the interface index value and the system MAC value, the device also introduces a detection MAC value, which is used to distinguish between cross-device loops and device self-loops after the loop is formed. Among them, the loop detection protocol is initialized once after each detection period ends; the counting threshold should be set to be less than the product of the detection period and the packet sending frequency, otherwise effective loop detection cannot be achieved; the detection period needs to be greater than the time for the device to restart. When the device restarts, the loop detection protocol cannot work. Therefore, in order to prevent the formation of a loop during the device restart process, the detection period is set to a time greater than the device restart time. External networks include: VPLS (Virtual Private LAN Service), VPWS (Virtual Private Wi re Service), EVPN (Ethernet Virtual Private Network), etc.

[0052] S2: Send detection messages according to the packet sending frequency and detection period; receive protocol messages according to the detection period.

[0053] Specifically, according to the packet sending frequency and detection period, a detection message is sent, and the detection message includes the interface index value, system MAC value and detection MAC value of the device. The network direct connection port of the device receives all protocol messages in the detection period, and the protocol messages also include the interface index value, system MAC value and detection MAC value.

[0054] S3: Compare the information in all received protocol messages with the information on the device in sequence, determine whether to add one to the count according to the comparison result, and determine the total count.

[0055] Specifically, the loop detection protocol compares the information in all received protocol messages with the information on the device in turn. If the comparison result meets the conditions, the count is increased by one. If it does not meet the conditions, it can be ignored. After the detection cycle ends, the count is stopped, the count is reset, and the total count is determined. The information in the protocol message is the interface index value, system MAC value, and detection MAC value. The information on the device is also the interface index value, system MAC value, and detection MAC value.

[0056] S4: Compare the total count with the count threshold, and control the connection state of the network direct connection port according to the comparison result.

[0057] Specifically, the loop detection protocol compares the total count with the count threshold. When the total count is less than the count threshold, the network direct connection port of the device is kept open or the blocked network direct connection port is changed to an open state; when the total count is greater than the count threshold, the network direct connection port of the device is blocked.

[0058] In some examples, the detection period, packet sending frequency, and counting threshold of the loop detection protocol are determined, the loop detection protocol is configured on the network direct connection port of the device, and the detection MAC value of the device is configured, specifically including:

[0059] S11: According to the detection period, the packet sending frequency and the counting threshold, a loop detection protocol is configured on the first network direct connection port of the first device and the second network direct connection port of the second device.

[0060] Specifically, there are usually two devices directly connected to the network, the first device and the second device, which are directly connected to the external network. According to the detection period, the packet sending frequency and the counting threshold, the loop detection protocol is configured on the first network direct connection port of the first device and the second network direct connection port of the second device.

[0061] S12: Configure a first detection MAC value of the first device and a second detection MAC value of the second device so that the first detection MAC value and the second detection MAC value are equal.

[0062] Specifically, the first device directly connected to the external network is configured with a first detection MAC value, and the second device directly connected to the external network is configured with a second detection MAC value. The first device and the second device both send detection messages according to the packet sending frequency and the detection period. At this time, the first detection MAC value and the second detection MAC value are made equal. When the first device receives the detection message sent by the second device, the interface index value and the system MAC value are different, but the detection MAC values ​​are the same, then there is a possibility that a network loop has been formed at this time. It can be understood that the embodiment of the present disclosure takes the network direct connection ports of two devices setting the loop detection protocol as an example to illustrate. When there are multiple devices with network direct connection ports setting the loop detection protocol, the detection MAC values ​​of all devices with the loop detection protocol set are equal.

[0063] In some examples, the detection message is sent according to the packet sending frequency and the detection period; and the protocol message is received according to the detection period, which specifically includes:

[0064] S21: according to the packet sending frequency and the detection period, the first network direct connection port of the first device and the second network direct connection port of the second device send detection messages.

[0065] Specifically, within a detection cycle, according to the packet sending frequency, the first network direct connection port of the first device and the second network direct connection port of the second device send a detection message. The detection message includes an interface index value, a system MAC value, and a detection MAC value; wherein the first network direct connection port of the first device sends a first detection MAC value, and the second network direct connection port of the second device sends a second detection MAC value, and the first detection MAC value and the second detection MAC value are equal.

[0066] S22: The first network direct connection port of the first device and the second network direct connection port of the second device receive the protocol message, and obtain the interface index value, the system MAC value, and the detection MAC value in the protocol message.

[0067] Specifically, the first network direct connection port of the first device and the second network direct connection port of the second device receive the protocol message, and the loop detection protocol located at the network direct connection port obtains the interface index value, system MAC value and detection MAC value in the protocol message.

[0068] In some examples, the information in all received protocol messages is compared with the information of the device in sequence, and whether to add one to the count is determined according to the comparison result, and the total count is determined, which specifically includes:

[0069] S31: Determine whether the detection MAC value in the protocol message is equal to the detection MAC value of the device itself. If they are equal, continue to compare the interface index value and the system MAC value.

[0070] Specifically, when the detection MAC value in the protocol message is equal to the detection MAC value of the device itself, it can be used to determine whether the network forms a loop across devices. Otherwise, no other processing is required. In an actual network environment, the protocol message will also be received at other interfaces of the device, that is, interfaces that are not set with loop detection protocols. When an interface that is not set with loop detection protocols receives a protocol message, the protocol message is not processed, and comparison, counting, and other processes are not performed based on the protocol message.

[0071] S32: Use the interface index value in the protocol message to compare with the interface index value of the device. If the comparison result shows that the interface index value of the device is smaller than the interface index value in the protocol message, add one to the count.

[0072] Specifically, if the interface index value of the local end of the device is equal to the interface index value in the protocol message, the system MAC value is used for judgment because the system MAC value is a unique value of the device.

[0073] S33: If the interface index value of the device is equal to the interface index value in the protocol message, use the system MAC value in the protocol message to compare with the system MAC value of the device. If the comparison result is that the system MAC value of the device is less than the system MAC value in the protocol message, add one to the count.

[0074] Specifically, the system MAC value is a unique value of the device and generally does not appear to be the same. If the system MAC value in the protocol message is compared with the system MAC value of the device itself, and the comparison result is that the system MAC value of the device itself is equal to the system MAC value in the protocol message, it is determined that the device forms a self-loop, but the count is not increased by one.

[0075] It should be understood that in the disclosed embodiment, when the interface index value of the device itself is compared with the interface index value in the protocol message, it is also possible to add one to the count when the interface index value of the device itself is greater than the interface index value in the protocol message; correspondingly, when the system MAC value of the device itself is compared with the system MAC value in the protocol message, it is also possible to add one to the count when the system MAC value of the device itself is greater than the system MAC value in the protocol message. When determining whether to add one to the count, the comparison method is used, and repeated addition of one to the count will not be generated in the first device and the second device at the same time. Therefore, the first network direct connection port of the first device and the second network direct connection port of the second device will not be blocked, resulting in a decrease in device utilization.

[0076] S34: All received protocol messages are compared with the information of the device in turn to determine whether to add one to the count and determine the total count.

[0077] Specifically, for all received protocol messages, the loop detection protocol executes steps S31 to S34 to determine whether to add a count and determine the total count. After completing a detection cycle, the count is cleared.

[0078] In some examples, the count sum is compared with the count threshold, and the connection state of the network direct connection port is controlled according to the comparison result, specifically including:

[0079] S41: Compare the total count with the count threshold. If the total count is less than or equal to the count threshold, the network direct connection port is controlled to be opened. If the total count is greater than the count threshold, the network direct connection port is controlled to be blocked.

[0080] Specifically, the loop detection protocol compares the total count with the count threshold. When the total count is less than the count threshold, the network direct connection port of the device is kept open or the blocked network direct connection port is changed to an open state; when the total count is greater than the count threshold, the network direct connection port of the device is blocked.

[0081] It should be noted that in the embodiment of the present disclosure, the first device and the second device both execute steps S3 and S4. When determining whether to add a count, a comparison method is used, and repeated add-on counts will not be generated in the first device and the second device at the same time. Therefore, the first network direct connection port of the first device and the second network direct connection port of the second device will not be blocked, resulting in a decrease in device utilization.

[0082] In order to more clearly illustrate a loop detection method in the present disclosure, a specific embodiment is provided below.

[0083] like Figure 2 As shown, the embodiment of the present disclosure includes three devices, namely a first device, a second device and a third device, wherein the first device and the second device are directly connected to an external network, the third device is connected to the first device, and the first device and the second device are connected, and the third device, the first device and the second device cannot directly configure the anti-loop protocol in the network. According to the characteristics or relevant parameters of the external network and the device, as well as the needs of the customer, the detection period, packet sending frequency and counting threshold of the loop detection protocol are determined. The loop detection protocol is configured at the network direct connection port of the first device and the network direct connection port of the second device. The detection MAC value of the first device is set to be consistent with the detection MAC value of the second device. When the first device and the second device are working, detection messages are sent according to the packet sending frequency and the detection period.

[0084] like Figure 3As shown, the first device and the second device are configured with a network direct connection port of the loop detection protocol, receive a protocol message, and obtain the interface index value, system MAC value and detection MAC value in the protocol message. The first device and the second device perform the same steps, and the first device is used as an example for explanation. The first device is configured with a network direct connection port of the loop detection protocol, receives a protocol message, and obtains the interface index value, system MAC value and detection MAC value in the protocol message. Determine whether the detection MAC value in the protocol message is equal to the detection MAC value of the first device. If they are equal, continue to compare the interface index value and the system MAC value, otherwise no other processing is required. Use the interface index value in the protocol message to compare with the interface index value of the first device. If the comparison result is that the interface index value of the device is less than the interface index value in the protocol message, then add one to the count. If the interface index value of the first device is equal to the interface index value in the protocol message, the system MAC value in the protocol message is used to compare with the system MAC value of the first device. If the comparison result is that the system MAC value of the first device is less than the system MAC value in the protocol message, then the count is incremented; if the system MAC value in the protocol message is compared with the system MAC value of the first device, and the comparison result is that the system MAC value of the first device is equal to the system MAC value in the protocol message, then it is determined that the device forms a loop, but the count is not incremented. All received protocol messages are compared with the information of the first device in turn to determine whether to increment the count and determine the total count. The loop detection protocol compares the total count with the count threshold. When the total count is less than the count threshold, the network direct connection port of the first device is kept open or the blocked network direct connection port is changed to an open state; when the total count is greater than the count threshold, the network direct connection port of the first device is blocked.

[0085] In the second aspect, the embodiment of the present disclosure also provides a loop detection system, which includes a configuration module, a message sending and receiving module, a counting module and a threshold comparison module; the configuration module is used to determine the detection period, packet sending frequency and counting threshold of the loop detection protocol, configure the loop detection protocol at the network direct connection port of the device, and configure the detection MAC value of the device; the message sending and receiving module is used to send detection messages according to the packet sending frequency and the detection period; receive protocol messages according to the detection period; the counting module is used to compare the information in all received protocol messages with the information on the local end of the device in turn, determine whether to add one count according to the comparison result, and determine the total count; the threshold comparison module is used to compare the total count with the counting threshold, and control the connection status of the network direct connection port according to the comparison result.

[0086] On the third aspect, based on the same inventive concept, the embodiments of the present disclosure further provide a computer-readable storage medium storing one or more programs, which, when executed, can implement the aforementioned loop detection method.

[0087] In a fourth aspect, based on the same inventive concept, an embodiment of the present disclosure further provides a device, including a processor, a communication interface, the aforementioned computer-readable storage medium, and a communication bus. The processor, the communication interface, and the computer-readable storage medium communicate with each other via the communication bus. The processor is used to execute the program stored in the aforementioned computer-readable storage medium.

[0088] Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A loop detection method, characterized in that: The method comprises, Determine the detection period, packet sending frequency and counting threshold of the loop detection protocol, configure the loop detection protocol on the network direct connection port of the device, and configure the detection MAC value of the device; Sending a detection message according to the packet sending frequency and the detection period; receiving a protocol message according to the detection period; Compare the information in all the received protocol messages with the information on the device in sequence, determine whether to add one to the count according to the comparison result, and determine the total count; The count sum is compared with the count threshold, and the connection state of the network direct connection port is controlled according to the comparison result.

2. The method according to claim 1, characterized in that The method of determining the detection period, packet sending frequency and counting threshold of the loop detection protocol, configuring the loop detection protocol at the network direct connection port of the device, and configuring the detection MAC value of the device includes: According to the detection period, the packet sending frequency and the counting threshold, the loop detection protocol is configured at a first network direct connection port of a first device and a second network direct connection port of a second device; wherein the first device and the second device are devices directly connected to an external network; A first detection MAC value of the first device and a second detection MAC value of the second device are configured so that the first detection MAC value and the second detection MAC value are equal.

3. The method according to claim 1 or 2, characterized in that: The detection message is sent according to the packet sending frequency and the detection period; According to the detection period, receive protocol messages, including: According to the packet sending frequency and the detection period, the first network direct connection port of the first device and the second network direct connection port of the second device send a detection message; The first network direct connection port of the first device and the second network direct connection port of the second device receive a protocol message, and obtain an interface index value, a system MAC value, and a detection MAC value in the protocol message.

4. The method according to claim 1, characterized in that: The step of sequentially comparing the information in all received protocol messages with the information on the device itself, determining whether to add one to the count according to the comparison result, and determining the total count includes: Determine whether the detection MAC value in the protocol message is equal to the detection MAC value of the device. If they are equal, continue to compare the interface index value and the system MAC value; The interface index value in the protocol message is compared with the interface index value of the local device. If the comparison result shows that the interface index value of the local device is smaller than the interface index value in the protocol message, the device increments the count. If the interface index value of the device is equal to the interface index value in the protocol message, the system MAC value in the protocol message is used to compare with the system MAC value of the device. If the comparison result shows that the system MAC value of the device is less than the system MAC value in the protocol message, the count is increased by one. All received protocol messages are compared with the information on the device in turn to determine whether to add one to the count and determine the total count.

5. The method according to claim 1, characterized in that The total count is compared with the count threshold, and the connection status of the network direct connection port is controlled according to the comparison result, including: The count sum is compared with the count threshold, and if the count sum is less than or equal to the count threshold, the network direct connection port is controlled to be opened; if the count sum is greater than the count threshold, the network direct connection port is controlled to be blocked.

6. The method according to claim 1, characterized in that The counting threshold is smaller than the product of the detection period and the packet sending frequency.

7. The method according to claim 1, characterized in that The detection period is greater than the time it takes for the device to restart.

8. A loop detection system, characterized in that: The system includes a configuration module, a message transceiver module, a counting module and a threshold comparison module; The configuration module is used to determine the detection period, packet sending frequency and counting threshold of the loop detection protocol, configure the loop detection protocol at the network direct connection port of the device, and configure the detection MAC value of the device; The message transceiver module is used to send detection messages according to the packet sending frequency and the detection period; and receive protocol messages according to the detection period; The counting module is used to compare the information in all received protocol messages with the information of the device in sequence, determine whether to add one to the count according to the comparison result, and determine the total count; The threshold comparison module is used to compare the count sum with the count threshold, and control the connection state of the network direct connection port according to the comparison result.

9. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed, the loop detection method described in any one of claims 1 to 7 can be implemented.

10. An electronic device comprising a processor, a communication interface, the computer-readable storage medium of claim 9, and a communication bus; wherein: The processor, the communication interface, and the computer-readable storage medium communicate with each other via a communication bus; It is characterized in that The processor is configured to execute a program stored in a computer-readable storage medium.

Citation Information

Patent Citations

  • Two-layer loop detection method, two-layer loop detection device and communication system

    CN103607317A

  • Method for detecting loop in two-layer network and controller

    CN104144082A

  • Loop detection method and related device

    CN108270670A

  • Loop detection method and system based on tolerance mechanism

    CN108989155A

  • Ethernet two-layer anti-loop method and Ethernet two-layer anti-loop device

    CN112003783A