Method, device, storage medium and electronic device for determining routing path

By determining and passing the routing information in the link status notification in the router, the problem of suboptimal routing caused by the introduction of foreign routes is solved, and the ability to select the optimal path after the introduction of foreign routes is realized.

CN119652814BActive Publication Date: 2025-05-16ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510164559.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-05-16
Estimated Expiration
2045-02-14

AI Technical Summary

Technical Problem

When introducing external routes, the router cannot make optimal judgments, resulting in the problem of suboptimal routing.

Method used

By determining the routing information in the received link status announcement, it is determined whether there is an equivalent route in the link where the decision device is located, and a link status announcement is generated based on the target source information and passed to the adjacent decision device, so that the subsequent router can sense the source of the foreign route and make the optimal judgment.

Benefits of technology

It realizes the effect of still being able to select the optimal path after introducing foreign routes, avoiding the problem of suboptimal routes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652814B_ABST
    Figure CN119652814B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device, storage medium and electronic device for determining a routing path, wherein the method comprises: determining the routing information included in all received link state notifications; determining whether there is an equivalent route in the link where the decision device is located based on the routing information; in the case of an equivalent route, determining the target source information in each target link state included in all link state notifications; and determining the routing path from the target route corresponding to the target source information based on the target source information. The present invention solves the problem that the introduction of external routing in the related art will lead to suboptimal routing, and achieves the effect of still being able to select the optimal path after the introduction of external routing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of communications, and in particular, to a method, device, storage medium and electronic device for determining a routing path. Background Art

[0002] In the related art, when an external route is introduced, the router is usually unable to make an optimal judgment on the introduced route.

[0003] It can be seen from this that the related art has the problem that introducing external routes will lead to suboptimal routes.

