Onion routing table lookup method and device for satellite-borne router

By constructing a TCAM routing table with an onion-layer structure and optimizing the insertion and deletion of prefix entries using the free space within and between layers, the problems of slow TCAM routing table lookup speed and high power consumption in spaceborne routers are solved, achieving low-power and efficient routing table updates.

CN121077968APending Publication Date: 2025-12-05PEKING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511033035.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

In existing technologies, the TCAM routing table has a slow lookup speed in spaceborne routers, which cannot meet the needs of power-constrained spaceborne routers. Furthermore, frequent prefix insertion and deletion operations result in high power consumption and excessive latency.

Method used

The onion routing table lookup method is adopted. By constructing a pre-built TCAM routing table with an onion layer structure, the free space within and between layers is utilized to prioritize the insertion or deletion of prefix entries in the free position of the target layer, thereby reducing the number of entry moves and reducing power consumption.

Benefits of technology

It improves the update speed of the TCAM routing table, reduces the power consumption of the onboard router for route lookup, and enhances on-orbit performance and endurance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121077968A_ABST
    Figure CN121077968A_ABST
Patent Text Reader

Abstract

The invention provides an onion routing table lookup method and device for a satellite-borne router, and relates to the technical field of computers.The method comprises the steps that a prefix item of current to-be-stored data is obtained, and a target layer, corresponding to the prefix item, in a TCAM routing table in the satellite-borne router is determined; then determining a target storage position of the prefix item in the TCAM routing table based on an in-layer free space of the target layer; and finally, inserting the prefix item into the target storage position, and updating the TCAM routing table. According to the onion routing table lookup method for the satellite-borne router, provided by the invention, the TCAM routing table updating and lookup speed of the satellite-borne router is improved, the dynamic and efficient maintenance of physical storage data is realized, the power consumption of the satellite-borne router in a routing management process is effectively reduced, and the service life of the satellite-borne router is prolonged. Therefore, the on-orbit performance and the cruising ability of the satellite-borne router are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an onion routing table lookup method and device for a satellite router. BACKGROUND

[0002] The satellite router is limited by the limited solar power supply and battery storage capacity of the satellite platform, and has strict requirements on power consumption and performance. In the satellite router, a ternary content addressable memory (TCAM) routing table is used to realize high-speed routing lookup and packet classification.

[0003] The entries in the TCAM routing table are usually arranged in descending order of prefix length, however, prefix insertion and deletion operations occur frequently, and if the absolute order of prefix length is strictly maintained, a large number of existing entries in the TCAM may need to be moved for each update operation, resulting in excessive lookup delay, reduced efficiency, and high power consumption burden on the satellite router.

[0004] The prior art uses the CAO-OPT algorithm to construct a prefix tree Trie data structure, so that the number of memory moves in routing lookup is half of the maximum chain length D in the prefix tree Trie, thereby reducing the number of memory moves in the TCAM and improving the update speed of the TCAM routing table. However, when the value of the maximum chain length D in the prefix tree Trie is large, the number of memory moves in the TCAM will also increase, resulting in increased TCAM routing table lookup delay, which cannot meet the needs of the power-limited satellite router. SUMMARY

[0005] The present application provides an onion routing table lookup method and device for a satellite router, which solves the technical problem of slow TCAM routing table lookup speed in the prior art, which cannot meet the needs of the satellite router, and realizes high-speed routing table lookup to meet the low-power consumption needs of the satellite router.

[0006] The present application provides an onion routing table lookup method for a satellite router, comprising the following steps: Obtain the prefix item of the current data to be stored; Determine the target layer of the prefix item in the TCAM routing table in the satellite router; the structure of the TCAM routing table is an onion layer structure constructed in advance; Determine the target storage location of the prefix item in the TCAM routing table based on the intra-layer free space of the target layer; Insert the prefix item into the target storage location and update the TCAM routing table.

