A Routing Method and Device Based on Border Gateway Protocol

By obtaining the user-selected routing algorithm in the BGP routing method, the received route is optimized, and the problem of low routing optimization rate in public cloud scenarios is solved, and the flexibility and optimization rate of routing are improved.

CN113595901BActive Publication Date: 2025-06-13HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010364392.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-30
Publication Date
2025-06-13
Estimated Expiration
2040-04-30

AI Technical Summary

Technical Problem

The existing BGP routing optimization algorithm has a low routing optimization rate in public cloud scenarios, and has few applicable scenarios and poor flexibility.

Method used

A routing method based on the boundary gateway protocol is provided. By obtaining a routing algorithm selected by the user, using one of a variety of pre-stored routing algorithms, the received route is optimized, and the flexibility of routing is improved.

Benefits of technology

This allows users to flexibly select routing algorithms, and the preferred routes are more in line with the current scenario and improve the routing optimization rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113595901B_ABST
    Figure CN113595901B_ABST
Patent Text Reader

Abstract

A routing method and device based on the Border Gateway Protocol. The method includes: obtaining N routes out of L routes received based on the Border Gateway Protocol (BGP), and obtaining a routing algorithm selected by a user; wherein the routing algorithm corresponds to a cloud scenario, and the routing algorithm selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers; selecting one route from the N routes according to the routing algorithm selected by the user. Through the solution of this application, the routing algorithm can be applicable to multiple scenarios and the flexibility of selecting the routing algorithm can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technologies, and in particular, to a routing selection method and apparatus based on the Border Gateway Protocol (BGP). Background Art

[0002] The Border Gateway Protocol (BGP) is used to exchange routing information between different autonomous systems (ASs), and is mainly used for the interconnection between operator networks or between ASs within an operator network. In recent years, with the continuous rise of public clouds, the BGP protocol is used for the interconnection between public cloud networks and operator networks.

[0003] The current BGP protocol is mainly used for routing preference algorithms in operator scenarios. Due to different network scenarios, the preference rate of routes will also be different, and the requirements for the selected routes in the public cloud scenario are higher. If the existing BGP routing preference algorithm is used for route preference in the public cloud scenario, the preference rate of routes will be relatively low. That is to say, the existing routing preference algorithms supported by BGP are not good enough for services in the cloud scenario, and the applicable scenarios of the routing algorithms are few and the flexibility is poor. Summary of the Invention

[0004] This application provides a routing selection method and apparatus based on the Border Gateway Protocol to improve the flexibility of the routing selection algorithm.

[0005] In a first aspect, this application provides a routing selection method based on the Border Gateway Protocol, including: obtaining N routes out of L routes received based on the Border Gateway Protocol (BGP), and obtaining a routing algorithm selected by a user; wherein, the routing algorithm corresponds to a cloud scenario, and the routing algorithm selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers; and selecting one route from the N routes according to the routing algorithm selected by the user.

[0006] In the above technical solution, the routes to be selected for routing can be preferred according to the routing algorithm selected by the user, so that the user can flexibly select the routing algorithm, and the selected route better conforms to the current scenario, improving the routing preference rate.

[0007] In a possible design, the N routes have the same routing prefix.

[0008] In the solution of this application, for routes with the same routing prefix, routing preference needs to be performed to select an optimal route.

[0009] In this application, the routing algorithm selected by the user can be obtained through the following possible implementation methods:

[0010] The first method:

[0011] In a possible design, before obtaining the routing algorithm selected by the user, the method further includes: obtaining multiple pre-stored routing algorithms and displaying the multiple routing algorithms in a graphical interface.

[0012] The obtaining of the routing algorithm selected by the user includes: determining the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

[0013] In the first method, multiple routes can be displayed in the form of a graphical interface, and then the user can make a selection on the graphical interface. This method is more intuitive, can facilitate user operation, and improve the user experience.

[0014] The second method:

[0015] In a possible design, the obtaining of the routing algorithm selected by the user includes: obtaining the routing algorithm input by the user through a command-line interface. In this application, the user can input the routing algorithm in the command-line interface so that the routing selection device can obtain the routing algorithm input by the user.

[0016] It should be noted that the above two methods are only examples. In this application, the routing algorithm can also be obtained through other forms such as voice and scripts, and this application does not limit the method of obtaining the routing algorithm.

