Implementation of a multi-layer tuple space data packet classification algorithm based on a single hash table
By using a single hash table to manage the multi-layer tuple space packet classification algorithm in FPGA, the hash table management is simplified, the number of memory accesses is reduced, and the performance of the packet classification algorithm is improved.
Patent Information
- Application Number
- CN202210992929.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-08-18
AI Technical Summary
When existing multi-layer tuple space packet classification algorithms are implemented in FPGA, the hash table management is complex, resulting in many memory accesses and performance degradation.
A multi-layer tuple space data packet classification algorithm based on a single hash table is adopted. By constructing a multi-layer tuple space data structure, hash table data structure, hash node data structure and rule data structure, and managing and storing them in FPGA, the number of memory accesses is reduced.
The hash table management is simplified, suitable for implementation in FPGA, and the number of accesses to the tuple space data structure, hash nodes, and rule data structure is reduced, thereby improving the performance of the packet classification algorithm.
Smart Images

Figure CN115392364B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular relates to a method for implementing a multi-layer tuple space data packet classification algorithm based on a single hash table. Background Art
[0002] The existing technical solution architecture of the multi-layer tuple space data packet classification algorithm is as follows: Figure 1 As shown, each multilayer tuple space data structure (MultilayerTuple) contains multiple tuple space data structures (Tuple), and each tuple space has its own corresponding hash table (HashTable). Each hash table contains multiple hash nodes (HashNode). Each hash node contains a corresponding rule (Rule) entry. The implementation method of this multilayer tuple space packet classification algorithm is a multiple hash table implementation method.
[0003] The existing implementation of the multi-layer tuple space packet classification algorithm described above uses a multi-hash table approach, with each tuple space corresponding to a hash table. This implementation suffers from complex hash table management and is unsuitable for implementation in an FPGA. Furthermore, this implementation requires more accesses to the tuple space data structure (Tuple), hash node data structure (HashNode), and rule data structure (Rule) in the multi-layer tuple space packet classification algorithm, resulting in increased memory accesses and reduced performance of the multi-layer tuple space packet classification algorithm. Summary of the Invention
[0004] (1) Technical issues to be solved
[0005] The technical problem to be solved by the present invention is: how to design a multi-layer tuple space data packet classification algorithm suitable for implementation in FPGA, so that compared with the existing multi-layer tuple space data packet classification algorithm, the algorithm has fewer memory accesses and higher performance when performing data packet classification queries.
[0006] (2) Technical solution
[0007] In order to solve the above technical problems, the present invention provides an implementation system of a multi-layer tuple space data packet classification algorithm based on a single hash table, comprising a multi-layer tuple space data structure construction module, a hash table data structure construction module, a hash node data structure construction module, a rule data structure construction module, an FPGA multi-layer tuple space data structure management module, an FPGA hash table data structure management module, an FPGA hash node data structure management module, an FPGA rule data structure management module, an FPGA multi-layer tuple space data structure storage space module, an FPGA hash table data structure storage space module, an FPGA hash node data structure storage space module, and an FPGA rule data structure storage space module;
[0008] Among them, the multi-layer tuple space data structure construction module is used to construct and organize the multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple according to the rule information sent by the user. The multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple constructed by this module will be used by the FPGA multi-layer tuple space data structure management module FPGAMultilayerTuple Manage Module to send the multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple information to the FPGA multi-layer tuple space data structure storage space module;
[0009] The hash table data structure construction module is used to construct and organize the hash table data structure HashTable according to the rule information issued by the user. The hash table data structure HashTable constructed by this module will be used by the FPGA hash table data structure management module to issue the hash table data structure HashTable information to the FPGA hash table data structure storage space module;
[0010] The hash node data structure construction module is used to construct and organize the hash node data structure HashNode according to the rule information issued by the user. The hash node data structure HashNode constructed by this module will be used by the FPGA hash node data structure management module to send the hash node data structure HashNode information to the FPGA hash node data structure storage space module;
[0011] The rule data structure construction module is used to construct and organize the rule data structure Rule according to the rule information issued by the user. The rule data structure Rule constructed by this module will be used by the FPGA rule data structure management module to issue the rule data structure Rule information to the FPGA rule data structure storage space module;
[0012] The FPGA multi-layer tuple space data structure management module is used to send the multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information transmitted by the multi-layer tuple space data structure construction module and the current state of the FPGA multi-layer tuple space data structure storage space module after comprehensive processing to the FPGA multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information;
[0013] The FPGA hash table data structure management module is used to send the hash table data structure HashTable information to the FPGA hash table data structure storage space module after comprehensive processing based on the hash table data structure HashTable information transmitted by the hash table data structure construction module and the current status of the FPGA hash table data structure storage space module;
[0014] The FPGA hash node data structure management module is used to send the hash node data structure HashNode information to the FPGA hash node data structure storage space module after comprehensive processing based on the hash node data structure HashNode information transmitted by the hash node data structure construction module and the current status of the FPGA hash node data structure storage space module;
[0015] The FPGA rule data structure management module is used to send the rule data structure Rule information transmitted by the rule data structure construction module and the current state of the FPGA rule data structure storage space module after comprehensive processing to the FPGA rule data structure storage space module;
[0016] The FPGA multi-layer tuple space data structure storage space module is used to receive the multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information and the storage information of the FPGA multi-layer tuple space data structure storage space issued by the FPGA multi-layer tuple space data structure management module, and store the received multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information to a designated location of the FPGA multi-layer tuple space data structure storage space;
[0017] The FPGA hash table data structure storage space module is used to receive the hash table data structure HashTable information and the storage information of the FPGA hash table data structure storage space issued by the FPGA hash table data structure management module, and store the received hash table data structure HashTable information in a designated location of the FPGA hash table data structure storage space;
[0018] The FPGA hash node data structure storage space module is used to receive the hash node data structure HashNode information and the storage information of the FPGA hash node data structure storage space issued by the FPGA hash node data structure management module, and store the received hash node data structure HashNode information to a specified location of the FPGA hash node data structure storage space;
[0019] The FPGA rule data structure storage space module is used to receive the rule data structure Rule information and the storage information of the FPGA rule data structure storage space issued by the FPGA rule data structure management module, and store the received rule data structure Rule information to the specified location of the FPGA rule data structure storage space.
[0020] Preferably, the system further comprises a data packet classification query index management module and a data packet classification query module;
[0021] The data packet classification query index management module is used to process and calculate the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query, based on the information such as the pointer to the multi-layer tuple space data structure to be queried currently, the layer height of the multi-layer tuple space data structure to be queried currently, the tuple space data structure index to be queried currently in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result transmitted by the data packet classification query module; and return the calculated multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as the information whether to end the current query to the data packet classification query module;
[0022] The data packet classification query module is used to pass the pointer of the multi-layer tuple space data structure being queried, the level of the multi-layer tuple space data structure being queried, the index of the tuple space data structure being queried in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result to the data packet classification query index management module, and receive the multi-layer tuple space data structure to be queried next time, the level of the multi-layer tuple space data structure, the index of the tuple space data structure to be queried in the multi-layer tuple space data structure and the tuple space mask information as well as whether to end the current query returned by the data packet classification query index management module, and then perform data packet classification query based on the information returned by the data packet classification query index management module and the five-tuple information extracted from the data packet.
[0023] The present invention also provides a method for constructing a data structure of a multi-layer tuple space data packet classification algorithm based on a single hash table, which is realized by utilizing the system.
[0024] Preferably, the steps include:
[0025] The first step is to receive the rule information issued by the user;
[0026] The second step is that the multi-layer tuple space data structure construction module constructs the multi-layer tuple space data structure and tuple space Tuple data structure information according to the rule information issued by the user;
[0027] In the third step, the FPGA multi-layer tuple space data structure management module processes the multi-layer tuple space data structure constructed by the multi-layer tuple space data structure construction module, the tuple space Tuple data structure information, and the current state of the FPGA multi-layer tuple space data structure storage space module, and sends the multi-layer tuple space data structure and tuple space data structure Tuple information to the FPGA multi-layer tuple space data structure storage space module after comprehensive processing;
[0028] Step 4: The hash table data structure construction module constructs the hash table data structure according to the rule information issued by the user;
[0029] Step 5: The FPGA hash table data structure management module processes the hash table data structure information constructed by the hash table data structure construction module and the current state of the FPGA hash table data structure storage space module, and then sends the hash table data structure information to the FPGA hash table data structure storage space module.
[0030] Step 6: The hash node data structure construction module constructs a hash table data structure based on the rule information issued by the user;
[0031] Step 7: The FPGA hash node data structure management module processes the hash node data structure information constructed by the hash node data structure construction module and the current state of the FPGA hash node data structure storage space module, and then sends the hash node data structure information to the FPGA hash node data structure storage space module.
[0032] Step 8: The rule data structure construction module constructs the rule data structure according to the rule information issued by the user;
[0033] In the ninth step, the FPGA rule data structure management module comprehensively processes the rule data structure information constructed by the rule data structure construction module and the current status of the FPGA rule data structure storage space module and sends the rule data structure information to the FPGA rule data structure storage space module.
[0034] The present invention also provides a data packet query method based on a multi-layer tuple space data packet classification algorithm and a single hash table, which is realized by utilizing the system.
[0035] Preferably, after the data structure is constructed, the following steps are performed:
[0036] The first step is that the data packet classification query module extracts the five-tuple index information in the data packet;
[0037] In the second step, the data packet classification query module transmits information such as a pointer to the multi-layer tuple space data structure currently being queried, a layer height of the multi-layer tuple space data structure currently being queried, an index of the tuple space data structure currently being queried in the multi-layer tuple space data structure, a pointer to the parent multi-layer tuple space data structure, and the current query result to the data packet classification query index management module;
[0038] Step 3: The data packet classification query index management module calculates the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask to be queried in the multi-layer tuple space data structure, and whether to end the current query based on the pointer of the multi-layer tuple space data structure to be queried, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask, and other information transmitted by the data packet classification query module.
[0039] Step 4: The data packet classification query module receives the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask information, and whether to end the current query, which are returned by the data packet classification query index management module.
[0040] Step 5: Determine whether to end the data packet classification query. If the judgment result is yes, end the data packet classification query and return the query result. If the judgment result is no, jump to the next step to continue execution.
[0041] In the sixth step, the data packet classification query module performs data packet classification query based on the multi-layer tuple space data structure that needs to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index and tuple space mask information that needs to be queried in the multi-layer tuple space data structure, and the five-tuple information extracted from the data packet returned by the received data packet classification query index management module. After completing the query, jump to the second step to continue execution.
[0042] The present invention also provides a method for constructing a multi-layer tuple space data structure MultilayerTuple, a tuple space data structure Tuple, a hash table data structure HashTable, a hash node data structure HashNode and a rule data structure Rule within an FPGA, which is realized by using the system.
[0043] The present invention also provides an organization and management method for FPGA internal tuple space data structure Tuple, FPGA internal hash table data structure HashTable, FPGA internal hash node data structure HashNode, and FPGA internal rule data structure Rule, which is realized by using the system.
[0044] The present invention also provides an application of the system in the field of communications.
[0045] The present invention also provides an application of the method in the field of communications.
[0046] (3) Beneficial effects
[0047] Compared to existing multi-layer tuple-space packet classification algorithms that use multiple hash tables, this single-hash-table implementation simplifies hash table management, making it well-suited for implementation in FPGAs. Furthermore, the algorithm requires fewer accesses to the tuple space data structure (Tuple), hash node data structure (HashNode), and rule data structure (Rule), resulting in fewer memory accesses, improving the performance of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is the overall architecture diagram of the multi-layer tuple space data packet classification algorithm implemented in the existing multi-hash table mode;
[0049] Figure 2 This is the overall architecture diagram of the multi-layer tuple space data packet classification algorithm based on a single hash table of the present invention;
[0050] Figure 3 Construct a flow chart for the data structure of the multi-layer tuple space data packet classification algorithm based on a single hash table of the present invention;
[0051] Figure 4 This is a data packet query flow chart of the multi-layer tuple space data packet classification algorithm based on a single hash table of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below with reference to the accompanying drawings and examples.
[0053] The overall solution architecture of the implementation method of the multi-layer tuple space data packet classification algorithm based on a single hash table provided by the present invention is as follows: Figure 2 As shown, it mainly consists of software (Software) technical architecture part and logic (FPGA) technical architecture part.
[0054] The software technical architecture mainly consists of the multi-layer tuple space data structure construction module (MultilayerTuple Module), the hash table data structure construction module (HashTable Module), the hash node data structure construction module (HashNode Module), the rule data structure construction module (Rule Module), the FPGA multi-layer tuple space data structure management module (FPGA MultilayerTuple Manage Module), the FPGA hash table data structure management module (FPGA HashTable Manage Module), the FPGA hash node data structure management module (FPGAHashNode Manage Module) and the FPGA rule data structure management module (FPGA Rule Manage Module).
[0055] The multi-layer tuple space data structure construction module (MultilayerTuple Module) is used to construct and organize the multi-layer tuple space data structure (MultilayerTuple) and tuple space data structure (Tuple) according to the rule information sent by the user. The multi-layer tuple space data structure (MultilayerTuple) and tuple space data structure (Tuple) constructed by this module will be used by the FPGA multi-layer tuple space data structure management module (FPGAMultilayerTuple Manage Module) to send the multi-layer tuple space data structure (MultilayerTuple) and tuple space data structure (Tuple) information to the FPGA multi-layer tuple space data structure storage space module (MultilayerTuple memory space) of the logic (FPGA) technology architecture part.
[0056] The Hash Table Data Structure Construction Module (HashTable Module) is used to construct and organize the Hash Table data structure (HashTable) based on the rule information sent by the user. The Hash Table data structure (HashTable) constructed by this module will be used by the FPGA Hash Table Data Structure Management Module (FPGA HashTable Manage Module) to send the Hash Table data structure (Hash Table) information to the FPGA Hash Table Data Structure Storage Space Module (HashTable memory space) of the logic (FPGA) technology architecture.
[0057] The HashNode Module is used to construct and organize the HashNode data structure based on the rule information sent by the user. The HashNode data structure constructed by this module will be used by the FPGA HashNode Manage Module to send the HashNode data structure information to the FPGA HashNode memoryspace module in the logic (FPGA) technology architecture.
[0058] The Rule Data Structure Construction Module (Rule Module) is used to construct and organize the Rule Data Structure (Rule) based on the rule information sent by the user. The Rule Data Structure (Rule) constructed by this module will be used by the FPGA Rule Data Structure Management Module (FPGA Rule Manage Module) to send the Rule Data Structure (Rule) information to the FPGA Rule Data Structure Storage Space Module (Rule Memory Space) in the logic (FPGA) technology architecture.
[0059] The FPGA MultilayerTuple Manage Module is used to process the MultilayerTuple and Tuple information transmitted by the MultilayerTuple Module and the current state of the MultilayerTuple memory space, and then send the MultilayerTuple and Tuple information to the MultilayerTuple memory space.
[0060] The FPGA HashTable Manage Module is used to process the HashTable data structure information passed by the HashTable Module and the current status of the FPGA HashTable memory space, and then send the HashTable data structure information to the FPGA HashTable memory space.
[0061] The FPGA HashNode Manage Module is used to process the HashNode information passed by the HashNode Module and the current state of the FPGA HashNode memory space, and then send the HashNode information to the FPGA HashNode memory space.
[0062] The FPGA Rule Manage Module is used to process the rule data structure (Rule) information transmitted by the Rule Module and the current status of the FPGA rule data structure storage space module (Rule memory space) and then send the rule data structure (Rule) information to the FPGA rule data structure storage space module (Rule memory space).
[0063] The logic (FPGA) technical architecture mainly consists of the FPGA multi-layer tuple space data structure storage space module (MultilayerTuple memory space), FPGA hash table data structure storage space module (HashTablememory space), FPGA hash node data structure storage space module (HashNode memory space), FPGA rule data structure storage space module (Rule memory space), data packet classification query index management module (IndexManage Module) and data packet classification query module (lookup Module).
[0064] The FPGA multi-layer tuple space data structure storage space module (MultilayerTuple memory space) is used to receive the multi-layer tuple space data structure (MultilayerTuple) and tuple space data structure (Tuple) information and the storage information of the FPGA multi-layer tuple space data structure storage space issued by the FPGA multi-layer tuple space data structure management module (FPGA MultilayerTuple Manage Module), and store the received multi-layer tuple space data structure (MultilayerTuple) and tuple space data structure (Tuple) information in a specified location of the FPGA multi-layer tuple space data structure storage space.
[0065] The FPGA hash table data structure storage space module (HashTable memory space) is used to receive the hash table data structure (HashTable) information and the storage information of the FPGA hash table data structure storage space issued by the FPGA hash table data structure management module (FPGA HashTable Manage Module), and store the received hash table data structure (HashTable) information in a specified location of the FPGA hash table data structure storage space.
[0066] The FPGA hash node data structure storage space module (HashNode memory space) is used to receive the hash node data structure (HashNode) information and the storage information of the FPGA hash node data structure storage space issued by the FPGA hash node data structure management module (FPGA HashNode Manage Module), and store the received hash node data structure (HashNode) information in a specified location of the FPGA hash node data structure storage space.
[0067] The FPGA rule data structure storage space module (Rule memory space) is used to receive the rule data structure (Rule) information issued by the FPGA rule data structure management module (FPGA Rule Manage Module) and the storage information of the FPGA rule data structure storage space, and store the received rule data structure (Rule) information in a specified location of the FPGA rule data structure storage space.
[0068] The data packet classification query index management module (Index Manage Module) is used to process and calculate the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query, based on the information transmitted by the data packet classification query module (lookup Module), including the pointer to the multi-layer tuple space data structure to be queried currently, the layer height of the multi-layer tuple space data structure to be queried currently, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query; and return the calculated multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query, to the data packet classification query module (lookup Module).
[0069] The data packet classification query module (lookup Module) is used to pass the pointer of the multi-layer tuple space data structure being queried, the level of the multi-layer tuple space data structure being queried, the index of the tuple space data structure being queried in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result to the data packet classification query index management module (Index Manage Module), and receive the multi-layer tuple space data structure to be queried next time, the level of the multi-layer tuple space data structure, the index of the tuple space data structure to be queried in the multi-layer tuple space data structure and the tuple space mask information as well as whether to end the current query returned by the data packet classification query index management module (Index Manage Module), and then perform data packet classification query based on the information returned by the data packet classification query index management module (Index Manage Module) and the five-tuple information extracted from the data packet.
[0070] The data structure construction process of the multi-layer tuple space data packet classification algorithm based on a single hash table is as follows: Figure 3 As shown, the following steps are included:
[0071] The first step is to receive the rule information issued by the user;
[0072] The second step is that the multi-layer tuple space data structure construction module (MultilayerTuple Module) constructs the multi-layer tuple space data structure and tuple space (Tuple) data structure information according to the rule information issued by the user;
[0073] In the third step, the FPGA multilayer tuple space data structure management module (FPGA MultilayerTuple ManageModule) comprehensively processes the multilayer tuple space data structure constructed by the multilayer tuple space data structure construction module (MultilayerTuple Module), the tuple space (Tuple) data structure information, and the current state of the FPGA multilayer tuple space data structure storage space module (MultilayerTuple memory space), and sends the multilayer tuple space data structure and tuple space data structure (Tuple) information to the FPGA multilayer tuple space data structure storage space module (MultilayerTuple memory space);
[0074] The fourth step is to construct a hash table data structure module (HashTable Module) based on the rule information sent by the user.
[0075] In the fifth step, the FPGA HashTable Manage Module processes the hash table data structure information constructed by the HashTable Module and the current status of the FPGA HashTable memory space, and then sends the hash table data structure information to the FPGA HashTable memory space.
[0076] The sixth step is to construct the hash node data structure module (HashNode Module) based on the rule information sent by the user to build the hash table data structure.
[0077] In the seventh step, the FPGA HashNode Manage Module processes the hash node data structure information constructed by the HashNode Module and the current status of the FPGA HashNode memory space, and then sends the hash node data structure information to the FPGA HashNode memory space.
[0078] In the eighth step, the rule data structure construction module (Rule Module) constructs the rule data structure according to the rule information issued by the user.
[0079] In the ninth step, the FPGA Rule Data Structure Management Module (FPGA Rule Manage Module) comprehensively processes the rule data structure information constructed by the Rule Data Structure Construction Module (Rule Module) and the current status of the FPGA Rule Data Structure Storage Space Module (Rule memory space), and then sends the rule data structure information to the FPGA Rule Data Structure Storage Space Module (Rule memory space).
[0080] After the data structure is constructed, the packet query process of the multi-layer tuple space packet classification algorithm based on a single hash table is as follows: Figure 4 As shown, the following steps are included:
[0081] In the first step, the packet classification query module (lookup Module) extracts the five-tuple index information in the packet.
[0082] In the second step, the data packet classification query module (lookup Module) passes the pointer to the multi-layer tuple space data structure of the current query, the layer height of the multi-layer tuple space data structure of the current query, the index of the tuple space data structure of the current query in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result to the data packet classification query index management module (Index Manage Module).
[0083] In the third step, the data packet classification query index management module (Index Manage Module) calculates the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query, based on the pointer to the multi-layer tuple space data structure to be queried, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as the information such as the current query result passed by the data packet classification query module (lookup Module).
[0084] In the fourth step, the data packet classification query module (lookup Module) receives the information returned by the data packet classification query index management module (Index Manage Module), including the multi-layer tuple space data structure that needs to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index and tuple space mask information that needs to be queried in the multi-layer tuple space data structure, and whether to end the current query.
[0085] The fifth step is to determine whether to end the packet classification query. If the judgment result is yes, the packet classification query is ended and the query result is returned. If the judgment result is no, jump to the next step to continue execution.
[0086] In the sixth step, the packet classification lookup module performs a packet classification lookup based on the multi-layer tuple space data structure to be queried next, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried within the multi-layer tuple space data structure, the tuple space mask information, and the quintuple information extracted from the packet, as returned by the packet classification lookup index management module. After the lookup is complete, the process jumps to the second step to continue.
[0087] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A system for implementing a multi-layer tuple space data packet classification algorithm based on a single hash table, characterized in that: Including multi-layer tuple space data structure construction module, hash table data structure construction module, hash node data structure construction module, rule data structure construction module, FPGA multi-layer tuple space data structure management module, FPGA hash table data structure management module, FPGA hash node data structure management module, FPGA rule data structure management module, FPGA multi-layer tuple space data structure storage space module, FPGA hash table data structure storage space module, FPGA hash node data structure storage space module, FPGA rule data structure storage space module; Among them, the multi-layer tuple space data structure construction module is used to construct and organize the multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple according to the rule information sent by the user. The multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple constructed by this module will be used by the FPGA multi-layer tuple space data structure management module FPGAMultilayerTupleManageModule to send the multi-layer tuple space data structure MultilayerTuple and the tuple space data structure Tuple information to the FPGA multi-layer tuple space data structure storage space module; The hash table data structure construction module is used to construct and organize the hash table data structure HashTable according to the rule information issued by the user. The hash table data structure HashTable constructed by this module will be used by the FPGA hash table data structure management module to issue the hash table data structure HashTable information to the FPGA hash table data structure storage space module; The hash node data structure construction module is used to construct and organize the hash node data structure HashNode according to the rule information issued by the user. The hash node data structure HashNode constructed by this module will be used by the FPGA hash node data structure management module to send the hash node data structure HashNode information to the FPGA hash node data structure storage space module; The rule data structure construction module is used to construct and organize the rule data structure Rule according to the rule information issued by the user. The rule data structure Rule constructed by this module will be used by the FPGA rule data structure management module to issue the rule data structure Rule information to the FPGA rule data structure storage space module; The FPGA multi-layer tuple space data structure management module is used to send the multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information transmitted by the multi-layer tuple space data structure construction module and the current state of the FPGA multi-layer tuple space data structure storage space module after comprehensive processing to the FPGA multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information; The FPGA hash table data structure management module is used to send the hash table data structure HashTable information to the FPGA hash table data structure storage space module after comprehensive processing based on the hash table data structure HashTable information transmitted by the hash table data structure construction module and the current status of the FPGA hash table data structure storage space module; The FPGA hash node data structure management module is used to send the hash node data structure HashNode information to the FPGA hash node data structure storage space module after comprehensive processing based on the hash node data structure HashNode information transmitted by the hash node data structure construction module and the current status of the FPGA hash node data structure storage space module; The FPGA rule data structure management module is used to send the rule data structure Rule information transmitted by the rule data structure construction module and the current state of the FPGA rule data structure storage space module after comprehensive processing to the FPGA rule data structure storage space module; The FPGA multi-layer tuple space data structure storage space module is used to receive the multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information and the storage information of the FPGA multi-layer tuple space data structure storage space issued by the FPGA multi-layer tuple space data structure management module, and store the received multi-layer tuple space data structure MultilayerTuple and tuple space data structure Tuple information to a designated location of the FPGA multi-layer tuple space data structure storage space; The FPGA hash table data structure storage space module is used to receive the hash table data structure HashTable information and the storage information of the FPGA hash table data structure storage space issued by the FPGA hash table data structure management module, and store the received hash table data structure HashTable information in a designated location of the FPGA hash table data structure storage space; The FPGA hash node data structure storage space module is used to receive the hash node data structure HashNode information and the storage information of the FPGA hash node data structure storage space issued by the FPGA hash node data structure management module, and store the received hash node data structure HashNode information to a specified location of the FPGA hash node data structure storage space; The FPGA rule data structure storage space module is used to receive the rule data structure Rule information and the storage information of the FPGA rule data structure storage space issued by the FPGA rule data structure management module, and store the received rule data structure Rule information to the specified location of the FPGA rule data structure storage space.
2. The system according to claim 1, wherein The system also includes a data packet classification query index management module and a data packet classification query module; The data packet classification query index management module is used to process and calculate the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as whether to end the current query, based on the information such as the pointer to the multi-layer tuple space data structure to be queried currently, the layer height of the multi-layer tuple space data structure to be queried currently, the tuple space data structure index to be queried currently in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result transmitted by the data packet classification query module; and return the calculated multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried in the multi-layer tuple space data structure and the tuple space mask, as well as the information whether to end the current query to the data packet classification query module; The data packet classification query module is used to pass the pointer of the multi-layer tuple space data structure being queried, the level of the multi-layer tuple space data structure being queried, the index of the tuple space data structure being queried in the multi-layer tuple space data structure, the pointer to the parent multi-layer tuple space data structure and the current query result to the data packet classification query index management module, and receive the multi-layer tuple space data structure to be queried next time, the level of the multi-layer tuple space data structure, the index of the tuple space data structure to be queried in the multi-layer tuple space data structure and the tuple space mask information as well as whether to end the current query returned by the data packet classification query index management module, and then perform data packet classification query based on the information returned by the data packet classification query index management module and the five-tuple information extracted from the data packet.
3. A method for constructing a data structure of a multi-layer tuple space data packet classification algorithm based on a single hash table implemented using the system described in claim 1.
4. The method according to claim 3, wherein The following steps are involved: The first step is to receive the rule information issued by the user; The second step is that the multi-layer tuple space data structure construction module constructs the multi-layer tuple space data structure and tuple space Tuple data structure information according to the rule information issued by the user; In the third step, the FPGA multi-layer tuple space data structure management module processes the multi-layer tuple space data structure constructed by the multi-layer tuple space data structure construction module, the tuple space Tuple data structure information, and the current state of the FPGA multi-layer tuple space data structure storage space module, and sends the multi-layer tuple space data structure and tuple space data structure Tuple information to the FPGA multi-layer tuple space data structure storage space module after comprehensive processing; Step 4: The hash table data structure construction module constructs the hash table data structure according to the rule information issued by the user; Step 5: The FPGA hash table data structure management module processes the hash table data structure information constructed by the hash table data structure construction module and the current state of the FPGA hash table data structure storage space module, and then sends the hash table data structure information to the FPGA hash table data structure storage space module. Step 6: The hash node data structure construction module constructs a hash table data structure based on the rule information issued by the user; Step 7: The FPGA hash node data structure management module processes the hash node data structure information constructed by the hash node data structure construction module and the current state of the FPGA hash node data structure storage space module, and then sends the hash node data structure information to the FPGA hash node data structure storage space module. Step 8: The rule data structure construction module constructs the rule data structure according to the rule information issued by the user; In the ninth step, the FPGA rule data structure management module comprehensively processes the rule data structure information constructed by the rule data structure construction module and the current status of the FPGA rule data structure storage space module and sends the rule data structure information to the FPGA rule data structure storage space module.
5. A data packet query method based on a multi-layer tuple space data packet classification algorithm based on a single hash table implemented using the system described in claim 2.
6. The method according to claim 5, wherein After the data structure is constructed, the following steps are performed: The first step is that the data packet classification query module extracts the five-tuple index information in the data packet; In the second step, the data packet classification query module transmits information such as a pointer to the multi-layer tuple space data structure currently being queried, a layer height of the multi-layer tuple space data structure currently being queried, an index of the tuple space data structure currently being queried in the multi-layer tuple space data structure, a pointer to the parent multi-layer tuple space data structure, and the current query result to the data packet classification query index management module; Step 3: The data packet classification query index management module calculates the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask to be queried in the multi-layer tuple space data structure, and whether to end the current query based on the pointer of the multi-layer tuple space data structure to be queried, the layer height of the multi-layer tuple space data structure to be queried, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask, and other information transmitted by the data packet classification query module. Step 4: The data packet classification query module receives the multi-layer tuple space data structure to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index to be queried in the multi-layer tuple space data structure, the tuple space mask information, and whether to end the current query, which are returned by the data packet classification query index management module. Step 5: Determine whether to end the data packet classification query. If the judgment result is yes, end the data packet classification query and return the query result. If the judgment result is no, jump to the next step to continue execution. In the sixth step, the data packet classification query module performs data packet classification query based on the multi-layer tuple space data structure that needs to be queried next time, the layer height of the multi-layer tuple space data structure, the tuple space data structure index and tuple space mask information that needs to be queried in the multi-layer tuple space data structure, and the five-tuple information extracted from the data packet returned by the received data packet classification query index management module. After completing the query, jump to the second step to continue execution.
7. A method for constructing a multi-layer tuple space data structure MultilayerTuple, a tuple space data structure Tuple, a hash table data structure HashTable, a hash node data structure HashNode, and a rule data structure Rule within an FPGA, implemented using the system described in claim 1 or 2.
8. A method for organizing and managing an FPGA internal tuple space data structure Tuple, an FPGA internal hash table data structure HashTable, an FPGA internal hash node data structure HashNode, and an FPGA internal rule data structure Rule, implemented using the system described in claim 1 or 2.
9. Application of the system according to claim 1 or 2 in the field of communications.
10. Application of the method according to claims 3 to 6 in the field of communications.
Citation Information
Patent Citations
Implementation method for multi-field rule matching
CN104468381A
Hash join operator acceleration method and system based on FPGA-DDR
CN109977116A