[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention

[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for determining a routing path, so as to at least solve the problem existing in the related art that the introduction of external routing may lead to suboptimal routing.

[0006] According to one embodiment of the present invention, a method for determining a routing path is provided, comprising: determining routing information included in all received link state announcements, wherein the link state announcement includes an announcement generated by a first device based on target source information of a target route when the target route is acquired, the target route supports a protocol different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; determining whether there is an equivalent route in the link where a decision device is located based on the routing information; in the case where there is an equivalent route, determining the target source information in each target link state included in all the link state announcements; and determining a routing path from the target route corresponding to the target source information based on the target source information.

[0007] In an exemplary embodiment, determining whether there is an equivalent route in the link where the decision-making device is located based on the routing information includes: determining the route type included in the routing information; when the route type includes multiple target route types of the same type, determining the metric value corresponding to each target route type respectively to obtain multiple target metric values; when the multiple target metric values ​​are the same, determining the existence of the equivalent route.

[0008] In an exemplary embodiment, determining a routing path from the target route corresponding to the target source information based on the target source information includes: determining a target protocol corresponding to the target source information; determining a target trust of the target protocol; and determining a route corresponding to a maximum trust included in the target trust as the routing path.

[0009] In an exemplary embodiment, determining the target trust level of the target protocol includes: acquiring a correspondence between a protocol and a trust level; and determining the target trust level corresponding to the target protocol from the correspondence.

[0010] According to another embodiment of the present invention, a method for determining a routing path is also provided, comprising: when a first device obtains a target route, determining target source information of the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; generating a target link state announcement based on the target source information; sending the target link state announcement to a decision device adjacent to the first device to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all received link state announcements, and in the case of an equivalent route, determining the target source information in each target link state included in all the link state announcements, and determining a routing path from the target route corresponding to the target source information based on the target source information.

[0011] In an exemplary embodiment, generating a link state advertisement based on the target source information includes: determining configuration information of the first device; and writing the target source information into the link state advertisement when publishing source information is set in the configuration information.

[0012] According to another embodiment of the present invention, a device for determining a routing path is provided, comprising: a first determination module, used to determine routing information included in all received link state announcements, wherein the link state announcement includes an announcement generated by a first device based on target source information of a target route when the target route is acquired, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; a second determination module, used to determine whether there is an equivalent route in the link where a decision device is located based on the routing information; a third determination module, used to determine the target source information in each target link state included in all the link state announcements when an equivalent route exists; and a fourth determination module, used to determine a routing path from the target route corresponding to the target source information based on the target source information.

[0013] According to another embodiment of the present invention, a routing path determination device is also provided, including: a fifth determination module, used to determine the target source information of the target route when the first device obtains the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; a generation module, used to generate a target link state announcement based on the target source information; a sending module, used to send the target link state announcement to a decision device adjacent to the first device to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all received link state announcements, and in the case of an equivalent route, determine the target source information in each target link state included in all the link state announcements, and determine the routing path from the target route corresponding to the target source information based on the target source information.

[0014] According to yet another embodiment of the present invention, 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 one of the above method embodiments when run.

[0015] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0017] Through the present invention, the routing information included in all received link state notifications is determined, wherein the link state notification includes a notification generated by the first device based on the target source information of the target route when the target route is obtained, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; whether there is an equivalent route in the link where the decision device is located is determined according to the routing information; in the case of hierarchical routing, the target source information in each target link state included in all link state notifications is determined; and the routing path is determined from the target route corresponding to the target source information according to the target source information. Since the first device can generate a link state notification according to the target source information of the target route when introducing an external target route. After receiving the link state notification, it can be determined whether there is an equivalent route according to the routing information included in the link state notification, and if there is, the routing path can be determined according to the target source information, that is, the route selection is realized according to the target source information when determining the routing path, therefore, the problem that the introduction of external routes in the related art will lead to suboptimal routes can be solved, and the effect of still being able to select the optimal path after the introduction of external routes can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for determining a routing path according to an embodiment of the present invention;

[0019] Figure 2 The process of the method for determining a routing path according to an embodiment of the present invention is as follows Figure 1 ;

[0020] Figure 3 is an application scenario diagram of the method for determining a routing path according to an embodiment of the present invention;

[0021] Figure 4 It is a schematic diagram of the format of the original link status notification message in the related technology;

[0022] Figure 5 is a schematic diagram of a link state advertisement message format according to an embodiment of the present invention;

[0023] Figure 6 is a flow chart of a method for determining a routing path according to a specific embodiment of the present invention;

[0024] Figure 7 is a flow chart of sending a link state advertisement according to a specific embodiment of the present invention;

[0025] Figure 8 The process of the method for determining a routing path according to an embodiment of the present invention is as follows Figure 2 ;

[0026] Fig. 9is a structural frame of a device for determining a routing path according to an embodiment of the present invention. Figure 1 ;

[0027] Fig.10 is a structural frame of a device for determining a routing path according to an embodiment of the present invention. Figure 2 . DETAILED DESCRIPTION

[0028] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0030] The method embodiments provided in the embodiments 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 determining a routing path according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 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) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the routing path in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement 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 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] 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. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as 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 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] In this embodiment, a method for determining a routing path is provided. Figure 2 The process of the method for determining a routing path according to an embodiment of the present invention is as follows Figure 1 ,like Figure 2 As shown, the process includes the following steps:

[0034] Step S202, determining routing information included in all received link state advertisements, wherein the link state advertisement includes an advertisement generated by the first device based on target source information of the target route when the target route is acquired, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route;

[0035] In the above embodiment, the application scenario diagram of the method for determining the routing path can be found in the attached Figure 3 ,like Figure 3As shown, the output transmission link includes a first device, a second device, and an nth device, wherein the first device may be a device included in the link that can introduce external routes, such as R1 and R2. The second device may be a device connected to the first device, such as R3 and R5. The first device may be a device that supports the OSPF (Open Shortest Path First) protocol. OSPF is a link state routing protocol that can maintain routing information by broadcasting link state updates. In order to understand and use routing information in other networks or autonomous systems (AS), OSPF can be set to introduce external routing functions, and import routes from other routing protocols, such as BGP (Border Gateway Protocol), RIP (Routing Information Protocol), EIGRP (Enhanced Interior Gateway Routing Protocol), etc. or static routes into the OSPF routing table. When introducing external routes in the OSPF protocol, E1 and E2 can be distinguished to meet different network requirements and routing strategies. Therefore, when the first device introduces the target route, the target source information of the target route can be written into the link state advertisement. The target route can be a route or static route that supports protocols such as BGP, RIP, and EIGRP, and the link state advertisement can be a type 5 LSA (Link-State Advertisement), a type 7 LSA, and the like.

