Route processing method and device

By maintaining control identifiers among BGP instances, and determining whether to send a route based on whether the control identifiers match or not, the BGP loop problem is solved, and bandwidth resource consumption is reduced.

CN121283928APending Publication Date: 2026-01-06NEW H3C TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511540686.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

Existing technologies for resolving BGP loop problems require the receiving device to make judgments and occupy bandwidth resources, which cannot effectively prevent loop formation.

Method used

By maintaining control identifiers among BGP instances, routes are avoided from being sent based on whether the control identifiers match or not.

Benefits of technology

It effectively avoids the formation of BGP loops, reduces bandwidth resource consumption, and optimizes the route propagation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121283928A_ABST
    Figure CN121283928A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a route processing method and device, relates to the technical field of communication, is applied to a first BGP (Border Gateway Protocol) instance, and comprises the following steps: receiving a first route sent by a second BGP instance; establishing a BGP peer relationship between the first BGP instance and the second BGP instance; if the control identifier of the second BGP instance is matched with the control identifier of the third BGP instance, refusing to send the second route to the third BGP instance according to the first route; a BGP peer relationship is established between the first BGP instance and the third BGP instance. According to the scheme, the BGP loop problem can be solved, and bandwidth resource occupation is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a routing processing method and apparatus. Background Technology

[0002] The Border Gateway Protocol (BGP) focuses not on discovering and calculating routes, but on controlling route propagation and selecting the best route. BGP provides rich routing policies, enabling flexible filtering and selection of routing information. Because BGP does not perform route calculations, loops may occur during route transmission and reception.

[0003] To overcome the BGP routing loop problem, existing technologies utilize the Originator ID attribute to solve the BGP loop problem within an AS in a reflective network, and employ the AS Path attribute to solve the BGP loop problem across ASs.

[0004] Both of these methods for resolving BGP loop problems require the receiving device to make a judgment. Even if the route is eventually discarded, it still needs to be advertised through a message, which consumes bandwidth resources. Summary of the Invention

[0005] The purpose of this application is to provide a routing processing method and apparatus to solve the BGP loop problem and reduce bandwidth resource consumption. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide a routing processing method applied to a first BGP instance, the method comprising:

[0007] Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance;

[0008] If the control identifier of the second BGP instance matches the control identifier of the third BGP instance, then the second route is refused to be sent to the third BGP instance according to the first route; a BGP peer relationship is established between the first BGP instance and the third BGP instance.

[0009] In some embodiments, the method further includes: if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, then sending the second route to the third BGP instance according to the first route.

[0010] In some embodiments, after receiving the first route sent by the second BGP instance, the method further includes:

[0011] Detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance;

[0012] If they are the same, then it is determined that the control identifier of the second BGP instance matches the control identifier of the third BGP instance;

[0013] If they are different, it is determined that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0014] In some embodiments, the first BGP instance records at least one control identifier group; after receiving the first route sent by the second BGP instance, the method further includes:

[0015] Detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group;

[0016] If they are in the same control identifier group, then the control identifier of the second BGP instance is determined to match the control identifier of the third BGP instance;

[0017] If they are not in the same control identifier group, it is determined that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0018] In some embodiments, the first BGP instance records at least one control identifier group; after receiving the first route sent by the second BGP instance, the method further includes:

[0019] Detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance;

[0020] If they are the same, then it is determined that the control identifier of the second BGP instance matches the control identifier of the third BGP instance;

[0021] If they are different, then check whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group;

[0022] If they are in the same control identifier group, then the control identifier of the second BGP instance is determined to match the control identifier of the third BGP instance;

[0023] If they are not in the same control identifier group, it is determined that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0024] In some embodiments, the control identifier group includes a first transmission strategy or a second transmission strategy;

[0025] The first sending policy is used to prohibit BGP instances corresponding to multiple control identifiers included in the control identifier group from forwarding routes to each other;

[0026] The second sending policy is used to prohibit one-way forwarding of routes between BGP instances corresponding to multiple control identifiers not included in the control identifier group.

[0027] Secondly, embodiments of this application provide a routing processing apparatus applied to a first BGP instance, the apparatus comprising:

[0028] The receiving module is used to receive the first route sent by the second BGP instance; a BGP peer relationship is established between the first BGP instance and the second BGP instance;

[0029] The processing module is configured to refuse to send the second route to the third BGP instance according to the first route if the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and to establish a BGP peer relationship between the first BGP instance and the third BGP instance.