[0017] In a possible design, the obtaining of the routing algorithm selected by the user includes: obtaining the scenario information selected by the user and determining the routing algorithm corresponding to the scenario information selected by the user.

[0018] In the above technical solution, the scenario information selected by the user can also be obtained, and then according to the scenario information selected by the user, the routing algorithm corresponding to the scenario information is determined. It should be noted that the scenario information can also be displayed in the form of a graphical interface for the user to select, and this application does not limit this.

[0019] In a possible design, the routing algorithm corresponding to the cloud scenario includes at least one of the following rules:

[0020] The local priority is the highest; the autonomous system path is the shortest; the delay is the lowest; the packet loss is the least; the line cost is the lowest.

[0021] In this application, the rules included in the routing algorithm can be at least one, and the rules are not limited to the above several rules. For different scenarios, the corresponding routing algorithms are different. Therefore, in different scenarios, the rules included in the routing algorithm are also different.

[0022] In a second aspect, this application provides a routing selection device based on the Border Gateway Protocol (BGP), including:

[0023] An acquisition unit, configured to acquire N routes out of L routes received based on the Border Gateway Protocol (BGP), and acquire the routing algorithm selected by the user; wherein, the routing algorithm is a routing algorithm corresponding to the cloud scenario, and the routing algorithm selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers; A selection unit, configured to select one route from the N routes according to the routing algorithm selected by the user acquired by the acquisition unit.

[0024] In a possible design, the N routes have the same routing prefix.

[0025] In a possible design, the acquisition unit is further configured to: before acquiring the routing algorithm selected by the user, acquire multiple pre-stored routing algorithms and display the multiple routing algorithms in a graphical interface.

[0026] The acquisition unit is specifically configured to acquire the routing algorithm selected by the user in the following manner: determine the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

[0027] In a possible design, the acquisition unit is specifically configured to acquire the routing algorithm selected by the user in the following manner: acquire the routing algorithm input by the user through a command-line interface.

[0028] In a possible design, the acquisition unit is specifically configured to acquire the routing algorithm selected by the user in the following manner: acquire the scenario information selected by the user and determine the routing algorithm corresponding to the scenario information selected by the user.

[0029] In a possible design, the routing algorithm corresponding to the cloud scenario includes at least one of the following rules:

[0030] The highest local priority; the shortest autonomous system path; the lowest latency; the fewest packet losses; the lowest line cost.

[0031] Regarding the technical effects brought by the second aspect or various embodiments of the second aspect, reference can be made to the introduction of the technical effects of the first aspect or various embodiments of the first aspect, and no further elaboration will be made here.

[0032] In a third aspect, the present application provides a routing selection device based on the Border Gateway Protocol (BGP). The device has the function of implementing the routing selection method based on the Border Gateway Protocol in the first aspect or any possible implementation manner of the first aspect. The function can be implemented by hardware or by software executed by the hardware.

[0033] The device includes a communication interface, a processor, and a memory. The communication interface is used to receive and send data. The processor is configured to support the device to execute the corresponding functions in the above-mentioned first aspect or any possible implementation manner of the first aspect. The memory is coupled to the processor and stores the necessary program instructions of the device.

[0034] In a fourth aspect, a computer-readable storage medium is provided. Instructions are stored in the computer-readable storage medium. When the instructions are run on a computer, the computer is caused to execute the methods in the first aspect and each implementation manner.

[0035] In a fifth aspect, a computer program product containing instructions is provided. When the computer program product is run on a computer, the computer is caused to execute the methods in the first aspect and each implementation manner.

[0036] In a sixth aspect, a chip is provided. The logic in the chip is used to execute the methods in the first aspect and each implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of a routing selection process in the prior art;

[0038] Figure 2 It is a network architecture diagram provided by an embodiment of the present application;

[0039] Figure 3 It is a flowchart of a routing selection method based on the Border Gateway Protocol provided by an embodiment of the present application;

[0040] Figure 4 It is a functional module diagram of a BGP routing preference algorithm provided by an embodiment of the present application;

[0041] Figure 5 It is a schematic diagram of the functional modules of a routing selection device based on the Border Gateway Protocol provided by an embodiment of the present application;

[0042] Figure 6 It is a schematic diagram of a routing selection device based on the Border Gateway Protocol provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0043] The embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0044] Currently, Border Gateway Protocol (BGP) can be used to exchange routing information between two autonomous systems (AS). When a router receives multiple routes sent from other routers, if there are routes with the same destination Internet Protocol (IP) prefix among the received multiple routes, it is necessary to select the preferred route from the routes with the same destination IP prefix. In the prior art, the rules for route selection among routes with the same destination IP prefix include the following rules:

[0045] R1. Prefer the route with the largest preferred - value;

[0046] R2. Prefer the route with the highest LOCAL_PREF;

[0047] R3. Prefer the AGGREGATE route;

[0048] R4. Prefer the route with the shortest AS_PATH;

[0049] R5. Prefer the route with the ORIGIN attribute of interior gateway protocol (IGP), exterior gateway protocol (EGP), or Incomplete;

[0050] R6. Prefer the route with the lowest multi - exit discriminator (MED) value;

[0051] R7. Select the routes learned from EBGP (External / Exterior BGP), confederation, and IBGP (Internal / Interior BGP) in sequence;

[0052] R8. Prefer the route with the lowest Next_HOP metric value;

[0053] R9. Prefer the route with the shortest CLUSTER_LIST length;

[0054] R10. Prefer the route with the smallest ORIGINATOR_ID;

[0055] R11. Prefer the route advertised by the router with the smallest Router ID;

[0056] R12. Prefer the routes advertised by the peer with the smallest Internet Protocol (IP) address.

[0057] Combine Figure 1 Introduce the routing selection process in the prior art. As Figure 1 shown, it is a diagram of the BGP route preference function module in the prior art. Refer to Figure 1 shown. It should be noted that while receiving routes, a router may also send routes. The following only takes the example of multiple routers sending and one router receiving for illustration.

[0058] It should be noted that Figure 1 "RFC4271" in

[0059] is a version of the BGP protocol. For the sake of convenient description, the receiving router is denoted as Router 1, and the sending routers are denoted as Router 2 and Router 3.

[0060] After Router 1 receives multiple routes sent by Router 2 and Router 3, it can save the routes in Adj-RIBS-In. Then Router 1 selects the routes to be routed. Specifically, it can be preferred according to the above 12 rules, and the preferred routes are saved in Loc-RIB. Finally, the selected routes are downloaded and forwarded to other routers. It should be noted that Adj-RIBS-In and Loc-RIB will be introduced below and will not be specifically described here.

[0061] Specifically, when Router 1 prefers according to the above 12 rules, it selects in sequence according to the numbers of the above 12 rules. Exemplarily, Router 1 first prefers N (N is a positive integer) routes according to R1. If the parameters of the N routes do not have a preferred-value, or the preferred-value is the same, then it continues to prefer the N routes according to R2. If the parameters of the N routes do not have a LOCAL_PREF, or the LOCAL_PREF is the same, then it prefers the N routes according to R3, and so on, until one route is selected.

[0062] From the above routing preference process, it can be seen that the existing routing preference algorithm can be understood as a linear preference algorithm. The current BGP only supports this one routing preference algorithm and does not support multiple routing preference algorithms.

[0063] In addition, existing BGP is mainly used for interconnection between operator networks and interconnection between different ASs within an operator. In recent years, with the widespread rise of public clouds, BGP is widely used for interconnection between public cloud networks and operator networks. The operator interconnection scenario mainly realizes the intercommunication between a large number of user terminals in different ASs. The main concern is to ensure the high availability of the intercommunication of large users with a relatively small proportion first, and the normal intercommunication of a large number of general users without frequent major failures. There is no need to spend much effort on optimizing the intercommunication experience (such as latency and packet loss) feedback by numerous general users at any time. However, public clouds are very concerned about the experience of applications (APPs) on user terminals in each AS distributed in the target coverage area accessing various cloud services in the public cloud, such as latency and packet loss. If the user experience is poor, it may cause the cloud service to choose to migrate to other public cloud providers with better network performance.

[0064] That is to say, the concerns in the public cloud scenario and the operator scenario are different. If the linear optimization algorithm in the existing technology is used in the public cloud scenario, the selected route may not be the optimal route in the public cloud scenario.

[0065] In view of this, the embodiments of the present application provide a routing selection method, which provides multiple routing algorithms for network administrators (hereinafter referred to as "users") to select according to different scenarios, so as to realize the parallel existence of multiple routing algorithms, and at the same time be applicable to multiple scenarios, improving flexibility.