[0036] In the introduction of external routes in the related art, only the first router, that is, the first device, knows what protocol (such as rip, bgp, static, etc.) the introduced external route table comes from, but the subsequent Nth router cannot know this topology information, so it is impossible to make the best judgment on the introduced route, resulting in suboptimal routing. In this embodiment, the first device can generate a link state announcement based on the target source information and send the link state announcement to the second device, so that the subsequent routers can also perceive the source of the external route and make the best judgment on the introduced route.

[0037] Step S204, determining whether there is an equal-cost route in the link where the decision-making device is located based on the routing information;

[0038] In the above embodiment, the routing information may include the routing type, the metric value, etc. The routing type may include Type 1 (E1) external routing, Type 2 (E2) external routing, etc. The total cost of the E1 external routing is the cost of the OSPF internal path plus the cost of the external routing. In this way, when calculating the path, E1 takes into account the status and cost of all OSPF internal links to the external destination. This allows the E1 routing to more accurately reflect the entire network environment and make corresponding adjustments when the internal network structure changes. The E2 external routing only considers the customized cost of the external routing and is not affected by the OSPF internal network status. The priority of the E2 routing is usually higher because it has a fixed cost.

[0039] In the above embodiment, the second device can determine whether there is a hierarchical route in the link according to the route type and the metric value included in the route information. For example, different weights can be assigned to the route type and the metric value, and the route type and the metric value are weighted and summed. When the weighted sum values ​​are the same, it is considered that there is an equivalent route, otherwise there is no equivalent route.

[0040] In the above embodiment, the second device may also determine to compare the route types first, and then compare the metric values ​​when the same route types exist, and determine that equal-cost routes exist when the same metric values ​​exist. If the same route types do not exist or the same route types exist but the same metric values ​​do not exist, it is determined that no equal-cost routes exist.

[0041] Step S206, in the case where equal-cost routes exist, determining the target source information in each target link state included in all the link state advertisements;

[0042] Step S208, determining a routing path from the target route corresponding to the target source information based on the target source information.

[0043] In the above embodiment, when the first device introduces an external route to publish a Category 5 / Category 7 link state announcement, it carries the target source information of the introduced route (for example, the external route is introduced from the rip protocol). The second device that has learned the external route can select a route based on the carried target source information; it can classify different trust levels according to the source and select a route with a higher trust level as the optimal path. The original link state announcement message format diagram can be found in the attached Figure 4 , the link state notification message format diagram can be found in the attached Figure 5 , compared with the attached Figure 4-5 It can be seen that the link state advertisement message in this embodiment adds the target source information on the basis of the original link state advertisement.

[0044] Through the present invention, the routing information included in all received link state notifications is determined, wherein the link state notification includes a notification generated by the first device based on the target source information of the target route when the target route is obtained, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; whether there is an equivalent route in the link where the decision device is located is determined according to the routing information; in the case of hierarchical routing, the target source information in each target link state included in all link state notifications is determined; and the routing path is determined from the target route corresponding to the target source information according to the target source information. Since the first device can generate a link state notification according to the target source information of the target route when introducing an external target route. After receiving the link state notification, it can be determined whether there is an equivalent route according to the routing information included in the link state notification, and if there is, the routing path can be determined according to the target source information, that is, the route selection is realized according to the target source information when determining the routing path, therefore, the problem that the introduction of external routes in the related art will lead to suboptimal routes can be solved, and the effect of still being able to select the optimal path after the introduction of external routes can be achieved.

[0045] Optionally, the execution subject of the above steps may be a decision-making device, that is, other devices in the link except the first device that introduces the external route, but it is not limited thereto.