[0030] In some embodiments, the processing module is further configured to send the second route to the third BGP instance according to the first route if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0031] In some embodiments, the processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if they are the same, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are different, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0032] In some embodiments, the first BGP instance records at least one control identifier group;

[0033] The processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if they are in the same control identifier group, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are not in the same control identifier group, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0034] In some embodiments, the first BGP instance records at least one control identifier group;

[0035] The processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if they are the same, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are different, detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if they are in the same control identifier group, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are not in the same control identifier group, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0036] In some embodiments, the control identifier group includes a first transmission strategy or a second transmission strategy;

[0037] The first sending policy is used to prohibit BGP instances corresponding to multiple control identifiers included in the control identifier group from forwarding routes to each other;

[0038] The second sending policy is used to prohibit one-way forwarding of routes between BGP instances corresponding to the multiple control identifiers included in the control identifier group.

[0039] Thirdly, embodiments of this application provide a router, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0040] Memory, used to store computer programs;

[0041] The processor, when executing a program stored in memory, implements any of the methods provided in the first aspect.

[0042] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the methods provided in the first aspect.

[0043] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods provided in the first aspect.

[0044] Beneficial effects of the embodiments in this application:

[0045] In the technical solution provided in this application embodiment, the first BGP instance maintains the control identifiers of its BGP peers. When the control identifiers of two BGP peers match, it indicates that route advertising between the two BGP peers will cause a BGP loop, and the first BGP instance will not send routes to the target BGP peer. Therefore, in this application embodiment, after obtaining a route but before advertising it, the BGP instance uses the control identifiers to determine if a BGP loop will occur. If a BGP loop is determined to occur, the instance will not advertise the route via packets, thus resolving the BGP loop problem while reducing bandwidth resource consumption.

[0046] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.

[0048] Figure 1 This is a schematic diagram of the first type of network architecture within an AS.

[0049] Figure 2 This is a second schematic diagram of the networking architecture within the AS;

[0050] Figure 3 This is a schematic diagram of a first flowchart of a routing processing method provided in an embodiment of this application;

[0051] Figure 4 This is a second flowchart illustrating the routing processing method provided in the embodiments of this application;

[0052] Figure 5 This is a schematic diagram of a third type of routing processing method provided in an embodiment of this application;

[0053] Figure 6 This is a schematic diagram of the fourth flowchart of the routing processing method provided in the embodiments of this application;

[0054] Figure 7 A fifth flowchart illustrating the routing processing method provided in this application embodiment;

[0055] Figure 8 A schematic diagram of the routing processing apparatus provided in an embodiment of this application;

[0056] Figure 9 This is a schematic diagram of a router provided in an embodiment of this application. Detailed Implementation

[0057] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0058] To facilitate understanding, the terms appearing in the embodiments of this application will be explained below.

[0059] Border Gateway Protocol (BGP): A dynamic routing protocol that can be used both between different Autonomous Systems (AS) and within the same AS, exchanging routing information through BGP peers.

[0060] Internal BGP (IBGP): BGP peers run within the same AS.

[0061] External BGP (EBGP): BGP peers operate between different ASs.

[0062] BGP instance: A virtual, stand-alone BGP router.

[0063] BGP peer: A remote router that establishes a Transmission Control Protocol (TCP) connection with a BGP instance on the local router and exchanges BGP messages. A single BGP instance on the local router can establish multiple BGP peers with remote routers.

[0064] Route Reflector (RR): Passes (reflects) received routes to multiple routers acting as clients, including routers acting as clients and other RRs.

[0065] The Routing Information Base (RIB) is a centralized database that manages routing information. It includes routing table information and related information such as route iteration information, route sharing information, and route extension information. Each routing protocol notifies the RIB of its own routes, which the RIB maintains and manages using predetermined policies such as priority, guiding forwarding accordingly.

[0066] Within an AS, after two routers establish an IBGP connection, these two routers become IBGP peers. A router that learns a route from an IBGP peer will not advertise that route to other IBGP peers. Therefore, within an AS, a router needs to establish IBGP connections with all routers. Figure 1 The AS shown includes routers R1 to R3. Router R1 has established IBGP connections with routers R2 to R3 respectively, and router R2 has established an IBGP connection with router R3.

