Route optimization method and related equipment
By adjusting the link state information in the BGP-LS-SPF protocol, the problems of topological delay, repeated diffusion messages and optimization failures in the prior art are solved, and a more efficient and stable network optimization process is achieved.
Patent Information
- Application Number
- CN202311214896.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-03-21
AI Technical Summary
In the BGP-LS-SPF protocol, when link state information is optimized based on existing preferred rules, there are problems such as unnecessary topological delay, repeated diffusion packets and link state information being preferred failed.
The rule "directly connected BGPSPF neighbors generate link status information first" has been deleted, and preferred rules have been added, including priority based on the latest link status information based on the Sequence Number, priority link status information that has been preferred if the Sequence Number value is equal, priority link status information that has a large router ID value, priority link status information that has a small Peer ID value, priority link status information, priority link status information that has a small Peer ID value, etc.
Through these optimization measures, unnecessary topological delays are avoided, duplicate diffusion messages are avoided, and link status information is optimized and the stability and efficiency of the network are improved.
Smart Images

Figure CN119676142A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the computer field, and in particular to a routing optimization method and related devices. Background Art
[0002] The Border Gateway Protocol-Link State Shortest Path First (BGP-LS-SPF) protocol draft is continuously updated on the IETF website. It was proposed in the early days mainly to solve the problem of large-scale data center networking. With the evolution of the protocol draft, it is currently believed that it can also be used in scenarios such as SDWAN and satellite networks.
[0003] In the BGP-LS-SPF protocol, there are three rules for the optimization of link state network layer reachability information (NLRI): (1) the link state information generated by the directly connected BGP-LS-SPF neighbor is prioritized; (2) the link state information generated later based on the sequence number is prioritized; (3) the link state with a larger router ID value is prioritized. However, in actual application scenarios, there are some problems in optimizing link state information based on the above rules. Summary of the invention
[0004] The embodiments of the present application provide a route optimization method and related devices for avoiding unnecessary topology delays, avoiding repeated diffusion of messages, and avoiding failure of link state information optimization.
[0005] The first aspect of the present application provides a routing optimization method:
[0006] Based on BGP, multiple link state information are received, and the NLRIs of the multiple link state information are the same; a preferred rule is obtained, and the preferred rule includes a first priority rule, a second priority rule, a third priority rule and a fourth priority rule, and the priorities of the first priority rule to the fourth priority rule decrease in sequence; the first priority rule is that the link state information generated later based on the SequenceNumber is given priority, the second priority rule is that if the Sequence Number values of the link state information are equal, the link state information that has been preferred is given priority, the third priority rule is that the link state information with a larger routerID value is given priority, or the third priority rule is that the link state information with a smaller router ID value is given priority, and the fourth priority rule is that the link state information with a smaller Peer ID value is given priority; multiple link state information are preferred according to the preferred rule.
[0007] In this application, the rule of "the link status information self-generated by the directly connected BGPSPF neighbor takes precedence" is deleted, so the link status information with the latest Sequence Number will be selected with the highest priority, thereby avoiding unnecessary topological delays; based on the second priority rule, when the Sequence Number values of the link status information are equal, the selection will no longer be repeated, thereby avoiding repeated diffusion of messages; when the third priority rule fails to select successfully, the fourth priority rule can ensure the selection success and avoid the failure of selection.
[0008] In a possible implementation, the preferred rule further includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; the first optional rule is that link state information with a legal source address is prioritized.
[0009] In the present application, network attacks can be prevented based on the first optional rule.
[0010] In a possible implementation, the preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule, and higher than the third priority rule. The second optional rule is that link state information without bit errors is prioritized.
[0011] In a possible implementation, the preferred rule also includes a first optional rule and a second optional rule; the priority of the first optional rule is greater than the first priority rule; the priority of the second optional rule is less than the second priority rule, and greater than the third priority rule. The first optional rule is that link state information with a legal source address is prioritized, and the second optional rule is that link state information without bit errors is prioritized.
[0012] The second aspect of the present application provides a routing optimization method:
[0013] Based on BGP, multiple link state information are received, and the NLRIs of the multiple link state information are the same; a preferred rule is obtained, and the preferred rule includes a first priority rule, a second priority rule, a third priority rule and a fourth priority rule, and the priorities of the first priority rule to the fourth priority rule are successively reduced; the first priority rule is that the link state information generated later based on the Sequence Number is given priority, the second priority rule is that if the Sequence Number values of the link state information are equal, the link state information received first is given priority, the third priority rule is that the link state information with a larger router ID value is given priority, or the third priority rule is that the link state information with a smaller router ID value is given priority, and the fourth priority rule is that the link state information with a smaller Peer ID value is given priority; and multiple link state information are preferred according to the preferred rule.
[0014] In this application, the rule of "the link status information self-generated by the directly connected BGPSPF neighbor takes precedence" is deleted, so the link status information with the latest Sequence Number will be selected with the highest priority, thereby avoiding unnecessary topological delays; based on the second priority rule, when the Sequence Number values of the link status information are equal, the selection will no longer be repeated, thereby avoiding repeated diffusion of messages; when the third priority rule fails to select successfully, the fourth priority rule can ensure the selection success and avoid the failure of selection.
[0015] In a possible implementation, the preferred rule further includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; the first optional rule is that link state information with a legal source address is prioritized.
[0016] In the present application, network attacks can be prevented based on the first optional rule.
[0017] In a possible implementation, the preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule, and higher than the third priority rule. The second optional rule is that link state information without bit errors is prioritized.
[0018] In a possible implementation, the preferred rule also includes a first optional rule and a second optional rule; the priority of the first optional rule is greater than the first priority rule; the priority of the second optional rule is less than the second priority rule, and greater than the third priority rule. The first optional rule is that link state information with a legal source address is prioritized, and the second optional rule is that link state information without bit errors is prioritized.
[0019] The present application provides a router in three aspects:
[0020] The invention comprises a plurality of functional modules, which interact with each other to realize the methods in the above-mentioned various aspects and their implementations. The plurality of functional modules can be realized based on software, hardware or a combination of software and hardware, and the plurality of functional modules can be arbitrarily combined or divided based on the specific implementation.
[0021] The present application provides a router in four aspects:
[0022] The system comprises a processor, the processor is coupled to a memory, and the memory is used to store instructions. When the instructions are executed by the processor, the sending end device executes the methods in the aforementioned aspects.
[0023] A fifth aspect of the present application provides a computer-readable storage medium:
[0024] A computer program or instruction is stored thereon, and it is characterized in that when the computer program or instruction is executed, the computer program or instruction is stored thereon, and when the computer program or instruction is executed, the computer executes the method in the aforementioned various aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of optimizing link state information based on existing optimization rules;
[0026] Figure 2a Another schematic diagram of optimizing link state information based on existing optimization rules;
[0027] Figure 2b Another schematic diagram of optimizing link state information based on existing optimization rules;
[0028] Figure 2c Another schematic diagram of optimizing link state information based on existing optimization rules;
[0029] Figure 3a Another schematic diagram of optimizing link state information based on existing optimization rules;
[0030] Figure 3b A schematic diagram of a flow chart of the routing optimization method in this application;
[0031] Figure 4a A schematic diagram of optimizing link state information based on the optimization rule of the present application;
[0032] Figure 4b Another schematic diagram of optimizing link state information based on the optimization rule of the present application;
[0033] Figure 4c Another schematic diagram of optimizing link state information based on the optimization rule of the present application;
[0034] Figure 5 Another schematic diagram of optimizing link state information based on the optimization rule of the present application;
[0035] Figure 6 Another schematic diagram of optimizing link state information based on the optimization rule of the present application;
[0036] Figure 7 A schematic diagram of the structure of the router in this application;
[0037] Figure 8 Another structural diagram of the router in this application;
[0038] Fig. 9 A schematic diagram of the structure of the router in this application. DETAILED DESCRIPTION
[0039] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0040] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Link state information refers to the message that a router (or peer) encapsulates the link state change in a certain protocol format according to the change of the local link state and can be spread in the network. Link state information can be sent in the format of the update message of the BGP-LS-SPF protocol. The update message includes the "Next hop network address", "NetworkLayer Reachability Information", and "Path Attribute-BGP-LS Attribute" fields, where the NLRI field is used to describe a link, node, or prefix. The "Path Attribute-BGP-LS Attribute" field includes the "Sequence Number TLV" field and the "SPF Status TLV" field. When the SPF Status attribute is carried and the value is 1, it means that the link is unreachable. If the attribute is not carried, it means that the link is reachable. According to the protocol, when more than one link state information about the same NLRI is released, the value of the Sequence Number attribute needs to be increased or decreased.
[0042] When a router receives multiple link state information with the same NLRI, it needs to select the best one. In the current BGP-LS-SPF protocol, three rules for selecting link state information are defined: (1) Link state information generated by directly connected BGPSPF neighbors is prioritized; (2) Link state information generated later based on the sequence number is prioritized; (3) Link state information with a larger router ID value is prioritized. Among them, rule (1) is used to solve the problem of sequence number disorder; rule (2) is used to ensure that the latest published link state information is preferred; rule (3) is used to directly select the link state information with a larger router ID value when the above two rules cannot be successfully selected. However, in actual application scenarios, there are some problems in selecting link state information based on the above three rules, which are introduced below:
[0043] 1. It causes repeated diffusion of messages.
[0044] See also Figure 1 , in the network topology, including R1, R2, R3, and R4, when link A on R1 becomes unreachable, R1 generates a link state information indicating that link A is unreachable, and the link state information can be diffused to R5 through the path R1-R2-R4; or it can also be diffused to R5 through the path R1-R3-R4. If the network congestion level of the path R1-R2-R4 is relatively good, the link state information will first diffuse from this path to R4. For R4, at this time, there is only one link state information from R2 for link A, so the link state information will be directly preferred and published to R5. Afterwards, the link state information diffuses to R4 from the path R1-R3-R4. Since the router ID value of R3 is larger than that of R2, R4 prefers the link state information from R3 based on the above rule (3) and publishes it to R5 again. It is not difficult to see that for the same link state information, R4 publishes it to R5 twice just because it comes from different paths, resulting in unnecessary duplication. Similar to the above-mentioned repeated diffusion message situation will increase with the increase of the number of BGP-SPF neighbors. Especially in large-scale networks, the impact of such repeated diffusion messages cannot be ignored.
[0045] 2. It causes delayed network convergence.
[0046] See also Figure 2a, the network topology includes R1, R2, R3, and R4. The link between R1 and R2 is defined as L12, the link between R1 and R3 is defined as L13, the link between R2 and R3 is defined as L23, and the link between R3 and R4 is defined as L34. When L34 is unreachable, R3 publishes a link status information indicating that L34 is unreachable. The link status information is diffused from L23 to R2, and also diffused from L13 and L12 to R2. After R2 receives the link status information from R3 and R1, because R3 is R2's directly connected BGPSPF neighbor and the link status information is also self-generated by R3, R2 prefers the link status information from R3 based on the above rule (1). Please refer to Figure 2b If L23 becomes unreachable later, it will cause session failure between R2 and R3, and further cause peer down between R2 and R3. According to the BGPSPF protocol, during peer down, the link status information from R3 is deleted after a delay of two seconds. During the delay, the link status information is set to stable state, that is, outdated. Figure 2c , if L34 becomes reachable later, R3 publishes a link status information indicating that L34 is reachable, and the link status information is diffused to R2 through L13 and L12. However, due to the above-mentioned two-second delay, the link status information from R3 indicating that L34 is unreachable is still stored in R2's routing table. Based on the above rule (1), the link status information from R3 indicating that L34 is unreachable has a higher priority than the link status information from R1 indicating that L34 is reachable, so it is still preferred. That is to say, during the peer down hold period between R2 and R3, the network topology stored on R2 is inconsistent with the actual network topology.
[0047] 3. Link status information optimization fails.
[0048] See also Figure 3a , the network topology includes R1, R2, and R3. The link between R1 and R2 is defined as L12. There are two reachable links between R2 and R3, and BGP-LS-SPF neighbors are established based on these two links. When the link status of L12 changes, R1 publishes a link status message to indicate the change, and R2 notifies R3 of the two link status messages through peer1 and peer2 respectively. Assuming that the two link status messages arrive at R3 at the same time, since the values of the Sequence Numbers of the two link status messages are the same as the values of the router ID, no optimal result can be obtained.
[0049] The present application provides a routing optimization method and related devices for avoiding unnecessary topology delays, avoiding repeated diffusion of messages, and avoiding failure of link state information optimization.
[0050] The present application can be applied to a network scenario in which a router optimizes link state information based on the BGP-LS-SPF protocol.
[0051] See also Figure 3b , the process of the routing optimization method in this application is described in detail below:
[0052] 301. Receive multiple pieces of link state information based on a border gateway protocol BGP, where the network layer reachability information NLRI of the multiple pieces of link state information are the same;
[0053] In the network topology, a router receives multiple link state information based on BGP, and the NLRI of these multiple link state information is the same. In an example, see Figure 4a , the network topology includes R1, R2, R3, and R4, and R3 is the router in this application. The link between R1 and R2 is defined as L12, the link between R1 and R3 is defined as L13, the link between R2 and R3 is defined as L23, and the link between R3 and R4 is defined as L34, wherein the router ID of R2 is 4.4.4.4, and the router ID of R4 is 2.2.2.2. When L12 becomes unreachable, R2 publishes a link status information indicating that L12 is unreachable, and the link status information spreads from L23 to R3, and also spreads from L23 and L23 to R3.
[0054] 302. Obtaining a preferred rule, where the preferred rule includes a first priority rule, a second priority rule, a third priority rule, and a fourth priority rule, where the priorities of the first priority rule to the fourth priority rule decrease in sequence;
[0055] This application modifies the link state information optimization rules in the BGP-LS-SPF protocol. First, the aforementioned rule (1) is deleted. Deleting this rule does not affect the topology convergence when the Sequence Number is out of sequence. The reason is as follows: In the BGP protocol, when receiving messages from the same BGP neighbor, the new message overwrites the old message processing rule is adopted. Based on this processing rule, when the Sequence Number is out of sequence, the BGP neighbor can achieve the purpose of topology convergence through hop-by-hop coverage. In addition, the "BGPSelf-Originated NLRI Processing Rules" in Section 6.1.1 of the BGPSPF draft can also ensure the recovery of Sequence Number out of sequence. Therefore, the above rule (1) is not a mandatory rule and will cause the aforementioned network delay convergence problem, so it is deleted.
[0056] In addition, this application also adds 4 new optimization rules, which are introduced below:
[0057] A. If the Sequence Number values of the link state information are equal, the preferred link state information takes precedence;
[0058] B. Link status information with smaller Peer ID value takes precedence;
[0059] C. Link state information with a valid source address takes precedence. This rule is optional.
[0060] It should be understood that for this rule, the router needs to obtain the whitelist of addresses from the RPKI server when starting up, and determine whether the source address of the link state information is in the whitelist. If so, it means that the source address of the link state information is legal.
[0061] D. Link status information without bit errors takes precedence. This rule is optional.
[0062] It should be understood that for this rule, the router can determine whether there are bit errors in the link state information through CRC check, and the details will not be repeated.
[0063] After the above adjustments, the optimization rules of this application may include the following situations:
[0064] Case 1, in descending order of priority, includes the following rules:
[0065] (1) Link state information with a valid source address takes precedence;
[0066] (2) The link status information generated later based on the sequence number is given priority;
[0067] It should be understood that, in actual situations, if the Sequence Number of the newly released link state information corresponding to the same NLRI increases compared to the old link state information, then the link state information with a larger Sequence Number value is generated later; if the Sequence Number of the newly released link state information corresponding to the same NLRI decreases compared to the old link state information, then the link state information with a smaller Sequence Number value is generated later.
[0068] (3) If the Sequence Number values of the link state information are equal, the preferred link state information takes precedence;
[0069] (4) Link status information without bit errors takes precedence;
[0070] (5) Link status information with a larger router ID value takes precedence;
[0071] (6) Link status information with a smaller Peer ID value takes precedence.
[0072] Case 2, in descending order of priority, includes the following rules:
[0073] (1) The link status information generated later based on the sequence number is given priority;
[0074] (2) If the Sequence Number values corresponding to the link state information are equal, the preferred link state information takes precedence;
[0075] (3) Link status information with a larger router ID value takes precedence;
[0076] (4) Link status information with a smaller Peer ID value takes precedence.
[0077] Case 3, in descending order of priority, includes the following rules:
[0078] (1) Link state information with a valid source address takes precedence;
[0079] (2) Link status information with a larger Sequence Number value takes precedence;
[0080] (3) If the Sequence Number values corresponding to the link state information are equal, the preferred link state information takes precedence;
[0081] (4) Link status information with a larger router ID value takes precedence;
[0082] (5) Link status information with a smaller Peer ID value takes precedence.
[0083] Case 4 includes the following rules in descending order of priority:
[0084] (1) The link status information generated later based on the sequence number is given priority;
[0085] (2) If the Sequence Number values corresponding to the link state information are equal, the preferred link state information takes precedence;
[0086] (3) Link status information without bit errors takes precedence;
[0087] (4) Link status information with a larger router ID value takes precedence;
[0088] (5) Link status information with a smaller Peer ID value takes precedence.
[0089] Of course, the rule of "link state information with a larger router ID value takes precedence" in the above cases 1 to 4 can also be modified to "link state information with a smaller router ID value takes precedence". "If the Sequence Number values corresponding to the link state information are equal, the link state information that has been selected takes precedence" can also be modified to "If the Sequence Number values corresponding to the link state information are equal, the link state information that is received first takes precedence". Those skilled in the art can make flexible choices based on needs to obtain the preferred rules for other combinations, which will not be listed one by one in this embodiment.
[0090] The router obtains the above-mentioned preferred rule. In this embodiment, the preferred rule is taken as the above-mentioned case 1 as an example for description.
[0091] 303. Optimize the multiple pieces of link state information based on an optimization rule.
[0092] Please continue reading Figure 4a , assuming that R3 receives link state information from R2 and R4 at the same time, based on rule (1), R3 first determines whether the source addresses of the two link state information are legal. In this embodiment, it is assumed that the source addresses of the above two link state information are both legal, so the optimization fails. Based on rule (2), R3 compares the SequenceNumber values of the two link state information. Since the Sequence Number values of the two link state information are both 1, the optimization also fails. Since neither of the above two link state information is preferred, the optimization also fails based on rule (3). Based on rule (4), R3 determines whether there are bit errors in the two link state information. In this embodiment, there are no bit errors in the above two link state information, so the optimization also fails. Based on rule (5), R3 compares the values of the router IDs of the two link state information. Since R2's router ID 4.4.4.4 is greater than R4's router ID 2.2.2.2, R3 prefers the link state information from R2 and records it in the routing table. The specific contents are as follows:
[0093] {
[0094] Best>NLRI{L12},attr{SN(Sequence Number)=1,SPF status=1,router ID=4.4.4.4}; / The link status information from R2 is preferred
[0095] NLRI{L12},attr{SN=1,SPF status=1,router ID=2.2.2.2}; / Link status information from R4
[0096] }
[0097] See also Figure 4b If L23 becomes unreachable, R3 sets the link status information from R2 to stale in the routing table. The details are as follows:
[0098] {
[0099] Stale, Best>NLRI{L12}, attr{SN=1, SPF status=1, router ID=4.4.4.4}; / The link status information from R2 is set to stable
[0100] NLRI{L12},attr{SN=1,SPF status=1,router ID=2.2.2.2};
[0101] }
[0102] See also Figure 4c If L12 becomes reachable again, R2 publishes a link state information indicating that L12 is reachable, and the link state information is diffused to R3 through L24 and L34. Since the link state information is the second link state information published by R2 for L12, its sequence number is 2. For the convenience of description, the link state information is recorded as link state information 1, and the aforementioned preferred link state information is recorded as link state information 2.
[0103] After receiving link state information 1, R3 performs a optimization between link state information 1 and link state information 2 based on the aforementioned optimization rule. Assuming that the source addresses of link state information 1 and link state information 2 are both legal, the optimization based on rule (1) fails. Based on rule (2), R3 determines that the sequence number of link state information 1 is greater than link state information 2, so R3 optimizes link state information 1 and records it in the routing table. The specific content is as follows:
[0104] {
[0105] Stale, NLRI{L12}, attr{SN=1, SPF status=1, router ID=4.4.4.4};
[0106] Best>NLRI{L12},attr{SN=2,router ID=2.2.2.2}; / The link status information from R4 is preferred
[0107] }
[0108] It is not difficult to see that compared with Figure 2a to Figure 2c In the example shown, in similar scenarios, the preferred rules of the present application can avoid the situation where the network delays convergence.
[0109] In another example, please refer to step A01 to step A03:
[0110] A01, receiving multiple link state information based on the Border Gateway Protocol BGP, wherein the network layer reachability information NLRI of the multiple link state information is the same;
[0111] See also Figure 5 , the network topology includes R1, R2, R3, and R4, where R4 is the router in this application. The router ID of R2 is 2.2.2.2, and the router ID of R3 is 3.3.3.3. When link A on R1 becomes unreachable, R1 generates a link status information indicating that link A is unreachable, and the link status information can be diffused to R5 through the path R1-R2-R4; or it can also be diffused to R5 through the path R1-R3-R4.
[0112] A02. Obtaining a preferred rule, wherein the preferred rule includes a first priority rule, a second priority rule, a third priority rule, and a fourth priority rule, wherein the priorities of the first priority rule to the fourth priority rule decrease in sequence;
[0113] This step is similar to the aforementioned step 402 and will not be described in detail here. This embodiment is still described by taking the aforementioned situation 1 as an example for the optimization rule.
[0114] A03. Optimize the multiple pieces of link state information based on optimization rules.
[0115] If the network congestion level of the path R1-R2-R4 is relatively good, the link state information will first spread from this path to R4. For R4, at this time, there is only one link state information from R2 for link A, so this link state information will be directly preferred and published to R5. R4 also records the above link state information in the routing table, the specific content is as follows:
[0116] {
[0117] Best>NLRI{LA}, attr{SN=1, SPF status=1, router ID=2.2.2.2} / The link status information from R2 is preferred.
[0118] }
[0119] Afterwards, the link state information spreads from the path R1-R3-R4 to R4, and R4 performs the optimization between the two link state information based on the aforementioned optimization rules. Since the Sequence Numbers of the two link state information are the same, and assuming that the source addresses of the link state information from R2 and R3 are both legal, the optimization based on both rules (1) and (2) fails. Based on rule (3), if R4 has already optimized the link state information from R2, and then receives the link state information from R3, and the Sequence Numbers of the two link state information are the same, the already optimized link state information will still take precedence, and the link state information from R3 will no longer be released to R5. At this time, the specific contents of R4's routing table are as follows:
[0120] {
[0121] Best>NLRI{LA}, attr{SN=1, SPF status=1, router ID=2.2.2.2} / The link status information from R2 is still preferred.
[0122] NLRI{LA}, attr{SN=1, SPF status=1, router ID=3.3.3.3}
[0123] }
[0124] It is not difficult to see that compared with Figure 1 In the scenario shown, the preferred rules based on the present application can avoid repeated diffusion of messages.
[0125] In another example, please refer to step B01 to step B03:
[0126] B01, receiving multiple link state information based on the Border Gateway Protocol BGP, and the network layer reachability information NLRI of the multiple link state information is the same;
[0127] See also Figure 6 , the network topology includes R1, R2, and R3, and R3 is the router in this application. The link between R1 and R2 is defined as L12, and there are two reachable links between R2 and R3, and BGP-LS-SPF neighbors are established based on these two links. When the link status of L12 changes, R1 publishes a link status message to indicate the change, and R2 notifies R3 of the above two link status messages through peer1 and peer2 respectively.
[0128] B02, obtaining a preferred rule, the preferred rule including a first priority rule, a second priority rule, a third priority rule and a fourth priority rule, the priorities of the first priority rule to the fourth priority rule decreasing in sequence;
[0129] This step is similar to the aforementioned step 402 and will not be described in detail here. This embodiment is still described by taking the aforementioned situation 1 as an example for the optimization rule.
[0130] B03. Optimize the multiple pieces of link state information based on optimization rules.
[0131] In one case, the two link state information arrive at R3 at the same time. R3 performs the optimization between the two link state information based on the above optimization rule. Assuming that the source addresses of the two link state information are both legal and have no bit errors, the optimization based on rules (1) to (5) all fail. Based on rule (6), R3 compares the peer IDs of the two link state information. Since peer 1 is smaller than peer 2, R3 prefers the link state information from peer 1.
[0132] In another case, for example, if the link state information from peer 1 reaches R3 first, R3 will directly prioritize the link state information. Later, when the link state information from peer 2 arrives, assuming that the source addresses of the above two link state information are both legal, the preference from rule (1) to rule (2) fails. Based on rule (3), R3 still prioritizes the link state information from peer 1. It is not difficult to see that compared with Figure 3a In the above example, the optimization rules based on the present application can ensure that the optimization will succeed in this scenario.
[0133] The aforementioned embodiments are introduced by taking the optimization rule as case 1 as an example. When the optimization rule is the other cases mentioned above, the method of optimizing the link state information based on the optimization rule can refer to the introduction of the aforementioned embodiments, and the details will not be repeated one by one.
[0134] The following is an introduction to the router in this application:
[0135] See also Figure 7 The router in this application includes a receiving unit 701, an acquiring unit 702, and a processing unit 703.
[0136] A receiving unit 701 is configured to receive multiple pieces of link state information based on BGP, where the NLRIs of the multiple pieces of link state information are the same;
[0137] An acquisition unit 702 is used to acquire a preferred rule, where the preferred rule includes a first priority rule, a second priority rule, a third priority rule and a fourth priority rule, where the priorities of the first priority rule to the fourth priority rule decrease in sequence;
[0138] Processing unit 703, for giving priority to the link state information generated later indicated by the Sequence Number according to the first priority rule, giving priority to the link state information that has been selected if the Sequence Number values of the link state information are equal, giving priority to the link state information with a larger router ID value according to the third priority rule, or giving priority to the link state information with a smaller router ID value according to the third priority rule, and giving priority to the link state information with a smaller Peer ID value according to the fourth priority rule;
[0139] The processing unit 703 is used to optimize the multiple link state information according to the optimization rule.
[0140] In a possible implementation, the preferred rule further includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; the first optional rule is that link state information with a legal source address is prioritized.
[0141] In a possible implementation, the preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; the second optional rule is that link status information without bit errors is prioritized.
[0142] In a possible implementation, the preferred rules also include a first optional rule and a second optional rule; the priority of the first optional rule is greater than the first priority rule; the priority of the second optional rule is less than the second priority rule, and greater than the third priority rule; the first optional rule is that link status information with a legal source address is prioritized; the second optional rule is that link status information without errors is prioritized.
[0143] See also Figure 8 The router in this application includes a receiving unit 801, an acquiring unit 802, and a processing unit 803.
[0144] A receiving unit 801 is configured to receive multiple pieces of link state information based on BGP, where the NLRIs of the multiple pieces of link state information are the same;
[0145] An acquisition unit 802 is used to acquire a preferred rule, where the preferred rule includes a first priority rule, a second priority rule, a third priority rule and a fourth priority rule, where the priorities of the first priority rule to the fourth priority rule decrease in sequence;
[0146] The first priority rule is that the link state information generated later based on the Sequence Number is given priority. The second priority rule is that if the Sequence Number values of the link state information are equal, the link state information received first is given priority. The third priority rule is that the link state information with a larger router ID value is given priority, or the third priority rule is that the link state information with a smaller router ID value is given priority. The fourth priority rule is that the link state information with a smaller Peer ID value is given priority.
[0147] The processing unit 803 is used to optimize the multiple link state information according to the optimization rule.
[0148] In a possible implementation, the preferred rule further includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; the first optional rule is that link state information with a legal source address is prioritized.
[0149] In a possible implementation, the preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; the second optional rule is that link status information without bit errors is prioritized.
[0150] In a possible implementation, the preferred rules also include a first optional rule and a second optional rule; the priority of the first optional rule is greater than the first priority rule; the priority of the second optional rule is less than the second priority rule, and greater than the third priority rule; the first optional rule is that link status information with a legal source address is prioritized; the second optional rule is that link status information without errors is prioritized.
[0151] Fig. 9 1 is a schematic diagram of the structure of a router provided in an embodiment of the present application. The router 900 may be the aforementioned sending end device or receiving end device, including one or more central processing units (CPU) 901 and a memory 905, wherein the memory 905 stores one or more application programs or data. Among them, the memory 905 may be a volatile storage or a persistent storage. The program stored in the memory 905 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 901 may be configured to communicate with the memory 905, and execute a series of instruction operations in the memory 905 on the router 900. The device 1500 may also include one or more power supplies 902, one or more wired or wireless network interfaces 903, one or more input and output interfaces 904, and / or, one or more operating systems. The central processing unit 901 may perform the operations of the router in the illustrated embodiment, and the specific details are not repeated here.
[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0153] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0154] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A routing optimization method, applied to a router, characterized in that: include: Receive multiple link state information based on the Border Gateway Protocol BGP, where the network layer reachability information NLRI of the multiple link state information is the same; Obtaining a preferred rule, wherein the preferred rule includes a first priority rule, a second priority rule, a third priority rule, and a fourth priority rule, wherein the priorities of the first priority rule to the fourth priority rule decrease in sequence; The first priority rule is that the link state information generated later based on the Sequence Number is given priority, the second priority rule is that if the Sequence Number values of the link state information are equal, the link state information that has been selected is given priority, the third priority rule is that the link state information with a larger router ID value is given priority, or the third priority rule is that the link state information with a smaller router ID value is given priority, and the fourth priority rule is that the link state information with a smaller Peer ID value is given priority; The plurality of link state information are optimized according to the optimization rule.
2. The method according to claim 1, characterized in that The preferred rule also includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; The first optional rule is that link state information with a valid source address is given priority.
3. The method according to claim 1, characterized in that The preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; The second optional rule is that link status information without bit errors is given priority.
4. The method according to claim 1, characterized in that The preferred rule also includes a first optional rule and a second optional rule; The priority of the first optional rule is greater than the first priority rule; The priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; The first optional rule is that link state information with a legitimate source address is prioritized; The second optional rule is that link status information without bit errors is given priority.
5. A routing optimization method, applied to a router, characterized in that: include: Receive multiple link state information based on the Border Gateway Protocol BGP, where the network layer reachability information NLRI of the multiple link state information is the same; Obtaining a preferred rule, wherein the preferred rule includes a first priority rule, a second priority rule, a third priority rule, and a fourth priority rule, wherein the priorities of the first priority rule to the fourth priority rule decrease in sequence; The first priority rule is that the link status information generated later based on the Sequence Number is given priority, the second priority rule is that if the Sequence Number values of the link status information are equal, the link status information received first is given priority, the third priority rule is that the link status information with a larger router ID value is given priority, or the third priority rule is that the link status information with a smaller router ID value is given priority, and the fourth priority rule is that the link status information with a smaller Peer ID value is given priority; The plurality of link state information are optimized according to the optimization rule.
6. The method according to claim 5, characterized in that The preferred rule also includes a first optional rule, the priority of the first optional rule is greater than the first priority rule; The first optional rule is that link state information with a valid source address is given priority.
7. The method according to claim 5, characterized in that The preferred rule further includes a second optional rule, the priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; The second optional rule is that link status information without bit errors is given priority.
8. The method according to claim 5, characterized in that The preferred rule also includes a first optional rule and a second optional rule; The priority of the first optional rule is greater than the first priority rule; The priority of the second optional rule is lower than the second priority rule and higher than the third priority rule; The first optional rule is that link state information with a legitimate source address is prioritized; The second optional rule is that link status information without bit errors is given priority.
9. A router, characterized in that: It comprises a plurality of functional modules, and the plurality of functional modules interact with each other to implement any one of the methods 1 to 8 above.
10. A router, characterized in that: The method comprises a processor coupled to a memory, wherein the memory is used to store instructions. When the instructions are executed by the processor, the router executes the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: A computer program or instruction is stored thereon, wherein when the computer program or instruction is executed, the computer is caused to execute the method as claimed in any one of claims 1 to 8.
Citation Information
Cited By
Data processing method and device and electronic equipment
CN122437803A