Routing loop detection method and system, electronic equipment and storage medium

Through message interaction and security key verification between routers, loop risks between policy routing and static routing are automatically identified and resolved, ensuring network stability and solving loop problems caused by manual configuration errors.

CN118612142APending Publication Date: 2024-09-06太保科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410727606.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

When using policy routing and static routing, when configuring blackhole routing to prevent loop risks, there is a problem that human errors lead to loops not being fully guaranteed. In particular, mismatches and omissions are prone to occur between routers managed by different personnel.

Method used

Through packet exchange between routers, the pre-configured local routing table and neighbor configuration table are used to detect loops, generate packets and send them to neighboring routers, automatically identify loop risks, and establish communication connections through security key verification to increase transmission Security, trigger alarms or adjust routing chains to ensure network stability.

Benefits of technology

It realizes automatic loop risk identification of the routing system, increases transmission security, ensures stable operation of the network, and avoids loop problems caused by not configuring correct black hole routing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612142A
    Figure CN118612142A
Patent Text Reader

Abstract

The invention provides a routing loop detection method and system, electronic equipment and a storage medium, and the method comprises the steps: receiving a first message from a neighbor router, carrying out the loop detection of a routing chain passing through the router according to a pre-configured local routing table and the first message, obtaining a loop detection result, generating a second message according to the loop detection result, and sending the second message to the neighbor router. And sending the second message to the neighbor router, so that the neighbor router determines a loop detection result. Based on the above mode, the method enables the routing system to automatically recognize the loop risk through the message interaction between the routers. A security key is configured between the routers, so that the transmission security is improved; when a correct black hole route is not configured for the strategy route and the static route, the route is smooth by alarming and / or adjusting the on-off of a corresponding route chain, so that the stable operation of the network can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the technical field of routing loop prevention, and in particular to a routing loop detection method, system, electronic equipment and storage medium. Background Art

[0002] When using policy routing and static routing to adapt to business scenarios, non-32-bit host routes (such as the summary route of a network segment) are often configured. At this time, it is necessary to configure a black hole route at the next hop pointed to by this host route to prevent loops, otherwise loop risks are likely to occur. However, the configuration of black hole routes needs to be done manually, which is full of uncertainty. Especially when the two routers to be configured are managed by different people, it is particularly easy to mismatch or miss, resulting in the inability to fully guarantee routing loop prevention. Summary of the invention

[0003] The object of the present invention is to provide a routing loop detection method, system, electronic device and storage medium, which are used to enable a routing system to automatically identify loop risks and avoid routing failures through message interaction between routers.

[0004] To achieve the above-mentioned purpose, in a first aspect, the present invention provides a routing loop detection method, comprising: receiving a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to the identifier of the next router pointed to by the corresponding neighbor routing prefix; performing loop detection on a routing chain passing through the router according to a pre-configured local routing table and the first message to obtain a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to the identifier of the next router pointed to by the corresponding local routing prefix; generating a second message according to the loop detection result, and sending the second message to the neighbor router so that the neighbor router determines the loop detection result.

[0005] In an optional implementation, before receiving the first message from the neighbor router, it also includes: receiving a neighbor communication request carrying a security key, wherein the neighbor communication request is used to establish a communication connection with the neighbor router; verifying the security key, and establishing a communication connection with the neighbor router if the security key verification passes.

[0006] In an optional implementation, the loop detection of the routing chain passing through the current router according to the pre-configured local routing table and the first message includes: comparing each received neighbor routing prefix with each local routing prefix respectively; wherein: if the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free; if the local routing prefix contains or is equal to the neighbor routing prefix, and the corresponding local successor identifier points to the neighbor router, it is determined that the corresponding routing chain has a loop; if the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is not empty and points to the next router, it is determined that the corresponding routing chain is pending; if the local routing prefix is ​​contained in the neighbor routing prefix, and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free, and the local routing table is continuously monitored.

[0007] In an optional implementation, after determining that the corresponding routing chain is pending, the method further includes: sending a third message to the next router, wherein the third message includes an identifier of the router and the local routing table.

