Loop detection method, system, storage medium and electronic device

By setting up a loop detection protocol on the device's network direct connection port and comparing the interface index value with the MAC value, the broadcast storm problem caused by loops between devices is solved, efficient loop detection and blocking is achieved, and device utilization is improved.

CN119254679BActive Publication Date: 2025-09-19FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies easily generate loops at the data link layer between devices, leading to broadcast storms and network paralysis. In addition, commonly used anti-loop protocols cannot solve the problem that some devices cannot be configured or are not supported.

Method used

A loop detection protocol is configured on the device's direct network interface. The protocol compares the interface index, system MAC address, and detection MAC address in packets to determine whether to count packets. The protocol then compares the total count with the count threshold to control the connection status of the direct network interface.

Benefits of technology

This allows loop detection and blocking without configuring anti-loop protocols on all devices, improving device utilization, adapting to loop detection in different situations, and resolving periodic loop issues caused by device restart time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119254679B_ABST
    Figure CN119254679B_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the field of communication technology and provides a loop detection method, system, storage medium and electronic device. The method includes 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; sending a detection message according to the packet sending frequency and detection period; receiving a protocol message according to the detection period; sequentially comparing the information in all received protocol messages with the information on the local end of the device, determining whether to add one to the count based on the comparison result, and determining the total count; comparing the total count with the counting threshold, and controlling the connection status of the network direct connection port based on the comparison result. According to the device and the external network, the packet sending frequency, detection period and counting threshold are set, the loop detection protocol is set only on the network direct connection port, and the network direct connection port is blocked when a loop is formed, effectively solving the problems of network loop formation and low device utilization.
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] At the data link layer, between external networks and devices, and between devices, a large number of broadcast messages occur. These messages are typically forwarded by interfaces on switches. The data link layer primarily handles direct point-to-point communication. Switches typically lack the intelligent routing capabilities of the network layer, making direct point-to-point communication prone to loops. Loops in the network can cause broadcast storms, rapidly consuming network bandwidth and impacting the transmission of other data. The large number of duplicate messages in the loop can even paralyze the network.

[0003] Common loop prevention protocols include Rapid Ring Protection Protocol, Spanning Tree Protocol, and Rapid Spanning Tree Protocol. These protocols require configuration on all devices to take effect. If some devices cannot be configured or do not support these protocols, these protocols cannot resolve loops. 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. A loop detection protocol is set at the network direct connection port of the device. The network direct connection port sends and receives messages. By comparing the interface index value, system MAC value and detection MAC value in the message, it is determined whether to count; 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] Comparing the information in all received protocol messages with the information on the device in sequence, determining whether to add one to the count based on the comparison result, and determining 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] Further,

[0012] According to the detection period, the packet sending frequency, and the counting threshold, the loop detection protocol is configured on 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] Further,

