Network loop position detection method and system, storage medium and electronic equipment
By generating and updating loopback detection messages in the network and carrying forward information, the problem of unintuitive loop position confirmation in the network is solved, and the rapid positioning of loop interfaces or links is achieved, and network optimization efficiency is improved.
Patent Information
- Application Number
- CN202310804873.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
The prior art cannot intuitively confirm the location of the loop in the network and the specific equipment and interface information, resulting in low network optimization efficiency.
By generating and updating loopback detection messages, carrying the source device's outgoing port and incoming port forwarding information, the detection of loop locations in the target network is realized, and the forwarding information is used to quickly locate loop interfaces or links.
It improves the intuitiveness and accuracy of detection of network loop locations, quickly finds the interface or link that causes loops in the network, and improves the efficiency of network optimization.
Smart Images

Figure CN119232616A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network transmission technology, and in particular to a method and system for detecting a network loop position, a storage medium, and an electronic device. Background Art
[0002] The loop / loopback detection technology in the related technology can only identify the existence of loops in the current network and break the loops according to the configuration. Regardless of whether the breaking behavior is reasonable, it is impossible to know what actions were taken in the network to cause the loop, what is the direct cause of the loop in the network, and how to more reasonably and better break the loop in the existing network. As a result, the solution for confirming loops in the network is not intuitive enough, and the specific equipment and interface information of the network loop cannot be determined, and effective prompts cannot be provided to network maintenance personnel.
[0003] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention
[0004] The embodiments of the present application provide a method and system for detecting the location of a network loop, a storage medium, and an electronic device, so as to at least solve the problem that the solutions for confirming loops in the network in the related art are not intuitive enough and cannot determine the specific equipment and interface information of the network loop.
[0005] According to one embodiment of the present application, a method for detecting a network loop location is provided, which is applied to a source device in a target network, and includes: in response to the initiation of a loopback detection operation, generating a first loopback detection message, wherein the first loopback detection message carries first forwarding information corresponding to an egress port of the source device; sending the first loopback detection message to a forwarding device in the target network, wherein the forwarding device is used to indicate devices in the target network other than the source device, and the first loopback detection message is updated by adding second forwarding information corresponding to the forwarding device; receiving the updated first loopback detection message, and adding the first forwarding information corresponding to an ingress port of the source device in the first loopback detection message to generate a second loopback detection message; and detecting the network loop location of the target network based on the second loopback detection message.
[0006] According to one embodiment of the present application, another method for detecting the location of a network loop is provided, which is applied to other forwarding devices in a target network except a source device, and includes: in response to the start of a loopback detection operation, receiving a first loopback detection message, wherein the first loopback detection message is a message generated by the source device in response to the start of the loopback detection operation and carries the first forwarding information corresponding to the egress port of the source device; updating the first loopback detection message by the second forwarding information corresponding to the current forwarding device to obtain an updated first loopback detection message; forwarding the updated first loopback detection message to devices in the target network, so that the other devices can update the first loopback detection message by the forwarding information corresponding to the current forwarding device, and the source device can add the first forwarding information corresponding to the ingress port of the source device to the received updated first loopback detection message to generate a second loopback detection message; wherein the second loopback detection message carries the second forwarding information corresponding to all forwarding devices in the target network that forward the first loopback detection message, and the second loopback detection message is used to instruct the source device to detect the location of a network loop on the target network.
[0007] According to another embodiment of the present application, a network loop location detection system is provided, including: a source device, for generating a first loopback detection message in response to the start of a loopback detection operation, and sending the first loopback detection message to a forwarding device in a target network; and receiving an updated first loopback detection message, and adding first forwarding information corresponding to an input port of the source device in the updated first loopback detection message to generate a second loopback detection message, and detecting the network loop location of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to an output port of the source device; a forwarding device is used to indicate devices other than the source device in the target network; a forwarding device, for receiving the first loopback detection message in response to the start of a loopback detection operation, and updating the first loopback detection message through the second forwarding information corresponding to the current forwarding device to obtain an updated first loopback detection message; and forwarding the updated first loopback detection message to devices in the target network, so that other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device.
[0008] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0009] According to another embodiment of the present application, an electronic device is provided, which may include a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0010] Through the above-mentioned embodiment, the source device generates a first loopback detection message in response to the start of the loopback detection operation, sends the first loopback detection message to the forwarding device in the target network, receives the updated first loopback detection message, and adds the first forwarding information corresponding to the input port of the source device in the first loopback detection message to generate a second loopback detection message, and detects the network loop position of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to the output port of the source device; the forwarding device is used to indicate the devices in the target network other than the source device, and the forwarding device receives the first loopback detection message and updates the first loopback detection message using the second forwarding information corresponding to the current forwarding device to obtain the updated first loopback detection message; The updated first loopback detection message is forwarded to the device in the target network, so that the other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device, and the source device can add the first forwarding information corresponding to the input port of the source device in the received updated first loopback detection message to generate a second loopback detection message; the second loopback detection message is used to detect the network loop position of the target network, thereby realizing the detection of the network loop position of multiple devices under the target network through the updated forwarding information in the loopback detection message, solving the problem that the solution for confirming the loop in the network is not intuitive enough and the specific device and interface information of the network loop cannot be determined, thereby achieving the effect of quickly finding the exact location of the interface or link that causes the loop in the network, thereby improving the optimization efficiency of network optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic diagram of a hardware structure block diagram of a mobile terminal of a method for detecting a network loop position according to an embodiment of the present application;
[0012] Figure 2 1 is a flow chart of a method for detecting a network loop location according to an embodiment of the present application (I);
[0013] Figure 3 is a flow chart of a method for detecting a network loop location according to an embodiment of the present application (II);
[0014] Figure 4 This is a structural intention of a network loop location detection system according to an embodiment of the present application;
[0015] Figure 5 This is a structural intention of a network composed of 4 devices according to an embodiment of the present application;
[0016] Figure 6 is a structural schematic diagram of a network loop location detection system according to an embodiment of the present application;
[0017] Figure 7 It is a block diagram of the computer system structure of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0018] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0020] Example 1
[0021] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for detecting a network loop position according to an embodiment of the present application. Figure 1 As shown, the mobile terminal 10 may include one or more (only one is shown in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0022] The memory 104 can be used to store software programs and modules of application software, such as program instructions / modules corresponding to the method for detecting the network loop position in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal 10 via a network. Examples of the above-mentioned network may include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0023] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 may include a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0024] In this embodiment, a method for detecting a network loop position is provided, which is applied to a source device in a target network. Figure 2 1 is a flow chart of a method for detecting a network loop position according to an embodiment of the present application (I), such as Figure 2 As shown, the process may include, but is not limited to, the following steps:
[0025] Step S202, in response to the start of the loopback detection operation, generating a first loopback detection message, wherein the first loopback detection message carries first forwarding information corresponding to the egress port of the source device;
[0026] It should be noted that the above-mentioned source device is a target device determined among the devices that can perform loopback detection operations in the target network and is used to carry out message decision and execution functions. The source device can be flexibly selected according to the actual application scenario, and this embodiment does not impose too many restrictions on this.
[0027] It can be understood that, in order to better identify, the source device sends a first loopback detection message to the forwarding device in the target network, and effectively identifies the updated first loopback detection message with the second forwarding information added that is returned to the source device by other forwarding devices, determines whether a loop occurs in the current target network, and then adds the first forwarding information corresponding to the egress port to the first loopback detection message. Optionally, the above-mentioned first forwarding information may include the following content: the service forwarding duration of the first loopback detection message being sent out of the source device through the egress port, the service forwarding duration is used to indicate the duration between the time when the egress port allows the execution of the message transfer and the current forwarding of the first loopback detection message, and there is no state change between the above-mentioned moments, the state change is used to indicate the process in which the corresponding port on the device is converted from the first forwarding state that allows service forwarding to the second forwarding state that prohibits service forwarding and then recovers to the first forwarding state that allows service forwarding, that is, the determination of the above-mentioned forwarding duration needs to ensure that between the two moments of calculating the duration, the device has not been restarted or the port state of the egress port has changed from Active to Inactive, so as to ensure the accuracy of the determined duration.
[0028] Step S204, sending the first loopback detection message to a forwarding device in the target network, wherein the forwarding device is used to indicate a device other than the source device in the target network, and the first loopback detection message is updated by adding second forwarding information corresponding to the forwarding device;
[0029] For example, the first loopback detection message sent by the source device includes the following contents: source device IP information, forwarding domain information of the loopback detection message in the source device, outbound interface information from which the loopback detection message is sent from the source device, and Active duration of the outbound interface (equivalent to the service forwarding duration in this embodiment). After the forwarding device connected to the source device receives the first loopback detection message, the forwarding device will add the IP information of the current forwarding device, the forwarding domain information of the current forwarding device, and the inbound interface information and Active duration information of the inbound interface when the first loopback detection message enters the current forwarding domain to the first loopback detection message.
[0030] Furthermore, after determining the output interface through which the first loopback detection message is forwarded in the forwarding device, the output interface information and the active duration information of the output interface are added to the first loopback detection message to obtain an updated first loopback detection message for updating the forwarding device. Through the above process of adding forwarding information corresponding to the forwarding device, the forwarding devices through which the first loopback detection message is forwarded after the source device can be recorded. The recorded information can be used to quickly provide data reference for whether a loop exists in the device that passes the first loopback detection message.
[0031] Step S206, receiving the updated first loopback detection message, and adding the first forwarding information corresponding to the inbound port of the source device to the first loopback detection message to generate a second loopback detection message;
[0032] Step S208: Detect the network loop location of the target network based on the second loopback detection message.
[0033] Optionally, the second loopback detection message carries second forwarding information corresponding to all forwarding devices in the target network that forward the first loopback detection message.
[0034] In an exemplary embodiment, when the updated first loopback detection message is transmitted back to the source device through the forwarding device, it is determined that a loop has occurred in the forwarding device through which the current first loopback detection message passes, that is, a loop exists between the source device and the last device that updates the second forwarding information for the first loopback detection message. Therefore, after the source device receives the updated first loopback detection message, after adding the first forwarding information corresponding to the input port of the source device, it generates a second loopback detection message to detect the location of the network loop on the target network.
[0035] Through the above steps, the source device generates a first loopback detection message in response to the start of the loopback detection operation, sends the first loopback detection message to the forwarding device in the target network, receives the updated first loopback detection message, and adds the first forwarding information corresponding to the input port of the source device in the first loopback detection message to generate a second loopback detection message, and detects the network loop position of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to the output port of the source device, thereby realizing the detection of the network loop position of multiple devices under the target network through the updated forwarding information in the loopback detection message, solving the problem that the scheme for confirming the loop in the network is not intuitive enough and the specific device and interface information of the network loop cannot be determined, thereby achieving the effect of quickly finding the exact position of the interface or link that causes the loop in the network.
[0036] In an exemplary embodiment, the execution subject of the above steps may be a terminal with at least one display screen, etc., but is not limited thereto.
[0037] In an exemplary implementation, the above step S208 detects the network loop location of the target network based on the second loopback detection message, including the following steps S11-S13:
[0038] Step S11: parsing the second loopback detection message to determine the first forwarding information and the second forwarding information; wherein the first forwarding information at least includes: the service forwarding duration of the source device, and the second forwarding information at least includes: the service forwarding duration of each of the forwarding devices;
[0039] Step S12: determining the device with the shortest service forwarding time as the target forwarding device;
[0040] Step S13: Detecting the network loop location of the target network based on the target forwarding device.
[0041] It should be noted that after a loop occurs in the network, the source device that sends the first loopback detection message will receive the first loopback detection message sent and updated from the device. And the updated first loopback detection message records the forwarding information of the device through which the first loopback detection message passes. According to the forwarding information, the forwarding path through which the first loopback detection message passes can be determined, and by comparing the service forwarding duration of the corresponding ports in these forwarding paths, the forwarding interface / forwarding path with the shortest service forwarding duration is calculated, and the historical operations of these forwarding interfaces / forwarding paths are determined. When the historical operation of the forwarding interface / forwarding path is close to the time when the loop occurs in the target network, it means that the historical operation of the forwarding interface / forwarding path may be the direct cause of the network loop, and then the location where the loop occurs in the target network can be accurately located.
[0042] In an exemplary embodiment, the service forwarding duration is used to indicate the time difference between the forwarding time when the corresponding port of the current device was last engaged in service forwarding and the current time, wherein the current time is the time when the corresponding port of the current device forwards the first loopback detection message, the corresponding port is an input port or an output port, and the forwarding state of the corresponding port does not change between the forwarding time and the current time.
[0043] It should be noted that the forwarding time of the most recent service forwarding is the time when the port status is always allowed to be used from the time the corresponding port is put into message forwarding to the time the first loopback detection message is forwarded, so as to avoid the calculation process of the service forwarding duration being affected by changes in the status of the equipment or ports in the loop. For example, the first loopback detection message is transmitted between the four devices A, B, C, and D, where A is the source device, B, C, and D are forwarding devices, and a loop occurs between the A device and the D device. When the service forwarding duration is counted, the service forwarding duration in the loop includes: the service forwarding duration of the port corresponding to the A device, the service forwarding duration of the port corresponding to the B device, the service forwarding duration of the port corresponding to the C device, and the service forwarding duration of the port corresponding to the D device. However, if the status of the port corresponding to the B device changes or the B device is restarted, the service forwarding duration of the port corresponding to the B device will not appear when the first loopback message is updated, which will cause a deviation in the subsequent process of locating the loopback fault location based on the service forwarding duration.
[0044] In an exemplary embodiment, the network loop location of the target network is detected based on the target forwarding device, including: querying the first moment when the historical alarm operation or alarm information corresponding to the target forwarding device is generated, and the second moment when the target network generates a loopback alarm; when the first moment is consistent with the second moment, determining the port of the target forwarding device with the shortest service forwarding time as the loopback fault location, wherein the first moment is consistent with the second moment in time means that the time difference between the first moment and the second moment is less than or equal to a preset time difference.
[0045] It should be noted that when the message transmission path of the device in the target network operates normally, at this time, the corresponding port of a certain device is adjusted from the port closed state to the port punched state. After the corresponding port passes the first loopback detection message, the recorded service forwarding time will be shorter than the time of other continuously working ports that have been forwarding messages. After the corresponding port is opened, a loop appears in the target network. Then, based on the operation of opening the corresponding port and the corresponding information of the corresponding port, it can be determined whether the cause of the loop in the current target network has occurred, and the loopback fault position in the target network can be quickly located.
[0046] In addition, in order to ensure that the determined loopback fault location is associated with the historical alarm operation or alarm information, the second moment when the loopback alarm is generated in the network record corresponding to the target network is determined, and the first moment corresponding to the historical alarm operation generated by different operations performed on the target forwarding device, or the first moment when the alarm information caused by the target forwarding device appears, is determined. When the time difference between the first moment and the second moment is within the allowable error range, it means that the change of the corresponding port in the target forwarding device is the essential cause of the loop in the target network.
[0047] For example, assuming that the preset time difference is 3 minutes, when the generation time of the loopback alarm in the target network is 2023-06-23, 14:46:53, and the time when the historical alarm operation or alarm information appears in the target forwarding device is 2023-06-23, 14:47:50, the time difference between the two times is less than 3 minutes, which means that the port adjustment operation that caused the historical alarm operation or alarm information to appear in the target forwarding device caused the loopback alarm in the target network after the operation was completed. It should be noted that the above-mentioned preset time difference is flexibly set based on the actual application requirements of the target network, and the above is only an illustration. Optionally, the above-mentioned preset time difference can also be 60 seconds, 90 seconds, etc.
[0048] In an exemplary embodiment, after parsing and processing the second loopback detection message to determine the first forwarding information and the second forwarding information, the method further includes: determining a message transmission path existing in the target network; determining a first service forwarding duration corresponding to an input port of each target forwarding device through which the message transmission path passes and a second service forwarding duration corresponding to an output port of each target forwarding device; determining a total forwarding duration corresponding to the message transmission path based on the first service forwarding duration and the second service forwarding duration; and determining the message transmission path with the shortest total forwarding time as the target path, wherein the target path is used to indicate that the message transmission path is the message transmission path at a loopback fault location in the target network.
[0049] As an optional embodiment, the forwarding time of the egress and ingress ports in the multiple forwarding devices in the target network can be determined by parsing the second loopback message, and then when the message transmission path existing in the target network is obtained, the total forwarding time of the forwarding devices appearing in each message transmission path can be determined. When there are forwarding devices and other message transmission devices in the message transmission path, the target path with the highest probability of the loopback fault location in the target network can be determined from the multiple message transmission paths corresponding to the target network, thereby providing data reference for subsequent network optimization, avoiding the long determination cycle caused by determining multiple message transmission paths one by one, and improving the search efficiency for the specific loopback fault location in the target network.
[0050] In an exemplary embodiment, after detecting the network loop location of the target network based on the second loopback detection message, the method further includes: sending the detection result to a network management object to instruct the network management object to perform network maintenance on the target network based on the detection result, wherein the detection result is used to indicate the forwarding information of the corresponding port causing the loopback fault in the target network or the message transmission path where the loopback fault location is located.
[0051] In an exemplary embodiment, it is characterized in that the first forwarding information also includes: device information of the source device, domain information of the forwarding domain where the source device is located; the second forwarding information also includes: device information of the forwarding device in the target network, domain information of the forwarding domain where the forwarding device is located, the forwarding device obtains the input port information of the first loopback detection message, and the forwarding device forwards the updated output port information of the first loopback detection message.
[0052] For example, take a network consisting of 4 devices as an example. Figure 5As shown in the figure. When a loop occurs in the network, the loop direction of the message in the figure is A->B->C->D->E->F->G->H, that is, the first loopback detection message is sent from port A of device 1 (equivalent to the source device) and received at port H of device 1. The loopback detection operation is enabled on device 1. The sending unit, receiving unit, decision-making and execution unit corresponding to the loopback detection operation are all on device 1. Devices 2, 3, and 4 are all deployed with intermediate units for loopback detection operations. After device 1 constructs the first loopback detection message, the sending unit adds the first forwarding information corresponding to the outbound interface of device 1, such as the IP of device 1, the forwarding domain information where the loopback detection message is located, the outbound interface information, and the Active duration of the outbound interface (equivalent to the service forwarding duration in the above implementation), and then sends it out from interface A; after device 2 receives the first loopback detection message sent by device 1 from interface B, it adds the second forwarding information corresponding to device 2, such as the IP of device 2, the forwarding domain information where the message is located, the input interface information, the Active duration of the input interface, the output interface information, and the Active duration of the output interface, and then sends it out from interface C; after device 3 receives the loopback detection message sent by device 1 from interface D, it adds the second forwarding information corresponding to device 3, such as the IP of device 3, the forwarding domain information where the message is located, the input interface information, the Active duration of the input interface, the output interface information, and the Active duration of the output interface After receiving the loopback detection message sent by device 1 from interface F, device 4 adds the second forwarding information corresponding to device 4, such as the IP of device 4, the forwarding domain information of the message, the input interface information, the active duration of the input interface, the output interface information and the active duration of the output interface, and then sends it out from interface G; after receiving the loopback detection message sent by device 1 from interface H, device 1 adds the first forwarding information corresponding to the input interface of device 1, such as the IP of device 1, the forwarding domain information of the message, the input interface information and the active duration of the input interface, and then generates a second loopback detection message, and sends the second loopback detection message to the decision-making and execution unit; after the decision-making and execution unit confirms that a loop occurs in the network according to the received second loopback detection message, it compares the active duration of the interface recorded in the second loopback detection message to determine the device interface or path that may cause the network loop. At the same time, the device forwarding path information recorded in the second loopback detection message is saved for network maintenance personnel to query.
[0053] In an exemplary embodiment, after using the second loopback detection message to detect the network loop location of the target network, the above method also includes: when it is determined that a loop occurs in the target network, monitoring the device status of multiple target forwarding devices in the loop to obtain monitoring results; when the monitoring result indicates that the target forwarding device has a status adjustment, determining the detection result corresponding to the network loop location detection performed on the target network using the second loopback detection message as an invalid detection, and instructing the target network to be re-detected after a preset detection period.
[0054] It is understandable that there is a third-party network in the network loop, or after the network loop occurs, the status of the device or port in the loop has changed. For example: after the network loop occurs, the device in the network loop is restarted; after the network loop occurs, the interface status on the network loop changes from Active to Inactive and then to Active. At this time, since the changed information has a certain impact on the detection result, when performing network loop location detection in the application scenario, it is necessary to avoid the above scenarios to ensure the accuracy of network loop location detection.
[0055] In this embodiment, another method for detecting the location of a network loop is provided, which is applied to other forwarding devices in the target network except the source device. Figure 3 2 is a flow chart of a method for detecting a network loop position according to an embodiment of the present application (II), such as Figure 3 As shown, the process may include, but is not limited to, the following steps:
[0056] Step S306: In response to the start of the loopback detection operation, receiving a first loopback detection message, wherein the first loopback detection message is a message generated by the source device in response to the start of the loopback detection operation and carrying first forwarding information corresponding to the egress port of the source device;
[0057] Step S308: updating the first loopback detection message by using the second forwarding information corresponding to the current forwarding device to obtain an updated first loopback detection message;
[0058] Step S310: forward the updated first loopback detection message to the device in the target network, so that the other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device, and the source device can add the first forwarding information corresponding to the input port of the source device in the received updated first loopback detection message to generate a second loopback detection message; wherein, the second loopback detection message carries the second forwarding information corresponding to all forwarding devices in the target network that forward the first loopback detection message, and the second loopback detection message is used to instruct the source device to detect the network loop location of the target network.
[0059] Through the above steps, the forwarding device receives the first loopback detection message and updates the first loopback detection message using the second forwarding information corresponding to the current forwarding device to obtain an updated first loopback detection message; forwards the updated first loopback detection message to the device in the target network, so that the other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device, and the source device adds the first forwarding information corresponding to the input port of the source device in the received updated first loopback detection message to generate a second loopback detection message; uses the second loopback detection message to detect the network loop position of the target network, thereby realizing the detection of the network loop position of multiple devices under the target network through the updated forwarding information in the loopback detection message, solving the problem that the scheme for confirming the loop in the network is not intuitive enough and the specific device and interface information of the network loop cannot be determined, thereby achieving the effect of quickly finding the exact position of the interface or link causing the loop in the network, thereby improving the optimization efficiency of network optimization.
[0060] In order to better understand the technical solutions of the embodiments of the present application and the optional embodiments, the process of the above-mentioned network loop location detection method is explained below with reference to examples, but it is not used to limit the technical solutions of the embodiments of the present application.
[0061] In an exemplary implementation, an optional embodiment of the present application provides a method for detecting the location of a network loop. When a loop occurs in the network, a source device for sending a loop detection message for the first time is determined in the network, and the first loop detection message sent by the source device is forwarded by multiple forwarding devices on the loop in the network, and when forwarding the first loop detection message, second forwarding information related to the forwarding device is added to the first loop detection message. Due to the existence of a loop in the network, the first loop detection message is eventually added with multiple second forwarding information and then returns to the destination device. It should be noted that the source device and the destination device are the same device, and the source device and the destination device are mainly relative to the sending and termination of the first loop detection message.
[0062] That is, when the forwarding device sends and forwards the first loopback detection message, the second forwarding information related to the current device is added to the first loopback detection message to update it. When the source device finally receives the first loopback detection message sent by itself, the first forwarding information corresponding to the input port of the source device is added to the first loopback detection message to generate a second loopback detection message. According to the forwarding information of the first loopback detection message through the device in the network recorded in the second loopback detection message, the specific device interface or path that caused the network loop is identified. This provides data support for analyzing the cause of the network loop and reasonably solving the loop failure in the network.
[0063] Optionally, the above-mentioned device-related forwarding information includes: a field identifying the current device information (which can be the device IP or the device name); a field identifying the forwarding domain where the first loopback detection message is currently located; a field identifying the input interface (equivalent to the input port in the above-mentioned embodiment) through which the first loopback detection message enters the forwarding domain; a field identifying the Active duration of the input interface through which the first loopback detection message enters the forwarding domain; a field identifying the output interface (equivalent to the output port in the above-mentioned embodiment) through which the first loopback detection message exits the forwarding domain after being updated; and a field identifying the Active duration of the output interface through which the current first loopback detection message exits the forwarding domain after being updated.
[0064] In an illustrative example, Figure 4 This is a structural intention of a network loop location detection system according to an embodiment of the present application; Figure 4 As shown, the following units may be included: a sending unit 32, an intermediate unit 34, a receiving unit 36, and a decision and execution unit 38;
[0065] Optionally, for the loopback detection scenario, the sending unit, receiving unit, decision-making and execution units are all on a device with the loopback detection function deployed, i.e., the above-mentioned source device, and the intermediate processing unit is on an intermediate device through which the first loopback detection message passes, i.e., the above-mentioned forwarding device.
[0066] The sending unit 32: on the source device that sends the first loopback detection message, construct the first loopback detection message, and add the first forwarding information corresponding to the source device before the first loopback detection message is sent out from the outgoing interface, and the first loopback detection message is sent out from the outgoing interface after being updated. The first forwarding information of the source device includes: source device IP information, forwarding domain information of the first loopback detection message in the source device, outgoing interface information from which the first loopback detection message is sent from the source device, and Active duration of the outgoing interface.
[0067] Intermediate unit 34: After the forwarding device where the intermediate unit is located receives the first loopback detection message, it adds the IP information of the forwarding device where the intermediate unit is located, the forwarding domain information of the first loopback detection message in the forwarding device where the intermediate unit is located, and the input interface information when the first loopback detection message enters the current forwarding domain and the Active duration information of the input interface. After determining the output interface forwarded by the first loopback detection message, the output interface information and the Active duration information of the output interface are added to the first loopback detection message, and the updated first loopback detection message is sent out from the output interface, wherein the information added by the above intermediate unit is the second forwarding information.
[0068] Receiving unit 36: On the destination device receiving the updated first loopback detection message, the IP information of the forwarding device where the intermediate unit is located is added to the first loopback detection message, the forwarding domain information of the forwarding device where the intermediate unit is located, and the input interface information when the updated first loopback detection message enters the current forwarding domain and the active duration information of the input interface are added to the updated first loopback detection message, to obtain a second loopback detection message. The second loopback detection message is sent to the decision and execution unit.
[0069] Decision-making and execution unit 38: On the destination device, based on the content of the received second loopback detection message, decide whether there is a loop in the current network; based on the configuration, decide whether it is necessary to block the interface in the loop; based on the second forwarding information and the first forwarding information of the first loopback detection message in the network recorded in the second loopback detection message, especially based on the interface Active duration information in the first forwarding information and the second forwarding information, find the interface and path with the shortest Active duration, and decide the device interface and path that may cause the network to form a loop; and save the path information of the first loopback detection message recorded in the second loopback detection message for updating and forwarding in the network. The network maintenance personnel confirm the device interface and path that may cause the network to form a loop by querying the information in the loopback alarm or querying the forwarding path of the first loopback detection message.
[0070] In an exemplary embodiment, a detection method for the detection system of the network loop position is provided, which at least comprises the following steps:
[0071] Step 1: After the device enables the loopback detection function, it periodically sends loopback detection messages. The device sending unit adds the first forwarding information corresponding to the source device in the first loopback detection message. The above-mentioned first forwarding information is the information corresponding to the source device's outbound interface, including the source device IP or name, the forwarding domain information of the first loopback detection message in the source device, the outbound interface of the first loopback detection message in the source device, and the Active duration of the outbound interface.
[0072] Step 2: When the first loopback detection message passes through the intermediate device, it is sent to the intermediate unit of the intermediate device. The intermediate unit adds the second forwarding information corresponding to the current device to the first loopback detection message, and the second forwarding information includes the IP or name of the device that the first loopback detection message currently passes through, the forwarding domain information of the first loopback detection message in the current device, the inbound interface of the first loopback detection message in the current device and the active duration of the inbound interface, the outbound interface of the first loopback detection message in the current device and the active duration of the outbound interface, etc.
[0073] Step 3: When a loop occurs in the network, the first loopback detection message is forwarded through the loop in the network and finally returns to the destination device that sent the first loopback detection message. The destination device is the source device. After receiving the first loopback detection message updated by the intermediate unit, the receiving unit on the destination device adds the first forwarding information corresponding to the input interface corresponding to the destination device to the updated first loopback detection message to obtain the second loopback detection message. The destination device-related forwarding information includes the destination device IP or name, the updated first loopback detection message in the forwarding domain where the destination device is located, the updated first loopback detection message in the input interface of the destination device and the Active duration of the input interface, etc.
[0074] Step 4: The receiving unit of the destination device sends the second loopback detection message to the decision and execution unit. The decision and execution unit determines whether the current network forms a loop by parsing the content of the second loopback detection message. If a loop forms, it takes action according to the device configuration and provides the customer with a means to query the forwarding path information of the second loopback detection message in the network. Based on the loopback path information of the first loopback detection message in the network recorded in the second loopback detection message, it is determined that the path of the interface with the shortest interface active time is the direct cause that may cause the network to form a loop.
[0075] As an optional implementation, take a network consisting of 4 devices as an example. Figure 5 As shown, Figure 5 This is a structural intention of a network composed of 4 devices according to an embodiment of the present application. When a loop occurs in the network, the loop direction of the message in the figure is A->B->C->D->E->F->G->H, that is, the message is sent from the A port of device 1 and received at the H port of device 1. The first loopback detection message is enabled on device 1, and the sending unit, receiving unit, decision-making and execution unit of the first loopback detection message are all on device 1. Devices 2, 3, and 4 are all deployed with intermediate units for loop processing of the first loopback detection message.
[0076] After device 1 constructs the first loopback detection message, the sending unit adds the first forwarding information related to the device, such as the IP of device 1, the forwarding domain information where the current first loopback detection message is located, the outbound interface information, and the Active duration of the outbound interface, and then sends it out from interface A. The message format of the updated first message sent by interface A is shown in Table 1 below.
[0077] Table 1
[0078] The first loopback detection message constructed by device 1 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the outbound interface A of device 1. The duration of the first loopback detection message being active on the outbound interface A of device 1
[0079] After device 2 receives the first loopback detection message sent by device 1 from interface B, it is marked with the IP of device 2, the forwarding domain information where the current first loopback detection message is located, the input interface information, the active duration of the input interface, the output interface information and the active duration of the output interface, and other device-related second forwarding information, and then sent out from interface C. The format of the updated first message sent by interface C is shown in Table 2.
[0080] Table 2
[0081] The first loopback detection message constructed by device 1 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the outbound interface A of device 1. The duration of the first loopback detection message being active on the outbound interface A of device 1 Device 2's IP Forwarding domain of device 2 The first loopback detection message is sent on the inbound interface B of device 2. The duration of the first loopback detection message being active on the outbound interface B of device 2 The first loopback detection message is sent on the outbound interface C of device 2. The active duration of the first loopback detection message on the outbound interface C of device 2
[0082] After device 3 receives the first loopback detection message sent by device 1 from interface D, it is marked with the IP of device 3, the forwarding domain information where the current first loopback detection message is located, the input interface information, the active duration of the input interface, the output interface information and the active duration of the output interface, and other device-related second forwarding information, and then sent out from interface F. The message format of the updated first message sent by interface F is shown in Table 3.
[0083] Table 3
[0084] The first loopback detection message constructed by device 1 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the outbound interface A of device 1. The duration of the first loopback detection message being active on the outbound interface A of device 1 Device 2's IP Forwarding domain of device 2 The first loopback detection message is sent on the inbound interface B of device 2. The duration of the first loopback detection message being active on the outbound interface B of device 2 The first loopback detection message is sent on the outbound interface C of device 2. The active duration of the first loopback detection message on the outbound interface C of device 2 IP of device 3 Forwarding domain of device 3 The first loopback detection message is sent on the inbound interface D of device 3. The duration of the first loopback detection message being active on the outbound interface D of device 3 The first loopback detection message is sent on the outbound interface E of device 3. The duration of the first loopback detection message being active on the outbound interface E of device 3
[0085] After device 4 receives the first loopback detection message sent by device 1 from interface F, it is marked with the IP of device 4, the forwarding domain information where the current first loopback detection message is located, the input interface information, the active duration of the input interface, the output interface information and the active duration of the output interface, and other device-related second forwarding information, and then sent out from interface G. The format of the updated first loopback detection message sent by interface G is shown in Table 4.
[0086] Table 4
[0087] The first loopback detection message constructed by device 1 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the outbound interface A of device 1. The duration of the first loopback detection message being active on the outbound interface A of device 1 IP of device 2 Forwarding domain of device 2 The first loopback detection message is sent on the inbound interface B of device 2. The duration of the first loopback detection message being active on the outbound interface B of device 2 The first loopback detection message is sent on the outbound interface C of device 2. The active duration of the first loopback detection message on the outbound interface C of device 2 IP of device 3 Forwarding domain of device 3 The first loopback detection message is sent on the inbound interface D of device 3. The duration of the first loopback detection message being active on the outbound interface D of device 3 The first loopback detection message is sent on the outbound interface E of device 3. The duration of the first loopback detection message being active on the outbound interface E of device 3 IP of device 4 Forwarding domain of device 4 The first loopback detection message is sent to the inbound interface F of device 4. The duration of the first loopback detection message being active on the outbound interface F of device 4 The first loopback detection message is sent on the outbound interface G of device 4. The duration of the first loopback detection message being active on the outbound interface G of device 4
[0088] After device 1 receives the first loopback detection message sent by the device from interface H, it adds the second forwarding information related to the device, such as the IP of device 1, the forwarding domain information where the current first loopback detection message is located, the input interface information and the Active time of the input interface, and then generates a second loopback detection message and sends the second loopback detection message to the decision & execution unit. The format of the second loopback detection message sent to the decision & execution unit is shown in Table 5.
[0089] Table 5
[0090] The first loopback detection message constructed by device 1 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the outbound interface A of device 1. The duration of the first loopback detection message being active on the outbound interface A of device 1 Device 2's IP Forwarding domain of device 2 The first loopback detection message is sent on the inbound interface B of device 2. The duration of the first loopback detection message being active on the outbound interface B of device 2 The first loopback detection message is sent on the outbound interface C of device 2. The active duration of the first loopback detection message on the outbound interface C of device 2 IP of device 3 Forwarding domain of device 3 The first loopback detection message is sent on the inbound interface D of device 3. The duration of the first loopback detection message being active on the outbound interface D of device 3 The first loopback detection message is sent on the outbound interface E of device 3. The duration of the first loopback detection message being active on the outbound interface E of device 3 IP of device 4 Forwarding domain of device 4 The first loopback detection message is sent to the inbound interface F of device 4. The duration of the first loopback detection message being active on the outbound interface F of device 4 The first loopback detection message is sent on the outbound interface G of device 4. The duration of the first loopback detection message being active on the outbound interface G of device 4 IP of device 1 Forwarding domain of device 1 The first loopback detection message is sent on the inbound interface H of device 1. The active duration of the first loopback detection message on the inbound interface H of device 1
[0091] After confirming that a network loop occurs based on the received second loopback detection message, the decision and execution unit determines the device interface or path that may cause the network loop by comparing the interface Active duration recorded in the second loopback detection message. At the same time, the device forwarding path information recorded in the second loopback detection message is saved for query by network maintenance personnel.
[0092] It should be noted that, by utilizing the above-mentioned method to loop back and transmit the first loopback detection message in the network where the loop occurs, and finally transmitting the first forwarding information and the second forwarding information carried in the first loopback detection message back to the source device, the target device of the loop occurring in the current network is determined according to the duration of the interface Active duration included in the first forwarding information and the second forwarding information, thereby realizing the detection of the network loop location. Secondly, the interface UP time used in the related technology is replaced by the interface Active duration, thereby avoiding the situation where the calculation is not accurate enough due to the use of a single moment.
[0093] Optionally, the above-mentioned interface Active duration is the duration that the device interface is continuously in the state of forwarding business messages as of the current time point. If the device interface is not in the state of forwarding business messages at the current time point, the Active duration of the device interface is 0. That is, by counting the forwarding duration of the outbound interface and the inbound interface of different devices in forwarding the first loopback detection message, the device corresponding to the abnormal loopback forwarding point can be located. In actual use, the change content that needs to be displayed in the network management interface can be determined by judging the interface Active duration. Through the change content, the network management object can intuitively see which device or which interface or which path in the network may have caused the network loop. In combination with the first forwarding information and the second forwarding information in the second loopback detection message, the specific device and interface information that caused the network loop can be intuitively queried.
[0094] As an optional implementation, in actual applications, by deploying a loopback detection function, combined with the application in the optional embodiment of the present application, when a loop occurs in the network, the first forwarding information and the second forwarding information recorded in the second loopback detection message can be used to directly locate the location of the interface or link that may cause the network loop. Furthermore, when no loop occurs in the network, by deploying a receiving unit and a decision-making and execution unit in an intermediate device (no longer deploying an intermediate unit), all forwarding paths from the source device that sends the loopback detection message to the destination device (i.e., the source device) that receives the updated first loopback detection message can be queried based on the first forwarding information and the second forwarding information recorded in the second loopback detection message.
[0095] In summary, through the above-mentioned implementation methods, compared with the prior art, the optional implementation methods of the present application can quickly find the exact location of the interface or link that causes the loop in the network, thereby providing direct help for fundamentally solving the loop problem in the network or optimizing the current loop problem from the network optimization level.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory (ROM / RAM), a disk, or an optical disk), and may include a number of instructions to enable a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0097] Example 2
[0098] In this embodiment, a network loop position detection system is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0099] Figure 6 is a schematic diagram of the structure of a network loop location detection system according to an embodiment of the present application, such as Figure 6 As shown, the system may include:
[0100] The source device 62 is used to generate a first loopback detection message in response to the start of the loopback detection operation, and send the first loopback detection message to the forwarding device in the target network; and receive the updated first loopback detection message, and add the first forwarding information corresponding to the input port of the source device in the updated first loopback detection message to generate a second loopback detection message, and detect the network loop position of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to the output port of the source device; the forwarding device is used to indicate the devices other than the source device in the target network;
[0101] The forwarding device 64 is used to receive a first loopback detection message in response to the start of a loopback detection operation, update the first loopback detection message through the second forwarding information corresponding to the current forwarding device, and obtain an updated first loopback detection message; and forward the updated first loopback detection message to the device in the target network, so that the other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device.
[0102] Through the above-mentioned system, the source device generates a first loopback detection message in response to the start of the loopback detection operation, sends the first loopback detection message to the forwarding device in the target network, receives the updated first loopback detection message, and adds the first forwarding information corresponding to the input port of the source device in the first loopback detection message to generate a second loopback detection message, and detects the network loop position of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to the output port of the source device; the forwarding device is used to indicate the devices in the target network other than the source device, and the forwarding device receives the first loopback detection message and updates the first loopback detection message using the second forwarding information corresponding to the current forwarding device to obtain the updated first loopback detection message; The updated first loopback detection message is forwarded to the device in the target network, so that the other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device, and the source device adds the first forwarding information corresponding to the input port of the source device in the received updated first loopback detection message to generate a second loopback detection message; the second loopback detection message is used to detect the network loop position of the target network, thereby realizing the detection of the network loop position of multiple devices under the target network through the updated forwarding information in the loopback detection message, solving the problem that the solution for confirming the loop in the network is not intuitive enough and the specific device and interface information of the network loop cannot be determined, thereby achieving the effect of quickly finding the exact location of the interface or link that causes the loop in the network, thereby improving the optimization efficiency of network optimization.
[0103] In an exemplary embodiment, the above-mentioned source device 62 is also used to parse and process the second loopback detection message to determine the first forwarding information and the second forwarding information; wherein the first forwarding information at least includes: the service forwarding duration of the source device, and the second forwarding information at least includes: the service forwarding duration of each of the forwarding devices; the device with the shortest service forwarding duration is determined as the target forwarding device; and the network loop position of the target network is detected based on the target forwarding device.
[0104] In an exemplary embodiment, the service forwarding duration is used to indicate the time difference between the forwarding time when the corresponding port of the current device was last engaged in service forwarding and the current time, wherein the current time is the time when the corresponding port of the current device forwards the first loopback detection message, the corresponding port is an input port or an output port, and the forwarding state of the corresponding port does not change between the forwarding time and the current time.
[0105] In an exemplary embodiment, the above-mentioned source device 62 is also used to query the first moment when the historical alarm operation or alarm information corresponding to the target forwarding device is generated, and the second moment when the target network generates a loopback alarm; when the first moment is consistent with the second moment, the port of the target forwarding device with the shortest service forwarding time is determined as the loopback fault location, wherein the first moment is consistent with the second moment in time means that the time difference between the first moment and the second moment is less than or equal to the preset time difference.
[0106] In an exemplary embodiment, the above-mentioned source device 62 also includes: a path unit, which is used to parse and process the second loopback detection message, determine the first forwarding information and the second forwarding information, and then determine the message transmission path existing in the target network; determine the first service forwarding duration corresponding to the input port of each target forwarding device passed by the message transmission path and the second service forwarding duration corresponding to the output port of each target forwarding device; determine the total forwarding duration corresponding to the message transmission path based on the first service forwarding duration and the second service forwarding duration; determine the message transmission path with the shortest total forwarding time as the target path, wherein the target path is used to indicate that the message transmission path is the message transmission path where the loopback fault occurs in the target network.
[0107] In an exemplary embodiment, the above-mentioned source device 62 is also used to send the detection result to the network management object to instruct the network management object to perform network maintenance on the target network based on the detection result, wherein the detection result is used to indicate the forwarding information of the corresponding port causing the loopback fault in the target network or the message transmission path where the loopback fault is located.
[0108] In an exemplary embodiment, the first forwarding information also includes: device information of the source device and domain information of the forwarding domain where the source device is located; the second forwarding information also includes: device information of the forwarding device in the target network and domain information of the forwarding domain where the forwarding device is located, the input port information of the first loopback detection message obtained by the forwarding device, and the output port information of the updated first loopback detection message forwarded by the forwarding device.
[0109] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0110] To facilitate the understanding of the technical solution provided by the present application, a detailed explanation will be given below in combination with embodiments of specific scenarios.
[0111] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0112] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0113] An embodiment of the present application further provides an electronic device, which may include a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0114] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0115] S1, in response to the start of the loopback detection operation, generating a first loopback detection message, wherein the first loopback detection message carries first forwarding information corresponding to the egress port of the source device;
[0116] S2, sending the first loopback detection message to a forwarding device in the target network, wherein the forwarding device is used to indicate a device other than the source device in the target network, and the first loopback detection message is updated by adding second forwarding information corresponding to the forwarding device;
[0117] S3, receiving the updated first loopback detection message, and adding the first forwarding information corresponding to the inbound port of the source device to the first loopback detection message to generate a second loopback detection message;
[0118] S4: Detect a network loop location of the target network based on the second loopback detection message.
[0119] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit 801, various functions provided by the embodiments of the present application are executed. The above serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0120] Figure 7 The computer system structure block diagram of the electronic device used to implement the embodiment of the present application is schematically shown. Figure 7 As shown, the computer system 800 includes a central processing unit 801 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 802 (ROM) or the program loaded from the storage part 808 to the random access memory 803 (RAM). Various programs and data required for system operation are also stored in the random access memory 803. The central processing unit 801, the read-only memory 802 and the random access memory 803 are connected to each other through a bus 804. The input / output interface 805 (Input / Output interface, i.e., I / O interface) is also connected to the bus 804.
[0121] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0122] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processor 801, various functions defined in the system of the present application are executed.
[0123] It should be noted that Figure 7 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0124] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0125] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0126] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting a network loop position, characterized in that: Applicable to source devices in the target network, including: In response to the initiation of the loopback detection operation, a first loopback detection message is generated, wherein the first loopback detection message carries first forwarding information corresponding to the egress port of the source device; Sending the first loopback detection message to a forwarding device in the target network, wherein the forwarding device is used to indicate a device other than the source device in the target network, and the first loopback detection message is updated by adding second forwarding information corresponding to the forwarding device; receiving the updated first loopback detection message, and adding first forwarding information corresponding to the ingress port of the source device to the first loopback detection message to generate a second loopback detection message; A network loop location is detected on the target network based on the second loopback detection message.
2. The method according to claim 1, characterized in that Detecting a network loop position of the target network based on the second loopback detection message includes: Parsing the second loopback detection message to determine the first forwarding information and the second forwarding information; wherein the first forwarding information at least includes: the service forwarding duration of the source device, and the second forwarding information at least includes: the service forwarding duration of each of the forwarding devices; Determine the device with the shortest service forwarding time as the target forwarding device; A network loop location is detected on the target network based on the target forwarding device.
3. The method according to claim 2, characterized in that The service forwarding duration is used to indicate the time difference between the forwarding time when the corresponding port of the current device was last used for service forwarding and the current time, wherein the current time is the time when the corresponding port of the current device forwards the first loopback detection message, the corresponding port is an input port or an output port, and the forwarding state of the corresponding port does not change between the forwarding time and the current time.
4. The method according to claim 2, characterized in that: Detecting a network loop location of the target network based on the target forwarding device includes: Query the first time when the historical alarm operation or alarm information corresponding to the target forwarding device is generated, and the second time when the target network generates a loopback alarm; When the first moment is consistent with the second moment, the port of the target forwarding device with the shortest service forwarding time is determined as the loopback fault location, wherein the first moment is consistent with the second moment means that the time difference between the first moment and the second moment is less than or equal to the preset time difference.
5. The method according to claim 2, characterized in that: After parsing the second loopback detection message to determine the first forwarding information and the second forwarding information, the method further includes: Determining a message transmission path existing in the target network; Determine a first service forwarding duration corresponding to an ingress port of each target forwarding device through which the message transmission path passes and a second service forwarding duration corresponding to an egress port of each target forwarding device; Determine a total forwarding duration corresponding to the message transmission path based on the first service forwarding duration and the second service forwarding duration; The message transmission path with the shortest total forwarding time is determined as the target path, wherein the target path is used to indicate that the message transmission path is the message transmission path at the location where the loopback fault occurs in the target network.
6. The method according to claim 1, characterized in that After detecting the network loop location of the target network based on the second loopback detection message, the method further includes: The detection result is sent to the network management object to instruct the network management object to perform network maintenance on the target network based on the detection result, wherein the detection result is used to indicate the forwarding information of the corresponding port causing the loopback fault in the target network or the message transmission path where the loopback fault is located.
7. The method according to claim 1, characterized in that The first forwarding information also includes: device information of the source device and domain information of the forwarding domain where the source device is located; The second forwarding information also includes: device information of the forwarding device in the target network, domain information of the forwarding domain where the forwarding device is located, input port information of the first loopback detection message obtained by the forwarding device, and output port information of the updated first loopback detection message forwarded by the forwarding device.
8. A method for detecting a network loop position, characterized in that: Applicable to other forwarding devices in the target network except the source device, including: In response to the start of the loopback detection operation, receiving a first loopback detection message, wherein the first loopback detection message is a message generated by the source device in response to the start of the loopback detection operation and carries first forwarding information corresponding to the egress port of the source device; The first loopback detection message is updated by using the second forwarding information corresponding to the current forwarding device to obtain an updated first loopback detection message; Forwarding the updated first loopback detection message to the device in the target network, so that other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device, and the source device can add the first forwarding information corresponding to the inbound port of the source device to generate a second loopback detection message in the received updated first loopback detection message; The second loopback detection message carries second forwarding information corresponding to all forwarding devices in the target network that forward the first loopback detection message, and the second loopback detection message is used to instruct the source device to detect the network loop location of the target network.
9. A network loop location detection system, characterized in that: include: A source device, configured to generate a first loopback detection message in response to initiation of a loopback detection operation, and send the first loopback detection message to a forwarding device in a target network; and receiving the updated first loopback detection message, and adding the first forwarding information corresponding to the input port of the source device to the updated first loopback detection message to generate a second loopback detection message, and detecting the network loop position of the target network based on the second loopback detection message, wherein the first loopback detection message carries the first forwarding information corresponding to the output port of the source device; the forwarding device is used to indicate devices other than the source device in the target network; A forwarding device, used to respond to the initiation of a loopback detection operation, receive a first loopback detection message, update the first loopback detection message through second forwarding information corresponding to the current forwarding device, and obtain an updated first loopback detection message; and forward the updated first loopback detection message to the device in the target network, so that other devices can update the first loopback detection message through the forwarding information corresponding to the current forwarding device.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 8 when executed by a processor.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Network loop position detection method and system, and storage medium and electronic device
EP4718808A1
Network loop position detection method and system, and storage medium and electronic device
WO2025001255A1
