A processing method and storage medium for routing information
By converting the initial state of routing information into cache state, and converting the cache state in batches into deployed states and active states based on the triggering of preset conditions, the problem of low efficiency of routing table entries is solved, and efficient batch issuance of routing information and the stability of network equipment is improved.
Patent Information
- Application Number
- CN202211697991.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-12-28
AI Technical Summary
In large data center networks, the issuance efficiency of routing table entries is low, resulting in frequent interface switching affecting efficiency.
Through operation instructions, the initial state of the routing information is converted into cached state, and based on the triggering of preset conditions, the cached state is converted into deployed state and active state to realize batch issuance of routing information.
It improves the efficiency of routing information issuance, reduces the number of operations of hardware forwarding components, and enhances the stability and performance of network equipment.
Smart Images

Figure CN116319504B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a method for processing routing information and a storage medium. Background Art
[0002] In large or ultra-large data center networks, network devices such as servers or virtual machines that support large amounts of data and information are usually required. Therefore, based on this network application scenario, network devices are usually required to support routing table entries of several hundred KB in size. Therefore, in large-scale routing application scenarios, the fast and reliable delivery of routing table entries and other similar information has higher performance requirements.
[0003] Based on the conventional network device framework, the delivery of routing table items is usually implemented in the hardware forwarding component. Currently, the delivery of routing table items is generally done one by one, but since this delivery of routing table items one by one usually involves frequent interface switching, it greatly affects the efficiency of routing delivery. Summary of the invention
[0004] A major advantage of the present application is that it provides a method for processing routing information, which converts the initial state of routing information into a cache state based on an operation instruction, solves the problem of insufficient efficiency in sending multiple routing information, and enables batch processing of multiple routing information.
[0005] Another advantage of the present application is that it provides a method for processing routing information, which, based on the triggering of preset conditions, batch converts the cache state of multiple routing information into the deployment state, and then converts it into the active state for delivery after successful deployment, thereby solving the problem of low efficiency of batch conversion of routing information from the cache state to the active state, and enables routing information to be delivered in batches.
[0006] Another advantage of the present application is that it provides a method for processing routing information, which regularly detects whether the routing information in the cache state meets the preset conditions, provides a change opportunity for the routing information in the cache state, and enables the stored routing information in the cache state to be changed in batches.
[0007] Another advantage of the present application is that it provides a method for processing routing information, which converts the initial routing information into the routing information in the add or delete cache state according to the add or delete operation instruction of the routing information, solves the problem caused by the frequent addition or deletion of routing information, and enables the routing information to be modified in time.
[0008] Another advantage of the present application is that it provides a method for processing routing information, which, when routing information in a cache state of adding or deleting routing information receives an operation instruction that is exclusive with it, converts one cache state of routing information into another cache state that is exclusive with it, so as to solve the problem of modifying the state of routing information in the cache state, and facilitates timely modification of routing information in the cache state.
[0009] Another advantage of the present application is that it provides a method for processing routing information, wherein the cached routing information can be stored based on an AVL tree, a hash chain, etc., thereby solving the problem of insufficient storage efficiency of the cached routing information and improving the storage efficiency of the cached routing information.
[0010] Other advantages and features of the present application are fully apparent from the following detailed description and can be achieved through the combination of means and devices particularly pointed out in the appended claims.
[0011] In some embodiments, the method for processing routing information includes:
[0012] Based on an operation instruction for a piece of routing information, an initial state is changed into a cache state;
[0013] In response to meeting a preset condition, batch-operating multiple routing information to change a cache state into a deployment state;
[0014] In response to successful deployment, changing the deployment state to the active state;
[0015] Among them, the initial state and the active state are stable states, and the cache state and the deployment state are transient states; the active state adds or deletes multiple routing information relative to the initial state, and then sends the routing information of the active state.
[0016] A method for processing routing information and a storage medium provided by the embodiments of the present disclosure can achieve the following technical effects: the modified routing information can be cached to implement batch operations on routing information, thereby facilitating the batch distribution of routing information and improving the efficiency of routing information distribution. The preset conditions for triggering batch operations can be detected regularly to determine the timing of batch operations, thereby better ensuring the timeliness and sustainability of batch distribution of routing information. The cached state of routing information can be offset when the cached routing information receives an operation instruction that is inconsistent with the current cached state of the routing information, thereby avoiding a large number of invalid batch operations and effectively reducing the number of forwarding operations of the hardware forwarding unit. The use of a hash chain to store cached routing information can effectively improve the efficiency of routing table lookup, optimize the performance of routing information modification operations, and further improve the efficiency of routing distribution by the network operating system.
[0017] These and other objects, features and advantages of the present application are fully reflected in the following detailed description, drawings and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a system environment diagram of a method for processing routing information provided by an embodiment of the present disclosure.
[0019] Figure 2It is a flowchart of a method for processing routing information provided by an embodiment of the present disclosure.
[0020] Figure 3 It is a flowchart of another method for processing routing information provided by an embodiment of the present disclosure.
[0021] Figure 4 This is a flowchart of another method for processing routing information provided by an embodiment of the present disclosure.
[0022] Figure 5 This is a flowchart of another method for processing routing information provided by an embodiment of the present disclosure.
[0023] Fig. 6A It is a state machine control logic flow chart of a processing method using routing information provided by an embodiment of the present disclosure.
[0024] Figure 6B It is another state machine control logic flow chart of the processing method using routing information provided by the embodiment of the present disclosure.
[0025] Figure 7 It is a logic flow chart of the state machine batch increase operation control of the method for processing routing information provided by the embodiment of the present disclosure.
[0026] Figure 8 It is a logic flow chart of the control of batch deletion operations of a state machine using a method for processing routing information provided by an embodiment of the present disclosure.
[0027] Fig. 9 It is a schematic diagram of storing routing information based on a hash chain provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0029] Unless the context requires otherwise, the term "comprise" and other forms such as the third person singular form "comprises" and the present participle form "comprising" are to be interpreted as open, inclusive, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments" or "example" and the like are intended to indicate that specific features, structures, materials or characteristics associated with the embodiment or example are included in at least one embodiment or example of the present disclosure. The schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner.
[0030] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0031] When describing some embodiments, the expressions "coupled" and "connected" and their derivatives may be used. For example, when describing some embodiments, the term "connected" may be used to indicate that two or more components are in direct physical or electrical contact with each other. For another example, when describing some embodiments, the term "coupled" may be used to indicate that two or more components are in direct physical or electrical contact. However, the term "coupled" may also refer to two or more components that are not in direct contact with each other, but still cooperate or interact with each other. The embodiments disclosed herein are not necessarily limited to the contents of this document.
[0032] “At least one of A, B, and C” includes the following combinations of A, B, and C: A only, B only, C only, a combination of A and B, a combination of A and C, a combination of B and C, and a combination of A, B, and C.
[0033] “A and / or B” includes the following three combinations: A only, B only, and a combination of A and B.
[0034] The use of "configured to" herein is intended to be open and inclusive language that does not exclude devices adapted or configured to perform additional tasks or steps.
[0035] Additionally, the use of “based on” is meant to be open and inclusive, in that a process, step, calculation, or other action “based on” one or more stated conditions or values may, in practice, be based on additional conditions or beyond values.
[0036] Combination Figure 1 , Figure 1 The system environment for implementing a method for processing routing information provided by the embodiment of the present disclosure, for example, a network device, includes a processor 100, a storage unit, a hardware forwarding unit 200, a management interface 300 and an external interface 400.
[0037] The processor 100 can call the logic instructions in the storage unit to execute a method for processing routing information in the following embodiment.
[0038] In addition, the logic instructions in the above-mentioned storage unit can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0039] The storage unit, as a computer-readable storage medium, can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the storage unit, that is, implements a method for processing routing information in the above embodiment.
[0040] The storage unit may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created according to the use of the terminal device, etc. In addition, the storage unit may include a high-speed random access memory and may also include a non-volatile memory.
[0041] The hardware forwarding unit 200 is used to receive the routing information sent by the processor 100 in batch operation, and then transmit the routing information through the external interface 400, so as to send the routing information in batch operation and improve the efficiency of forwarding the routing information. At the same time, the hardware forwarding component of the network device can be a dedicated integrated circuit chip (Application Specific Integrated Circuit, ASIC) network forwarding chip, network processor (Network Processor, NP), data processor (Data Processing Unit, DPU), or field programmable gate array (Field Programmable Gate Array, FPGA) and the like.
[0042] The management interface 300 is used to transmit various operation instructions to the processor 100, so that the processor 100 executes a method for processing routing information in the above embodiment based on the transmitted operation instructions.
[0043] The external interface 400 is used to transmit routing information forwarded in batches by the hardware forwarding unit 200 .
[0044] Combination Figure 2 As shown, the embodiment of the present disclosure provides a method for processing routing information, including:
[0045] S10, based on an operation instruction for a piece of routing information, changing the initial state into a cache state;
[0046] S20, in response to satisfying a preset condition, batch-operating multiple routing information to change the cache state into a deployment state;
[0047] S30, in response to successful deployment, changing the deployment state to an active state;
[0048] S40, sending active routing information.
[0049] Using a method for processing routing information provided by an embodiment of the present disclosure, the management interface 300 sends an operation instruction for routing information to the processor 100. The processor 100 changes the routing information from an initial state to a cache state and stores it in a storage unit. When the processor 100 detects that multiple cached-state routing information stored meet a preset condition, the processor 100 performs batch operations on the multiple cached-state routing information, and batches the multiple cached-state routing information into deployed-state routing information. When the routing information is successfully deployed, the multiple deployed-state routing information are batched into active-state routing information, and finally the multiple active-state routing information are batched and sent to the hardware forwarding unit 200. The hardware forwarding unit 200 then batches forwards the multiple routing information to the external interface 400 to achieve batch forwarding of routing information, thereby improving the efficiency of sending routing information.
[0050] Furthermore, the routing information includes: IP address, mask, and routing table entry outbound interface.
[0051] Furthermore, the initial state and active state of routing information are stable states, and the cache state and deployment state of routing information are transient states. That is, when routing information is in the initial state or active state, the routing information is in a stable state of not being modified or having been modified, and when routing information is in the cache state or deployment state, the routing information is in a transient state of being modified or having been modified.
[0052] Furthermore, the active state of the routing information adds or deletes multiple pieces of routing information relative to the initial state of the routing information. In other words, the active state of the routing information is obtained by modifying multiple pieces of routing information in the initial state of the routing information.
[0053] Optionally, step S10 includes:
[0054] S11, based on an add operation instruction for a piece of routing information, the initial state is changed to an add cache state.
[0055] Specifically, when a routing information receives an add operation instruction, the routing information adds information according to the add operation instruction, so that the routing information in the initial state is converted into routing information in the add cache state and stored in the storage unit, waiting for the execution of the batch add operation.
[0056] Optionally, step S10 includes:
[0057] S12, based on a delete operation instruction for a piece of routing information, the initial state is changed to a delete cache state.
[0058] Specifically, when a routing information receives a deletion operation instruction, the routing information is deleted according to the deletion operation instruction, so that the routing information in the initial state is converted into routing information in the deletion cache state and stored in the storage unit, waiting for the execution of the batch deletion operation.
[0059] Optionally, after step S11 and before step S20, the following steps are included:
[0060] S13, based on the delete operation instruction for the routing information, the routing information in the add cache state is changed to the delete cache state, thereby offsetting the add cache state of the routing information.
[0061] Specifically, when the routing information is changed from the initial state to the cache adding state based on the adding operation instruction, and then a deleting operation instruction is received for the routing information, the cache adding state of the routing information is directly changed to the cache deleting state.
[0062] Therefore, it can be understood that when a routing information receives mutually exclusive operation instruction information in a short period of time, the addition and deletion operation instructions can be merged or offset. An operation instruction issued later covers another operation instruction issued earlier. Furthermore, the cache state of mutually exclusive routing information is avoided, and the increase in the triggering number of preset conditions and the large number of invalid batch operations are avoided. Therefore, if the network is in an environment of oscillation, the above steps can effectively reduce the number of forwarding operations of the hardware forwarding unit 200. In other words, the solution of merging or offsetting two mutually exclusive operation instructions for the same routing information is adopted, which is conducive to reducing the number of routing information that needs to be issued, and thus effectively improving the stability of network equipment.
[0063] Optionally, after step S12 and before step S20, the following steps are included:
[0064] S14, based on the add operation instruction for the routing information, the routing information in the delete cache state is changed to the add cache state, thereby offsetting the delete cache state of the routing information.
[0065] Specifically, when the routing information is changed from the initial state to the deleted cache state based on the delete operation instruction, and then an add operation instruction is received for the routing information, the deleted cache state of the routing information is directly changed to the added cache state.
[0066] Therefore, it can be understood that when a routing information receives mutually exclusive operation instruction information in a short period of time, the deletion and addition operation instructions can be merged or offset, and the operation instruction issued later covers the previous operation instruction. Furthermore, it avoids caching too much routing information cache state that can be offset, avoids increasing the triggering times of the preset conditions, and avoids performing a large number of invalid batch operations. Therefore, if the network is in an environment of oscillation, the above steps can effectively reduce the number of forwarding operations of the hardware forwarding unit 200. In other words, the scheme of merging or offsetting mutually exclusive operation instructions for the same routing information is conducive to reducing the number of routing information that needs to be issued, and thus effectively improving the stability of the network equipment.
[0067] Optionally, step S20 includes:
[0068] S21, regularly checking whether the routing information in the cache state meets the preset conditions;
[0069] S22, if the preset conditions are met, batch operate multiple routing information to change the cache state into the deployment state.
[0070] In this way, by detecting the cached routing information on time to detect whether the cached routing information meets the preset conditions, and then triggering batch operations on multiple routing information, the timing for starting to execute batch delivery of routing information can be detected more timely and accurately, which can better ensure the timeliness and sustainability of batch delivery of routing information.
[0071] Further, step S20 includes:
[0072] S23, in response to a preset condition, batch adding multiple routing information, and changing the adding cache state to the adding deployment state;
[0073] S24, in response to a preset condition, batch delete multiple pieces of routing information, and transform the cache deletion state into the deployment deletion state.
[0074] Optionally, the storage method of the routing information in the cache state includes: at least one of an AVL tree and a hash chain. Specifically, the AVL tree has a better traversal efficiency and a moderate search efficiency, while the hash chain has a better search efficiency and a moderate traversal efficiency. The characteristics of both are applicable to the storage of routing information in the cache state in this scheme, but since the method disclosed in the present invention first focuses on the efficiency of searching for routing information, it is preferred to adopt a hash chain routing information storage scheme. The advantage of the hash chain storage scheme is that it can effectively improve the search efficiency of stored routing information, optimize the performance of add and delete operations, and improve the efficiency of the network operating system in sending routing information.
[0075] Preferably, if Fig. 9 As shown, based on the hash algorithm, the routing table item data is stored in the corresponding hash bucket. If multiple routing table item data correspond to the same hash bucket, the remaining routing table item data are stored in the hash chain storage unit. Specifically, in the selection of the hash algorithm, a hash algorithm that is friendly to the IP address can be selected to achieve better discreteness. In one embodiment, the 32-bit golden section prime number 2654435761 is used as the hash factor. After the IP address is converted to a 32-bit value, it is multiplied by the hash factor to maintain the information entropy of the IP address, and then the remainder is taken according to the size of the hash bucket to obtain the hash bucket position where the routing information needs to be stored. If multiple routing information falls into the same hash bucket, a linked list solution is used for storage.
[0076] Furthermore, the ratio of the number of hash buckets to the number of hash chain storage units is 1:1. Specifically, in order to further improve the efficiency of routing information search, the ratio of the number of hash buckets M to the number of hash chain storage units N is set to 1:1, that is, in the ideal case of uniform hashing, each hash chain attached to a hash bucket only stores one routing information. The routing information stored in the hash chain data structure includes the following information: routing information: IP address and mask, outbound interface of routing table items, and operation information of routing information: addition, deletion, etc.
[0077] Combination Figure 3 As shown, the embodiment of the present disclosure provides another method for processing routing information, including:
[0078] S10, based on an operation instruction for a piece of routing information, changing the initial state into a cache state;
[0079] S21, regularly checking whether the routing information in the cache state meets the preset conditions;
[0080] S22, if the preset conditions are met, batch-operate multiple routing information to change the cache state to the deployment state;
[0081] S30, in response to successful deployment, changing the deployment state to an active state;
[0082] S40, sending active routing information.
[0083] Using a method for processing routing information provided by an embodiment of the present disclosure, the management interface 300 sends an operation instruction for routing information to the processor 100. The processor 100 changes the routing information from an initial state to a cache state, and stores it in a storage unit. The processor 100 periodically checks the routing information in the cache state, and periodically determines whether the routing information in the cache state meets the preset conditions. When the processor 100 detects that multiple pieces of routing information in the cache state stored meet the preset conditions, it indicates that batch operations need to be performed on multiple pieces of routing information in the cache state, and then the processor 100 performs batch operations on multiple pieces of routing information in the cache state. First, multiple pieces of routing information in the cache state are batch converted into routing information in the deployment state. When the routing information is successfully deployed, multiple pieces of routing information in the deployment state are batch converted into routing information in the active state, and finally multiple pieces of routing information in the active state are batch sent to the hardware forwarding unit 200. The hardware forwarding unit 200 then batch forwards multiple pieces of routing information to the external interface 400 to achieve batch forwarding of routing information. Furthermore, compared with the method of sending routing information one by one in the prior art, it is more conducive to improving the efficiency of sending routing information. At the same time, the timed detection of multiple cached routing information can more timely and accurately detect the time when the batch sending of routing information needs to be started, which can better ensure the timeliness and sustainability of the batch sending of routing information.
[0084] Furthermore, the preset condition includes at least one of: cache timeout when routing information is not empty and the number of routing information reaches a threshold. In one embodiment, a combination of two preset conditions can be used, that is, cache timeout when routing information is not empty and the number of routing information reaches a threshold. As long as any one of these two preset conditions is met, batch operation of multiple routing information can be triggered. The batch operation can include batch increase operation, batch decrease operation, etc.
[0085] Furthermore, the operation instruction for a routing information comes from the network operating system, and the preset condition is set by the network operating system. Specifically, the setting of the preset condition can be comprehensively considered according to the application environment or application requirements of the network operating system, so that the execution timing of batch operation routing information is more in line with the actual network application environment and requirements.
[0086] Further, step S30 includes:
[0087] S31, in response to the added deployment being successful, changing the added deployment state to the active state.
[0088] Further, step S30 includes:
[0089] S32, in response to the successful deletion of the deployment, changing the deleted deployment state to the active state.
[0090] Combination Figure 4 As shown, the embodiment of the present disclosure provides another method for processing routing information, including:
[0091] S11, based on an add operation instruction for a piece of routing information, the initial state is changed to an add cache state;
[0092] S13, the routing information in the added cache state is changed to the deleted cache state based on the delete operation instruction for the routing information, so as to offset the added cache state of the routing information;
[0093] S23 responds to the preset condition, batch adds multiple routing information, and changes the increase cache state into the increase deployment state;
[0094] S31, in response to the addition of deployment being successful, changing the addition of deployment state to the active state;
[0095] S40, sending active routing information.
[0096] A method for processing routing information provided by an embodiment of the present disclosure is used, combined with Fig. 6A and Figure 7 As shown. The management interface 300 sends an add operation instruction for routing information to the processor 100. The processor 100 changes the routing information from the initial state to the add cache state, and stores it in the storage unit. At this time, if the routing information that is in the add cache state has not been subjected to a batch add operation, and the management interface 300 sends a delete operation instruction for the routing information to the processor 100, the add cache state of the routing information is changed to the delete cache state, and the add cache state of the routing information is offset. In other words, when a delete operation instruction for the same routing information in the processor 100 is received before the preset conditions are met, the modifications of the two cancel each other out, which is equivalent to not modifying the routing information, and thus, there is no need to perform an add operation on the routing information. In this way, two mutually exclusive operation instructions can be merged or offset, and the later issued operation instruction covers the previously issued operation instruction, which effectively reduces the number of operations on the hardware forwarding unit 200 in scenarios such as network shocks.
[0097] When the processor 100 detects that the stored multiple pieces of routing information in the cache state meet the preset conditions, the processor 100 performs batch addition operations on the multiple pieces of routing information in the cache state, and converts the multiple pieces of routing information in the cache state into the routing information in the deployment state. After the routing information is added and deployed successfully, the multiple pieces of routing information in the deployment state are converted into the active state routing information in batches, and finally the multiple pieces of routing information in the active state are sent to the hardware forwarding unit 200 in batches. The hardware forwarding unit 200 then forwards the multiple pieces of routing information to the external interface 400 in batches to realize batch forwarding of routing information. In addition, the efficiency of sending routing information is improved. At the same time, a technical solution of providing mutually offsetting mutually exclusive operation instructions before batch operation can better ensure the effective cache state of routing information and avoid increasing the workload of the hardware forwarding unit 200 in the case of network oscillation. In other words, the solution of merging or offsetting mutually exclusive operation instructions for the same routing information is adopted, which is conducive to reducing the number of routing information that needs to be sent, and thus effectively improving the stability of network equipment.
[0098] refer to Figure 6B In order to simplify the operation instructions for routing information, the add operation instruction and the modify operation instruction can be combined and referred to as the add operation instruction. Moreover, if the routing information in the add deployment state fails to be added, the routing information is returned to the initial state, in other words, the routing information is returned to the stable state.
[0099] Furthermore, the initial state and active state of routing information are stable states, and the added cache state and added deployment state of routing information are transient states. That is, when routing information is in the initial state or active state, the routing information is in a stable state where no addition or modification has been made or the addition and modification has been completed, and when routing information is in the added cache state or added deployment state, the routing information is in a transient state where the addition and modification are being made or the addition and modification are confirmed. In other words, the routing information changes from a stable state to an added cache state in response to an addition operation instruction, and then changes to an added deployment state in response to a batch addition operation, and finally changes to a modified stable state in response to a successful addition and deployment. That is, the routing information responds to a variety of operation instructions, and the state of the routing information changes from a stable state to a transient state and then to a stable state, and both the initial state and the active state are stable states.
[0100] Furthermore, the active state of the routing information adds multiple pieces of routing information relative to the initial state of the routing information. In other words, the active state of the routing information is obtained by adding and modifying multiple pieces of routing information to the initial state of the routing information.
[0101] Combination Figure 5 As shown, the embodiment of the present disclosure provides another method for processing routing information, including:
[0102] S12, based on a delete operation instruction for a piece of routing information, the initial state is changed to a delete cache state;
[0103] S14, based on the add operation instruction for the routing information, the routing information in the delete cache state is changed from the delete cache state to the add cache state, thereby offsetting the delete cache state of the routing information;
[0104] S24, in response to a preset condition, batch delete multiple pieces of routing information, and change the cache deletion state to the deployment deletion state;
[0105] S32, in response to the successful deletion of the deployment, changing the deleted deployment state to an active state;
[0106] S40, sending active routing information.
[0107] A method for processing routing information provided by an embodiment of the present disclosure is used, combined with Fig. 6A and Figure 7 As shown. The management interface 300 sends an add operation instruction for routing information to the processor 100. The processor 100 changes the routing information from the initial state to the add cache state, and stores it in the storage unit. At this time, if the routing information that is in the add cache state has not been subjected to a batch add operation, and the management interface 300 sends a delete operation instruction for the routing information to the processor 100, the add cache state of the routing information is changed to the delete cache state, and the add cache state of the routing information is offset. In other words, when a delete operation instruction for the same routing information in the processor 100 is received before the preset conditions are met, the modifications of the two cancel each other out, which is equivalent to not modifying the routing information, and thus, there is no need to perform an add operation on the routing information. In this way, two mutually exclusive operation instructions can be merged or offset, and the later issued operation instruction covers the previously issued operation instruction, which effectively reduces the number of operations on the hardware forwarding unit 200 in scenarios such as network shocks.
[0108] When the processor 100 detects that the stored multiple pieces of routing information in the cache state meet the preset conditions, the processor 100 performs batch deletion operations on the multiple pieces of routing information in the cache state, and converts the multiple pieces of routing information in the cache state into the routing information in the deployment state. When the routing information is successfully deleted and deployed, the multiple pieces of routing information in the deployment state are converted into the active state in batches, and finally the multiple pieces of routing information in the active state are sent to the hardware forwarding unit 200 in batches. The hardware forwarding unit 200 then forwards the multiple pieces of routing information to the external interface 400 in batches to achieve batch forwarding of routing information. In addition, the efficiency of sending routing information is improved. At the same time, a technical solution is provided for mutually canceling mutually exclusive operation instructions before batch operations, which can better ensure the effective cache state of routing information and avoid increasing the workload of the hardware forwarding unit 200 in the case of network oscillation. In other words, the solution of merging or canceling the exclusive operation instructions of the same routing information is adopted, which is conducive to reducing the number of routing information that needs to be sent, and thus effectively improving the efficiency of processing information of network equipment.
[0109] refer to Figure 6B If the routing information in the deletion deployment state fails to be deleted, the routing information is returned to the initial state. In other words, the routing information is returned to the stable state before the transformation.
[0110] Furthermore, the initial state and active state of routing information are stable states, and the deletion cache state and deletion deployment state of routing information are transient states. That is, when routing information is in the initial state or active state, the routing information is in a stable state where deletion modification has not been performed or deletion modification has been completed, and when routing information is in the deletion cache state or deletion deployment state, the routing information is in a transient state where deletion modification is being performed or deletion modification is confirmed. In other words, routing information changes from a stable state to a deletion cache state in response to a deletion operation instruction, and then changes to a deletion deployment state in response to a batch deletion operation, and finally changes to a modified stable state in response to a successful deletion deployment. That is, routing information responds to a variety of operation instructions, and the state of routing information changes from a stable state to a transient state and then to a stable state, and both the initial state and the active state are stable states.
[0111] Furthermore, the active state of the routing information deletes multiple pieces of routing information relative to the initial state of the routing information. In other words, the active state of the routing information is obtained by deleting and modifying multiple pieces of routing information from the initial state of the routing information.
[0112] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0113] An embodiment of the present disclosure provides a computer program product, which includes computer instructions stored on a computer-readable storage medium. When the program instructions are executed by a computer, the computer implements the above-mentioned method for processing routing information.
[0114] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
Claims
1. A method for processing routing information, characterized in that: include: Based on an operation instruction for a piece of routing information, an initial state is changed into a cache state; In response to meeting a preset condition, batch-operating multiple routing information to change a cache state into a deployment state; In response to successful deployment, changing the deployment state to the active state; The initial state and the active state are stable states, and the cache state and the deployment state are transient states; the active state adds or deletes multiple routing information relative to the initial state, and then sends the routing information of the active state; Wherein, the converting the initial state into the cache state based on the operation instruction for a piece of routing information comprises: converting the initial state into the cache deletion state based on the deletion operation instruction for a piece of routing information; Before the preset conditions are met, the following are included: The routing information in the increase cache state is changed to the delete cache state based on the delete operation instruction for the routing information, thereby offsetting the increase cache state of the routing information; The routing information in the cache deletion state is converted to the cache addition state based on the add operation instruction for the routing information, thereby offsetting the cache deletion state of the routing information.
2. The method according to claim 1, wherein: The preset condition includes at least one of: cache timeout when routing information is not empty and the number of routing information reaching a threshold.
3. The method according to claim 1, wherein: The batch operation of the plurality of routing information in response to the preset condition to change the cache state into the deployment state comprises: Regularly check whether the routing information in the cache state meets the preset conditions; If the preset conditions are met, multiple routing information are batch operated to change the cache state to the deployment state.
4. The method according to claim 1, wherein: The operation instruction for a routing information comes from a network operating system, and the preset condition is set by the network operating system.
5. The method according to claim 1, wherein: The step of changing the initial state to the cache state based on an operation instruction for a piece of routing information includes: Based on an add operation instruction for a piece of routing information, the initial state is changed into an add cache state.
6. The method according to claim 1, wherein: The storage method of the routing information in the cache state includes: at least one of an AVL tree and a hash chain.
7. The method according to claim 1, wherein: The routing information includes: IP address, mask, and routing table entry outbound interface.
8. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by a machine.
Citation Information
Patent Citations
Multi-core SDN switch flow table management method and system based on batch updating
CN112260948A
Data synchronization method and device, computer storage medium and electronic equipment
CN114297216A