[0066] At least one involved in the embodiments of the present application includes one or more; among them, multiple means greater than or equal to two. In addition, in the description of the present application, terms such as "first" and "second" are only used for the purpose of distinguishing description objects, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0067] For the convenience of understanding, an exemplary description of concepts related to the present application is given for reference as follows:

[0068] 1) Border Gateway Protocol (BGP): A routing protocol for autonomous systems running on the Transmission Control Protocol (TCP). BGP is used to exchange routing information between different autonomous systems (ASs). When two ASs need to exchange routing information, each AS must specify a node running BGP to represent the AS and exchange routing information with other ASs. This node can be a host. But usually, a router is used to execute BGP. The routers that use BGP to exchange information in two ASs are also called Border Gateways or Border Routers.

[0069] 2) Autonomous System AS: All routers within an autonomous system must be interconnected, run the same routing protocol, and be assigned the same autonomous system number.

[0070] 3) Adj-RIBS-In: Stores routing information learned from the update messages of neighbors. Here, RIB refers to the Routing Information Base (RIB) or the routing table.

[0071] 4) Loc-RIB: Stores the routing information selected by the BGP speaker from Adj-RIBS-In according to the local routing policy.

[0072] 5) Adj-RIBS-Out: Stores the routing information used to announce to each peer.

[0073] 6) Peer: Includes external peers and internal peers. For a certain BGP speaker, if it communicates with other BGP speakers and that other BGP speaker is in a different AS, then that other BGP speaker is called an external peer, and if it is within the same AS, it is called an internal peer.

[0074] 7) BGP speaker: The router directly connected through BGP is the BGP speaker. The BGP speakers can be within the same AS or in different ASs. The BGP speakers of each AS communicate with each other, exchange network reachability information in accordance with the policies established for each AS. In this application, the BGP speaker is the border BGP router.

[0075] 8) IBGP: BGP running between two or more peer entities within the same autonomous system AS.

[0076] 9) EBGP: BGP running between peer entities belonging to different ASs.

[0077] It should be noted that for the convenience of description in this application, "Adj-RIBS-In" can be denoted as "the first storage module", "Loc-RIB" as "the second storage module", and "Adj-RIBS-Out" as "the third storage module".

[0078] First, please refer to Figure 2 shown in the following figure, which is a network architecture diagram to which the embodiments of this application can be applied. As Figure 2 shown, the network architecture may include: end users (USer), routers under the operator network, and routers in the public cloud scenario. In Figure 2Under the network architecture shown, end users can connect to an Internet service provider (ISP), that is, the operator network, through the Internet. Then, routing information can be exchanged between the border BGP routers under the operator network and the border BGP routers of the public cloud, so as to enable end users to access cloud services. Among them, the point-of-presence (POP) of the public cloud is connected to the backbone network between the data center (DC) or region of the public cloud.

[0079] In Figure 2 , routing information can be exchanged between the operator border BGP router and the public cloud border BGP router. While each border BGP router sends routes to other routers, it may also receive routes sent by other routers.

[0080] The following details the routing selection method involved in the embodiments of the present application.

[0081] As Figure 3 shown, it is a flowchart of a BGP-based routing selection method provided by an embodiment of the present application. Referring to Figure 3 shown, the method includes:

[0082] For ease of description, the router at the receiving end is hereinafter denoted as Router 1, and the routers at the sending end are denoted as Router 2 and Router 3. Of course, it can be understood that there can be multiple routers at the sending end, and only two are taken as examples for illustration below.

[0083] S301: Obtain N routes from the L received routes.

[0084] Among them, L and N are positive integers. Router 1 receives the L routes sent by Router 2 and Router 3, and then saves the L routes in the local routing information library. The router can obtain multiple routes received based on BGP from the local routing information library.

[0085] In a possible implementation, after receiving and saving the L routes, the L routes can be divided into two parts of routes. One part of the routes is the routes with the same routing prefix, such as N routes, that is, the routes for which routing selection needs to be performed, and the other part is the routes for which routing selection is not required.

[0086] It should be understood that the same routing prefix in the present application can be understood as the same IP prefix. In other words, it can be understood as a set of the same group of IPs. For example, from 192.168.0.1 to 192.168.0.25 all belong to the same routing prefix.

[0087] Of course, in the embodiments of the present application, the L routes can be grouped. For example, they can be divided into three groups, namely A, B, and C. Among them, the routes in group A are the routes that do not require route selection, and the routes in groups B and C are the routes that require route selection. It can be understood that the number of groups can be two groups, four groups, etc., and the present application does not limit this.