[0007] According to the onion routing table lookup method for spaceborne routers provided by the present invention, the construction steps of the onion layer structure of the TCAM routing table include: An initial prefix tree is constructed using all historical prefix entries of the data to be stored as prefix information nodes; each prefix information node includes a parent node and a child node; the next level of the parent node connects to one or more of the prefix information nodes, and the next level of the child node has no prefix information nodes. Repeat the iterative steps until all prefix information nodes in the initial prefix tree are moved to the preset storage area of ​​the TCAM routing table, thus obtaining a TCAM routing table with an onion layer structure; The iterative steps include: Move all child nodes from the prefix tree after the previous iteration to the preset storage area of ​​the TCAM routing table to obtain the onion layer obtained in this iteration; In the first iteration, the child nodes used are all the child nodes in the initial prefix tree, and the onion layer obtained in each iteration is stored in the order of the storage addresses in the preset storage area.

[0008] According to the onion routing table lookup method for spaceborne routers provided by the present invention, there is an interlayer free space between each layer and any adjacent layer in the TCAM routing table of the onion layer structure; Within each layer of the TCAM routing table in the onion layer structure, there is an intra-layer free space.

[0009] According to the onion routing table lookup method for spaceborne routers provided by the present invention, the target storage location of the prefix entry in the TCAM routing table is determined based on the free space within the target layer, including: If the number of free locations in the free space within the target layer is greater than or equal to a preset threshold, the free locations are used as the target storage locations. If the number of free locations in the free space within the target layer is less than a preset threshold, the free space between the target layer and any adjacent layer shall be used as the target storage location.

[0010] According to the present invention, an onion routing table lookup method for spaceborne routers is provided, the method further includes: Retrieve the prefix of any data to be deleted; Delete the prefix entry of any of the data to be deleted from the TCAM routing table and determine a new available location; The TCAM routing table is updated based on the new available locations.

[0011] According to the onion routing table search method for the satellite router, the TCAM routing table is updated based on the new idle position, and the updating includes: In the case that the new idle position is in any onion layer, metadata in the any onion layer is updated; In the case that the new idle position is at the boundary of any onion layer, inter-layer idle space between the boundary of the any onion layer and a neighboring onion layer is updated.

[0012] The application further provides an onion routing table search device for a satellite router, comprising the following modules: An acquisition module is configured to acquire a prefix item of current data to be stored; A first determination module is configured to determine a target layer corresponding to the prefix item in a TCAM routing table of the satellite router; the TCAM routing table has a pre-constructed onion layer structure; A second determination module is configured to determine a target storage position of the prefix item in the TCAM routing table based on intra-layer idle space of the target layer; An updating module is configured to insert the prefix item into the target storage position and update the TCAM routing table.

[0013] The application further provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the onion routing table search method for the satellite router when executing the computer program.

[0014] The application further provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the onion routing table search method for the satellite router.

[0015] The application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the onion routing table search method for the satellite router.

[0016] The application provides an onion routing table searching method for a satellite router, which comprises the following steps: obtaining a prefix item of current data to be stored, quickly extracting routing prefix information to be updated, and providing data basis for subsequent hierarchical storage; determining a target layer of the prefix item in a TCAM routing table in the satellite router, wherein the structure of the TCAM routing table is an onion layer structure constructed in advance, and the logical attribution of the prefix item in the TCAM routing table with the onion layer structure is located, so as to avoid global search and reduce complexity; determining a target storage position of the prefix item in the TCAM routing table based on the idle space in the target layer, so as to preferentially use the dispersed idle position of the current layer, reduce the number of entry movements, and improve routing search efficiency; and updating the TCAM routing table by inserting the prefix item into the target storage position, so as to improve the updating speed of the TCAM routing table through local updating, effectively reduce the power consumption of the satellite router caused by routing search, realize dynamic maintenance of the physical storage data of the TCAM routing table, meet the demand of the power-limited satellite router, and improve the on-orbit performance and endurance of the satellite router. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.

[0018] Figure 1 is a flowchart of an onion routing table searching method for a satellite router provided by the present application.

[0019] Figure 2 is a structural diagram of an initial prefix tree provided by the present application.

[0020] Figure 3 is a structural diagram of an onion routing table searching device for a satellite router provided by the present application.

[0021] Figure 4 is a structural diagram of an electronic device provided by the present application. DETAILED DESCRIPTION

[0022] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort are within the protection scope of the present application.