[0008] In an optional implementation, the continuous monitoring of the local routing table includes: when a new configuration entry is monitored to appear in the local routing table, performing the following operations: determining a new routing prefix and a new successor identifier in the new configuration entry; wherein: if the new successor identifier is empty, no processing is performed; if the new successor identifier points to the neighboring router, it is determined that the corresponding routing chain has a loop, and the loop status information and the new configuration entry are sent to the neighboring router; if the new successor identifier points to the next router, it is determined that the corresponding routing chain is pending, and the new configuration entry is sent to the next router.

[0009] In an optional implementation, after sending the newly added configuration entry to the next router, it also includes: upon receiving loop-free status information from the next router, determining that the routing chain is loop-free, and sending the loop-free status information to the neighboring router; upon receiving loop status information from the next router, determining that the routing chain is looped, triggering an alarm according to preset rules, and sending the loop status information to the neighboring router.

[0010] In an optional implementation, triggering an alarm according to a preset rule includes any one of the following: no alarm; blocking the routing chain to take effect and triggering an alarm at the same time; not blocking the routing chain to take effect and triggering an alarm at the same time.

[0011] In a second aspect, the present application provides a routing loop detection device, which is applied to a router, including: a receiving module, which is used to receive a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to the identifier of the next router pointed to by the corresponding neighbor routing prefix; a detection module, which is used to perform loop detection on a routing chain passing through the router according to a pre-configured local routing table and the first message to obtain a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to the identifier of the next router pointed to by the corresponding local routing prefix; a transmission module, which is used to generate a second message according to the loop detection result, and send the second message to the neighbor router so that the neighbor router determines the loop detection result.

[0012] In a third aspect, the present application provides a routing system, comprising at least two routers, each of which is configured to execute any of the methods described in the first aspect above.

[0013] In a fourth aspect, the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores instructions, and when the instructions are called by the processor, the processor executes any method described in the first aspect above.

[0014] Compared with the prior art, the advantages of this application are:

[0015] The present application provides a routing loop detection method, system, electronic device and storage medium. Through message interaction between routers, the routing system can automatically identify loop risks; by configuring security keys between routers, transmission security is increased; when incorrect black hole routing is configured when configuring policy routing and static routing, the routing is unblocked by issuing alarms and / or adjusting the on / off of corresponding routing chains, thereby ensuring stable operation of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are included to provide a further understanding of the present application. They are included and constitute a part of the present application. The accompanying drawings illustrate embodiments of the present application and together with the present specification serve to explain the principles of the present application. In the accompanying drawings:

[0017] Figure 1 is a schematic diagram of a routing system exemplarily provided in the present application;

[0018] Figure 2 is a flow chart of a routing loop detection method exemplarily provided by the present application;

[0019] Figure 3 It is a schematic diagram of a judgment logic for loop detection provided by way of example in the present application.

[0020] Figure 4 It is a schematic diagram of continuously monitoring a local routing table provided by the present application as an example;

[0021] Figure 5 is a schematic diagram of a routing loop detection device exemplarily provided by the present application;

[0022] Figure 6 This is a schematic diagram of an electronic device provided as an example in this application. DETAILED DESCRIPTION

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.

[0024] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0025] refer to Figure 1 , a routing loop detection method provided by the present application can be executed by a router. The router can refer to any router in the routing system. When using policy routing and static routing, a designated router can be used as a starting node to execute the above method to determine whether there is a loop in the topology of the routing system. Exemplarily, the routing system includes n routers, referred to as R1 to Rn, and R1 is used as the starting node for the following description. Figure 2 , for R1, the specific implementation steps of the above routing detection method include:

[0026] S1, receiving a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to an identifier of a next router pointed to by the corresponding neighbor routing prefix.

[0027] Specifically, refer to Figure 1 , for R1, it can be the neighbor router of R2, R3, R5 or R6. The following is an explanation using R2 as an example. In routing loop detection, the above n routers can enable the policy routing and static routing automatic loop identification functions to indicate that the corresponding routers need to participate in loop detection. Each router is configured with a unique identifier, which can be the interface address of the router, or the selected maximum IP interface address, without restriction.

[0028] In some embodiments, before step S1, it also includes receiving a neighbor communication request carrying a security key, wherein the neighbor communication request is used to establish a communication connection with a neighbor router; verifying the security key, and establishing a communication connection with the neighbor router if the security key verification passes. If the security key verification fails, inform the relevant personnel that the neighbor router is not trustworthy. Exemplarily, when R2 receives a neighbor communication request carrying a security key from R1, R2 verifies the security key, thereby establishing a trusted communication connection between R1 and R2, eliminating abnormal routers in the routing system, and helping to increase transmission security.