[0088] In this way, for router 1, it is necessary to select the routes with the same route prefix received. That is to say, assuming that there are N routes that all need to be sent to router 2, then router 1 needs to select one route from the N routes and send it to router 2.

[0089] The following refers to Table 1 to give an example of the routes involved in the present application. As shown in Table 1, it is a partial route example in the route table provided by the embodiments of the present application.

[0090] Table 1 Route Example

[0091] Network Nextop MED LocPrf PreVal Path / Ogn 1.0.0.0 / 24 201.125.254.8 0 1500 0 8151 13335i 1.0.4.0 / 22 201.125.254.8 0 1500 0 8151 1299 4826 38803 56203i 1.0.4.0 / 24 201.125.254.8 0 1500 0 8151 1299 4826 38803 56203i 1.0.5.0 / 24 201.125.254.8 0 1500 0 8151 1299 4826 38803 56203i 1.0.6.0 / 24 201.125.254.8 0 1500 0 8151 1299 4826 38803 56203i 1.0.7.0 / 24 201.125.254.8 0 1500 0 8151 1299 4826 38803 56203i

[0092] It should be noted that in Table 1, Network represents the network segment, Nextop represents the next-hop IP address, MED represents the multi-exit discrimination value, LocPrf represents the local priority, PreVal represents the protocol preference value, Path represents the path, and Ogn represents the origin.

[0093] It can be understood that the routes in Table 1 are only illustrative explanations, and the present application is not limited to this.

[0094] S302: Obtain the routing algorithm selected by the user.

[0095] Among them, the routing algorithm is a routing algorithm corresponding to the current scenario, and the routing algorithm selected by the user is one of multiple pre-stored routing algorithms. It should be noted that there is a corresponding relationship between the scenario and the routing algorithm in the embodiments of the present application. For example, scenario 1 corresponds to routing algorithm 1, scenario 2 corresponds to routing algorithm 2, etc.

[0096] It should be noted that in the embodiments of the present application, the corresponding relationship between the scenario and the routing algorithm can be pre-saved. For example, it can be saved in the form of a table. Exemplarily, the corresponding relationship between the routing algorithm and the scenario can be referred to Table 1.

[0097] Table 1 Corresponding Relationship between Scenario and Routing Algorithm

[0098] Scenario Routing Algorithm Scenario 1 Routing Algorithm 1 Scenario 2 Routing Algorithm 2 Scenario 3 Routing Algorithm 3 Scenario 4 Routing Algorithm 4

[0099] Of course, it can be understood that Table 1 is only an illustrative explanation, and the form of storage is not limited to the above table, and the present application does not make any limitations in this regard.

[0100] In some embodiments, the scenario can be an operator scenario, such as China Mobile, China Unicom, or China Telecom, or it can be a cloud scenario, such as a public cloud scenario or a private cloud scenario. Of course, it can also be China Broadcasting Network Corporation Limited (abbreviation: Radio and TV), etc. The present application does not make any limitations in this regard.

[0101] Taking the public cloud as an example below, the routing algorithm corresponding to the scenario involved in the present application will be introduced.

[0102] In the public cloud scenario, the experience of end users accessing cloud services through the Internet (e.g., latency and packet loss) is very sensitive. If the user access experience is poor, the mobile APP may be uninstalled, resulting in a reduction in the number of users of the cloud service corresponding to the APP on the mobile phone. Cloud services are very sensitive to the number of active user accesses. Once the number of users decreases, it will affect the profitability and survival of the cloud service. Therefore, the corresponding cloud service will consider migrating to other public clouds immediately, and in this way, a public cloud will lose a customer.

[0103] Based on this, the public cloud requires that the optimal route selected by the border BGP router at its POP point using the route preference algorithm can always ensure the experience of users accessing various cloud services on the public cloud. For example, it is required that the selected route has the lowest latency, the lowest packet loss, and the lowest line cost and line utilization for carrying cloud ingress traffic.

[0104] Exemplarily, in the public cloud scenario, the corresponding routing algorithm can be: when selecting the preferred route for multiple routes with the same destination address prefix, the LP value, AS-Path, line cost, and line utilization of the route can be compared simultaneously. Specifically, the route with the highest LP value, the shortest AS-Path, the lowest line cost, and the lowest line utilization can be selected. It should be noted that LP is Local Preference, which is the local priority (LOCAL_PREF) introduced above, and is sometimes abbreviated as LP, and it should be understood that they have the same meaning.