[0067] To reduce network complexity, route reflection was developed. Within an AS, one or more routers act as Route Reflectors (RRs), and other routers act as clients. IBGP connections are established between the clients and the RRs. For example... Figure 2 Within the AS shown, routers R1 through R5 are configured as Routers R1 and R2 (Routers Reflectors), and routers R3 through R5 are configured as Clients. Routers R1 and R2 have established an IBGP connection, routers R3 through R4 have established an IBGP connection with router R1, and router R5 has established an IBGP connection with router R2. After receiving a route from router R3 via an IBGP connection, router R1 forwards the route to routers R4 and R2 via the same IBGP connection. Similarly, router R2 receives a route from router R1 and forwards it to router R5 via an IBGP connection. By using a route reflector, clients can learn each other's routes without establishing BGP connections, significantly reducing network complexity.

[0068] Unlike interior gateway protocols such as Open Shortest Path First (OSPF), BGP focuses not on discovering and calculating routes, but on controlling route propagation and selecting the best route. Furthermore, BGP provides a rich set of routing policies that enable flexible filtering and selection of routing information.

[0069] However, since BGP does not perform route calculation, loops may occur during route sending and receiving within an AS (Autonomous Server). For example: Router A is the client, Router B is the RR (Router Receiver), Router A has multiple BGP instances configured, such as BGP instance 1 and BGP instance 2, and Router B has one BGP instance 3 configured. BGP instances 1 and 2 on Router A establish IBGP connections with BGP instance 3 on Router B, i.e., they establish peer relationships. BGP instance 1 and BGP instance 3 are peers, and BGP instance 2 and BGP instance 3 are peers. BGP instance 1 on Router A obtains a route 1 with destination address 1 (e.g., route 1 to 10.0.0.0), makes route 1 effective in the RIB (Reference Area Block) on Router A, and then sends route 2 with destination address 1 to BGP instance 3 on Router B via the IBGP connection. After receiving route 2, BGP instance 3 sends route 2 to BGP instance 2 on Router A via the IBGP connection. In BGP instance 2, route 2 is made effective in the RIB on router A. At this point, two routes with destination address 1, namely route 1 and route 2, are effective in the RIB on router A. Router A chooses the preferred route from route 1 and route 2. If route 2 is chosen, a BGP routing loop is formed.

[0070] Existing technologies employ the following two methods to overcome the BGP routing loop problem.

[0071] Method 1 uses the Originator ID attribute to prevent BGP loops.

[0072] The Originator ID is the router identifier of the originating device within the local AS. It can only be added by a route reflector and is an optional, non-transitional attribute. The Originator ID is primarily used to prevent loop problems caused by introducing a route reflector.

[0073] When a route is reflected for the first time by a Router Reflector (RR), the RR adds the Originator ID to the route. The value of this Originator ID is the Router ID of the device that sent the route to the route reflector. If the route already carries an Originator ID, the RR will not modify that Originator ID. After the route carrying the Originator ID is received, the receiving device compares the received Originator ID with its local Router ID. If they are the same, it indicates a BGP loop has occurred within the AS, and the receiving device discards the route.

[0074] Method 1 can only solve the BGP loop problem in AS under reflection networking, and it requires the receiving device to make a judgment. Even if the route is eventually discarded, it still needs to be published through packets, which consumes bandwidth resources.

[0075] Method 2 utilizes the AS Path attribute to prevent BGP loops.

[0076] The AS Path records all the ASs a route traverses from the local machine to the destination address. When a router sends a route to an EBGP peer in another AS, it adds the identifier of its own AS (such as the AS number) to the AS Path attribute; when sending a route to an IBGP peer in its own AS, it does not add the AS number to the AS Path attribute. The receiving router can determine the ASs it must traverse to reach the destination address based on the AS Path attribute. Devices receiving routes check if their own AS number is in the AS Path; if so, they discard the route, thus preventing BGP loops.

[0077] Method 2 can only solve the BGP loop problem across ASs, and it requires the receiving device to make a judgment. Even if the route is eventually discarded, it still needs to be published through a message, which consumes bandwidth resources.

[0078] Furthermore, if a router has two or more BGP instances belonging to different ASs, the router will still receive routes originating locally, forming a BGP loop.

[0079] For example, router A is configured with two BGP instances, AS1 and AS2, namely BGP instance 1 and BGP instance 2, while router B is configured with BGP instance 3, which is AS3. BGP instance 1 and BGP instance 2 establish EBGP connections with BGP instance 3, respectively.