[0029] After R1 and R2 successfully establish a communication connection, R2 receives a first message from R1, which includes R1's neighbor configuration table (denoted as P1). Optionally, the first message also includes a unique identifier of an adjacent router, such as R1's unique identifier, so that R2 can identify R1. Specifically, P1 includes at least one neighbor configuration entry, each of which includes a corresponding neighbor routing prefix and a neighbor successor identifier, wherein the neighbor successor identifier refers to the identifier of the next router pointed to by the corresponding neighbor routing prefix. Exemplarily, referring to Table 1, it is assumed that R2 receives two neighbor configuration entries from R1, namely, entry R1-a and entry R1-b, and their specific contents are as follows:

[0030] Neighbor Configuration Entries Item R1-a Item R1-b Neighbor Routing Prefix 10.1.0.0 / 16 10.2.0.0 / 16 Neighbor Successor Identifier R2 R2

[0031] Table 1

[0032] S2, performing loop detection on the routing chain passing through the router according to the pre-configured local routing table and the first message, and obtaining a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to the identifier of the next router pointed to by the corresponding local routing prefix.

[0033] S3, generating a second message according to the loop detection result, and sending the second message to a neighboring router, so that the neighboring router determines the loop detection result.

[0034] After R2 receives the first message, it compares the local routing table pre-configured by static routing and policy routing with the neighbor routing table, that is, for each neighbor routing prefix received, it compares it with each local routing prefix, and triggers loop detection on the routing chain passing through R2 through the comparison result to obtain the loop detection result. Specifically, refer to Figure 3 , including the following judgment logic:

[0035] 2.1: If the local routing prefix contains or is equal to the neighbor routing prefix, and the local subsequent identifier is empty, it is determined that the corresponding routing chain is loop-free.

[0036] Exemplarily, if the local routing prefix on R2 includes or is equal to the neighbor routing prefix from R1, and the local subsequent identifier is null0, it is determined that the routing chain passing through R1 and R2 is loop-free.

[0037] 2.2: If the local routing prefix contains or is equal to the neighbor routing prefix, and the corresponding local successor identifier points to the neighbor router, it is determined that the corresponding routing chain has a loop.

[0038] Exemplarily, if the local routing prefix on R2 includes or is equal to the neighbor routing prefix from R1, and the local subsequent identifier points to R1, it is determined that the routing chain passing through R1 and R2 has a loop.

[0039] 2.3: If the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is not empty and points to the next router, then the corresponding routing chain is determined to be pending.

[0040] Exemplarily, if the local routing prefix on R2 includes or is equal to the neighbor routing prefix from R1, and the local subsequent identifier points to the next router R3, it is determined that the loop state of the routing chain passing through R1, R2, and R3 is pending.

[0041] In some embodiments, if R2 determines that the corresponding routing chain is pending, R2 may send a third message to the next router (ie, R3), wherein the third message includes an identifier of the router (ie, R2) and a local routing table.

[0042] It is understandable that when the third message passes through R3, R3 can also execute the above judgment logic. If it is still determined that the corresponding routing chain is pending, a new message can still be sent to the next router, so that the message can be transmitted in the corresponding routing chain until it is determined on the end router whether the routing chain has a loop / no loop, and the message transmission is completed.

[0043] In general, the end router can be judged by whether there is a directly connected router or whether there is a next router, and there is no restriction on this.

[0044] 2.4: If the local routing prefix is ​​included in the neighbor routing prefix and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free and the local routing table is continuously monitored.

[0045] Exemplarily, if the local routing prefix on R2 is included in the neighbor routing prefix from R1, and the local subsequent identifier is null0, it is determined that the routing chain passing through R1 and R2 is loop-free, and the local routing table of R1 is continuously monitored.

[0046] In some embodiments, reference Figure 4 , a monitor is used to continuously monitor the local routing table, including determining the newly added routing prefix and the newly added successor identifier in the newly added configuration entry when a new configuration entry is detected in the local routing table. Taking Rn as an example, the newly added routing prefix contains or is equal to the difference set of the local routing prefix and the neighbor routing prefix. For the newly added successor identifier, the following judgment logic is executed:

