Routing sending method and apparatus, network device, and storage medium
By assigning batch identifiers to BGP neighbor devices and sharing advertisement units, the problem of memory and processor resource consumption in route sending in network devices is solved, and more efficient route advertisement performance is achieved.
Patent Information
- Application Number
- CN202410090677.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-22
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-01-22
AI Technical Summary
In network devices, the large size of BGP routes and neighbors leads to the process of assembling and sending routes consuming a lot of memory and processor resources, and existing technical solutions have problems with announcement delay and memory usage.
By assigning the same batch identifier to neighboring devices that join the same advertisement group, routes in the routing table are treated as routes to be sent, and the batch identifier is shared in the advertisement unit, enabling neighboring devices to reuse advertisement units, thereby reducing advertisement latency and memory usage.
It reduces announcement latency, decreases memory and processor resource consumption, and improves the announcement performance of network devices.
Smart Images

Figure CN117938734B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and more specifically, to a routing and transmission method, apparatus, network device, and storage medium. Background Technology
[0002] Currently, due to the increasing scale of BGP (Border Gateway Protocol) routes and neighbors, a single network device may carry hundreds of thousands or even millions of BGP route information, while simultaneously establishing thousands of BGP neighbor relationships with surrounding network devices. In this scenario, the total number of local route assembly operations during the packetization and transmission process can reach an astonishing billions. Furthermore, recording advertisement relationships and encapsulating route advertisement messages places enormous demands on the network device's memory usage and processor overhead. Therefore, improving the performance of network devices in assembling and transmitting BGP routes is a pressing issue that needs to be addressed, especially with larger network devices.
[0003] Update-group (also known as packet group or update group) technology treats all BGP neighbors with the same announcement policy as a single announcement group. This ensures that each route to be sent is encapsulated only once and then sent to all neighbors within the group, exponentially improving BGP route announcement efficiency. However, update-group technology presents a difficult balance problem. On one hand, all neighbors within the group should be processed centrally to improve efficiency; on the other hand, neighbor connectivity (UP) or neighbor group switching (i.e., a neighbor switching from one announcement group to another) triggers initial announcements (also known as batch announcements) to neighbors, but the UP times or the times when each neighbor joined the announcement group differ. To reduce the mutual influence of different neighbors' announcement progress, the first existing solution is batch queuing announcements. This means that only after the initial announcements of neighbors in the previous batch that have UP are completed can the initial announcements of neighbors in the next batch that have UP be made. This solution results in severe coupling between the announcement progress of each neighbor, with significant delays in the initial announcements of neighbors with later UP times, impacting network convergence time. The existing second approach is to use subgrouping, which further divides the notification group into multiple subgroups based on the different times when the neighbors joined the group. While this approach can reduce the mutual influence of different neighbors' notification progress to some extent, it also increases the number of notification logic objects, thus significantly increasing memory usage and processor overhead. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a routing transmission method, apparatus, network device and storage medium.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] In a first aspect, the present invention provides a routing transmission method applied to a network device, the routing transmission method comprising:
[0007] During the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, each neighboring device that joins the announcement group in the same preset time period is assigned the same batch identifier to treat them as a batch.
[0008] When making an initial announcement to any batch of neighboring devices, each route in the routing table associated with the announcement group is taken as a route to be sent. If there is an announcement unit corresponding to the route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches.
[0009] Based on the notification unit, the route to be sent is sent to the neighboring device that matches each batch identifier in the batch list of the notification unit.
[0010] In an optional implementation, the routing table includes routing prefix information and routing attribute information for each route;
[0011] Before the step of sending the route to be sent to neighboring devices matching each batch identifier in the batch list of the notification unit based on the notification unit, the route sending method further includes:
[0012] If there is no notification unit corresponding to the route to be sent in the notification group, then based on the route prefix information and route attribute information of the route to be sent, the field indicating that the notification type is an initial notification, and the preset batch list template, a notification unit corresponding to the route to be sent is created, and the batch identifier of this batch is added to the batch list in the notification unit.
[0013] In an optional implementation, the routing attribute information includes path attributes;
[0014] The step of sending the route to be sent to neighboring devices matching each batch identifier in the batch list of the announcement unit, based on the announcement unit, includes:
[0015] If there is no announcement unit in the announcement group with the same path attribute as the announcement unit, the message is encapsulated based on the announcement unit to obtain a shared message carrying all batch identifiers in the announcement unit, and the announcement unit is released after the shared message is cached in the shared message queue.
[0016] If there is an announcement unit in the announcement group with the same path attribute as the announcement unit, the message is encapsulated based on the multiple announcement units with the same path attribute to obtain a shared message carrying all batch identifiers in the multiple announcement units. The shared message is then cached in the shared message queue and the multiple announcement units are released.
[0017] The shared message is copied to obtain a copy message corresponding to the neighbor device that matches each batch identifier in the shared message, and each copy message is sent to the corresponding neighbor device.
[0018] In an optional implementation, all routes in the routing table are arranged according to routing prefix information, and the route sending method further includes:
[0019] The current number of notification units in the notification group is counted in real time;
[0020] When the current number reaches a preset first number, the creation of notification units is paused and breakpoint information is recorded. The breakpoint information includes the routing prefix information of the route for which a notification unit should be created at the moment.
[0021] When the current number is less than a preset second number, the notification unit continues to be created based on the routing table and the breakpoint information; the first number is greater than the second number.
[0022] In an optional implementation, the routing method further includes:
[0023] After sending each copy of the shared message to the corresponding neighbor device, the shared message is released.
[0024] When the shared message queue has no available space, message encapsulation is paused until the shared message queue has available space, at which point message encapsulation resumes.
[0025] In an optional implementation, the network device is further configured with a sending queue for caching replica packets corresponding to each neighboring device, and the routing sending method includes:
[0026] For each neighboring device's sending queue, when the neighboring device's sending queue has no available space, message copying is paused until the neighboring device's sending queue has available space, at which point message copying resumes.
[0027] Secondly, the present invention provides a routing transmission device applied to a network device, the routing transmission device comprising:
[0028] The allocation module is used to assign the same batch identifier to each neighboring device that joins the announcement group within the same preset time period during the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, so as to treat them as a batch.
[0029] The processing module is used to, when making an initial announcement to any batch of neighboring devices, take each route in the routing table associated with the announcement group as a route to be sent. If there is an announcement unit corresponding to the route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches.
[0030] The sending module is used to send the route to be sent to neighboring devices that match each batch identifier in the batch list of the announcement unit, based on the announcement unit.
[0031] In an optional implementation, the routing table includes routing prefix information and routing attribute information for each route, and the processing module is further configured to:
[0032] If there is no notification unit corresponding to the route to be sent in the notification group, then based on the route prefix information and route attribute information of the route to be sent, the field indicating that the notification type is an initial notification, and the preset batch list template, a notification unit corresponding to the route to be sent is created, and the batch identifier of this batch is added to the batch list in the notification unit.
[0033] Thirdly, the present invention provides a network device including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the routing transmission method described in any of the foregoing embodiments.
[0034] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the routing and transmission method described in any of the foregoing embodiments.
[0035] The present invention provides a route sending method, apparatus, network device, and storage medium. The method includes: firstly, during the process of multiple neighboring devices with Border Gateway Protocol (BGP) neighbor relationships joining an advertising group with the network device, assigning the same batch identifier to each neighboring device joining the advertising group within the same preset time period to classify them as a batch; then, when initially advertising to any batch of neighboring devices, treating each route in the routing table associated with the advertising group as a route to be sent; if there is an advertising unit corresponding to a route to be sent in the advertising group, adding the batch identifier of this batch to the batch list in the advertising unit, and this batch list includes the batch identifiers of previous batches; finally, based on the advertising unit, sending the route to be sent to the neighboring device matching each batch identifier in the batch list of the advertising unit. By sharing advertising units, neighboring devices joining the advertising group later can reuse advertising units created by neighboring devices joining the advertising group earlier, thereby reducing advertising latency, reducing the memory and processor resources occupied, and improving the advertising performance of the network device.
[0036] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 A block diagram of a network device provided in an embodiment of the present invention is shown;
[0039] Figure 2 A flowchart of a routing transmission method provided in an embodiment of the present invention is shown;
[0040] Figure 3 An example diagram of a network provided by an embodiment of the present invention is shown;
[0041] Figure 4 A functional block diagram of a routing transmission device provided in an embodiment of the present invention is shown.
[0042] Icons: 110 - Processor; 120 - Memory; 130 - Communication module; 300 - Routing and transmitting device; 310 - Distribution module; 330 - Processing module; 350 - Transmitting module. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0045] It should be noted that relational terms such as "first" and "second" are used merely 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.
[0046] Please see Figure 1 This is a block diagram of a network device provided in an embodiment of the present invention. The network device includes a processor 110, a memory 120, and a communication module 130. The components are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0047] The processor 110 is used to read / write data or programs stored in the memory 120 and perform corresponding functions. It can be a general-purpose processor, including CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a DSP digital signal processor, ASIC application-specific integrated circuit, FPGA off-the-shelf programmable gate array or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0048] The memory 120 is used to store programs or data. The memory 120 can be RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0049] The communication module 130 is used for signaling or data communication with other devices.
[0050] Understandable Figure 1 The structure shown is only a schematic diagram of a network device; the network device may also include components that are larger than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0051] The following will describe the various steps in the routing and sending method provided by the embodiments of the present invention, as well as the corresponding technical effects. Please refer to [link / reference]. Figure 2 , Figure 2 This is a flowchart illustrating a routing and sending method provided in an embodiment of the present invention.
[0052] Step S202: During the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, assign the same batch identifier to each neighboring device that joins the announcement group in the same preset time period so that they are treated as a batch.
[0053] Step S204: When making an initial announcement to any batch of neighboring devices, each route in the routing table associated with the announcement group is taken as a route to be sent. If there is an announcement unit corresponding to a route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches.
[0054] Step S206: Based on the announcement unit, send the route to be sent to the neighboring device that matches each batch identifier in the batch list in the announcement unit.
[0055] For ease of understanding, an example network diagram is provided in this embodiment of the invention. Please refer to [link / reference]. Figure 3The network consists of network devices 1 to 6, all of which are configured with basic BGP functions. Advertisement groups can be dynamically generated by BGP based on neighbor relationships; routing tables can be dynamically learned from neighbors by BGP or imported through other methods. Steps S202 to S206 will be explained below using network device 1 as the execution subject.
[0056] In the network configuration, network device 1 establishes BGP neighbor relationships with network devices 2 through 5 respectively. That is, network devices 2 through 5 are all neighbor devices of network device 1, and these 5 neighbor devices have the same advertising policy. That is, when network device 1 is in a stable state, network device 1 will classify these 5 neighbor devices into the same advertising group.
[0057] For example, after network device 1 restarts, its neighboring devices, namely network devices 2 to 5, will connect to network device 1 (i.e., UP), and the UP time of each neighboring device is random. Once each neighboring device connects to network device 1, network device 1 will add it to the same advertising group, such as advertising group G. During the process of adding these five neighboring devices (network devices 2 to 5) to advertising group G, network device 1 will assign a batch identifier to each neighboring device, and assign the same batch identifier to neighboring devices that join the advertising group within the same preset time period.
[0058] Assuming the preset time period is 3 seconds, and network devices 2 through 5 join the announcement group G at 2-second intervals, i.e., at seconds 0, 2, 4, 6, and 8 respectively. Since network devices 2 and 3 join the announcement group G during the 0-3 second interval, network device 1 assigns the same batch ID (e.g., batch ID1) to network devices 2 and 3 and designates them as the first batch. Similarly, network device 1 assigns batch ID2 to network devices 4 and 5 and designates them as the second batch, and assigns batch ID3 to network device 6 and designates it as the third batch.
[0059] A timer can be used to set each time period. When the timer expires, the initial notification to the neighboring devices in this batch will begin. The method for initial notification to each batch of neighboring devices is similar. For simplicity, the following explanation uses the initial notification to the second batch of neighboring devices as an example.
[0060] The second batch corresponds to a time period of 3 to 6 seconds. Therefore, starting from the 7th second, initial advertisements are made to the neighboring devices in the second batch, namely network devices 4 and 5. Specifically, network device 1 traverses its routing table to obtain each route associated with advertisement group G and uses it as a route to be sent. Since the processing method for each route to be sent is similar, the following example uses route a as the route to be sent.
[0061] If there is an advertisement unit corresponding to route 'a' in the advertisement group, it means that network device 1 has not yet sent route 'a' to neighboring devices in previous batches. That is, the batch list in the advertisement unit corresponding to route 'a' still contains batch identifiers from previous batches. Therefore, the batch identifier of the current batch is added to the batch list in that advertisement unit to share the advertisement unit with neighboring devices from previous batches. For example, assuming network device 1 has not yet sent route 'a' to neighboring devices in the first batch, the batch list in the advertisement unit corresponding to route 'a' contains the batch identifiers of the first batch (batch ID1) and the second batch (batch ID2). Then, based on the advertisement unit corresponding to route 'a', route 'a' is sent to neighboring devices that match each batch identifier in the batch list of that advertisement unit. Specifically, route 'a' is sent to neighboring devices matching batch ID1 (network devices 2 and 3) and neighboring devices matching batch ID2 (network devices 4 and 5).
[0062] It should be noted that the above implementation is merely an example. In practice, due to factors such as dynamic changes in routing, the batch list of the notification unit may contain batch identifiers from one or more batches preceding the current batch. That is, the batch identifier belonging to the previous batch in the batch list may be one or more.
[0063] As can be seen, compared to the existing first approach, this embodiment of the invention can use a single announcement unit to send routes to multiple batches of neighboring devices simultaneously, thereby reducing announcement latency. Compared to the existing second approach, in this embodiment, only one announcement unit is available for each route in the group at any given time, thus avoiding excessive memory consumption and reducing processor overhead. In other words, by sharing the announcement unit, this embodiment enables neighboring devices that join the announcement group later to reuse announcement units created by neighboring devices that joined earlier, thereby reducing announcement latency, minimizing memory and processor resource consumption, and improving the announcement performance of network devices.
[0064] As can be seen from the above steps, firstly, during the process of multiple neighboring devices with Border Gateway Protocol (BGP) neighbor relationships joining an advertising group with the network device, each neighboring device joining the advertising group within the same preset time period is assigned the same batch identifier to be considered as a batch. Then, when initially advertising to any batch of neighboring devices, each route in the routing table associated with the advertising group is treated as a route to be sent. If there is an advertising unit corresponding to a route to be sent in the advertising group, the batch identifier of this batch is added to the batch list in the advertising unit, and this batch list includes the batch identifiers of previous batches. Finally, based on the advertising unit, the route to be sent is sent to the neighboring device matching each batch identifier in the batch list of the advertising unit. By sharing advertising units, neighboring devices joining the advertising group later can reuse advertising units created by neighboring devices joining earlier, thereby reducing advertising latency, reducing the memory and processor resources consumed, and improving the advertising performance of the network device.
[0065] Optionally, for the route to be sent, this embodiment of the invention also provides an implementation method.
[0066] Step S208: If there is no advertisement unit corresponding to the route to be sent in the advertisement group, then based on the route prefix information and route attribute information of the route to be sent, the field indicating that the advertisement type is initial advertisement, and the preset batch list template, an advertisement unit corresponding to the route to be sent is created, and the batch identifier of this batch is added to the batch list in the advertisement unit.
[0067] To facilitate understanding, the above example will be used for illustration. The routing table of network device 1 includes routing prefix information and routing attribute information for each route.
[0068] If, during the initial announcement to the neighboring devices in the second batch, namely network devices 4 and 5, there is currently no announcement unit corresponding to route a in the announcement group, it means that there is no announcement unit in the announcement group that can share and send route a. In this case, the announcement unit corresponding to route a is recreated. That is, the announcement unit is constructed based on the route prefix information and route attribute information of route a, the field indicating that the announcement type is initial announcement, and the preset batch list template.
[0069] Understandably, there are two types of announcements for announcement units: initial announcement and real-time announcement. The real-time announcement type means that the route is sent to all neighboring devices in the announcement group, and this type of announcement unit does not need to carry a batch list; while the initial announcement type means that the route is sent to neighboring devices in the announcement group based on batches, so this type of announcement unit needs to carry a batch list.
[0070] Then, the batch identifier of this batch is added to the batch list of the advertisement unit. Thus, the batch list of the advertisement unit corresponding to route a contains the batch identifier of the second batch, ID2. The newly created advertisement unit corresponding to route a is then added to the advertisement chain of advertisement group G, i.e., a linked list is used to organize all advertisement units in the same advertisement group. Optionally, a queue can also be used. Furthermore, a data organization method such as a tree can be added to the advertisement units to facilitate fast lookup.
[0071] Next, based on the announcement unit corresponding to route a, route a is sent to the neighboring devices that match each batch ID in the batch list of the announcement unit, that is, to the neighboring devices that match batch ID2, namely network device 4 and network device 5.
[0072] Optionally, for step S206, the present invention provides one possible implementation method.
[0073] Step S206-1A: If there is no announcement unit in the announcement group with the same path attribute as the announcement unit, encapsulate the message based on the announcement unit to obtain a shared message carrying all batch identifiers in the announcement unit, and release the announcement unit after caching the shared message to the shared message queue.
[0074] Step S206-1B: If there is an announcement unit in the announcement group with the same path attribute as the announcement unit, encapsulate the message based on the multiple announcement units with the same path attribute to obtain a shared message carrying all batch identifiers in the multiple announcement units, and release the multiple announcement units after caching the shared message to the shared message queue.
[0075] Step S206-3: Copy the shared message to obtain the copy message corresponding to the neighbor device matched by each batch identifier in the shared message, and send each copy message to the corresponding neighbor device.
[0076] In this embodiment, the announcement unit can be understood as temporary data used to encapsulate the UPDATE message in the BGP route announcement, which contains the information needed to send a route to an announcement object. That is, in this embodiment of the invention, the announcement unit is used to encapsulate the message and send the message to the neighboring device to realize route transmission.
[0077] To facilitate understanding, we will continue with the example of the batch list of the announcement unit corresponding to route a, which includes the batch identifier of the first batch (batch ID1) and the batch identifier of the second batch (batch ID2). The routing attribute information of each route in the routing table of network device 1 includes path attributes.
[0078] If, when encapsulating the advertisement unit corresponding to route a, there is currently no advertisement unit in advertisement group G with the same path attributes as the advertisement unit, then the message is encapsulated based on the advertisement unit corresponding to route a to obtain a shared message. The shared message carries all the identifiers in the advertisement unit corresponding to route a, namely batch ID1 and batch ID2. After the shared message is cached in the shared message queue, the advertisement unit corresponding to route a is released.
[0079] Then, the shared message is copied to obtain the copy message corresponding to the neighbor device that matches each batch ID in the shared message. That is, the copy message corresponding to the neighbor device that matches batch ID1, namely network device 2 and network device 3, is obtained, as well as the copy message corresponding to the neighbor device that matches batch ID2, namely network device 4 and network device 5. Then, each copy message is sent to the corresponding neighbor device, which realizes the batch sending of route a to the neighbor device.
[0080] If, when encapsulating the advertisement unit corresponding to route a, there exists an advertisement unit in advertisement group G with the same path attribute as that advertisement unit, such as an advertisement unit corresponding to route b with the same path attribute as the advertisement unit corresponding to route a, and the batch list of the advertisement unit corresponding to route b includes the batch identifier of the third batch, i.e., batch ID3, then the message is encapsulated based on these multiple advertisement units with the same path attribute. That is, the message is encapsulated based on the advertisement unit corresponding to route a and the advertisement unit corresponding to route b to obtain a shared message. The shared message carries all the identifiers of the advertisement unit corresponding to route a and the advertisement unit corresponding to route b, i.e., batch ID1, batch ID2, and batch ID3. After the shared message is cached in the shared message queue, the advertisement units corresponding to route a and route b are released.
[0081] Then, the shared message is copied to obtain the copy message corresponding to the neighbor device that matches each batch ID in the shared message. That is, the copy message corresponding to the neighbor device matching batch ID1 (network device 2 and network device 3), the copy message corresponding to the neighbor device matching batch ID2 (network device 4 and network device 5), and the copy message corresponding to the neighbor device matching batch ID3 (network device 6) are obtained. Then, each copy message is sent to the corresponding neighbor device, which realizes the simultaneous batch sending of route a and route b to the neighbor device.
[0082] It can be understood that the embodiments of the present invention improve the announcement speed, reduce the announcement latency, and reduce the memory and processor resources occupied by uniformly encapsulating announcement units with the same path attributes in the announcement group into the same shared message, and sending multiple replica messages obtained by copying the shared message to the corresponding neighbor devices to send routes.
[0083] Optionally, based on the above process of creating the notification unit, this embodiment of the invention provides an implementation method to further reduce resource consumption.
[0084] Step S210: Real-time statistics of the current number of notification units in the notification group;
[0085] Step S212A: When the current number reaches the preset first number, pause the creation of advertising units and record the breakpoint information. The breakpoint information includes the route prefix information of the route for which an advertising unit should be created at the present time.
[0086] Step S212B: When the current quantity is less than the preset second quantity, continue to create announcement units based on the routing table and breakpoint information; when the first quantity is greater than the second quantity.
[0087] To facilitate understanding, the above example will be used for illustration. In the routing table configured for network device 1, all routes are arranged according to their route prefix information; that is, the position of a route in the routing table can be determined based on its route prefix information.
[0088] The system can count the current number of all advertisement units in advertisement group G in real time and compare the current number with the preset first and second numbers. If the current number reaches the first number (i.e., the current number is greater than or equal to the first number), it indicates that there are too many advertisement units in advertisement group G. To prevent the number of advertisement units from continuing to increase and consuming too many resources, the creation of advertisement units can be paused and breakpoint information can be recorded. That is, the route prefix information of the route that should be creating an advertisement unit is recorded as the breakpoint information.
[0089] As created advertisement units are released, the number of advertisement units in advertisement group G will gradually decrease. When the current number of advertisement units in advertisement group G is less than the second number, it means that there are few advertisement units in advertisement group G. Then, based on the routing table and the previously recorded breakpoint information, the position of the route in the routing table where the advertisement unit should be created can be determined, so as to continue to create advertisement units.
[0090] Optionally, based on the above process of caching shared messages into a shared message queue, this embodiment of the invention provides an implementation method to further reduce resource consumption.
[0091] Step S214: After sending each copy of the shared message to the corresponding neighbor device, release the shared message;
[0092] Step S216: When there is no available space in the shared message queue, pause message encapsulation until there is available space in the shared message queue, then resume message encapsulation.
[0093] In this embodiment, as shared packets corresponding to multiple routes are cached in the shared packet queue, the shared packet queue may run out of space. In this case, to avoid consuming too much memory, packet encapsulation can be paused. Then, as each copy of the cached shared packet is sent to the corresponding neighbor device, the cached shared packet will be released, and the shared packet queue will have available space. When the shared packet queue has available space, the encapsulation operation can be resumed to continue encapsulating packets.
[0094] Optionally, the network device is also configured with a sending queue for caching the copy packets corresponding to each neighboring device. Based on this, embodiments of the present invention provide an implementation method to further reduce resource consumption.
[0095] Step S218: For each neighboring device's sending queue, when the neighboring device's sending queue has no available space, pause message copying until the neighboring device's sending queue has available space, then resume message copying.
[0096] In this embodiment, for each neighboring device's sending queue, as multiple replica packets corresponding to routes are cached in the sending queue, the sending queue may run out of available space. In this case, to avoid consuming too much memory, packet copying can be paused. Then, as the cached replica packets are sent out, the sending queue will have available space. When the sending queue has available space, the copying operation can be resumed to continue copying packets.
[0097] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a routing transmission device is given below. Please refer to... Figure 4 , Figure 4 This is a functional block diagram of a routing sending device 300 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the routing sending device 300 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The routing sending device 300 includes:
[0098] The allocation module 310 is used to assign the same batch identifier to each neighboring device that joins the announcement group in the same preset time period during the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, so as to treat them as a batch.
[0099] The processing module 330 is used to, when making an initial announcement to any batch of neighboring devices, treat each route in the routing table associated with the announcement group as a route to be sent. If there is an announcement unit corresponding to a route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches.
[0100] The sending module 350 is used to send the route to be sent to the neighboring device that matches each batch identifier in the batch list of the announcement unit, based on the announcement unit.
[0101] Optionally, the routing table includes routing prefix information and routing attribute information for each route. The processing module 330 is further configured to: if there is no advertising unit corresponding to the route to be sent in the current advertising group, then based on the routing prefix information and routing attribute information of the route to be sent, the field indicating that the advertising type is initial advertising, and the preset batch list template, create an advertising unit corresponding to the route to be sent, and add the batch identifier of this batch to the batch list in the advertising unit.
[0102] Optionally, the routing attribute information includes path attributes, and the sending module 350 is further configured to: when there is no advertising unit in the advertising group with the same path attributes as the advertising unit, encapsulate the message based on the advertising unit to obtain a shared message carrying all batch identifiers in the advertising unit, cache the shared message in the shared message queue, and then release the advertising unit; when there is an advertising unit in the advertising group with the same path attributes as the advertising unit, encapsulate the message based on multiple advertising units with the same path attributes to obtain a shared message carrying all batch identifiers in multiple advertising units, cache the shared message in the shared message queue, and then release the multiple advertising units; copy the shared message to obtain a copy message corresponding to the neighbor device matched by each batch identifier in the shared message, and send each copy message to the corresponding neighbor device.
[0103] Optionally, all routes in the routing table are arranged according to the routing prefix information. The processing module 330 is also used to: count the current number of advertising units in the advertising group in real time; when the current number reaches a preset first number, pause the creation of advertising units and record the breakpoint information, which includes the routing prefix information of the route for which an advertising unit should be created; when the current number is less than a preset second number, continue to create advertising units based on the routing table and the breakpoint information; and when the first number is greater than the second number.
[0104] Optionally, the processing module 330 is also configured to: release the shared message after sending each copy of the shared message to the corresponding neighbor device; and pause message encapsulation when there is no available space in the shared message queue, until the shared message queue has available space, and then continue encapsulating the message.
[0105] Optionally, the processing module 330 is also configured to: for each neighboring device's transmission queue, when the neighboring device's transmission queue has no available space, pause message copying until the neighboring device's transmission queue has available space, and then continue copying messages.
[0106] This invention also provides a network device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the routing and transmission method disclosed in this invention.
[0107] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the routing and transmission method disclosed in this invention.
[0108] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0109] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0110] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0111] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A routing transmission method, characterized in that, Applied to network devices, the routing transmission method includes: During the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, each neighboring device that joins the announcement group in the same preset time period is assigned the same batch identifier to treat them as a batch. When making an initial announcement to any batch of neighboring devices, each route in the routing table associated with the announcement group is taken as a route to be sent. If there is an announcement unit corresponding to the route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches. Based on the notification unit, the route to be sent is sent to the neighboring device that matches each batch identifier in the batch list of the notification unit.
2. The routing transmission method according to claim 1, characterized in that, The routing table includes the routing prefix information and routing attribute information for each route; Before the step of sending the route to be sent to neighboring devices matching each batch identifier in the batch list of the notification unit based on the notification unit, the route sending method further includes: If there is no notification unit corresponding to the route to be sent in the notification group, then based on the route prefix information and route attribute information of the route to be sent, the field indicating that the notification type is an initial notification, and the preset batch list template, a notification unit corresponding to the route to be sent is created, and the batch identifier of this batch is added to the batch list in the notification unit.
3. The routing transmission method according to claim 2, characterized in that, The routing attribute information includes path attributes; The step of sending the route to be sent to neighboring devices matching each batch identifier in the batch list of the announcement unit, based on the announcement unit, includes: If there is no announcement unit in the announcement group with the same path attribute as the announcement unit, the message is encapsulated based on the announcement unit to obtain a shared message carrying all batch identifiers in the announcement unit, and the announcement unit is released after the shared message is cached in the shared message queue. If there is an announcement unit in the announcement group with the same path attribute as the announcement unit, the message is encapsulated based on the multiple announcement units with the same path attribute to obtain a shared message carrying all batch identifiers in the multiple announcement units. The shared message is then cached in the shared message queue and the multiple announcement units are released. The shared message is copied to obtain a copy message corresponding to the neighbor device that matches each batch identifier in the shared message, and each copy message is sent to the corresponding neighbor device.
4. The routing transmission method according to claim 2, characterized in that, All routes in the routing table are arranged according to the routing prefix information, and the route sending method further includes: The current number of notification units in the notification group is counted in real time; When the current number reaches a preset first number, the creation of notification units is paused and breakpoint information is recorded. The breakpoint information includes the routing prefix information of the route for which a notification unit should be created at the moment. When the current number is less than a preset second number, the notification unit continues to be created based on the routing table and the breakpoint information; the first number is greater than the second number.
5. The routing transmission method according to claim 3, characterized in that, The routing transmission method further includes: After sending each copy of the shared message to the corresponding neighbor device, the shared message is released. When the shared message queue has no available space, message encapsulation is paused until the shared message queue has available space, at which point message encapsulation resumes.
6. The routing transmission method according to claim 3, characterized in that, The network device is also configured with a sending queue for caching replica packets corresponding to each neighboring device, and the routing sending method further includes: For each neighboring device's sending queue, when the neighboring device's sending queue has no available space, message copying is paused until the neighboring device's sending queue has available space, then message copying continues.
7. A routing transmission device, characterized in that, Applied to network devices, the routing transmission device includes: The allocation module is used to assign the same batch identifier to each neighboring device that joins the announcement group within the same preset time period during the process of multiple neighboring devices that have a Border Gateway Protocol (BGP) neighbor relationship with the network device joining the announcement group, so as to treat them as a batch. The processing module is used to, when making an initial announcement to any batch of neighboring devices, take each route in the routing table associated with the announcement group as a route to be sent. If there is an announcement unit corresponding to the route to be sent in the announcement group, the batch identifier of this batch is added to the batch list in the announcement unit and the batch list contains the batch identifiers of previous batches. The sending module is used to send the route to be sent to neighboring devices that match each batch identifier in the batch list of the announcement unit, based on the announcement unit.
8. The routing transmission device according to claim 7, characterized in that, The routing table includes routing prefix information and routing attribute information for each route, and the processing module is further used for: If there is no notification unit corresponding to the route to be sent in the notification group, then based on the route prefix information and route attribute information of the route to be sent, the field indicating that the notification type is an initial notification, and the preset batch list template, a notification unit corresponding to the route to be sent is created, and the batch identifier of this batch is added to the batch list in the notification unit.
9. A network device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and when the processor executes the computer program, it implements the routing transmission method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the routing transmission method according to any one of claims 1 to 6.
Citation Information
Patent Citations
BGP (Border Gateway Protocol) route processing method, BGP route processing device and BGP equipment
CN106878175A
Routing information monitoring method and device
CN110191059A