[0080] Router A has a static route 1 with a destination address of 1.1.1.1 / 32, which is active in the RIB on router A. BGP instance 1 imports route 1 through the network and advertises it to BGP instance 3 on router B. After optimization, BGP instance 3 on router B sends route 2 with a destination address of 1.1.1.1 / 32 to BGP instance 2 on router A. Upon receiving route 2, BGP instance 2 notifies the RIB of route 2.

[0081] At this point, there are two active routes with a destination address of 1.1.1.1 / 32 in the RIB on router A. Due to priority considerations, only one is active; this could be either static route 1 or route 2 notified by BGP instance 2. If it's route 2, a BGP loop is formed within the network. If it's route 1, deleting route 1 will also create a BGP loop.

[0082] To address the above problems, embodiments of this application provide a routing processing method, such as... Figure 3As shown, applied to the first BGP instance, the method includes the following steps:

[0083] Step S301: Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance;

[0084] Step S302: If the control identifier of the second BGP instance matches the control identifier of the third BGP instance, then the second route is refused to be sent to the third BGP instance according to the first route; a BGP peer relationship is established between the first BGP instance and the third BGP instance.

[0085] In the technical solution provided in this application embodiment, the first BGP instance maintains the control identifiers of its BGP peers. When the control identifiers of two BGP peers match, it indicates that route advertising between the two BGP peers will cause a BGP loop, and the first BGP instance will not send routes to the target BGP peer. Therefore, in this application embodiment, after obtaining a route but before advertising it, the BGP instance uses the control identifiers to determine if a BGP loop will occur. If a BGP loop is determined to occur, the instance will not advertise the route via packets, thus resolving the BGP loop problem while reducing bandwidth resource consumption.

[0086] In some embodiments, based on Figure 3 The illustrated embodiment also provides a routing processing method, such as... Figure 4 As shown, when applied to the first BGP instance, the method may include the following steps:

[0087] Step S401: Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance; same as step S301 above.

[0088] Step S402: If the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, then the second route is sent to the third BGP instance according to the first route; a BGP peer relationship is established between the first BGP instance and the third BGP instance.

[0089] Step S403: If the control identifier of the second BGP instance matches the control identifier of the third BGP instance, then the second route to the third BGP instance based on the first route is refused; a BGP peer relationship is established between the first BGP instance and the third BGP instance. This is the same as step S302 above.

[0090] In the technical solution provided in this application embodiment, the first BGP instance maintains the control identifiers of its BGP peers. When the control identifiers of two BGP peers do not match, it indicates that the route advertisement between the two BGP peers will not cause a BGP loop, and the first BGP instance will then send the route to the target BGP peer (such as the third BGP instance). When the control identifiers of two BGP peers match, it indicates that the route advertisement between the two BGP peers will cause a BGP loop, and the first BGP instance will not send the route to the target BGP peer. Therefore, in this application embodiment, after obtaining the route, the BGP instance performs a BGP loop judgment using the control identifiers before advertising the route. If it determines that a BGP loop will occur, it will not advertise the route via packets, thus solving the BGP loop problem while reducing bandwidth resource consumption.

[0091] In this embodiment, the first BGP instance can be a BGP instance in any router, which can be an RR (Router Receiver) or a client. The second and third BGP instances can be BGP instances in any router. The first, second, and third BGP instances can be located on the same router or on different routers. Furthermore, the first, second, and third BGP instances can be located within the same AS (Autonomous System) or in different ASs.

[0092] When the first BGP instance and the second BGP instance are located in the same AS, an IBGP peer relationship is established between them; when the first BGP instance and the second BGP instance are located in different ASs, an EBGP peer relationship is established between them. Similarly, when the first BGP instance and the third BGP instance are located in the same AS, an IBGP peer relationship is established between them; when the first BGP instance and the third BGP instance are located in different ASs, an EBGP peer relationship is established between them.

[0093] When the first BGP instance and the second BGP instance are located in the same AS, the router where the first BGP instance is located is the RR; when the first BGP instance and the second BGP instance are located in different ASs, the router where the first BGP instance is located can be either the RR or the client.

[0094] In steps S401 / S301 above, the second BGP instance, through a BGP connection, can send an update message to the first BGP instance. The update message carries a route (i.e., the first route). The first BGP instance receives the update message sent by the second BGP instance, thereby receiving the first route.

[0095] After receiving the first route and performing route optimization, when it needs to send the first route, the first BGP instance can determine the target BGP instance (i.e., the third BGP instance) and obtain the control identifiers of the second and third BGP instances, and determine whether the control identifiers of the second and third BGP instances match. If the control identifiers of the second and third BGP instances do not match, step S402 is executed; if the control identifiers of the second and third BGP instances match, step S403 is executed.