[0047] 2.4.1: If the newly added successor flag is empty, it will not be processed.

[0048] For example, if the newly added successor identifier is null0, it is not processed.

[0049] 2.4.2: If the newly added successor identifier points to a neighbor router, it is determined that the corresponding routing chain has a loop, and the loop status information and the newly added configuration entry are sent to the neighbor router.

[0050] Exemplarily, if the newly added successor identifier points to R1, it is determined that the routing chain passing through R1 and R2 has a loop, and the loop state information and the newly added configuration entry are sent to R1 to inform R1 that the routing chain has a loop.

[0051] 2.4.3: If the newly added successor identifier points to the next router, the corresponding routing chain is determined to be pending, and the newly added configuration entry is sent to the next router.

[0052] Exemplarily, if the newly added successor identifier points to R3, it is determined that the loop state of the routing chain passing through R1, R2, and R3 is pending, and the newly added configuration entry is sent to R3.

[0053] Similarly, when the newly added configuration entry passes through R3, R3 can also execute the above judgment logic. If it is still determined that the corresponding routing chain is pending, the newly added configuration entry can still be sent to the next router. In this way, the newly added configuration entry can be transmitted in the corresponding routing chain until it is determined on the end router that the routing chain has a loop / no loop, and the transmission is considered to be completed.

[0054] In some embodiments, after sending the newly added configuration entry to the next router, it also includes: when receiving loop-free status information from the next router, determining that the routing chain is loop-free, and sending loop-free status information to the neighboring router; when receiving loop status information from the next router, determining that the routing chain is looped, triggering an alarm according to preset rules, and sending loop status information to the neighboring router.

[0055] Exemplarily, when the end router determines that the corresponding routing chain is loop-free, it sends loop-free status information to the previous router. The loop-free status information is transmitted in sequence through all routers on the routing chain, and the routing status is changed to loop-free each time it is transmitted, until R3 transmits the loop-free status information to R2, and R2 transmits the loop-free status information to R1. Then, the routing status of each router on the routing chain is confirmed to be loop-free, and the current routing chain detection is completed.

[0056] For another example, when the end router determines that the corresponding routing chain has a loop, it sends loop status information to the previous router. The loop status information is transmitted in sequence through all routers on the routing chain, and the routing status is changed to a loop each time it is transmitted, until R3 transmits the loop status information to R2, and R2 transmits the loop status information to R1. At the same time, an alarm can be triggered according to the preset rules, and R1 changes the routing status to a loop. At the same time, relevant personnel can troubleshoot the detected loop according to the alarm.

[0057] In some embodiments, triggering an alarm according to a preset rule includes any of the following: no alarm; blocking the routing chain to take effect and triggering an alarm at the same time; not blocking the routing chain to take effect and triggering an alarm at the same time.

[0058] It is understandable that in actual situations, these processing behaviors can be flexibly set for policy routing and static routing in different routing states, making loop detection more flexible and controllable. At the same time, these processing behaviors will not affect the normal transmission of messages in the routing system, nor will they affect other routers. Therefore, the routing can be unblocked by issuing alarms and / or adjusting the connection and disconnection of the corresponding routing chain, thereby ensuring the stable operation of the network.

[0059] Further, refer to Figure 5 The present application provides a routing loop detection device, which is applied to a router, and includes a receiving module 501, a detection module 502 and a transmission module 501, wherein:

[0060] The receiving module 501 is used to receive a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to the identifier of the next router pointed to by the corresponding neighbor routing prefix.

[0061] The detection module 502 is used to perform loop detection on the routing chain passing through the router according to the local routing table configured by the static policy and the first message to obtain a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to the identifier of the next router pointed to by the corresponding local routing prefix.

[0062] The transmission module 503 is used to generate a second message according to the loop detection result, and send the second message to the neighbor router so that the neighbor router determines the loop detection result.

[0063] In an optional implementation, before receiving the first message from the neighbor router, the receiving module 501 is further used to: receive a neighbor communication request carrying a security key, wherein the neighbor communication request is used to establish a communication connection with the neighbor router; verify the security key, and establish a communication connection with the neighbor router if the security key verification passes.