[0023] TCAM routing table has the advantage of parallel lookup and is widely used in routers to achieve high-speed routing lookup and packet classification. TCAM routing table allows input data to be compared with all stored entries in each clock cycle, thereby quickly finding the matching item. Especially in scenarios such as spaceborne routers that have strict requirements for power consumption and performance, the high-speed lookup capability of TCAM routing table is particularly important.

[0024] The spaceborne router is limited by the limited solar power supply and battery storage capacity of the satellite platform, so any design that can reduce power consumption is crucial. Traditional routing lookup mechanism will consume significant computing resources and energy if it needs to frequently move a large amount of data to maintain the routing table, which is an unbearable burden for energy-limited devices such as spaceborne routers. Therefore, seeking a low-power and high-efficiency routing table update mechanism is of key significance to improve the endurance and on-orbit performance of spaceborne routers.

[0025] The entries in the TCAM routing table are usually arranged in descending order of prefix length, however, prefix insertion and deletion operations occur frequently, and if the absolute order of prefix length is strictly maintained, a large number of existing entries in the TCAM routing table may need to be moved for a single update operation, resulting in excessive update delay and reducing the performance of the router. For spaceborne routers, the routing table may need to be frequently updated to adapt to complex changes in space network topology, dynamic adjustment of inter-satellite links, or ground command transmission. If the update delay is too large, it will not only affect the data forwarding efficiency, but also consume valuable power resources, shortening the on-orbit life of the satellite.

[0026] The prior art uses the CAO-OPT algorithm to construct a prefix tree Trie data structure, so that the number of memory moves in routing lookup is half of the maximum chain length D in the prefix tree Trie, thereby reducing the number of memory moves in the TCAM and improving the update speed of the TCAM routing table. However, when the value of the maximum chain length D in the prefix tree Trie is large, the number of memory moves in the TCAM will also increase, resulting in an increase in the update delay of the TCAM routing table and a decrease in the performance of the router. In the application environment of spaceborne routers, even though the value of D is usually small, once a specific routing strategy or network reconstruction causes the value of D to increase, the limitations of the CAO-OPT algorithm will result in higher power consumption and longer update time, which is unacceptable for power-limited spaceborne platforms. Therefore, there is an urgent need for a routing table lookup method that can further reduce update power consumption and is not sensitive to the maximum chain length D, to meet the special needs of spaceborne routers for low power consumption and high efficiency.

[0027] To this end, the application provides an onion routing table lookup method for a satellite router, which further reduces the number of TCAM entry moves required when dynamically inserting or deleting a routing table item (prefix item), reduces the dependence of TCAM routing table update operations on the maximum chain length (D) of the entire prefix tree, improves the TCAM routing table update speed, reduces the power consumption of routing lookup for the satellite router, and further improves the on-orbit performance and endurance of the satellite router.

[0028] The application is described below in combination with Figures 1 to 4 An onion routing table lookup method and device for a satellite router are described.

[0029] Figure 1 A flowchart of the onion routing table lookup method for a satellite router provided by the application is shown in FIG. 1, which includes the following steps: Figure 1 Step 101: Obtain a prefix item of current data to be stored. Step 102: Determine the target layer of the prefix item in the TCAM routing table of the satellite router; the structure of the TCAM routing table is an onion layer structure constructed in advance. Specifically, to facilitate the management of the TCAM routing table with an onion layer structure, an initial prefix tree Trie representation can be constructed as an auxiliary data structure, which is used to represent or reference the initial prefix tree, and can be used to determine the home layer of a new prefix item to be inserted or verify the ancestor-descendant relationship.

[0030] On the one hand, for any data to be stored, the prefix item thereof is first extracted, and then the prefix information node corresponding to the prefix item in the initial prefix tree is determined through the initial prefix tree Trie representation. At this time, the connection point of the prefix information node at the upper level in the initial prefix tree is its parent node, and the connection point at the lower level is its child node, so that the prefix information ancestor-descendant relationship between the prefix information nodes can be verified, and when a new prefix item is inserted, it can be ensured that the ancestor prefix item is always located before the descendant, satisfying the longest prefix matching principle.

[0031] On the other hand, since each level of prefix information nodes of the initial prefix tree corresponds to different onion layers in the TCAM routing table, the home layer in the TCAM routing table of the satellite router can also be determined according to the level of the prefix information node corresponding to the prefix item in the initial prefix tree.