[0105] Of course, it can be understood that the above is only an example, and the routing algorithm in the public cloud scenario is not limited to this.

[0106] That is to say, in addition to the existing 12 rules, there can also be other rules (e.g., M rules). For example, the rules can also include line cost and line utilization, etc. Based on the (12 + M) rules, a route preference algorithm is formed for users to select according to different scenarios.

[0107] In some embodiments of the present application, in the traditional operator scenario, mainly best-effort connection services are provided to a large number of end-users, and specific special guarantees are rarely made for specific services among them. Therefore, as long as the service is not interrupted, it is not sensitive to fluctuations in delay and packet loss. Once an end-user accesses the network, the phone number is bound to various banks and e-commerce services, and it is very difficult to switch networks. Therefore, fluctuations in service quality do not pose as much pressure on operators as on public cloud services. What operators are concerned about is the network construction cost and operation and maintenance cost. Therefore, the current BGP routing optimization algorithm is adopted, which is easier to network and maintain, and the costs in all aspects are relatively low.

[0108] Further, as a possible implementation manner, before obtaining the routing algorithm selected by the user, the method further includes:

[0109] Obtain a plurality of pre-stored routing algorithms and display the plurality of routing algorithms in a graphical interface.

[0110] In the embodiments of the present application, the user can input a selection instruction on the graphical interface, and the router determines the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

[0111] As another possible implementation manner, in the embodiments of the present application, the user can input a routing algorithm through the command line interface. That is to say, the router can obtain the routing algorithm input by the user through the command line interface to obtain the routing algorithm obtained by the user.

[0112] Of course, it can be understood that the user can also select a routing algorithm through voice, or other perceptible ways for humans (such as touch or even smell), or other forms such as scripts and files. The present application does not make any limitations in this regard.

[0113] Further, since the scenario in the present application corresponds to the routing algorithm, in a possible implementation manner, the scenario information selected by the user can be obtained, and the routing algorithm corresponding to the scenario information selected by the user can be determined. Exemplarily, for example, the router obtains that the scenario selected by the user is Scenario 1, and then according to Table 1, it can be known that the routing algorithm corresponding to Scenario 1 is Routing Algorithm 1. Therefore, it can be determined that the routing algorithm corresponding to the user-selected Scenario 1 is Routing Algorithm 1.

[0114] S303: Select one route from the N routes according to the routing algorithm selected by the user.

[0115] In the embodiments of the present application, multiple routes with the same routing prefix can be selected according to the routing algorithm selected by the user, so as to select one route to be sent to Router 2.

[0116] As an example, the routing algorithm may include the following rules: the highest local priority; the shortest autonomous system path; the lowest delay; the least packet loss; the lowest line cost. Of course, the routing algorithm is not limited to the above rules and may also include other rules. And the number of rules can be one or multiple, and this application does not make any limitations in this regard.

[0117] The following takes several of these parameters as examples for illustration. For example, the routing algorithm selected by the user requires the highest LP value and the shortest AS-Path. For instance, the routing algorithm includes the following rules:

[0118] R2: Preferentially select the route with the highest local priority (LOCAL_PREF);

[0119] R4: Preferentially select the route with the shortest AS path (AS_PATH).

[0120] Suppose there are 4 routes with the same routing prefix, and the partial parameters of the four routes are as follows:

[0121] Route 1: Local Preference = 2000, length of (AS_PATH) = 2.

[0122] Route 2: Local Preference = 1000, length of (AS_PATH) = 3.

[0123] Route 3: Local Preference = 1500, length of (AS_PATH) = 4.

[0124] Route 4: Local Preference = 1000, length of (AS_PATH) = 3.

[0125] By comparing the Local Preference values of the above four routes, it can be seen that the Local Preference value of Route 1 is the largest, and by comparing the AS_PATH of the four routes, it can be seen that the AS_PATH of Route 1 is the shortest. Therefore, according to the routing algorithm selected by the user, the route finally selected to be sent to Router 2 is Route 1.

[0126] Of course, it can be understood that the routing algorithm in the above example is only an illustrative description, and this application does not make any limitations in this regard.