[0046] In an exemplary embodiment, determining whether there is an equivalent route in the link where the decision device is located based on the routing information includes: determining the route type included in the routing information; in the case where the route type includes multiple target route types of the same type, determining the metric values ​​corresponding to the multiple target route types to obtain multiple target metric values; in the case where the multiple target metric values ​​are the same, determining the existence of the equivalent route. In this embodiment, the route type may include E1, E2, etc., but is not limited thereto. It may be determined first whether there is the same target route type, and if so, continue to judge, and if not, it is considered that there is no equivalent route. In the case where the same target route type exists, it may continue to judge whether there is the same metric value, and if so, determine that there is an equivalent route, otherwise, there is no equivalent route.

[0047] In an exemplary embodiment, determining a routing path from the target route corresponding to the target source information based on the target source information includes: determining a target protocol corresponding to the target source information; determining a target trust of the target protocol; and determining a route corresponding to a maximum trust included in the target trust as the routing path. Figure 3, the external route 10.1.1.0 / 24 is introduced into the first devices R1 and R2 respectively, and then published. When publishing, R1 carries the source information from static (from static route), and R2 carries the source information from rip (from rip route). R5 can make a trust setting based on the source information carried and the different source protocols. For example, compared with the route with static source, the route with rip protocol source is more trusted, that is, the route introduced from rip will be selected.

[0048] In an exemplary embodiment, determining the target trust of the target protocol includes: obtaining a correspondence between a protocol and a trust; and determining the target trust corresponding to the target protocol from the correspondence. In this embodiment, the correspondence between the protocol and the trust can be determined according to the protocol management distance, and the target trust corresponding to the target protocol can be determined from the correspondence.

[0049] The following describes a method for determining a routing path in conjunction with a specific embodiment:

[0050] Figure 6 is a flow chart of a method for determining a routing path according to a specific embodiment of the present invention. Figure 6 As shown, the method includes:

[0051] Step S602: The Nth router (decision-making device) learns multiple Category 5 LSAs and reads the contents.

[0052] Step S604, the Nth router (decision-making device) compares the route type E1 / E2 and the metric value to check whether there is an equal-cost route. If so, step S606 is executed; if not, step S610 is executed.

[0053] Step S606, the Nth router (decision-making device) reads five types of LSA to check whether they carry external routing source information (corresponding to the above-mentioned target source information). If the judgment result is yes, step S608 is executed; if the judgment result is no, step S610 is executed.

[0054] Step S608: Compare the source information carried by the five types of LSAs according to the protocol management distance, and use the protocol with higher trust as the priority path.

[0055] Step S610, end.

[0056] Figure 7 is a flow chart of sending a link state notification according to a specific embodiment of the present invention, such as Figure 7 As shown, the process includes:

[0057] Step S702: The first router (corresponding to the first device) obtains an external route (corresponding to the target route) by introducing a static routing protocol.

[0058] Step S704, the first router determines in its own configuration file whether the OSPF protocol is set to carry external route source information when publishing external routes. If the judgment result is yes, step S706 is executed; if the judgment result is no, step S710 is executed.

[0059] Step S706: The first router generates a five-type LSA (corresponding to the link state advertisement) according to the obtained external route. The LSA carries the external route source information (corresponding to the target route information).

[0060] Step S708: The first router sends the generated five types of LSAs to adjacent routers in the OSPF network.

[0061] Step S710, end.

[0062] In the above embodiment, the first router introduces external information and carries the source information of the external route when publishing the Type 5 / Type 7 LSA. The first router can identify the source information of the external route, and the subsequent Nth router can obtain this information, that is, any device in the subsequent Nth device can build its own routing strategy, providing more options for networking.

[0063] This embodiment also provides a method for determining a routing path. Figure 8 The process of the method for determining a routing path according to an embodiment of the present invention is as follows Figure 2 ,like Figure 8 As shown, the process includes the following steps:

[0064] Step S802, when the first device obtains the target route, determining the target source information of the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route;

[0065] Step S804, generating a target link state advertisement based on the target source information;

[0066] Step S806, sending the target link state announcement to the decision device adjacent to the first device to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all the received link state announcements, and if there is an equivalent route, determine the target source information in each target link state included in all the link state announcements, and determine the routing path from the target route corresponding to the target source information based on the target source information.