[0032] ​For example, assuming that the new prefix item is q, the parent node p of q can be found first. If p already exists in an onion layer Lp of the TCAM routing table, and q is a child node of p, then it can be determined that q should be placed in a deeper layer Lq behind Lp, i.e., the target layer corresponding to q in the TCAM routing table is Lq; If there are child nodes of q existing in the TCAM routing table, then the onion layer which is shallower than all the onion layers in which the child nodes of q exist is the target layer corresponding to q in the TCAM routing table; If there is no ancestor-descendant relationship between q and p, and q and p belong to the same logical block, then the target layer corresponding to q in the TCAM routing table is the onion layer in which p exists.

[0033] According to the principle that an ancestor node precedes a descendant node, the embodiments of the present application ensure that an ancestor prefix item is always placed before a descendant, satisfy the longest prefix matching principle, thereby quickly locating the target layer corresponding to the prefix item in the TCAM routing table having the onion layer structure, avoiding global search, and reducing complexity.

[0034] In step 103, a target storage location of the prefix item in the TCAM routing table is determined based on the in-layer free space of the target layer. Specifically, after the target layer is determined, the in-layer free space of the target layer is considered first. If the in-layer free space is sufficient, then the target storage location can be selected in the in-layer free space, and the prefix item can be inserted. If the in-layer free space is full or it is required to move too many entries (e.g., more than a preset 1-2 times of moving threshold) to insert q in the in-layer free space, then the target storage location can be selected in the inter-layer free space between the target layer and any adjacent layer, and the prefix item can be inserted.

[0035] According to the principle of preferentially using the in-layer free space of the target layer and reducing the number of entry movements, the embodiments of the present application determine the target storage location of the prefix item in the TCAM routing table, thereby improving the routing lookup efficiency.

[0036] In step 104, the prefix item is inserted into the target storage location, and the TCAM routing table is updated.

[0037] Specifically, after the target storage location is determined, the prefix item is directly inserted into the target storage location, and the TCAM routing table is updated synchronously, thereby effectively reducing the power consumption of the on-board router in the routing lookup process, achieving dynamic maintenance of the physical storage data of the TCAM routing table, and improving the performance of the router.

[0038] The application provides an onion routing table searching method for a satellite router, which comprises the following steps: obtaining a prefix item of current data to be stored, quickly extracting routing prefix information to be updated, and providing data basis for subsequent hierarchical storage; determining a target layer of the prefix item in a TCAM routing table in the satellite router, wherein the TCAM routing table has a pre-constructed onion layer structure, and the target layer is used to locate the logical attribution of the prefix item in the TCAM routing table with the onion layer structure, so as to avoid global search and reduce complexity; determining a target storage position of the prefix item in the TCAM routing table based on the idle space in the target layer, so as to preferentially use the dispersed idle space in the current layer, reduce the number of entry movements, and improve the routing searching efficiency; and inserting the prefix item into the target storage position, and updating the TCAM routing table, so as to improve the updating speed of the TCAM routing table through local updating, effectively reduce the power consumption of the satellite router caused by routing searching, realize dynamic maintenance of the physical storage data of the TCAM routing table, meet the demand of the power-limited satellite router, and improve the on-orbit performance and endurance of the satellite router.

[0039] Further, the construction step of the onion layer structure of the TCAM routing table comprises: constructing an initial prefix tree by taking all historical prefix items of historical data to be stored as prefix information nodes, wherein the prefix information nodes comprise parent nodes and child nodes, the next level of the parent nodes is connected with one or more prefix information nodes, and the next level of the child nodes is not connected with the prefix information nodes; repeatedly performing the iteration step until all the prefix information nodes in the initial prefix tree are moved to the preset storage area of the TCAM routing table, and obtaining the TCAM routing table with the onion layer structure; the iteration step comprises: moving all the child nodes in the prefix tree after the last iteration to the preset storage area of the TCAM routing table, and obtaining the onion layer obtained in the current iteration; wherein the child nodes used in the first iteration are all the child nodes in the initial prefix tree, and the onion layers obtained in each iteration are stored in order of the storage addresses in the preset storage area.

