A BGP-based message sending method and a router
By grouping BGP neighbors and sharing the adj-out queue, and dynamically adjusting neighbor groups, the problem of low packet sending efficiency when there are many BGP neighbors and a large number of routes is solved, and more efficient neighbor packet sending performance is achieved.
Patent Information
- Application Number
- CN202310252390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-12
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-03-12
AI Technical Summary
In scenarios with a large number of BGP neighbors and a large number of routes, packet sending efficiency decreases exponentially, and existing technologies are unable to effectively improve it.
BGP neighbors are divided into different update groups, and sub-group nodes are set under each update group. BGP neighbors are mounted in the form of a linked list and share the same adj-out queue. Neighbor groups are dynamically adjusted to respond to policy changes. Memory pools and dynamically allocated memory are used together to reduce memory fragmentation.
Without disrupting the existing neighbor packet sending rules, it significantly improves the packet sending efficiency and performance of BGP neighbors, reduces the number of adj-out tables and memory usage, adapts to the flexibility of grouping multiple neighbors, and improves the stability of the system and the efficiency of neighbor packet sending.
Smart Images

Figure CN116455802B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a BGP-based message sending method and router. Background Technology
[0002] With the rapid growth of network traffic, the routing tables in the network are growing rapidly. The complexity of the network topology necessitates that BGP support more neighbors. Each neighbor (peer) has a packet sending queue (adj-out), and each route entry is abbreviated as rn. When rn needs to be sent to peer1 through peern, it needs to be added to the packet sending queues (adj-out) of peer1 through peern respectively. As the number of rn entries and BGP neighbors increases, especially in scenarios with a large number of neighbors and a large volume of routes, packet sending efficiency decreases exponentially.
[0003] Improving the efficiency of outsourcing has become an urgent problem to be solved. Summary of the Invention
[0004] This application addresses the existing problems by proposing a BGP-based message sending method and router, with the specific technical solution as follows:
[0005] In a first aspect of this application, a BGP-based message sending method is provided, the method comprising:
[0006] Divide all BGP neighbors into different update groups;
[0007] At least one sub-group node is set up under each update-group. BGP neighbors are attached to the corresponding sub-group node in the form of a linked list. The BGP neighbors under each sub-group node use the same adj-out.
[0008] As an optional technical solution, when the routing policy of a BGP neighbor application changes;
[0009] If the BGP neighbor can be matched with the corresponding update group, a new sub-group node is created under the update group, and the BGP neighbor is removed from the original sub-group node and remounted under the new sub-group node.
[0010] After the original sub-group node and the BGP neighbors under the new sub-group node have finished processing the packet sending, the original sub-group node and the new sub-group node are merged.
[0011] As an optional technical solution, when the routing policy of a BGP neighbor application changes;
[0012] If the BGP neighbor cannot be matched with the corresponding update group, a new update group is created, and the BGP neighbor is attached to the sub-group node under the new update group.
[0013] As an optional technical solution, in the method,
[0014] The update-group and sub-group nodes share a memory pool and dynamically allocated memory.
[0015] As an optional technical solution, the method further includes:
[0016] Determination steps: Determine whether the BGP neighbors belong to the same update group, so that all BGP neighbors can be mounted under their respective update groups.
[0017] As an optional technical solution, the determination step includes:
[0018] The system sequentially determines the type of the BGP neighbor, the pseudo AS number used, the negotiation options used when establishing the BGP neighbor, the announcement period, the peer group to which it belongs, the routing policy used, the prefix list used, the AS number filtering rules used, and whether the filter used is consistent with the corresponding update group.
[0019] If the above judgment results are consistent, then the BGP neighbor belongs to the update-group.
[0020] If at least one of the above judgment results is inconsistent, a new update-group will be created for the BGP neighbor.
[0021] As an optional technical solution, in the judgment step,
[0022] If the type of the BGP neighbor is IBGP or EBGP, then the type of the BGP neighbor is considered to be consistent with the update-group.
[0023] As an optional technical solution, in the judgment step,
[0024] If both the BGP neighbor and the update group use pseudo-AS numbers, or if neither the BGP neighbor nor the update group uses pseudo-AS numbers, then the BGP neighbor is considered to be using the same pseudo-AS number as the update group.
[0025] In a second aspect of this application, a router is provided, wherein the BGP-based message sending method of any of the above-described technical solutions is applied to the router.
[0026] As an optional technical solution, the router is used to handle any one of BGP routing, EVPN routing, MVPN routing, L3VPN routing, and L2VPN routing.
[0027] In a third aspect of this application, an electronic device is provided, the device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the method described in the first aspect above.
[0028] In a fourth aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, and a processor executes the computer program to implement the method described in the first aspect above.
[0029] This application has the following beneficial effects:
[0030] Through the above technical solution, the method disclosed herein divides all BGP neighbors into different update groups. Each update group has one or more sub-group nodes. The sub-group nodes store all routing entries that need to be sent in the adj-out table. The relevant information of BGP neighbors is attached to the sub-group nodes in the form of a linked list. All BGP neighbors in the linked list of the sub-group nodes use the same adj-out table. In this way, the number of adj-out tables can be reduced, thereby improving the efficiency of BGP packet sending.
[0031] At the same time, the method disclosed herein can maximize the packet sending performance of BGP neighbors without breaking the original packet sending rules of BGP neighbors. Meanwhile, dynamic packet group transformation can be used to flexibly respond to changes in the policies of BGP neighbors. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0033] Figure 1 This is a flowchart of the BGP-based message sending method disclosed herein;
[0034] Figure 2 This is a diagram showing how routing entries rn are sent from neighbor peer1 to neighbor peer1 respectively.
[0035] Figure 3 A flowchart illustrating a specific embodiment of this disclosure for determining whether neighbors belong to the same update-group;
[0036] Figure 4 This is a schematic diagram illustrating the matching of update-group, sub-group nodes, and neighbor peers as an exemplary embodiment of this disclosure;
[0037] Figure 5 This is a schematic diagram illustrating the creation of a new sub-group node when the routing policy of the peer-1-1 application changes, as shown in an exemplary embodiment of this disclosure.
[0038] Figure 6 This is a schematic diagram illustrating the merging of two sub-group nodes as an exemplary embodiment of the present disclosure. Detailed Implementation
[0039] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0040] For related technologies, please refer to Figure 2 , Figure 2 This diagram illustrates how routing entry rn is sent from neighbor peer1 to neighbor peer2n respectively; as shown. Figure 2 As shown, each neighbor has a packet sending queue called adj-out, and each route entry is abbreviated as rn. When rn needs to be sent to peer1 through peern, it needs to be added to the packet sending queue adj-out of each peer1 through peern. As the number of rn entries and BGP neighbors increases, especially in scenarios with a large number of neighbors and routes, the packet sending efficiency will decrease exponentially. For example, a reflector has 100 clients and 100,000 routes that need to be reflected. If each neighbor is packaged separately, when the reflector RR sends routes to the 100 clients, the total number of times all routes are packaged is 100,000 × 100 = 10 million.
[0041] Therefore, the specific concept proposed in this application is to regroup BGP neighbors when there are a large number of neighbors and routes, taking advantage of the fact that BGP neighbors have the same exit strategy, in order to reduce the number of adj-out tables and improve the efficiency of BGP neighbor packet sending. The method disclosed herein can maximize the performance of BGP neighbor packet sending without violating the original BGP neighbor packet sending rules, thereby achieving the goal of improving the efficiency of BGP neighbor packet transmission. Specifically, the method disclosed herein is as follows: all BGP neighbors are divided into different update groups; at least one sub-group node is set under each update group; BGP neighbors are attached to the corresponding sub-group node in the form of a linked list; and the BGP neighbors under each sub-group node use the same adj-out table. Thus, using the method disclosed herein, all BGP neighbors are divided into different update groups. Each update group has one or more sub-group nodes. The sub-group nodes store all routing entries that need to be sent in the adj-out table. The relevant information of BGP neighbors is attached to the sub-group nodes in the form of a linked list. All BGP neighbors in the linked lists of all sub-group nodes use the same adj-out table. In this way, the number of adj-out tables can be reduced, thereby improving the efficiency of BGP packet sending.
[0042] In this disclosure, some of the professional names need to be explained.
[0043] In this disclosure, BGP refers to Border Gateway Protocol, a routing protocol for autonomous systems running on TCP. BGP is the only protocol designed to handle networks the size of the Internet and is the only one capable of handling multiple connections between unrelated routing domains effectively. BGP builds upon the experience gained from EGP. The primary function of a BGP system is to exchange network reachability information with other BGP systems. This network reachability information includes information about listed Autonomous Systems (AS). This information effectively constructs a topology map of interconnected ASes, thereby eliminating routing loops and enabling policy decisions at the AS level. BGP is an implementation of a path vector protocol. Its operation is also based on path vectors. A BGP router (referring to the routing information maintained by BGP itself, distinct from the device's main routing table) transmits data via the BGP protocol and stores it in the BGP router's database. Not all BGP router entries are written to the main routing table. Each BGP router entry contains the destination network, next hop, and complete path information. Path information is composed of AS numbers. When a BGP router receives a route, if the path contains its own AS number, it can determine that this is a route it previously sent, and the received route will be discarded. The end connected to the BGP router is called a BGP peer.
[0044] In this disclosure, routing policies are used to select routes or change route attributes by using different matching conditions and patterns. Routing policies are mainly applied in several aspects, including routing information advertising, receiving, importing, and modifying route attributes: 1. Controlling route advertising: Routing policies can filter the routing information to be advertised, allowing only routing information that meets the conditions to be advertised. 2. Controlling route receiving: Routing policies can filter the routing information to be received, allowing only routing information that meets the conditions to be received. This controls the number of routing entries and improves network routing efficiency. 3. Controlling route import: Routing policies can import only routing information that meets the conditions and control certain attributes of the imported routing information to ensure that it meets the routing attribute requirements of this routing protocol. 4. Setting route attributes: Modifying the attributes of routes filtered by routing policies to meet specific needs.
[0045] In this disclosure, AS (Autonomous System) refers to a group of networks that use a unified internal routing protocol. The AS number is the Autonomous System number, which is used to identify an independent Autonomous System. Within the same Autonomous System, the same internal routing protocol is used, while between Autonomous Systems, an external routing protocol (usually BGP) is used.
[0046] The scheme of this application will be further described below with reference to the accompanying drawings.
[0047] Reference Figure 1 , Figure 1 This is a flowchart of the BGP-based message sending method of this application.
[0048] In a first aspect of this application, a BGP-based message sending method is provided, the method comprising:
[0049] Divide all BGP neighbors into different update groups;
[0050] At least one sub-group node is set up under each update-group. BGP neighbors are attached to the corresponding sub-group node in the form of a linked list. The BGP neighbors under each sub-group node use the same adj-out.
[0051] Through the above technical solution, the method disclosed herein divides all BGP neighbors into different update groups. Each update group has one or more sub-group nodes. The sub-group nodes store all routing entries that need to be sent in the adj-out table. The relevant information of BGP neighbors is attached to the sub-group nodes in the form of a linked list. All BGP neighbors in the linked list of the sub-group nodes use the same adj-out table. In this way, the number of adj-out tables can be reduced, thereby improving the efficiency of BGP packet sending.
[0052] At the same time, the method disclosed herein can maximize the packet sending performance of BGP neighbors without breaking the original packet sending rules of BGP neighbors. Meanwhile, dynamic packet group transformation can be used to flexibly respond to changes in the policies of BGP neighbors.
[0053] As in the example above, a reflector has 100 clients and 100,000 routes to reflect. If each BGP neighbor is packaged separately, the reflector (RR) would package all routes a total of 100,000 × 100 = 10 million times when sending routes to the 100 clients. However, using the method disclosed in this paper, the total number of times all routes are packaged is 100,000 × 1 = 100,000.
[0054] In one embodiment of this disclosure, when the routing policy of a BGP neighbor changes; if the BGP neighbor can match the corresponding update group, a new sub-group node is created under the update group, and the BGP neighbor is removed from the original sub-group node and remounted under the new sub-group node.
[0055] After the original sub-group node and the BGP neighbors under the new sub-group node have finished processing the packet sending, the original sub-group node and the new sub-group node are merged.
[0056] In this embodiment, as Figure 5 and Figure 6 As shown, the reason for creating a new sub-group node (such as...) Figure 5 and Figure 6 The sub-group-n-2 in the sub-group is used instead of directly mounting it to the existing sub-group node (e.g., sub-group-n-2). Figure 5 and Figure 6 The `sub-group-n` in the mounting parameter is used because during the mounting process, packets from the sub-group node may be being processed, which could result in some route entries not being advertised. This effectively ensures that all route entries are advertised.
[0057] In one embodiment of this disclosure, when the routing policy applied to a BGP neighbor changes, if the BGP neighbor cannot match the corresponding update-group, a new update-group is created, and the BGP neighbor is attached to the sub-group node under the new update-group.
[0058] In other words, such as Figure 5 and Figure 6 As shown, when a certain BGP neighbor (such as...) Figure 5 and Figure 6 When the routing policy of the peer-1-1 application changes, the corresponding update-group will also change. If the corresponding update-group cannot be matched after the change, a new update-group will be created.
[0059] In one embodiment of this disclosure, the update-group and sub-group nodes share a memory pool and dynamically allocated memory.
[0060] In this implementation, the use of a shared memory pool and dynamically allocated memory between the update-group and sub-group nodes can effectively reduce memory fragmentation in the system.
[0061] In one embodiment of this disclosure, the method may further include a determination step: determining whether the BGP neighbors belong to the same update-group, so that all BGP neighbors can be mounted under the corresponding update-group respectively.
[0062] This allows all BGP neighbors to be assigned to the corresponding update group, enabling BGP neighbors in the same update group to send packets through the same sub-group node. This helps reduce the number of packets in the adj-out queue, which in turn improves the efficiency of BGP neighbors sending packets.
[0063] In one embodiment of this disclosure, the determination step includes:
[0064] The system sequentially determines the type of the BGP neighbor, the pseudo AS number used, the negotiation options used when establishing the BGP neighbor, the announcement period, the peer group to which it belongs, the routing policy used, the prefix list used, the AS number filtering rules used, and whether the filter used is consistent with the corresponding update group.
[0065] If the above judgment results are consistent, then the BGP neighbor belongs to the update-group.
[0066] If at least one of the above judgment results is inconsistent, a new update-group will be created for the BGP neighbor.
[0067] For example, such as Figure 3 As shown in the specific embodiment provided in this disclosure, the method steps for determining whether BGP neighbors belong to the same update-group are detailed in the following document. Figure 3 :
[0068] Step 1. First, determine whether the type of the BGP neighbor is consistent with the type of the corresponding update group. If the BGP neighbor type is IBGP (Internal BGP) or EBGP (External BGP), then the BGP neighbor type is considered to be consistent with the corresponding update group, and the matching continues downward. If they are inconsistent, they are considered to be mismatched.
[0069] In this context, IBGP refers to the neighbor relationship established between BGP routers operating in different ASs (with different AS numbers), while EBGP refers to the neighbor relationship established between BGP routers operating in the same AS (with the same AS number).
[0070] Step 2. Then determine whether the pseudo AS number used by the BGP neighbor is consistent with the pseudo AS number used by the update group. If both are used at the same time or neither is used at the same time, it is considered consistent, and the matching continues downward. If they are inconsistent, it is considered a mismatch.
[0071] Step 3. Then determine whether the negotiation options used when creating the BGP neighbor are consistent with the negotiation options used by the corresponding update group. If they are consistent, continue matching downwards; otherwise, they are considered mismatched.
[0072] Step 4. Then determine whether the announcement period of the BGP neighbor is consistent with the announcement period of the corresponding update group. If they are consistent, continue matching downwards; otherwise, they are considered mismatched.
[0073] Step 5. Then determine whether the peer group to which the BGP neighbor belongs is consistent with the peer group to which the corresponding update group belongs. If they are consistent, continue matching downwards; otherwise, they are considered mismatched.
[0074] Step 6. Then determine whether the routing policy used by the BGP neighbor is consistent with the routing policy used by the corresponding update group. If they are consistent, continue matching downwards; otherwise, they are considered mismatched.
[0075] Step 7. Then determine whether the prefix list used by the BGP neighbor is consistent with the prefix list used by the corresponding update group. If they are consistent, continue matching downwards; otherwise, they are considered to be mismatched.
[0076] Step 8. Then determine whether the AS number filtering rule used by the BGP neighbor is consistent with the AS number filtering rule used by the corresponding update group. If they are consistent, continue matching downwards; otherwise, they are considered to be mismatched.
[0077] Step 9. Finally, determine whether the ORF (Outbound Route Filtering) used by the BGP neighbor is consistent with the ORF used by the corresponding update group. Both are considered to be consistent, or neither is used at the same time. If they are consistent, continue matching downwards; otherwise, they are considered to be mismatched.
[0078] If the results of the above 9 steps are consistent, it can be concluded that the BGP neighbor belongs to this update group. If no matching update group can be found, a new update group should be created.
[0079] In one specific embodiment of this disclosure, in the determination step of this disclosure,
[0080] If the type of the BGP neighbor is IBGP or EBGP, then the type of the BGP neighbor can be considered to be consistent with the update-group.
[0081] In one specific embodiment of this disclosure, in the determination step of this disclosure,
[0082] If both the BGP neighbor and the update group use pseudo-AS numbers, or if neither the BGP neighbor nor the update group uses pseudo-AS numbers, then the BGP neighbor is considered to be using the same pseudo-AS number as the update group.
[0083] like Figure 5 and Figure 6 As shown in one specific embodiment of this disclosure,
[0084] Step 1. Divide all BGP neighbors into different update groups. If no update group can be matched, a new update group needs to be created.
[0085] Step 2. Each update-group has one or more sub-group nodes. In the sub-group nodes, all route entries that need to be sent are stored in adj-out.
[0086] Step 3. The information of BGP neighbors will be attached to the corresponding sub-group nodes in the form of a linked list. All BGP neighbors under the sub-group linked list use the same adj-out, which can reduce the number of adj-out tables and improve the efficiency of BGP packet sending.
[0087] Step 4. When the routing policy applied by peer-1-1 changes, the corresponding update-group will also change. Assuming that it can match update-group-n after the change (it may not match, and if it does not match, a new update-group will be created), a new sub-group will be created under update-group-n, which is sub-group-n-2.
[0088] Step 5. Remove peer-1-1 from sub-group-1 and then remount it under sub-group-n-2. The reason for creating a new sub-group-n-2 instead of directly mounting it under sub-group-n is that the mounting process may be processing packets sent by this sub-group, and some route entries may not be published at this time.
[0089] Step 6. After all the neighbors under sub-group-n-2 and sub-group-n have finished processing their packets, merge the two nodes.
[0090] In this disclosure, the method has the following advantages:
[0091] 1. The method disclosed herein can greatly reduce the number of adj-out tables and memory usage. Most importantly, multiple BGP neighbors can share a single adj-out table, which can maximize the packet sending efficiency of BGP neighbors.
[0092] 2. The method disclosed herein introduces a synchronization mechanism. When the configuration or attributes of a BGP neighbor change, a new sub-group is created accordingly. After multiple sub-groups under an update-group have been processed, they are merged. This way, it does not affect BGP neighbors that have not changed, and it can also process BGP neighbors that have changed.
[0093] 3. The method disclosed herein can handle both ordinary BGP routes and routes corresponding to EVPN / MVPN / L3VPN / L2VPN, exhibiting extremely high scalability.
[0094] 4. In this public minute, update-group and sub-group nodes can use memory pools and dynamically allocated memory to reduce memory fragmentation in the system.
[0095] Furthermore, it is understood that the method disclosed herein can be applied to scenarios with a large number of neighbors and a large number of routes, especially scenarios where BGP neighbors have the same attributes.
[0096] In a second aspect of this application, a router is provided, wherein the BGP-based message sending method of any of the above-described technical solutions is applied to the router.
[0097] Thus, in situations with a large number of neighbors and routes, by leveraging the characteristic that BGP neighbors share the same exit policy, BGP neighbors can be regrouped to reduce the number of adj-out tables and improve the efficiency of BGP neighbor packet transmission. The method disclosed herein can maximize BGP neighbor packet transmission performance without violating the original BGP neighbor packet transmission rules, thereby achieving the goal of improving the efficiency of BGP neighbor message sending.
[0098] In one embodiment of this disclosure, the router in the above-described technical solution can be used to process any one of BGP routing, EVPN (Ethernet Virtual Private Network) routing, MVPN (Movable Virtual Private Network) routing, L3VPN (Layer3 MPLS VPNs) routing, and L2VPN (Layer2 MPLS VPNs) routing.
[0099] Based on the same inventive concept, embodiments of this application also provide an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute a BGP-based message sending method.
[0100] The memory can be the memory in a router, etc., and can include volatile memory, such as random access memory; it can also include non-volatile memory, such as read-only memory, flash memory, hard disk or solid-state drive; it can also include a combination of the above types of memory.
[0101] The processor described above can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0102] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements a BGP-based message sending method on a circuit board.
[0103] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections having one or more wires; portable computer disks; hard disks; random access memory (RAM); read-only memory (ROM); erasable programmable read-only memory (EPROM); registers; hard disks; optical fibers; portable compact disc read-only memory (CD-ROM); optical storage devices; magnetic storage devices; or any suitable combination thereof; or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In the embodiments of this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0104] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a device including one or any combination of the above-mentioned memories. The computer may be a variety of computing devices, including smart terminals and servers.
[0105] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0106] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., files that store one or more modules, subroutines, or code sections).
[0107] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0108] Since the router, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects obtained can also be referred to the above method embodiments, and the embodiments of the present invention will not be repeated here.
[0109] In the several embodiments provided in this 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 merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0110] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0111] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0112] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0113] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0114] The above provides a detailed description of a BGP-based message sending method. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for sending a packet based on BGP, characterized in that, The method comprises: dividing all BGP neighbors into different update-group; when the route policy applied by a BGP neighbor changes; if the BGP neighbor can match the corresponding update-group, a new sub-group node is created under the update-group, the BGP neighbor is removed from the original sub-group node and is re-hung under the new sub-group node; after the BGP neighbors under the original sub-group node and the new sub-group node finish packet sending, the original sub-group node and the new sub-group node are merged; at least one sub-group node is set under each update-group, and the BGP neighbors are hung under the corresponding sub-group node in a linked list form, and the BGP neighbors under each sub-group node use the same adj-out.
2. The BGP-based packet sending method according to claim 1, wherein, when the route policy applied by a BGP neighbor changes; if the BGP neighbor cannot match the corresponding update-group, a new update-group is created, and the BGP neighbor is hung under the sub-group node of the new update-group.
3. The BGP-based packet forwarding method of claim 1, wherein, In the method, the update-group and the sub-group use the memory pool and the dynamically applied memory in a shared manner.
4. The BGP-based packet sending method according to any one of claims 1-3, characterized in that, The method further comprises: a judging step of judging whether the BGP neighbor belongs to the same update-group, so that all BGP neighbors can be hung under the corresponding update-group.
5. The BGP-based packet sending method according to claim 4, wherein, The judging step comprises: judging the type of the BGP neighbor, the pseudo AS number used, the negotiation option used when the BGP neighbor is established, the announcement period, the peer group to which the BGP neighbor belongs, the route policy used, the prefix list used, the AS number filter rule used, and whether the filter used is consistent with the corresponding update-group in sequence; if the above judging results are all consistent, the BGP neighbor belongs to the update-group; if at least one of the above judging results is inconsistent, a new update-group is created for the BGP neighbor.
6. The BGP-based packet sending method according to claim 5, wherein, In the judging step, if the type of the BGP neighbor is IBGP or EBGP, it is considered that the type of the BGP neighbor is consistent with the update-group.
7. The BGP-based packet forwarding method of claim 5, wherein, In the judging step, If the BGP neighbor and the update-group use the pseudo AS number simultaneously, or, the BGP neighbor and the update-group do not use the pseudo AS number simultaneously, it is considered that the BGP neighbor uses the pseudo AS number consistent with the update-group.
8. A router, characterized in that The method of any of claims 1-7 is applied to the router.
9. The router of claim 8, wherein, The router is configured to process any of BGP routes, EVPN routes, MVPN routes, L3VPN routes, L2VPN routes. The router is configured to process any of BGP routes, EVPN routes, MVPN routes, L3VPN routes, L2VPN routes.