[0096] In step S402 above, the second route is determined based on the first route. For example, the second route can be a route obtained by adding the AS number of the first BGP instance to the AS Path attribute of the first route, or a route obtained by adding the router ID of the second BGP instance to the Originator ID attribute of the first route. The second route can also be the first route.

[0097] The mismatch between the control identifier of the second BGP instance and the control identifier of the third BGP instance can be understood as follows: the advertising of routes between the second BGP instance and the third BGP instance will not cause a BGP loop, such as if the second BGP instance and the third BGP instance are not on the same router or not on the same group of routers.

[0098] In this case, if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, the first BGP instance sends a second route to the third BGP instance through the BGP connection between the first BGP instance and the third BGP instance to complete the route advertisement.

[0099] In this embodiment, if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, the first BGP instance can also perform other checks such as policy checks on the second route based on the configuration. After the check passes, the first BGP instance sends the second route to the third BGP instance to complete the route advertisement; if the check fails, the first BGP instance can refuse to send the second route to the third BGP instance.

[0100] In the above steps S403 / S302, the control identifier of the second BGP instance matches the control identifier of the third BGP instance. This can be understood as: the advertisement of routes between the second BGP instance and the third BGP instance will cause a BGP loop, such as the second BGP instance and the third BGP instance being on the same router or on the same group of routers.

[0101] In this scenario, if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, the first BGP instance will refuse to send the second route to the third BGP instance, such as discarding the first or second route.

[0102] In this embodiment, the control identifier can be a router ID or a specified identifier. The control identifier can be obtained during the process of establishing a BGP peer relationship between BGP instances.

[0103] For example, during the establishment of a BGP peer relationship, the second BGP instance sends an OPEN message to the first BGP instance, carrying the control identifier of the second BGP instance. The first BGP instance obtains the control identifier of the second BGP instance from the OPEN message and records it. Similarly, the first BGP instance records the control identifier of the third BGP instance (i.e., the BGP peer). If the control identifier is not the Router ID, a field can be added to the OPEN message to carry the control identifier.

[0104] In some embodiments, the control identifiers of different routers can be different; that is, the control identifiers of BGP instances on the same router are the same, while the control identifiers of BGP instances on different routers are different.

[0105] When BGP instances on the same router have the same control identifier, but BGP instances on different routers have different control identifiers, such as... Figure 5 As shown in the embodiments of this application, a routing processing method is also provided, which may include the following steps:

[0106] Step S501: Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance; same as steps S301 / S401 above.

[0107] Step S502: Check whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if not, proceed to step S503; if yes, proceed to step S504.

[0108] In this embodiment, the second BGP instance is the learning peer of the route, and the third BGP instance is the sending peer of the route. The first BGP instance can obtain the control identifiers of the second BGP instance and the third BGP instance from the recorded control identifiers of the BGP instances, and then compare the control identifiers of the second BGP instance and the third BGP instance.

[0109] If the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance, it means that the control identifier of the second BGP instance matches the control identifier of the third BGP instance, and step S504 is executed; if the control identifier of the second BGP instance is different from the control identifier of the third BGP instance, it means that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, and step S503 is executed.

[0110] Step S503: Send the second route to the third BGP instance according to the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance; similar to step S402 above, see the relevant description in step S402.

[0111] Step S504: Reject sending the second route to the third BGP instance based on the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance. Similar to steps S403 / S302 above, please refer to the relevant descriptions in steps S403 / S302.

[0112] In this embodiment of the application, when multiple BGP instances within the same AS are running on the same router, or multiple BGP instances within different ASs are running on the same router, if the multiple BGP instances use the same control identifier, BGP loops can be avoided, and the BGP instances will not send back routes to the router where the peer resides, thus reducing the waste of bandwidth resources.

[0113] The embodiments of this application can be applied to routing processing scenarios within or across ASs, reducing the waste of bandwidth resources while avoiding BGP loops.

[0114] In some embodiments, the control identifiers of BGP instances on the same router can also be different, meaning the control identifiers are configured under the BGP instance. In this case, the first BGP instance records at least one control identifier group, that is, at least one control identifier group is configured on the router where the first BGP instance resides.

[0115] When the control identifiers of BGP instances on the same router are different, such as Figure 6 As shown in the embodiments of this application, a routing processing method is also provided, which may include the following steps:

[0116] Step S601: Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance; same as steps S301 / S401 above.