[0040] Specifically, a standard and complete binary prefix tree is constructed by taking all historical prefix items of historical data to be stored as prefix information nodes, and the binary prefix tree is used as the initial prefix tree, wherein the prefix information nodes comprise parent nodes and child nodes.

[0041] Figure 2 is a structural diagram of the initial prefix tree provided by the application, as shown in Figure 2 the next level of the three black prefix information nodes at the bottom layer has no connected prefix information nodes as child nodes, and the upper layer is the parent node.

[0042] When constructing the onion layer structure of the TCAM routing table, all child nodes in the prefix tree are gradually stripped and moved to the preset storage area of ​​the TCAM routing table as the onion layer obtained in this iteration, until all child nodes have been stripped.

[0043] For example, in the first iteration, first peeling Figure 2 The three bottom-most child nodes are moved to the preset storage area of ​​the TCAM routing table, becoming the first layer of the onion layer. After stripping the bottom three child nodes, the two parent nodes originally connected to them become new child nodes. Therefore, in the second iteration, all new child nodes are stripped and moved to the preset storage area of ​​the TCAM routing table, becoming the second layer of the onion layer. This process is repeated, continuously stripping new child nodes from the shrinking prefix tree and placing them in the preset storage area as the next layer of the onion layer, until all prefix information nodes in the initial prefix tree are assigned to an onion layer, resulting in a TCAM routing table with an onion layer structure.

[0044] In this process, the onion layer obtained in each iteration is stored in the order of the storage addresses in the preset storage area. For example, it is stored continuously (or in groups) downwards from the highest address of TCAM, or continuously (or in groups) upwards from the lowest address of TCAM, thereby ensuring that the ancestor prefix item is always placed before the descendant, satisfying the longest prefix matching principle.

[0045] Based on the topological properties of the prefix tree, when the child node is stripped for the first time, about 87% of the prefix items can be stripped. Therefore, a large number of child nodes are expected to be stripped in the first or initial few layers, and the number of onion layers will be much smaller than the maximum chain length of the prefix tree.

[0046] For example, in a routing table with 200,000 prefix entries, 87% are stripped at the first layer, leaving 13% (26,000). If another 87% are stripped at the second layer, approximately 3,380 remain. By going through just a few layers, all prefixes are stripped, allowing for the rapid construction of a TCAM routing table with very few onion layers, thus improving the efficiency of subsequent route lookups.

[0047] This invention forms a hierarchical structure by iteratively stripping child nodes from a Trie tree, with each layer corresponding to one stripping operation. This rapidly constructs a TCAM routing table with very few onion layers, improving the efficiency of subsequent route lookups and thus increasing the update speed of the TCAM routing table. It also effectively reduces the power consumption of the onboard router during route lookups, meeting the requirements of power-constrained onboard routers.

[0048] Furthermore, in the TCAM routing table of the onion layer structure, there is an interlayer free space between each layer and any adjacent layer; In each layer of the onion layer structure in the TCAM routing table, there is an intra-layer free space.

[0049] Specifically, according to the storage direction of the onion layer obtained in each round of iteration in the preset storage area, a free memory pool is reserved as an inter-layer free space behind or in front of the storage area of each layer, which can be seen from Figure 2 The inter-layer free space is used to store a preset number of TCAM free entries, such as newly added prefix entries.

[0050] The intra-layer free space is used to store a preset number of TCAM free entries. The intra-layer free space can be set by strategically inserting a small number of free slots in each onion layer, so that the prefix entries in a layer are not completely tightly arranged. When a new prefix entry needs to be inserted, the free slot can be directly inserted, reducing the probability of cross-layer movement and increasing the storage flexibility. Alternatively, a portion of continuous space can be reserved at the end of the TCAM block occupied by the layer, so that multiple new prefix entries can be directly inserted, maintaining the effectiveness and availability of the free space and avoiding excessive fragmentation.

[0051] The number of inter-layer free spaces and intra-layer free spaces can be configured according to factors such as the expected update frequency of the TCAM routing table, the TCAM hardware cost, and the total capacity. For example, the total amount of free space can be 5% to 50% of the size of the layer (or adjacent layers).