[0064] In an optional implementation, a loop detection is performed on the routing chain passing through the current router according to a pre-configured local routing table and a first message, and the detection module 502 is used to: compare each received neighbor routing prefix with each local routing prefix respectively; wherein: if the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free; if the local routing prefix contains or is equal to the neighbor routing prefix, and the corresponding local successor identifier points to the neighbor router, it is determined that the corresponding routing chain has a loop; if the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is not empty and points to the next router, it is determined that the corresponding routing chain is pending; if the local routing prefix is ​​contained in the neighbor routing prefix, and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free, and the local routing table is continuously monitored.

[0065] In an optional implementation, after determining that the corresponding routing chain is pending, the detection module 502 is used to: send a third message to the next router, wherein the third message includes the identifier of the router and the local routing table.

[0066] In an optional implementation, the local routing table is continuously monitored, and the detection module 502 is used to: when a new configuration entry is detected in the local routing table, perform the following operations: determine the new routing prefix and the new successor identifier in the new configuration entry; wherein: if the new successor identifier is empty, no processing is performed; if the new successor identifier points to a neighboring router, it is determined that the corresponding routing chain has a loop, and the loop status information and the new configuration entry are sent to the neighboring router; if the new successor identifier points to the next router, it is determined that the corresponding routing chain is pending, and the new configuration entry is sent to the next router.

[0067] In an optional implementation, after sending the newly added configuration entry to the next router, the detection module 502 is also used to: upon receiving loop-free status information from the next router, determine that the routing chain is loop-free, and send the loop-free status information to the neighboring router; upon receiving loop status information from the next router, determine that the routing chain is looped, trigger an alarm according to preset rules, and send loop status information to the neighboring router.

[0068] In an optional implementation, triggering an alarm according to a preset rule includes any of the following: no alarm; blocking the routing chain to take effect and triggering an alarm at the same time; not blocking the routing chain to take effect and triggering an alarm at the same time.

[0069] Furthermore, the present application provides a routing system, which may be, for example, Figure 1 The routing system shown includes at least two routers, each of which is configured to execute the routing loop detection method as described above.

[0070] Further, if Figure 6 The exemplary embodiment of the present application further provides an electronic device, including a memory 601 and a processor 602, wherein the memory 601 stores instructions, and when the instructions are executed by the processor 602, the processor 602 executes the above-mentioned routing loop detection method.

[0071] It should be understood that the processor mentioned in the embodiments of the present application may be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0072] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory, dynamic random access memory, synchronous dynamic random access memory, double data rate synchronous dynamic random access memory, enhanced synchronous dynamic random access memory, synchronously connected dynamic random access memory, and direct memory bus random access memory.

[0073] The present application also provides a storage medium storing computer program instructions, which, when executed by a processor of a computer, enables the computer to execute the steps of any of the methods mentioned above.

[0074] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.

[0075] The basic concepts have been described above. Obviously, for those skilled in the art, the above invention disclosure is only used as an example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the exemplary embodiments of the present application.

[0076] At the same time, the present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.

[0077] Some aspects of the present application may be performed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The above hardware or software may be referred to as "data blocks", "modules", "engines", "units", "components" or "systems". The processor may be one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. In addition, various aspects of the present application may be expressed as computer products located in one or more computer-readable media, which include computer-readable program codes. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, tapes ...), optical disks (e.g., compact disks CDs, digital versatile disks DVDs ...), smart cards, and flash memory devices (e.g., cards, sticks, key drives ...).

[0078] A computer-readable medium may include a propagated data signal containing computer program code, such as in baseband or as part of a carrier wave. The propagated signal may have a variety of manifestations, including electromagnetic, optical, etc., or a suitable combination. A computer-readable medium may be any computer-readable medium other than a computer-readable storage medium, which may be connected to an instruction execution system, device or apparatus to communicate, propagate or transmit a program for use. The program code on the computer-readable medium may be propagated via any suitable medium, including radio, cable, fiber optic cable, radio frequency signal, or similar medium, or any combination of the above mediums.

[0079] Similarly, it should be noted that in order to simplify the description of the disclosure of this application and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this application, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the object of this application are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.

[0080] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of the present application are approximate values, in specific embodiments, the setting of such numerical values ​​is as accurate as possible within the feasible range.