[0067] In the above embodiment, the application scenario diagram of the method for determining the routing path can be found in the attached Figure 3 ,like Figure 3 As shown, the output transmission link includes a first device, a second device, and an nth device, wherein the first device may be a device included in the link that can introduce external routes, such as R1 and R2. The second device may be a device connected to the first device, such as R3 and R5. The decision device may be a device other than the first device in the link. The first device may be a device supporting the OSPF (Open Shortest Path First) protocol, which is a link state routing protocol that can maintain routing information by broadcasting link state updates. In order to understand and use routing information in other networks or autonomous systems (AS), OSPF can be set to introduce external routing functions, and import routes from other routing protocols, such as BGP (Border Gateway Protocol), RIP (Routing Information Protocol), EIGRP (Enhanced Interior Gateway Routing Protocol), etc. or static routes into the OSPF routing table. When introducing external routes in the OSPF protocol, E1 and E2 can be distinguished to meet different network requirements and routing strategies. Therefore, when the first device introduces the target route, the target source information of the target route can be written into the link state advertisement. The target route can be a route or static route that supports protocols such as BGP, RIP, and EIGRP, and the link state advertisement can be a type 5 LSA (Link-State Advertisement), a type 7 LSA, and the like.

[0068] In the introduction of external routes in the related art, only the first router, that is, the first device, knows what protocol (such as rip, bgp, static, etc.) the introduced external route table comes from, but the subsequent Nth router cannot know this topology information, so it is impossible to make the best judgment on the introduced route, resulting in suboptimal routing. In this embodiment, the first device can generate a link state announcement based on the target source information and send the link state announcement to the second device, so that the subsequent routers can also perceive the source of the external route and make the best judgment on the introduced route.

[0069] In the above embodiment, the routing information may include the routing type, the metric value, etc. The routing type may include Type 1 (E1) external routing, Type 2 (E2) external routing, etc. The total cost of the E1 external routing is the cost of the OSPF internal path plus the cost of the external routing. In this way, when calculating the path, E1 takes into account the status and cost of all OSPF internal links to the external destination. This allows the E1 routing to more accurately reflect the entire network environment and make corresponding adjustments when the internal network structure changes. The E2 external routing only considers the customized cost of the external routing and is not affected by the OSPF internal network status. The priority of the E2 routing is usually higher because it has a fixed cost.

[0070] In the above embodiment, the second device can determine whether there is a hierarchical route in the link according to the route type and the metric value included in the route information. For example, different weights can be assigned to the route type and the metric value, and the route type and the metric value are weighted and summed. When the weighted sum values ​​are the same, it is considered that there is an equivalent route, otherwise there is no equivalent route.

[0071] In the above embodiment, the second device may also determine to compare the route types first, and then compare the metric values ​​when the same route types exist, and determine that equal-cost routes exist when the same metric values ​​exist. If the same route types do not exist or the same route types exist but the same metric values ​​do not exist, it is determined that no equal-cost routes exist.

[0072] Through the present invention, the routing information included in all received link state notifications is determined, wherein the link state notification includes a notification generated by the first device based on the target source information of the target route when the target route is obtained, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; whether there is an equivalent route in the link where the decision device is located is determined according to the routing information; in the case of hierarchical routing, the target source information in each target link state included in all link state notifications is determined; and the routing path is determined from the target route corresponding to the target source information according to the target source information. Since the first device can generate a link state notification according to the target source information of the target route when introducing an external target route. After receiving the link state notification, it can be determined whether there is an equivalent route according to the routing information included in the link state notification, and if there is, the routing path can be determined according to the target source information, that is, the route selection is realized according to the target source information when determining the routing path, therefore, the problem that the introduction of external routes in the related art will lead to suboptimal routes can be solved, and the effect of still being able to select the optimal path after the introduction of external routes can be achieved.

[0073] Optionally, the execution entity of the above steps may be the first device, but is not limited thereto.

[0074] In an exemplary embodiment, generating a link state announcement based on the target source information includes: determining the configuration information of the first device; and when the publishing source information is set in the configuration information, writing the target source information into the link state announcement. In this embodiment, when the first device introduces an external route to publish a Category 5 / Category 7 link state announcement, it carries the target source information of the introduced route (for example, the external route is introduced from the rip protocol). The second device that has learned the external route can select a route based on the carried target source information; divide the source into different trust levels, and select a route with a higher trust level as the optimal path. Among them, the format of the original link state announcement message can be found in the attached. Figure 4 The link state notification message format can be found in the attached Figure 5 , compared with the attached Figure 4-5 It can be seen that the link state advertisement message in this embodiment adds the target source information on the basis of the original link state advertisement.