[0052] The embodiment of the application balances the space utilization and update overhead by distributing the free space strategy and setting inter-layer free spaces and intra-layer free spaces, reduces the number of memory movements in the TCAM, enables the newly added prefix entries to be quickly inserted, thereby improving the routing lookup speed, reducing the power consumption of the on-board router for routing lookup, and further improving the on-orbit performance and endurance of the on-board router.

[0053] Further, based on the intra-layer free space of the target layer, the target storage location of the prefix entry in the TCAM routing table is determined, comprising: In the case where the number of free positions in the intra-layer free space of the target layer is greater than or equal to a preset threshold, the free position is taken as the target storage location; In the case where the number of free positions in the intra-layer free space of the target layer is less than a preset threshold, the inter-layer free space between the target layer and any adjacent layer is taken as the target storage location.

[0054] Specifically, the newly added prefix entry is preferentially inserted into the intra-layer free space of the target layer, and when the intra-layer free space is insufficient, it is expanded to the inter-layer free space, avoiding frequent triggering of cross-layer movement, reducing the routing table update overhead, and improving the router performance.

[0055] For example, when a new prefix item q needs to be inserted, firstly, try to insert q in the target layer of q using the reserved intra-layer free space. If there is enough free space in the target layer and the free space is in a suitable position (e.g. a position next to the logical predecessor of q, or any position that does not violate the ordering constraint), then the free space is used as the target storage position and q is directly inserted. This operation ideally requires 0 move (directly put into the empty slot) or 1 move (move one adjacent item to make space), thus quickly completing the TCAM routing table update.

[0056] If the intra-layer free space in the target layer is full, or inserting q in the target layer requires moving too many items (e.g. more than a preset 1-2 move threshold), then the inter-layer free space between the target layer and any adjacent layer is used as the target storage position. Specifically, assuming that q needs to be inserted in the inter-layer free space above or below the i-th layer: If the inter-layer free space above the i-th layer (in the direction of the logically earlier layer) is used, it is equivalent to extending the upper boundary of the i-th layer into the inter-layer free space. In this case, q can be directly put into the starting position of the inter-layer free space, or a small number of items at the top of the i-th layer can be moved. If the inter-layer free space below the i-th layer (in the direction of the logically later layer) is used, the i+1-th layer and all subsequent layers are moved downward (or upward, depending on the TCAM layout) as a whole to make space for the expansion of the i-th layer. Since the number of onion layers is small and there is free space between each layer, the length and frequency of such chain reactions will be low, thus effectively avoiding large-scale cross-layer movement.

[0057] According to the state of the intra-layer free space of the target layer, the embodiments of the present application dynamically select the optimal insertion strategy, preferentially selecting the intra-layer free space when inserting a prefix item, and secondarily selecting the inter-layer free space. The main influence is on the target layer to which the prefix item belongs and the adjacent free space, thus maximizing the avoidance of frequent cross-layer movement, completing the update locally, avoiding global ripple effects, reducing large-scale data movement, effectively reducing the number of memory moves in the TCAM, improving the routing lookup speed, effectively reducing the power consumption of the on-board router for routing lookup, and thus improving the performance of the power-constrained on-board router.

[0058] Further, the method further comprises: acquiring a prefix item of any to-be-deleted data; deleting the prefix item of the any to-be-deleted data from the TCAM routing table, and determining a new free position; updating the TCAM routing table based on the new free position.

[0059] Specifically, when any prefix item in the TCAM routing table needs to be deleted, the prefix item to be deleted is first found in the TCAM routing table; then the prefix item is removed from the TCAM routing table, and the TCAM entry originally occupied by the prefix item becomes a new free location; finally, the TCAM routing table is quickly updated according to the location of the new free location (for example, in a layer or at the boundary of a layer).

[0060] Further, the updating of the TCAM routing table based on the new free location comprises: in the case that the new free location is in any onion layer, updating the metadata in the any onion layer; in the case that the new free location is at the boundary of any onion layer, updating the inter-layer free space between the boundary of the any onion layer and the adjacent onion layer.

[0061] Specifically, if the new free location is in a layer, so that the intra-layer free space is increased, the metadata of the layer is directly updated. Each onion layer in the TCAM routing table includes a descriptor or metadata structure, which is used to record the start address, end address, number of contained prefix items, current intra-layer free space location information and information pointing to the adjacent inter-layer free space of the layer.