[0081] Although the present application has been described with reference to the current specific embodiments, ordinary technicians in this technical field should recognize that the above embodiments are only used to illustrate the present application, and various equivalent changes or substitutions may be made without departing from the spirit of the present application. Therefore, as long as the changes and modifications to the above embodiments are within the essential spirit of the present application, they will fall within the scope of the claims of the present application.

Claims

1. A routing loop detection method, characterized in that: Applicable to routers, including: Receive a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to an identifier of a next router pointed to by the corresponding neighbor routing prefix; Performing loop detection on a routing chain passing through the router according to a pre-configured local routing table and the first message to obtain a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to an identifier of a next router pointed to by the corresponding local routing prefix; A second message is generated according to the loop detection result, and the second message is sent to the neighboring router, so that the neighboring router determines the loop detection result.

2. The method according to claim 1, characterized in that Before receiving the first message from the neighbor router, the method further includes: Receiving a neighbor communication request carrying a security key, wherein the neighbor communication request is used to establish a communication connection with the neighbor router; The security key is verified, and if the security key is verified successfully, a communication connection is established with the neighbor router.

3. The method according to claim 1, characterized in that The performing loop detection on the routing chain passing through the current router according to the pre-configured local routing table and the first message includes: Each neighbor route prefix received is compared with each local route prefix; where: If the local routing prefix contains or is equal to the neighbor routing prefix, and the local subsequent identifier is empty, then the corresponding routing chain is determined to be loop-free; If the local routing prefix includes or is equal to the neighbor routing prefix, and the corresponding local successor identifier points to the neighbor router, it is determined that the corresponding routing chain has a loop; If the local routing prefix contains or is equal to the neighbor routing prefix, and the local successor identifier is not empty and points to the next router, then the corresponding routing chain is determined to be pending; If the local routing prefix is ​​included in the neighbor routing prefix, and the local successor identifier is empty, it is determined that the corresponding routing chain is loop-free, and the local routing table is continuously monitored.

4. The method according to claim 3, characterized in that After the corresponding routing chain is determined to be pending, the method further includes: A third message is sent to the next router, wherein the third message includes the identifier of the router and the local routing table.

5. The method according to claim 3, characterized in that The continuously monitoring the local routing table includes: When a new configuration entry is detected in the local routing table, the following operations are performed: Determine a newly added routing prefix and a newly added successor identifier in the newly added configuration entry; wherein: If the newly added successor identifier is empty, no processing will be performed; If the newly added successor identifier points to the neighbor router, it is determined that the corresponding routing chain has a loop, and the loop state information and the newly added configuration entry are sent to the neighbor router; If the newly added successor identifier points to the next router, it is determined that the corresponding routing chain is pending, and the newly added configuration entry is sent to the next router.

6. The method according to claim 5, characterized in that After sending the newly added configuration entry to the next router, the method further includes: Upon receiving the loop-free state information from the next router, determining that the routing chain is loop-free, and sending the loop-free state information to the neighbor router; When receiving the loop state information from the next router, it is determined that the routing chain has a loop, an alarm is triggered according to a preset rule, and the loop state information is sent to the neighbor router.

7. The method according to claim 1, characterized in that The triggering of an alarm according to a preset rule includes any of the following: No alarm; Blocking the routing chain takes effect and triggers an alarm; The routing chain is not blocked and an alarm is triggered.

8. A routing loop detection device, characterized in that: Applicable to routers, including: A receiving module, configured to receive a first message from a neighbor router, wherein the first message includes a neighbor configuration table, the neighbor configuration table includes at least one neighbor configuration entry, each neighbor configuration entry includes a corresponding neighbor routing prefix and a neighbor successor identifier, and the neighbor successor identifier refers to an identifier of a next router pointed to by the corresponding neighbor routing prefix; A detection module, configured to perform loop detection on a routing chain passing through the router according to a pre-configured local routing table and the first message, to obtain a loop detection result, wherein the local routing table includes at least one local configuration entry, each local configuration entry includes a corresponding local routing prefix and a local successor identifier, and the local successor identifier refers to an identifier of a next router pointed to by the corresponding local routing prefix; The transmission module is used to generate a second message according to the loop detection result, and send the second message to the neighbor router so that the neighbor router determines the loop detection result.

9. A routing system, characterized in that: The method comprises at least two routers, each of which is configured to execute the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores instructions, and when the instructions are called by the processor, the processor executes the method according to any one of claims 1 to 7.