[0127] As Figure 4 shown, it is a functional module diagram of a BGP route selection algorithm provided by an embodiment of this application. Refer to Figure 4As shown, in the present application, after the router 1 receives a route, it can save the route in the first storage module (Adj-RIBS-In). At the same time, through the route selection algorithm module, it selects a routing algorithm from routing algorithm 1, routing algorithm 2... routing algorithm N, and then optimizes the received route according to the selected routing algorithm. The optimized route is placed in the second storage module (Loc-RIB), and then the optimized route in Loc-RIB is placed in the third storage module (Adj-RIBS-Out), and finally the optimized route is broadcast to other routers.

[0128] Since the routes saved in the storage module may be updated. For example, Adj-RIBS-In saves the currently received routes. When route optimization is performed, an update message will be generated in Adj-RIBS-In. This message will contain the added, deleted, updated, or withdrawn routes. The Adj-RIBS-In can be updated using the update message. After a new round of route reception, the Loc-RIB can be updated continuously.

[0129] Figure 5 The figure shows a schematic diagram of the functional modules of a routing selection device based on the Border Gateway Protocol. The device 500 may include: an acquisition unit 501 and a selection unit 502.

[0130] Among them, the acquisition unit 501 is used to acquire N routes out of L routes received based on the Border Gateway Protocol (BGP), and acquire the routing algorithm selected by the user; where the routing algorithm is a routing algorithm corresponding to the cloud scenario, and the routing algorithm selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers.

[0131] The selection unit 502 is used to select one route from the N routes according to the routing algorithm selected by the user obtained by the acquisition unit 502.

[0132] In a possible design, the N routes have the same routing prefix.

[0133] In a possible design, the acquisition unit 502 is further used to: before acquiring the routing algorithm selected by the user, acquire multiple pre-stored routing algorithms and display the multiple routing algorithms in a graphical interface.

[0134] The acquisition unit 502 specifically acquires the routing algorithm selected by the user in the following manner: determining the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

[0135] In a possible design, the obtaining unit 502 is specifically configured to obtain the routing algorithm selected by the user in the following manner: obtain the routing algorithm input by the user through the command line interface.

[0136] In a possible design, the obtaining unit 502 is specifically configured to obtain the routing algorithm selected by the user in the following manner: obtain the scenario information selected by the user, and determine the routing algorithm corresponding to the scenario information selected by the user.

[0137] In a possible design, the routing algorithm corresponding to the cloud scenario includes at least one of the following rules:

[0138] The local priority is the highest; the autonomous system path is the shortest; the delay is the lowest; the packet loss is the least; the line cost is the lowest.

[0139] Among them, all the relevant contents of each step involved in the above method embodiments can be cited in the function description of the corresponding functional module, and will not be elaborated here.

[0140] The division of modules in the embodiments of the present application is illustrative. It is only a logical function division. In actual implementation, there may be other division methods. In addition, in each embodiment of the present application, each functional module can be integrated in one processor, or can exist separately physically, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.

[0141] As Figure 6 shown, a routing selection device 600 based on the Border Gateway Protocol provided by an embodiment of the present application. The device 600 includes at least one processor 602, which is used to implement or support the device 600 to implement the Figure 5 function of the selection unit shown. Exemplarily, the processor 602 can select one route from the N routes according to the routing algorithm selected by the user, and the like. For specific details, refer to the detailed description in the method example, and will not be elaborated here.

[0142] Device 400 may further include at least one memory 401 for storing program instructions. Exemplarily, the memory 401 can be used to store routing algorithms, scenario information, etc. For specific details, refer to the detailed description in the method examples, which will not be elaborated here. The memory 601 and the processor 602 are coupled. The coupling in the embodiments of the present application is an indirect coupling or communication connection between devices, units or modules, which can be electrical, mechanical or other forms for information interaction between devices, units or modules. The processor 602 may cooperate with the memory 601. The processor 602 may execute the program instructions and / or data stored in the memory 601. At least one of the at least one memory may be included in the processor.

[0143] Device 600 may further include a communication interface 603 for communicating with other devices through a transmission medium. The processor 602 can use the communication interface 603 to send and receive data.

[0144] The present application does not limit the specific connection medium between the communication interface 603, the processor 602, and the memory 601. In the embodiments of the present application Figure 6 it is shown that the memory 601, the processor 602, and the communication interface 603 are connected through a bus 604, and the bus is represented by a thick line in Figure 6 The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 6 only one thick line is used to represent it in