[0062] If the new free location makes a certain inter-layer free space block larger (for example, the new free location is at the boundary of a layer), the corresponding inter-layer free space information is directly updated.

[0063] In addition, according to the new free location, a local free space compression operation can also be performed. For example, the new free location forms a larger continuous free block in a layer, and one or more logically adjacent entries after (or before) the new free location in the layer can be moved to merge small free blocks and form larger available continuous free space, so as to maintain the effectiveness and availability of the free space, avoid excessive fragmentation, and realize effective recovery and reuse of the free space. When moving the entries, the intra-layer free space and the adjacent inter-layer free space are preferentially used, so as to avoid adjustment across multiple layers.

[0064] The embodiment of the application marks the new free location after deleting the prefix item, so that the way of updating the TCAM routing table according to the new free location is to update the intra-layer metadata or the inter-layer free space, without physical movement, thereby improving the updating speed of the TCAM routing table.

[0065] The following describes an onion routing table searching device for a satellite router provided by the application, which can be correspondingly referred to the onion routing table searching method for a satellite router described above.

[0066] Based on any of the above embodiments, Figure 3 is a structural schematic diagram of an onion routing table lookup device for a satellite router provided by the present application, as Figure 3 shown. The embodiment of the present application provides an onion routing table lookup device for a satellite router, comprising an acquisition module 301, a first determination module 302, a second determination module 303, and an update module 304, wherein: The acquisition module 301 is configured to acquire a prefix item of current data to be stored; the first determination module 302 is configured to determine a target layer corresponding to the prefix item in a TCAM routing table; the TCAM routing table has a pre-constructed onion layer structure; the second determination module 303 is configured to determine a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; and the update module 304 is configured to insert the prefix item into the target storage location and update the TCAM routing table.

[0067] The onion routing table lookup device for a satellite router provided by the present application can quickly extract routing prefix information to be updated by acquiring a prefix item of current data to be stored, and provide a data basis for subsequent hierarchical storage; the logical attribution of the prefix item in the TCAM routing table having an onion layer structure is located by determining a target layer corresponding to the prefix item in the TCAM routing table of the satellite router, wherein the TCAM routing table has a pre-constructed onion layer structure, thereby avoiding global search and reducing complexity; the target storage location of the prefix item in the TCAM routing table is determined based on an intra-layer free space of the target layer, thereby preferentially utilizing the dispersed free space of the current layer, reducing the number of entry movements, and improving routing lookup efficiency; the TCAM routing table is updated by inserting the prefix item into the target storage location, thereby improving the update speed of the TCAM routing table through local update, effectively reducing the power consumption of the satellite router for routing lookup, achieving dynamic maintenance of the physical storage data of the TCAM routing table, meeting the demand of the power-limited satellite router, and improving the on-orbit performance and endurance of the satellite router.

[0068] Figure 4 An example of a physical structure schematic diagram of an electronic device is shown in Figure 4 The electronic device can include a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 can communicate with each other through the communications bus 440. The processor 410 can invoke a logical instruction in the memory 430 to execute an onion routing table lookup method for a satellite router, which comprises: acquire a prefix item of current data to be stored; determine a target layer of the prefix item in a TCAM routing table in the spaceborne router; the TCAM routing table has a pre-constructed onion layer structure; determine a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; insert the prefix item into the target storage location, and update the TCAM routing table.

[0069] In addition, the logic instructions in the memory 430 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0070] On the other hand, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the onion routing table lookup method for the spaceborne router provided by the above-mentioned method, the method comprises: acquire a prefix item of current data to be stored; determine a target layer of the prefix item in a TCAM routing table in the spaceborne router; the TCAM routing table has a pre-constructed onion layer structure; determine a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; insert the prefix item into the target storage location, and update the TCAM routing table.

[0071] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the onion routing table lookup method for the spaceborne router provided by the above-mentioned method, the method comprises: acquire a prefix item of current data to be stored; determine a corresponding target layer of the prefix item in a TCAM routing table in the space router; the TCAM routing table has a structure of a pre-constructed onion layer structure; determine a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; insert the prefix item into the target storage location, and update the TCAM routing table.

[0072] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0073] Through the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary general hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in the embodiments or some parts of the embodiments.