[0075] See the attached Figure 3, the external route 10.1.1.0 / 24 is introduced into the first devices R1 and R2 respectively, and then published. When publishing, R1 carries the source information from static (from static route), and R2 carries the source information from rip (from rip route). R5 can make a trust setting based on the source information carried and the different source protocols. For example, compared with the route with static source, the route with rip protocol source is more trusted, that is, the route introduced from rip will be selected.

[0076] In the above embodiment, the first router introduces external information and carries the source information of the external route when publishing the Type 5 / Type 7 LSA. The first router can identify the source information of the external route, and the subsequent Nth router can obtain this information, that is, any device in the subsequent Nth device can build its own routing strategy, providing more options for networking.

[0077] 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 can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, 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 ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0078] In this embodiment, a device for determining a routing path 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 devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0079] Fig. 9 is a structural frame of a device for determining a routing path according to an embodiment of the present invention. Figure 1 ,like Fig. 9 As shown, the device comprises:

[0080] A first determination module 92 is configured to determine routing information included in all received link state advertisements, wherein the link state advertisement includes an advertisement generated by the first device based on target source information of the target route when the first device obtains the target route, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route;

[0081] A second determination module 94, configured to determine whether there is an equal-cost route in the link where the decision-making device is located based on the routing information;

[0082] A third determination module 96 is used to determine the target source information in each target link state included in all the link state advertisements when there are equal-cost routes;

[0083] The fourth determination module 98 is used to determine a routing path from the target route corresponding to the target source information based on the target source information.

[0084] In an exemplary embodiment, the second determination module 94 can determine whether there is an equivalent route in the link where the decision device is located based on the routing information in the following manner: determine the routing type included in the routing information; when the routing type includes multiple target routing types of the same type, determine the metric value corresponding to each target routing type respectively to obtain multiple target metric values; when the multiple target metric values ​​are the same, determine that the equivalent route exists.

[0085] In an exemplary embodiment, the fourth determination module 98 can determine the routing path from the target route corresponding to the target source information based on the target source information in the following manner: determine the target protocol corresponding to the target source information; determine the target trust of the target protocol; and determine the route corresponding to the maximum trust included in the target trust as the routing path.

[0086] In an exemplary embodiment, the fourth determination module 98 may determine the target trust level of the target protocol in the following manner: obtaining a correspondence between a protocol and a trust level; and determining the target trust level corresponding to the target protocol from the correspondence.

[0087] Fig.10 is a structural frame of a device for determining a routing path according to an embodiment of the present invention. Figure 2 ,like Fig.10 As shown, the device comprises:

[0088] A fifth determining module 1002 is used to determine target source information of the target route when the first device obtains the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route;

[0089] A generating module 1004, configured to generate a target link state advertisement based on the target source information;

[0090] The sending module 1006 is used to send the target link state announcement to the decision device adjacent to the first device to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all the received link state announcements, and in the case of hierarchical routing, determine the target source information in each target link state included in all the link state announcements, and determine the routing path from the target route corresponding to the target source information based on the target source information.

[0091] In an exemplary embodiment, the generation module 1004 can generate a link state announcement based on the target source information in the following manner: determine the configuration information of the first device; if the publishing source information is set in the configuration information, write the target source information into the link state announcement.

[0092] 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.

[0093] An embodiment of the present invention 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.

[0094] 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.

[0095] An embodiment of the present invention further provides an electronic device, including 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.

[0096] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0097] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.

[0098] 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.