[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 detection messages;

[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] Further,

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

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

[0020] If the local interface index value is equal to the interface index value in the protocol message, the device compares the system MAC value in the protocol message with the local system MAC value. If the comparison result shows that the local system MAC value is smaller than the system MAC value in the protocol message, the device increments the count by one.

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

[0022] Further,

[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 open; if the count sum is greater than the count threshold, the network direct connection port is controlled to be blocked.

[0024] Further,

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

[0026] Further,

[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 on the network direct connection port of the device, and configure the detection MAC value of the device;

[0030] The message transceiver module is configured 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 based on 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 above loop detection methods can be implemented.

[0035] In a fourth aspect, an embodiment of the present disclosure provides an electronic device, comprising a processor, a communication interface, the aforementioned 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 disclosure has the following advantages:

[0039] 1. It is not necessary to set up 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 occurring and being unable to operate the external network by blocking the network direct connection port of the device directly connected to the external network to destroy the loop.

[0041] 3. Only one network direct connection port of a device directly connected to the external network needs to be blocked to break the loop and improve the utilization rate of the device.

[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 in part will become apparent from the description, or will be understood by practicing the present disclosure. The purposes and other advantages of the present disclosure can be realized and obtained by the structures indicated 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 following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 in 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] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

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

[0050] S1: Determine the loop detection protocol detection period, packet sending frequency, and counting threshold. Configure the loop detection protocol on the device's direct network interface and configure the device's detection MAC address.

[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 self-loops of the device after the loop is formed. Among them, the loop detection protocol is initialized once after each detection period; the setting of the counting threshold should 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 time for the device to restart. External networks include: VPLS (Virtual Private LAN Service), VPWS (Virtual Private Wi-Fi 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, based on the packet transmission frequency and detection period, the device sends a detection message containing the device's interface index, system MAC address, and detection MAC address. The device's direct network port receives all protocol messages during the detection period, which also contain the interface index, system MAC address, and detection MAC address.

[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 based on the comparison result, and determine the total count.

[0055] Specifically, the loop detection protocol sequentially compares the information in all received protocol packets with the device's local information. If the comparison result meets the criteria, the count is incremented; if it does not meet the criteria, it is ignored. After the detection period ends, the count stops and is reset to zero, determining the total count. The information in the protocol packets is the interface index value, system MAC value, and detection MAC value. The local device also has 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 a count threshold. When the total count is less than the count threshold, the network direct connection port of the device is kept open or a 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 loop detection protocol detection period, packet sending frequency, and counting threshold 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, the following steps are performed:

[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, namely a first device and a second device, which are directly connected to the external network. A loop detection protocol is configured on a first network direct connection port of the first device and a second network direct connection port of the second device according to a detection period, a packet sending frequency, and a counting threshold.

[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 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 when the detection MAC values ​​are the same, there is a possibility that a loop has been formed in the network. It is understandable 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 setting the loop detection protocol are equal.

[0063] In some examples, detection messages are sent based on the packet transmission frequency and the detection period; and protocol messages are received based on the detection period, specifically including:

[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 are enabled to send detection messages.

[0065] Specifically, within a detection cycle, based on the packet transmission frequency, the first network direct connection port of the first device and the second network direct connection port of the second device send detection messages. The detection messages include an interface index value, a system MAC value, and a detection MAC value. The first network direct connection port of the first device sends the first detection MAC value, and the second network direct connection port of the second device sends the 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, information in all received protocol packets is sequentially compared with information on the device itself, and a determination is made based on the comparison result whether to increment the count and the total count is determined. Specifically, the comparison includes:

[0069] S31: 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.

[0070] Specifically, when the detection MAC value in the protocol message is equal to the detection MAC value on the device itself, it can be used to determine whether a cross-device loop has formed on the network. Otherwise, no further processing is required. In an actual network environment, protocol messages may also be received on other interfaces of the device, that is, interfaces that do not have the loop detection protocol configured. When an interface that does not have the loop detection protocol configured receives a protocol message, the protocol message is not processed, and no comparison, counting, or other processes are 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 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, increment the count by one.

[0072] Specifically, if the interface index value of the local 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, the system MAC value in the protocol message is compared 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 incremented by one.

[0074] Specifically, the system MAC value is unique to 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, and the comparison result shows that the system MAC value of the device is equal to the system MAC value in the protocol message, the device is determined to be in a self-loop, but the count is not increased.

[0075] It should be understood that in the embodiment of the present disclosure, when the interface index value of the device local end is compared with the interface index value in the protocol message, the count is incremented when the interface index value of the device local end is greater than the interface index value in the protocol message; correspondingly, when the system MAC value of the device local end is compared with the system MAC value in the protocol message, the count is incremented when the system MAC value of the device local end is greater than the system MAC value in the protocol message. When determining whether to increment, the comparison method is used, and repeated increments 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 one to the count and determine the total count. After completing a detection cycle, the count is cleared.

[0078] In some examples, the total count is compared with a count threshold, and the connection state of the network direct connection port is controlled based on 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 open. 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 a count threshold. When the total count is less than the count threshold, the network direct connection port of the device is kept open or a 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 one to the count, a comparison method is adopted, 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.

[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 the 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 the 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 the 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 compared 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 self-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 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 based on 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 based on 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] Fourthly, based on the same inventive concept, embodiments of the present disclosure further provide a device comprising 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 configured to execute a 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 cause the essence of the corresponding technical solutions to 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, configuring the loop detection protocol on a first network direct connection port of a first device and a second network direct connection port of a second device according to a detection period, a packet sending frequency, and a counting threshold of the loop detection protocol; wherein the first device and the second device are devices directly connected to an external network; Configuring 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; 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 the interface index value, the system MAC value, and the 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 device itself, and if so, continue to compare the interface index value and the system MAC value in the protocol message; The interface index value in the protocol packet is compared with the local interface index value of the device. If the comparison result shows that the local interface index value is smaller than the interface index value in the protocol packet, the device increments the count by one. If the local interface index value is equal to the interface index value in the protocol message, the device compares the system MAC value in the protocol message with the local system MAC value. If the comparison result shows that the local system MAC value is smaller than the system MAC value in the protocol message, the device increments the count by one. All received protocol packets are compared with the local information of the device in turn to determine whether to add one to the count 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 Compare the total count with the count threshold and control the connection status of the network direct connection port based on 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 open; if the count sum is greater than the count threshold, the network direct connection port is controlled to be blocked.

3. 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.

4. The method according to claim 1, wherein The detection period is greater than the time it takes for the device to restart.

5. 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 configured to configure the loop detection protocol on a first network direct connection port of a first device and a second network direct connection port of a second device according to a detection period, a packet sending frequency, and a counting threshold of the loop detection protocol; wherein the first device and the second device are devices directly connected to an external network; and 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; The message transceiver module is configured to enable the first network direct connection port of the first device and the second network direct connection port of the second device to send a detection message 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 to receive the protocol message and obtain the interface index value, system MAC value and detection MAC value in the protocol message; The counting module is used to determine whether the detection MAC value in the protocol message is equal to the detection MAC value of the device local end. If they are equal, continue to compare the interface index value and the system MAC value in the protocol message; use the interface index value in the protocol message to compare with the interface index value of the device local end. If the comparison result is that the interface index value of the device local end is less than the interface index value in the protocol message, then add one to the count; if the interface index value of the device local end 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 local end. If the comparison result is that the system MAC value of the device local end is less than the system MAC value in the protocol message, then add one to the count; all received protocol messages are compared with the information of the device local end in turn to determine whether to add one to the count 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.

6. 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 according to any one of claims 1 to 4 can be implemented.

7. An electronic device comprising a processor, a communication interface, the computer-readable storage medium according to claim 6, 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 by: The processor is configured to execute a program stored in a computer-readable storage medium.

Citation Information

Patent Citations

  • Loop detection method and related device

    CN108270670A

  • System and method for detecting a network loop

    US20090274054A1