[0074] It should be noted that in this document, the terms "comprising", "including", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles, or devices including a series of elements not only include those elements, but also include other elements not explicitly listed, or further include elements inherent to such processes, methods, articles, or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article, or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in a reverse order, for example, the described method can be performed in an order different from the described order, and various steps can be added, omitted, or combined. In addition, the features described with reference to certain examples can be combined in other examples.

[0075] In addition, it should be noted that the terms "target", "first", "second" and the like in the present application are used to distinguish similar objects, and are not intended to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second" are usually a class and do not limit the number of objects, for example, the first object can be one or more.

[0076] In the embodiments of the present application, "determining B based on A" means that A is considered as a factor when determining B. It is not limited to "determining B based on A only", but also includes "determining B based on A and C", "determining B based on A, C and E", "determining C based on A, and determining B further based on C", and the like. In addition, it can also include A as a condition for determining B, for example, "when A meets the first condition, B is determined using the first method"; for example, "when A meets the second condition, B is determined"; for example, "when A meets the third condition, B is determined based on the first parameter"; and the like. Of course, A can also be a condition for determining B, for example, "when A meets the first condition, C is determined using the first method, and B is further determined based on C", and the like.

[0077] In the present application, the term "a plurality of" means two or more, and other quantifiers are similar.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for on-board router oriented onion routing table lookup, characterized in that, The method comprises the following steps: acquiring a prefix item of current data to be stored; determining a target layer corresponding to the prefix item in a TCAM routing table of a satellite router; the TCAM routing table has a pre-constructed onion layer structure; determining a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; inserting the prefix item into the target storage location and updating the TCAM routing table.

2. The method of claim 1, wherein, The construction step of the onion layer structure of the TCAM routing table comprises the following steps: constructing an initial prefix tree by taking historical prefix items of all historical data to be stored as prefix information nodes; the prefix information nodes comprise parent nodes and child nodes; one or more prefix information nodes are connected to a next level of the parent nodes, and no prefix information node is connected to a next level of the child nodes; repeating an iteration step until all prefix information nodes in the initial prefix tree are moved to a preset storage area of the TCAM routing table, so as to obtain a TCAM routing table having an onion layer structure; the iteration step comprises the following steps: moving all child nodes in a prefix tree after a previous round of iteration to the preset storage area of the TCAM routing table, so as to obtain an onion layer in a current round of iteration; wherein the child nodes used in a first round of iteration are all child nodes in the initial prefix tree, and the onion layers obtained in each round of iteration are stored in order of storage addresses in the preset storage area.

3. The method of claim 2, wherein, An inter-layer free space is arranged between each layer and any adjacent layer in the TCAM routing table having the onion layer structure. An intra-layer free space is arranged in each layer in the TCAM routing table having the onion layer structure.

4. The method of claim 1, wherein, The method further comprises the following steps: acquiring a prefix item of any data to be deleted; deleting the prefix item of the any data to be deleted from the TCAM routing table, so as to determine a new free location; 5. The method of claim 1, wherein, updating the TCAM routing table based on the new free location. The updating of the TCAM routing table based on the new free location comprises the following steps: in a case where the new free location is inside any onion layer, updating metadata inside the any onion layer; in a case where the new free location is at a boundary of any onion layer, updating an inter-layer free space between the boundary of the any onion layer and an adjacent onion layer.

6. The method of claim 5, wherein, The method comprises the following steps: an acquiring module, configured to acquire a prefix item of current data to be stored; a first determining module, configured to determine a target layer corresponding to the prefix item in a TCAM routing table of a satellite router; 7. A satellite router oriented onion routing table lookup apparatus, characterized by, the TCAM routing table has a pre-constructed onion layer structure; a determining module, configured to determine a target storage location of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer; ​ ​ A second determining module is configured to determine a target storage position of the prefix item in the TCAM routing table based on an intra-layer free space of the target layer. An updating module is configured to insert the prefix item into the target storage position and update the TCAM routing table.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, The processor executes the computer program to implement the method for searching the onion routing table for the satellite router according to any one of claims 1 to 6. 9.A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method for searching the onion routing table for the satellite router according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the method for searching the onion routing table for the satellite router according to any one of claims 1 to 6.