TCAM (Ternary Content Addressable Memory) rapid updating method and system architecture applied to spaceborne routing
By splitting and reordering TCAM, the problem of TCAM update time in satellite-borne routing is solved, which improves the update efficiency and reduces the impact of cosmic radiation.
Patent Information
- Application Number
- CN202411625641.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-14
AI Technical Summary
In satellite-borne routing applications, the longest prefix matching (LPM) based on TCAM is updated too long, the efficiency is not high enough, and cosmic radiation will affect TCAM storage information.
A TCAM rapid update method is adopted to split TCAM, calculate the width of subtable items, reorder and divide the update table items and their masks, and finally write the subtable items into the storage address range of the corresponding TCAM partition.
Improve the update efficiency of TCAM, reduce update time, and avoid the impact of cosmic radiation on data by using BRAM memory resources in FPGAs.
Smart Images

Figure CN119520372A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of satellite communication technology, and in particular to a TCAM fast updating method and system architecture applied to satellite-borne routing. Background Art
[0002] The low earth orbit (LEO) satellite network is an ambitious technology that can provide high-quality consumer-grade Internet access worldwide. Satellite networking also plays a major role in the wave of information globalization. As the scale of satellites continues to expand, the difficulty of communication and management coordination between nodes has greatly increased. Introducing the control concept of SDN and separating the data domain and control domain of the satellite network can improve the scalability and flexibility of the network. The data domain is responsible for key information extraction, storage, classification, table lookup and other operations; the control domain is responsible for refined management and protocol operation to ensure service quality.
[0003] Field Programmable Gate Arrays (FPGAs) have been recognized as suitable for space applications due to their high performance and reconfigurability. High-end FPGAs consist of a large number of logic elements and on-chip RAM memory, which enables them to provide a high level of parallelization and thus achieve high processing throughput. Obviously, it is impossible to change the hardware on the satellite, while the functions implemented on the FPGA can easily modify and upgrade the wireless network resources. At the same time, the reconfigurability of FPGAs helps to mitigate single event and multiple event disturbances (SEU and MEU) caused by critical radiation effects. FPGAs can support protection mechanisms that replace affected modules with the correct modules. Application-Specific Integrated Circuits (ASICs) may be a more optimal solution in terms of power consumption or speed; however, ASICs lack flexibility because they cannot be reconfigured remotely in space. Therefore, FPGAs have a great advantage because they can be reconfigured when mission objectives change or the design is upgraded.
[0004] In recent years, ternary content addressable memory (TCAM) has been widely used in SDN flow tables because its ternary representation (0, 1, *) and fast search characteristics are very suitable for network address matching. TCAM-based flow tables can be regarded as ordered arrays with parallel search capabilities. As the demand for onboard services increases, it is necessary to ensure that TCAM can cope with high-speed searches. Longest prefix match (LPM) is usually used for network forwarding and can quickly perform indefinite-length searches. It can usually be implemented by ternary content addressable memory (TCAM) on field programmable gate arrays (FPGAs).
[0005] However, for onboard routing applications, the TCAM-based LPM update time is too long and the efficiency is not high enough, and cosmic radiation will affect the TCAM stored information. Summary of the invention
[0006] In order to solve the above-mentioned prior art problems, the present invention adopts a TCAM fast update method applied to satellite-borne routing, comprising:
[0007] S1. Split TCAM to get N sub TCAM partitions;
[0008] S2. Accept update data, where the update data includes: update table entries and their masks;
[0009] S3, according to N sub Calculate the sub-item width W based on N sub Reorder the update table entries and their masks by summing the width W to obtain reordered update table entries and their masks;
[0010] S4. Divide the reordered update table entry and its mask according to the width W to obtain multiple sub-table entries and their sub-table entry masks, and add one to the sub-table entry and its sub-table entry mask to obtain the final sub-table entry and its sub-table entry mask; each sub-table entry corresponds to a TCAM partition;
[0011] S5. Calculate the storage address range of the corresponding sub-entry in the corresponding TCAM partition according to the final sub-entry mask, and write the sub-entry into the storage address range of the corresponding TCAM partition.
[0012] Calculating the width W of the sub-table entry includes: obtaining the total length L of the update table entry, dividing the total length of the update table entry by the number of TCAM partitions N sub , get the width W of the sub-item.
[0013] Reordering the update table entries and their masks includes:
[0014] S31, initializing the sub-item width index w=0 and the sub-item number index i=0;
[0015] S32, determine whether w=W is established, if so, obtain the reordered update table entry and its mask; otherwise, execute step S33;
[0016] S33, judging i=N sub Is it true? If so, set i=0, w=w+1 and return to step S32; otherwise, execute step S34;
[0017] S34. Update the update entry and its mask according to the index w of the sub-entry width and the index i of the number of sub-entries, set i=i+1 and return to step S33.
[0018] Updating the update entry and its mask includes:
[0019] Re_Entry[i×W+w]=Entry[w×N sub +i]
[0020] Re_Mask[i×W+w]=Mask[w×N sub +i]
[0021] Among them, Mask[w×N sub +i], Entry[w×N sub +i] indicates updating the w×Nth sub +i bit, Re_Entry[i×W+w] and Re_Mask[i×W+w] represent the i×W+wth bit of the reordered update entry and its mask, respectively.
[0022] The operation of adding one to a sub-item and its sub-item mask includes:
[0023] Sub_Entry i [k] = Re_Entry i [k+1]
[0024] Sub_Mask i [k] = Re_Mask i [k+1]
[0025] Among them, Sub_Entry i [k], Sub_Mask i [k] represents the final i-th sub-entry and the k-th bit of its sub-entry mask, respectively. i [k+1]、Re_Mask i [k+1] represents the i-th sub-item and the k-th bit of its sub-item mask respectively.
[0026] The storage address range of the calculation sub-table entry in the corresponding TCAM partition is:
[0027] Addr_begin i =Sub_Entry i &~Sub_Mask i
[0028] Addr_End i =Sub_Entry i |Sub_Mask i
[0029] Among them, Addr_begin i The starting address of the sub-table entry of the i-th TCAM partition, Addr_End iSub_Entry is the end address of the sub-entry of the i-th TCAM partition. i 、Sub_Mask i They represent the final i-th sub-item and its sub-item mask respectively, & represents logical AND, ~ represents negation, and | represents logical OR.
[0030] A TCAM system architecture based on the TCAM fast update method applied to satellite-borne routing, comprising: a TCAM search module, a reordering and update information diversion module and a CPU;
[0031] The CPU is used to send update data; the reordering and update information shunting module receives the update data sent by the CPU, and writes the update data into the TCAM search module using the TCAM fast update method; the update data includes: update table entries and masks.
[0032] The TCAM system architecture also includes a filter and a pre-diversion module. The filter and the pre-diversion module receive input data and divert the input data into two groups of data. One group of data is uploaded to the CPU for parsing, and the other group of data is sent to the TCAM search module. The TCAM search module accurately matches the data sent by the filter and the pre-diversion module to obtain the search result.
[0033] The TCAM system architecture also includes a re-encoding module, which re-encodes the search result output by the TCAM search module and outputs the most matching result.
[0034] The TCAM search module includes: multiple TCAM partitions, and the mapping rule of each TCAM partition is:
[0035]
[0036] Among them, K i is the mapping result of the i-th TCAM partition, L n The nth byte of the table entry with length L.
[0037] Beneficial effects:
[0038] 1. All the internal storage of the TCAM of the present invention adopts BRAM resources based on FPGA, which can avoid the influence of radiation from the onboard environment on the data; 2. The present invention simplifies the processing flow through preprocessing of the filter and the pre-diversion module, reduces the data sent to the TCAM search module, meets the needs of data packet classification and table lookup, and improves the table lookup efficiency; 3. In order to solve the problem of long update time of TCAM table items, the present invention receives the update table items and their masks sent by the CPU, reorders and divides the update table items and their masks, obtains multiple sub-table items and their sub-table item masks, obtains the storage address range of the corresponding sub-table item in the corresponding TCAM partition according to the sub-table item mask, and writes the sub-table item into the storage address range of the corresponding TCAM partition, thereby improving the update efficiency of TCAM and reducing the update time of TCAM. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flowchart of a TCAM fast update method applied to onboard routing provided by an embodiment of the present invention;
[0040] Figure 2 A structural diagram of a TCAM system architecture applied to satellite-based routing provided by an embodiment of the present invention;
[0041] Figure 3 A schematic diagram of the internal structure of a TCAM provided in an embodiment of the present invention;
[0042] Figure 4 The internal architecture of the reordering and update information diversion module provided in the embodiment of the present invention;
[0043] Figure 5 A schematic diagram of a TCAM fast update method applied to satellite-based routing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] like Figure 1 As shown, the present invention adopts a TCAM fast update method applied to satellite-borne routing, comprising:
[0046] S1. Split TCAM to get N sub TCAM partitions; wherein TCAM is a ternary content addressable memory;
[0047] S2. Accept update data, where the update data includes: update table entries and their masks;
[0048] S3, according to N sub Calculate the sub-item width W based on N sub Reorder the update table entries and their masks by summing the width W to obtain reordered update table entries and their masks;
[0049] N sub Indicates the number of TCAM partitions, W indicates the width of the sub-entry, and L indicates the total length of the update entry. The calculation formula for the width of the sub-entry is:
[0050]
[0051] like Figure 5 As shown, reordering the update table entries and their masks includes:
[0052] S31, initializing the sub-item width index w=0 and the sub-item number index i=0;
[0053] S32, determine whether w=W is established, if so, obtain the reordered update table entry and its mask; otherwise, execute step S33;
[0054] S33, judging i=N sub Is it true? If so, set i=0, w=w+1 and return to step S32; otherwise, execute step S34;
[0055] S34. Update the update entry and its mask according to the index w of the sub-entry width and the index i of the number of sub-entries, set i=i+1 and return to step S33.
[0056] Updating the update entry and its mask includes:
[0057] Re_Entry[i×W+w]=Entry[w×N sub +i]
[0058] Re_Mask[i×W+w]=Mask[w×N sub +i]
[0059] Among them, Mask[w×N sub +i], Entry[w×N sub +i] indicates updating the w×Nth sub +i bit, Re_Entry[i×W+w] and Re_Mask[i×W+w] represent the i×W+wth bit of the reordered update entry and its mask, respectively.
[0060] S4. Divide the reordered update table entry and its mask according to the width W to obtain multiple sub-table entries and their sub-table entry masks, and add one to the sub-table entry and its sub-table entry mask to obtain the final sub-table entry and its sub-table entry mask; each sub-table entry corresponds to a TCAM partition;
[0061] Sub_Entry i [k] = Re_Entry i [k+1]
[0062] Sub_Mask i [k] = Re_Mask i [k+1]
[0063] Among them, Sub_Entry i [k], Sub_Mask i [k] represents the final i-th sub-entry and the k-th bit of its sub-entry mask, respectively. i [k+1]、Re_Mask i [k+1] represents the i-th sub-item and the k-th bit of its sub-item mask respectively.
[0064] S5. Calculate the storage address range of the corresponding sub-entry in the corresponding TCAM partition according to the final sub-entry mask, and write the sub-entry into the storage address range of the corresponding TCAM partition.
[0065] The resource used by the TCAM of the present invention is the BRAM memory resource. When performing an update operation, address calculation is required. The storage address is defined as a continuous BRAM address segment. Then, the storage address range of the corresponding sub-table entry in the corresponding TCAM partition is calculated as:
[0066] Addr_begin i =Sub_Entry i &~Sub_Mask i
[0067] Addr_End i =Sub_Entry i |Sub_Mask i
[0068] Among them, Addr_begin i The starting address of the sub-table entry of the i-th TCAM partition, Addr_End i is the end address of the sub-table entry of the i-th TCAM partition, & represents logical AND, ~ represents negation, and | represents logical OR.
[0069] The final sub-table entry is written into the TCAM partition by incrementing the write address pointer;
[0070] Wr_en=1
[0071] Wr_addr=Wr_addr+1
[0072] Among them, Wr_en represents write enable, Wr_addr represents write address, & represents logical AND, ~ represents negation, | represents logical OR, and the wildcard bit is represented by 1, so the calculation of the starting address requires the negation of the exact match bit, and the calculation of the ending address requires the OR of the exact match bit.
[0073] like Figure 2 As shown, the present invention provides a TCAM architecture using the TCAM fast update method applied to satellite routing. First, the overall architecture adopts an SDN structure, and the CPU part performs table item distribution and emergency processing, specifically including: a filter and pre-diversion module (Filter&Shunt), a TCAM search module, a reorder and update information diversion module (Reorder&Updata), a CPU, and a re-encoding module (Encoder);
[0074] like Figure 4 As shown, the reordering and update information diversion module receives the update data sent by the CPU, and uses the TCAM fast update method to reorder the update data and write the processed update data (Sub_1, Sub_2, ..., Sub_m) into the TCAM search module; the update data includes: update table entries (Entry) and masks (Mask).
[0075] The filter and pre-diversion module adopts a Bloom filter structure, which can reduce the text segments sent to the second stage; specifically, the Bloom filter first receives the input data (Data_in) and searches the input data to determine that a match will definitely not occur at certain byte positions, but a match may occur at other positions, that is, the data that misses the local storage information and the data that hits the local storage information are obtained. The data that misses the local storage information is uploaded to the CPU for parsing, and the data that hits the local storage information (Sub_1, Sub_2, ..., Sub_n) is sent to the TCAM search module. Although it will not produce accurate results, it will significantly reduce the data traffic to the next stage. For each table entry to be stored in the filter, k hash functions are constructed, with k representing the number of hash functions, and the k value calculation formula is: Here, n represents the size of the bit array, and m represents the number of entries to be inserted.
[0076] The probability of each entry being found is:
[0077] The probability of hashing all k hash functions and Bloom filters is:
[0078] The TCAM search module performs an accurate match on the data that hits the local storage information to obtain the search result;
[0079] like Figure 3 As shown in the figure, all storage inside TCAM is simulated based on BRAM resources in FPGA to cope with the influence of cosmic rays and radiation in satellite environment. In FPGA, BRAM is constrained as true dual-port RAM (BRAM True-Dual-Port), that is, physically two sub-modules (SubBlock) are a 46KB BRAM. There is no concept of 'x' state in FPGA, so all indeterminate states will be converted into 0 and 1 for storage respectively, that is, the final storage entry Entry_tcam is:
[0080] Entry_tcam=entry&~mask
[0081] The partitioning concept in the internal storage architecture of TCAM can save BRAM resources. The TCAM is split horizontally and vertically to obtain different partitions. Different bits in the same table entry are stored in different areas, and the address is mapped into a unique hot code. Taking an m*n TCAM as an example, it is divided into 4 TCAM partitioning;
[0082] The TCAM partition mapping rules are:
[0083]
[0084] Among them, K i is the mapping result of the i-th TCAM partition, L n The nth byte of the table entry with length L.
[0085] In one embodiment, when new data enters the TCAM search module for table entry matching, it is first determined whether the module is in the update process. The TCAM sub-block based on BRAM cannot perform search and update at the same time. When the module is not in the update state, it can be queried. This decouples the table lookup and update, so that the sub-modules do not affect each other, and enables the TCAM to perform search and update in parallel on a macro level.
[0086] Because the longest match needs to be considered, the TCAM search module will obtain multiple search results. The recoding module recodes the multiple search results, that is, compares the multiple search results, outputs the best match result and an address result (Match_addr) for searching the BRAM. According to the address result, a search is performed in a BRAM to obtain the final specific instruction (Out_con), such as upload or discard.
[0087] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A TCAM fast update method applied to onboard routing, characterized in that: include: S1. Split TCAM to get N sub TCAM partitions; wherein TCAM is a ternary content addressable memory; S2. Accept update data, where the update data includes: update table entries and their masks; S3, according to N sub Calculate the sub-item width W based on N sub Reorder the update table entries and their masks by summing the width W to obtain reordered update table entries and their masks; S4. Divide the reordered update table entry and its mask according to the width W to obtain multiple sub-table entries and their sub-table entry masks, and add one to the sub-table entry and its sub-table entry mask to obtain the final sub-table entry and its sub-table entry mask; each sub-table entry corresponds to a TCAM partition; S5. Calculate the storage address range of the corresponding sub-entry in the corresponding TCAM partition according to the final sub-entry mask, and write the sub-entry into the storage address range of the corresponding TCAM partition.
2. A TCAM fast update method for satellite-based routing according to claim 1, characterized in that: Calculating the width W of the sub-table entry includes: obtaining the total length L of the update table entry, dividing the total length of the update table entry by the number of TCAM partitions N sub , get the width W of the sub-item.
3. The TCAM fast update method for onboard routing according to claim 1, characterized in that: Reordering the update table entries and their masks includes: S31, initializing the sub-item width index w=0 and the sub-item number index i=0; S32, determine whether w=W is established, if so, obtain the reordered update table entry and its mask; otherwise, execute step S33; S33, judging i=N sub Is it true? If so, set i=0, w=w+1 and return to step S32; otherwise, execute step S34; S34. Update the update entry and its mask according to the index w of the sub-entry width and the index i of the number of sub-entries, set i=i+1 and return to step S33.
4. The TCAM fast update method for onboard routing according to claim 3, characterized in that: Updating the update entry and its mask includes: Re_Entry[i×W+w]=Entry[w×N sub +i] Re_Mask+[i×W+w]=Mask[w×N sub +i] Among them, Mask[w×N sub +i], Entry[w×N sub +i] indicates updating the w×Nth sub +i bit, Re_Entry[i×W+w] and Re_Mask[i×W+w] represent the i×W+wth bit of the reordered update entry and its mask, respectively.
5. The TCAM fast update method for onboard routing according to claim 1, characterized in that: The operation of adding one to a sub-item and its sub-item mask includes: Sub_Entry i [k]=Re_Entry i [k+1] Sub_Mask i [k]=Re_Mask i [k+1] Among them, Sub_Entry i [k], Sub_Mask i [k] represents the final i-th sub-entry and the k-th bit of its sub-entry mask, respectively. i [k+1]、Re_Mask i [k+1] represents the i-th sub-item and the k-th bit of its sub-item mask respectively.
6. The TCAM fast update method for onboard routing according to claim 1, characterized in that: The storage address range of the calculation sub-table entry in the corresponding TCAM partition is: Addr_begin i =Sub_Entry i &~Sub_Mask i Addr_End i =Sub_Entry i |Sub_Mask i Among them, Addr_begin i The starting address of the sub-table entry of the i-th TCAM partition, Addr_End i Sub_Entry is the end address of the sub-entry of the i-th TCAM partition. i 、Sub_Mask i They represent the final i-th sub-item and its sub-item mask respectively, & represents logical AND, ~ represents negation, and | represents logical OR.
7. A TCAM system architecture based on the TCAM fast update method for satellite-based routing according to any one of claims 1 to 6, characterized in that: It includes: TCAM search module, reordering and update information diversion module and CPU; The CPU is used to send update data; The reordering and update information shunting module receives the update data sent by the CPU, and writes the update data into the TCAM search module using the TCAM fast update method described in any one of claims 1 to 6; the update data includes: update table entries and masks.
8. The TCAM system architecture for onboard routing according to claim 7, characterized in that: The TCAM system architecture also includes a filter and a pre-diversion module. The filter and the pre-diversion module receive input data and divert the input data into two groups of data. One group of data is uploaded to the CPU for parsing, and the other group of data is sent to the TCAM search module. The TCAM search module accurately matches the data sent by the filter and the pre-diversion module to obtain the search result.
9. The TCAM system architecture for onboard routing according to claim 7, characterized in that: The TCAM system architecture also includes a re-encoding module, which re-encodes the search result output by the TCAM search module and outputs the most matching result.
10. The TCAM system architecture for onboard routing according to claim 7, characterized in that: The TCAM search module includes: multiple TCAM partitions, and the mapping rule of each TCAM partition is: Among them, K i is the mapping result of the i-th TCAM partition, L n The nth byte of the table entry with length L.
Citation Information
Patent Citations
Data packet content name coding compression method in NDN / CCN
CN103457700A
TCAM fast query system based on FPGA
CN117453733A
Verification of a RAM-based TCAM
US10115463B1