[0145] In the embodiments of the present application, the processor 602 can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly executed by the hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0146] In the embodiments of the present application, the memory 601 can be a non-volatile memory, such as a hard disk drive (HDD) or a solid-state drive (SSD), etc., or can also be a volatile memory, such as RAM. The memory is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory in the embodiments of the present application can also be a circuit or any other device capable of implementing a storage function for storing program instructions.

[0147] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, and the embodiments of the present application do not make specific limitations thereon.

[0148] The embodiments of the present application also provide a computer-readable storage medium, including instructions, which when running on a computer, cause the computer to execute Figure 3 the method of the embodiments shown.

[0149] The embodiments of the present application also provide a computer program product, including instructions, which when running on a computer, cause the computer to execute Figure 3 the method of the embodiments shown.

[0150] The embodiments of the present application also provide a chip, and the logic in the chip is used to execute Figure 3 the method of the embodiments shown.

[0151] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram can be realized by instructions, and the combination of the processes and / or blocks in the flowchart and / or block diagram can also be realized by instructions. These instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0152] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0153] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0154] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims

1. A routing method based on the Border Gateway Protocol, characterized in that, it includes: Obtaining N routes out of L routes received based on the Border Gateway Protocol (BGP); Obtaining the scenario information selected by the user, and determining the routing algorithm corresponding to the scenario information selected by the user; wherein, the scenario is a cloud scenario, the routing algorithm is a routing algorithm corresponding to the cloud scenario, and the routing algorithm corresponding to the scenario information selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers; Selecting the N routes according to the routing algorithm corresponding to the scenario information selected by the user to obtain one route; The cloud scenario includes a public cloud scenario, and the routing algorithm corresponding to the public cloud scenario includes at least one of the highest local priority, the shortest autonomous system path, the lowest delay, the least packet loss, and the lowest line cost.

2. The method according to claim 1, characterized in that, The N routes have the same routing prefix.

3. The method according to claim 1 or 2, characterized in that, Before obtaining the routing algorithm selected by the user, the method further includes: Obtaining multiple pre-stored routing algorithms and displaying the multiple routing algorithms in a graphical interface; The obtaining the routing algorithm selected by the user includes: Determining the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

4. The method according to claim 1 or 2, characterized in that, The obtaining the routing algorithm selected by the user includes: Obtaining the routing algorithm input by the user through a command-line interface.

5. A routing selection device based on the Border Gateway Protocol, characterized in that, it includes: An obtaining unit, configured to obtain N routes out of L routes received based on the Border Gateway Protocol (BGP), and obtain the scenario information selected by the user, and determine the routing algorithm corresponding to the scenario information selected by the user; wherein, the scenario is a cloud scenario, the routing algorithm is a routing algorithm corresponding to the cloud scenario, and the routing algorithm corresponding to the scenario information selected by the user is one of multiple pre-stored routing algorithms; L and N are positive integers; A selecting unit, configured to select the N routes according to the routing algorithm corresponding to the scenario information selected by the user obtained by the obtaining unit to obtain one route; The cloud scenario includes a public cloud scenario, and the routing algorithm corresponding to the public cloud scenario includes at least one of the highest local priority, the shortest autonomous system path, the lowest delay, the least packet loss, and the lowest line cost.

6. The device according to claim 5, characterized in that, The N routes have the same routing prefix.

7. The device according to claim 5 or 6, characterized in that, The obtaining unit is further configured to: before obtaining the routing algorithm selected by the user, obtain multiple pre-stored routing algorithms and display the multiple routing algorithms in a graphical interface; The obtaining unit specifically obtains the routing algorithm selected by the user in the following manner: Determine the routing algorithm selected by the user according to the selection instruction input by the user on the graphical interface.

8. The device according to claim 5 or 6, wherein, the obtaining unit is specifically configured to obtain the routing algorithm selected by the user in the following manner: Obtain the routing algorithm input by the user through the command line interface.

9. A routing selection device based on the Border Gateway Protocol, wherein, comprising: a memory, a communication interface and a processor; the memory stores computer instructions; the communication interface is used for receiving and sending data; the processor is configured to execute the computer instructions stored in the memory, so that the device executes the method according to any one of claims 1-4.

10. A computer-readable storage medium, wherein, the storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-4.

11. A computer program product, wherein, the computer program product includes computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Optimized border gateway protocol best path selection for optimal route reflection

    CN107409092A

  • Network data acceleration method and client, router, and server

    CN109246004A