[0117] Step S602: Detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if not, proceed to step S603; if yes, proceed to step S604.

[0118] In this embodiment, the second BGP instance is the learning peer of the route, and the third BGP instance is the sending peer of the route. The first BGP instance can obtain the control identifiers of the second BGP instance and the third BGP instance from the recorded control identifiers of the BGP instances, and then determine whether the control identifiers of the second BGP instance and the third BGP instance are in the same control identifier group.

[0119] If the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group, it means that the control identifier of the second BGP instance and the control identifier of the third BGP instance match, and step S604 is executed; if the control identifier of the second BGP instance and the control identifier of the third BGP instance are not in the same control identifier group, it means that the control identifier of the second BGP instance and the control identifier of the third BGP instance do not match, and step S603 is executed.

[0120] In this embodiment of the application, different control identifier groups can correspond to different transmission strategies, such as a control identifier group including a first transmission strategy or a second transmission strategy.

[0121] 1) The first sending policy is used to prohibit BGP instances corresponding to multiple control identifiers included in the control identifier group from forwarding routes to each other.

[0122] In this case, the relationships between the multiple control identifiers included in the control identifier group are equal; that is, the control identifier group includes multiple control identifiers with equal relationships. The fact that the control identifiers of the second BGP instance and the third BGP instance are within the same control identifier group indicates that the same control identifier group includes the control identifiers of both the second and third BGP instances.

[0123] For example, BGP instance 1 records control identifier groups as follows: Group 1 {R1, R2, R3}, Group 2 {R4, R5, R6}. If BGP instance 1 receives a route from BGP instance R1 (i.e., the second BGP instance), and BGP instances R2, R3, and R1 are all in Group 1, then BGP instance 1 will refuse to send the route to BGP instances R2 and R3. If BGP instances R4 through R6 are in Group 2 and not in Group 1, then BGP instance 1 can send the route to BGP instances R4 through R6.

[0124] 2) The second sending policy is used to prohibit one-way forwarding of routes between BGP instances corresponding to multiple control identifiers included in the control identifier group.

[0125] In this scenario, the control identifier group comprises multiple control identifiers with unequal relationships. Specifically, the control identifiers in the group can be categorized into Class I and Class II control identifiers. The BGP instance corresponding to the Class I control identifier is the source BGP instance, and the BGP instance corresponding to the Class II control identifier is the destination BGP instance. Routes from the source BGP instance are unidirectionally prohibited from being sent to the destination BGP instance, but routes from the destination BGP instance can be sent to the source BGP instance. This unequal relationship of control identifiers can be represented in the form of "from / to". For example, "from R1 to {R2,R3}", where R1 is a Class I control identifier, and R2 and R3 are Class II control identifiers. Routes from BGP instance R1 are prohibited from being sent to BGP instances R2 and R3.

[0126] In this case, the control identifiers of the second BGP instance and the third BGP instance are in the same control identifier group, indicating that within the same control identifier group, the control identifier of the second BGP instance is a first-class control identifier, and the control identifier of the third BGP instance is a second-class control identifier.

[0127] For example, BGP instance 1 records the control identifier group as: group 1 {from {R1,R4} to {R2,R3}}. When BGP instance 1 receives a route sent by BGP instance R1 (i.e., the second BGP instance), if the third BGP instance is BGP instance R2 or BGP instance R3, BGP instance R1 is a Class I control identifier within group 1, and BGP instances R2-R3 are Class II control identifiers within group 1. Therefore, it can be assumed that BGP instance R1 and BGP instances R2-R3 are all within group 1, and BGP instance 1 will refuse to send the route to BGP instances R2 and R3. When the third BGP instance is BGP instance R4, both BGP instances R1 and R4 are Class I control identifiers within group 1. Therefore, it can be assumed that BGP instance R1 and BGP instance R4 are not in the same control identifier group, and BGP instance 1 can send the route to BGP instance R4.

[0128] If BGP instance 1 receives a route sent by BGP instance R2 (i.e., the second BGP instance), then when the third BGP instance is BGP instance R1, R2 and R1 do not meet the sending policy of group 1. It can be assumed that BGP instance R1 and BGP instance R2 are not both in group 1, and BGP instance 1 sends the route to BGP instance R1.

[0129] Step S603: Send the second route to the third BGP instance according to the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance; similar to step S402 above, see the relevant description in step S402.