[0099] Obviously, those skilled in the art should understand that the above modules or steps of the present invention 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 than here, 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 invention is not limited to any specific combination of hardware and software.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining a routing path, characterized in that: include: Determining routing information included in all received link state advertisements, wherein the link state advertisement includes an advertisement generated by the first device based on target source information of the target route when the first device obtains the target route, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; Determine whether there is an equivalent route in the link where the decision-making device is located based on the routing information, wherein the decision-making device is a device other than the first device in the link; In the case where the equal-cost routes exist, determining the target source information in each target link state included in all the link state advertisements; Determine a routing path from the target route corresponding to the target source information based on the target source information; Determining a routing path from the target route corresponding to the target source information based on the target source information includes: determining a target protocol corresponding to the target source information; determining a target trust of the target protocol; and determining a route corresponding to a maximum trust included in the target trust as the routing path.

2. The method according to claim 1, characterized in that: Determining whether there is an equal-cost route in the link where the decision-making device is located based on the routing information includes: Determining a route type included in the route information; In the case where the routing type includes multiple target routing types of the same type, determining a metric value corresponding to each of the target routing types respectively to obtain multiple target metric values; When the multiple target metric values ​​are the same, it is determined that the equal-cost routes exist.

3. The method according to claim 1, characterized in that Determining the target trust level of the target protocol includes: Obtain the correspondence between the protocol and the trust level; The target trust level corresponding to the target protocol is determined from the corresponding relationship.

4. A method for determining a routing path, characterized in that: include: In the case where the first device obtains the target route, determining the target source information of the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; generating a target link state advertisement based on the target source information; Sending the target link state advertisement to a decision device adjacent to the first device to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all received link state advertisements, and in the case of an equivalent route, determining the target source information in each target link state included in all the link state advertisements, and determining a routing path from the target route corresponding to the target source information based on the target source information, wherein the decision device is a device other than the first device in the link; Determining a routing path from the target route corresponding to the target source information based on the target source information includes: determining a target protocol corresponding to the target source information; determining a target trust of the target protocol; and determining a route corresponding to a maximum trust included in the target trust as the routing path.

5. The method according to claim 4, characterized in that Generating a link state advertisement based on the target source information includes: Determining configuration information of the first device; In the case where the publishing source information is set in the configuration information, the target source information is written into the link state advertisement.

6. A device for determining a routing path, characterized in that: include: A first determination module, configured to determine routing information included in all received link state advertisements, wherein the link state advertisement includes an advertisement generated by the first device based on target source information of the target route when the first device acquires the target route, the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; A second determination module, configured to determine whether there is an equivalent route in the link where the decision-making device is located based on the routing information, wherein the decision-making device is a device in the link other than the first device; A third determination module is used to determine the target source information in each target link state included in all the link state advertisements when there are equal-cost routes; A fourth determination module, configured to determine a routing path from the target route corresponding to the target source information based on the target source information; The fourth determination module determines the routing path from the target route corresponding to the target source information based on the target source information in the following manner: determining the target protocol corresponding to the target source information; determining the target trust of the target protocol; and determining the route corresponding to the maximum trust included in the target trust as the routing path.

7. A device for determining a routing path, characterized in that: include: a fifth determination module, configured to determine target source information of the target route when the first device acquires the target route, wherein the protocol supported by the target route is different from the protocol supported by the first device, and the target source information is used to indicate the protocol supported by the target route; A generating module, configured to generate a target link state notification based on the target source information; a sending module, configured to send the target link state announcement to a decision device adjacent to the first device, so as to instruct the decision device to determine whether there is an equivalent route in the link where the decision device is located based on the routing information included in all received link state announcements, and in the case where an equivalent route exists, determine the target source information in each target link state included in all the link state announcements, and determine a routing path from the target route corresponding to the target source information based on the target source information, wherein the decision device is a device other than the first device in the link; The sending module determines the routing path from the target route corresponding to the target source information based on the target source information in the following manner: determining the target protocol corresponding to the target source information; determining the target trust of the target protocol; and determining the route corresponding to the maximum trust included in the target trust as the routing path.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 3, or execute the method described in any one of claims 4 to 5 when running.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of claims 1 to 3, or to execute the method described in any one of claims 4 to 5.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the method described in any one of claims 1 to 3, or performs the method described in any one of claims 4 to 5.

Citation Information

Patent Citations

  • Method and relevant equipment for introducing external route to OSPF (Open Shortest Path First Interior Gateway Protocol) network

    CN102082782A