[0130] Step S604: Reject sending the second route to the third BGP instance based on the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance. Similar to steps S403 / S302 above, please refer to the relevant descriptions in steps S403 / S302.

[0131] In this embodiment of the application, when multiple BGP instances within the same AS are running on the same router, or multiple BGP instances within different ASs are running on the same router, if the multiple BGP instances use different control identifiers, BGP loops can be avoided through control identifier groups, and the BGP instances will not send back routes to the router where the peer is located, thus reducing the waste of bandwidth resources.

[0132] The embodiments of this application can be applied to routing processing scenarios within or across ASs, reducing the waste of bandwidth resources while avoiding BGP loops.

[0133] In some embodiments, the control identifiers of different routers can be different, and the control identifiers of BGP instances on the same router can also be different. To further avoid BGP loops and reduce bandwidth waste, embodiments of this application also provide a routing processing method, such as... Figure 7 As shown, it may include the following steps:

[0134] Step S701: Receive the first route sent by the second BGP instance; establish a BGP peer relationship between the first BGP instance and the second BGP instance; same as steps S301 / S401 above.

[0135] Step S702: Detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if not, proceed to step S703; if yes, proceed to step S705.

[0136] Step S703: Detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if not, proceed to step S704; if yes, proceed to step S705.

[0137] Step S704: Send the second route to the third BGP instance according to the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance; similar to step S402 above, see the relevant description in step S402.

[0138] Step S705: Reject sending the second route to the third BGP instance based on the first route; establish a BGP peer relationship between the first BGP instance and the third BGP instance. Similar to steps S403 / S302 above, please refer to the relevant descriptions in steps S403 / S302.

[0139] In this embodiment of the application, when multiple BGP instances within the same AS are running on the same router, or multiple BGP instances within different ASs are running on the same router, if the multiple BGP instances use the same control identifier, or if the multiple BGP instances use different control identifiers, BGP loops can be avoided, and the BGP instances will not send back routes to the router where the peer resides, thus reducing the waste of bandwidth resources.

[0140] The embodiments of this application can be applied to routing processing scenarios within or across ASs, reducing the waste of bandwidth resources while avoiding BGP loops.

[0141] Corresponding to the above-mentioned routing processing device, this application embodiment also provides a routing processing device, such as... Figure 8 As shown, applied to a first BGP instance, the device includes:

[0142] The receiving module 801 is used to receive the first route sent by the second BGP instance; and to establish a BGP peer relationship between the first BGP instance and the second BGP instance.

[0143] The processing module 802 is used to refuse to send the second route to the third BGP instance according to the first route if the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and to establish a BGP peer relationship between the first BGP instance and the third BGP instance.

[0144] In some embodiments, the processing module 802 is further configured to send a second route to the third BGP instance if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0145] In some embodiments, the processing module 802 is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if they are the same, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are different, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0146] In some embodiments, at least one control identifier group is recorded in the first BGP instance;

[0147] The processing module 802 is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if they are in the same control identifier group, determine that the control identifier of the second BGP instance and the control identifier of the third BGP instance match; if they are not in the same control identifier group, determine that the control identifier of the second BGP instance and the control identifier of the third BGP instance do not match.

[0148] In some embodiments, at least one control identifier group is recorded in the first BGP instance;

[0149] The processing module 802 is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if they are the same, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are different, detect whether the control identifier of the second BGP instance and the control identifier of the third BGP instance are in the same control identifier group; if they are in the same control identifier group, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if they are not in the same control identifier group, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

[0150] In some embodiments, the control identifier group includes a first transmission strategy or a second transmission strategy;

[0151] The first sending policy is used to prohibit BGP instances corresponding to multiple control identifiers included in the control identifier group from forwarding routes to each other;

[0152] The second sending policy is used to prohibit one-way forwarding of routes between BGP instances corresponding to multiple control identifiers included in the control identifier group.

[0153] In the technical solution provided in this application embodiment, the first BGP instance maintains the control identifiers of its BGP peers. When the control identifiers of two BGP peers match, it indicates that route advertising between the two BGP peers will cause a BGP loop, and the first BGP instance will not send routes to the target BGP peer. Therefore, in this application embodiment, after obtaining a route but before advertising it, the BGP instance uses the control identifiers to determine if a BGP loop will occur. If a BGP loop is determined to occur, the instance will not advertise the route via packets, thus resolving the BGP loop problem while reducing bandwidth resource consumption.

[0154] This application also provides a router, such as... Figure 9As shown, it includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0155] Memory 903 is used to store computer programs;

[0156] When the processor 901 executes the program stored in the memory 903, it implements at least one BGP instance, and each BGP instance implements any of the above-mentioned routing processing methods.

[0157] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0158] The communication interface is used for communication between the router and other devices.

[0159] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0160] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0161] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it implements at least one BGP instance, and each BGP instance implements any of the above-described routing processing methods.

[0162] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any routing processing method applied to a first BGP instance.

[0163] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0164] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0165] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of devices, routers, storage media, and program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0166] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A routing processing method, characterized by, The method applied to a first BGP instance comprises: receiving a first route sent by a second BGP instance; establishing a BGP peer relationship between the first BGP instance and the second BGP instance; 2. The method of claim 1, wherein, if a control identifier of the second BGP instance matches a control identifier of a third BGP instance, rejecting sending a second route to the third BGP instance according to the first route; a BGP peer relationship is established between the first BGP instance and the third BGP instance. The method further comprises:

3. The method of claim 1, wherein, if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, sending the second route to the third BGP instance according to the first route. After receiving the first route sent by the second BGP instance, the method further comprises: detecting whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if the same, determining that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; 4. The method of claim 1, wherein, if different, determining that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance. The first BGP instance records at least one control identifier group; after receiving the first route sent by the second BGP instance, the method further comprises: detecting whether the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance; if in the same control identifier group, determining that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; 5. The method of claim 1, wherein, if not in the same control identifier group, determining that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance. The first BGP instance records at least one control identifier group; after receiving the first route sent by the second BGP instance, the method further comprises: detecting whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if the same, determining that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; if different, detecting whether the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance; if in the same control identifier group, determining that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; 6. The method according to claim 4 or 5, characterized in that, if not in the same control identifier group, determining that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance. The control identifier group comprises a first sending policy or a second sending policy; the first sending policy is used to prohibit mutual forwarding of routes between BGP instances corresponding to multiple control identifiers included in the control identifier group; 7. A routing processing device, characterized by the second sending policy is used to prohibit one-way forwarding of routes between BGP instances corresponding to multiple control identifiers included in the control identifier group. The device applied to a first BGP instance comprises: The receiving module is configured to receive a first route sent by a second BGP instance; The processing module is configured to, if the control identifier of the second BGP instance matches a control identifier of a third BGP instance, reject sending a second route to the third BGP instance according to the first route; and the first BGP instance and the third BGP instance establish a BGP peer relationship.

8. The apparatus of claim 7, wherein, The processing module is further configured to, if the control identifier of the second BGP instance does not match the control identifier of the third BGP instance, send the second route to the third BGP instance according to the first route.

9. The apparatus of claim 7, wherein, The processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and if the control identifier of the second BGP instance is different from the control identifier of the third BGP instance, determine that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

10. The apparatus of claim 7, wherein, The first BGP instance records at least one control identifier group; The processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance; If the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance, it is determined that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and if the control identifier of the second BGP instance is not in the same control identifier group as the control identifier of the third BGP instance, it is determined that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

11. The apparatus of claim 7, wherein, The first BGP instance records at least one control identifier group; The processing module is further configured to, after receiving the first route sent by the second BGP instance, detect whether the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance; if the control identifier of the second BGP instance is the same as the control identifier of the third BGP instance, determine that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and if the control identifier of the second BGP instance is different from the control identifier of the third BGP instance, detect whether the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance; If the control identifier of the second BGP instance is in the same control identifier group as the control identifier of the third BGP instance, it is determined that the control identifier of the second BGP instance matches the control identifier of the third BGP instance; and if the control identifier of the second BGP instance is not in the same control identifier group as the control identifier of the third BGP instance, it is determined that the control identifier of the second BGP instance does not match the control identifier of the third BGP instance.

12. The apparatus of claim 10 or 11, wherein, The control identifier group includes a first sending policy or a second sending policy; The first sending policy is used to prohibit mutual route forwarding between BGP instances corresponding to a plurality of control identifiers included in the control identifier group; The second sending policy is used to prohibit one-way route forwarding between BGP instances corresponding to a plurality of control identifiers included in the control identifier group.

Citation Information

Patent Citations

  • Method, device and system for router cancellation

    CN102045237A

  • Route aggregation method and device

    CN106789664A

  • Method for reducing routing loops, apparatus and system

    CN113261246A

  • Route announcement method, routing loop detection method and equipment

    CN114500362A

  • Routing processing method, device and equipment

    CN114640623A