WO2020248690A1 - 报文匹配查表方法、系统、存储介质和终端 - Google Patents

报文匹配查表方法、系统、存储介质和终端 Download PDF

Info

Publication number
WO2020248690A1
WO2020248690A1 PCT/CN2020/084405 CN2020084405W WO2020248690A1 WO 2020248690 A1 WO2020248690 A1 WO 2020248690A1 CN 2020084405 W CN2020084405 W CN 2020084405W WO 2020248690 A1 WO2020248690 A1 WO 2020248690A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
table lookup
tcam
matching
message
Prior art date
Application number
PCT/CN2020/084405
Other languages
English (en)
French (fr)
Inventor
戎立锋
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Priority to US17/613,793 priority Critical patent/US20220231945A1/en
Priority to EP20822182.0A priority patent/EP3964966B1/en
Publication of WO2020248690A1 publication Critical patent/WO2020248690A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/74591Address table lookup; Address filtering using content-addressable memories [CAM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/24569Query processing with adaptation to specific hardware, e.g. adapted for using GPUs or SSDs
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C15/00Digital stores in which information comprising one or more characteristic parts is written into the store and in which information is read-out by searching for one or more of these characteristic parts, i.e. associative or content-addressed stores
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11CSTATIC STORES
    • G11C7/00Arrangements for writing information into, or reading information out from, a digital store
    • G11C7/10Input/output [I/O] data interface arrangements, e.g. I/O data control circuits, I/O data buffers
    • G11C7/1006Data managing, e.g. manipulating data before writing or reading out, data bus switches or control circuits therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7452Multiple parallel or consecutive lookup operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing

Definitions

  • the embodiments of the present application relate to the field of Ethernet forwarding and transmission, for example, to a method, system, storage medium, and terminal for a message matching table lookup.
  • the message forwarding behavior in the network is determined by the characteristic fields and characteristic flow types of the messages, such as the Layer 2 Media Access Control Address (MAC) address, Virtual Local Area Network (VLAN), Layer 3 Internet Protocol (IP) address, Layer 2.5 Multi-Protocol Label Switching (MPLS) label, etc.
  • MAC Media Access Control Address
  • VLAN Virtual Local Area Network
  • IP Layer 3 Internet Protocol
  • MPLS Layer 2.5 Multi-Protocol Label Switching
  • the programmable match-action forwarding structure that has appeared in recent years, through the collection of possible multiple feature fields and multiple conditions, and then use large bit width, large depth of three-state content addressing memory (ternary content addressable memory, TCAM) matches the content of the field that the user is interested in, initiates a prefix lookup request, and then obtains the forwarding destination address.
  • TCAM ternary content addressable memory
  • the match-action forwarding structure takes all judgment conditions and message feature field information as the matched TCAM key value. Due to the fragmented key value, the bit width varies from length to narrow, and the combination of conditions, the amount of TCAM usage increases sharply.
  • the Action RAM corresponding to TCAM is also relatively large, and the cost and power consumption performance are not optimistic.
  • the present application provides a method, system, storage medium, and terminal for looking up a message matching table, which can save TCAM and Action RAM.
  • N is an integer greater than 1;
  • the Action RAM is searched according to the matching hit result of the TCAM, and the Action RAM outputs a table lookup request.
  • the field compression module is set to compress the data bit width of the specified part of the input message on demand
  • the comparison module is configured to extract N groups of data from the compressed data, and compare the data within each group of data to obtain N groups of comparison results, and to splice the N groups of comparison results with true values, where N is an integer greater than 1;
  • the matching module is set to use the true value splicing result as a keyword to perform matching search of the tri-state content addressing memory TCAM;
  • the table lookup request module is configured to look up the action random access memory Action RAM according to the matching hit result of the TCAM, and the Action RAM outputs the table lookup request.
  • An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the above-mentioned message matching table lookup method is implemented.
  • the embodiment of the present application also provides a message matching table lookup terminal, including:
  • the memory is set to store computer executable instructions
  • the processor is configured to execute the computer-executable instructions to implement the message matching table look-up method as described above.
  • FIG. 1 is a flowchart of a message matching table lookup method provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a flow chart of a two-level matching message matching table lookup for an application example of this application;
  • FIG. 3 is a schematic flowchart of steps 201 and 202 shown in FIG. 2;
  • FIG. 4 is a schematic flowchart of steps 203 and 204 shown in FIG. 2;
  • Fig. 5 is a composition diagram of a message matching table lookup system provided by an embodiment of the application.
  • the embodiment of the present application provides a message matching table lookup method. As shown in FIG. 1, the method includes:
  • the designated part information of the message may be header information and message attribute descriptor information.
  • S102 Extract N sets of data from the compressed data, and compare the data within the groups to obtain N sets of comparison results, and perform true value splicing on the N sets of comparison results.
  • N is an integer greater than 1.
  • Steps S101 and S102 are the first level matching process.
  • Steps S103 and S104 are the second level matching process.
  • N sets of data are extracted from the compressed data, and the data is compared within the groups to obtain N sets of comparison results, and the N sets of comparison results are true-value spliced, including:
  • Extract N groups of data from compressed data each group includes 2 to 3 data;
  • using the true value splicing result as a keyword to perform a matching search of the tri-state content addressing memory TCAM includes:
  • the depth of the TCAM is N*2 or N*3, and the width of the TCAM is N, which means that it supports the comparison of any mixture of 2N or 3N truth values, and Support single multiple item hits, a single multiple item hit means that IF (A&B&C..) conditions are met.
  • the output of the table lookup request by Action RAM includes:
  • Action RAM concurrently outputs multiple table lookup requests, including which types of tables need to be checked, such as hash tables, direct tables, and acl tables, as well as the key value extraction principles of each table;
  • one of the meter lookup requests is selected according to priority.
  • the message matching table lookup method compresses the information that may be needed for the message matching table lookup on demand, extracts N sets of data from the compressed data, and compares the data within the group to obtain N sets of comparison results , Realizes the subdivision condition judgment logic.
  • the Action RAM corresponding to TCAM is also relatively small. Compared with the judgment conditions and the message characteristic field information as the matched TCAM key value, it has the advantage of saving TCAM and Action RAM.
  • FIG. 2 is a schematic diagram of a flow chart of a two-level matching message matching table lookup in an application example of this application.
  • Step 201 Perform on-demand data bit width compression on the header information and descriptor information of the entry message.
  • Step 203 Use TCAM matching for the 64 true values, and the matching result can be a single hit or multiple hits.
  • Step 204 Look up the Action RAM in parallel according to the hit TCAM address, and the Action RAM obtains which forwarding tables the message needs to find.
  • FIG. 3 is a schematic diagram of the flow of step 201 and step 202 shown in FIG. 2.
  • Step 301 Receive the header information of the service message and the characteristic attribute information of the message.
  • Step 302 According to the user configuration, compress and select 768-bit partial message fields and characteristic information required by the user from the large-bit-width message information and characteristic information, and this information is used to determine the satisfaction conditions of the table lookup request.
  • Step 303 Extracting a total of 64 sets of data of 3 types of 8bit, 16bit, and 32bit from the compressed data; selecting the data of 3 types of bit widths is to make it possible to compare the data bit widths.
  • Step 304 Read 64 groups, each group of 2 or 3 data, a total of M*2+(64-M)*3 data, among which, the M group contains 2 data and the (64-M) group contains 3 data data.
  • Step 305 Perform 64 groups in parallel.
  • Step 306 Compare 2 or 3 data values of each group with the set immediate data, or compare pairwise data.
  • Step 307 Each group of comparison results is selected in combination, and it is possible to select a single satisfaction, simultaneous satisfaction, or none.
  • Step 308 Obtain 64 sets of comparison results to form a 64-bit true value bitmap combination.
  • Fig. 4 is a schematic diagram of the flow of steps 203 and 204 shown in Fig. 2:
  • Step 401 Use the 64bit judgment truth value as the key to perform TCAM matching search.
  • the maximum can be 2 ⁇ N power, and the depth value can be selected according to actual needs.
  • Step 402 According to the hit bit and hit address of the TCAM, the Action RAM is searched concurrently; that is, a single or multiple conditions are allowed to be true to achieve a judgment result similar to IF(A) or IF(B).
  • Step 403 Look up the Action RAM from the hit address, and output the table lookup request from the RAM configuration. Multiple table lookup requests can be initiated concurrently. When the results of multiple Action RAM have the same table lookup request, one of the requests is selected according to priority .
  • the embodiment of the present application also provides a message matching table lookup system, as shown in Figure 5, the system includes:
  • the field compression module 501 is configured to perform on-demand data bit width compression on the specified part information of the input message.
  • the designated part information of the message may be header information and message attribute descriptor information. For example, compressing 3Kbit data to 1Kbit or less bit width, these data contains information that may be needed for the message matching table lookup.
  • the comparison module 502 is configured to extract N groups of data from the compressed data, compare the data within the groups, obtain N groups of comparison results, and perform true value splicing on the N groups of comparison results, where N is an integer greater than 1.
  • the matching module 503 is configured to use the true value splicing result as a keyword to perform a matching search of the tri-state content addressing memory TCAM.
  • the table lookup request module 504 is configured to look up the action random access memory Action RAM according to the matching hit result of the TCAM, and the Action RAM outputs the table lookup request.
  • the comparison module 502 is configured to extract N groups of data from the compressed data, compare the data within the groups, obtain N groups of comparison results, and perform true value splicing on the N groups of comparison results, including:
  • Extract N groups of data from compressed data each group includes 2 to 3 data;
  • the matching module 503 is configured to use the true value splicing result as a keyword to perform a matching search in the tri-state content addressing memory TCAM, including:
  • TCAM Use Nbit truth value as a key for TCAM matching search.
  • the depth of TCAM is N*2 or N*3, and the width of TCAM is N, which means that it supports 2N or 3N comparisons of any mixture of truth values, and supports multiple single times Item hits, a single hit of multiple items means that the condition of IF (A&B&C..) is met.
  • the table lookup request module 504 is set to output the table lookup request from Action RAM, including:
  • Action RAM concurrently outputs multiple table lookup requests, including which types of tables need to be checked, such as hash tables, direct tables, and acl tables, as well as the key value extraction principles of each table;
  • one of the meter lookup requests is selected according to priority.
  • the message matching table lookup system compresses the information that may be needed for the message matching table lookup on demand, extracts N groups of data from the compressed data, and compares the data within the groups to obtain N sets of comparison results , Realizes the subdivision condition judgment logic.
  • the Action RAM corresponding to TCAM is also relatively small. Compared with the judgment conditions and the message characteristic field information as the matched TCAM key value, it has the advantage of saving TCAM and Action RAM.
  • An embodiment of the present application also provides a computer-readable storage medium that stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the message matching table lookup method described in the previous embodiment is implemented .
  • the embodiment of the present application also provides a message matching table lookup terminal, including:
  • the memory is set to store computer executable instructions
  • the processor is configured to execute the computer-executable instructions to implement the message matching table lookup method described in the previous embodiment.
  • the functional modules/units in the system, and the device can be implemented as software, firmware, hardware, and appropriate combinations thereof.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may consist of multiple The physical components cooperate to execute.
  • Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
  • Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
  • Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer readable instructions, data structures, program modules, or other data) .
  • Computer storage media include Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other memories Technology, portable compact disk read-only memory (Compact Disc Read Only Memory, CD-ROM), digital versatile disk (Digital Video Disk, DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or Any other medium that can be used to store desired information and that can be accessed by a computer.
  • Communication media usually contain computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本申请公开了一种报文匹配查表方法、系统、存储介质和终端,其中,所述报文匹配查表包括:对输入的报文的指定部位信息进行按需数据位宽压缩;从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,N为大于1的整数;将所述真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找;根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由Action RAM输出查表请求。

Description

报文匹配查表方法、系统、存储介质和终端
本申请要求在2019年06月14日提交中国专利局、申请号为201910517975.4的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及以太网转发和传输领域,例如涉及一种报文匹配查表方法、系统、存储介质和终端。
背景技术
在有线通信网络中,如承载网,交换网等,网络中的报文转发行为由报文的特征字段和特征流类型决定,比如二层媒体访问控制地址(Media Access Control Address,MAC)地址,虚拟局域网(Virtual Local Area Network,VLAN),三层互联网协议(Internet Protocol,IP)地址,2.5层多协议标签交换(Multi-Protocol Label Switching,MPLS)标签等。
近些年出现的可编程匹配-动作(match-Action)转发结构,通过搜集可能的多个特征字段、多个条件的融合,再利用大位宽,大深度的三态内容寻址存储器(ternary content addressable memory,TCAM)匹配用户感兴趣的字段内容,发起前缀查找的请求,进而获取转发目的地址。
该match-Action转发结构将所有的判断条件,报文特征字段信息都作为匹配的TCAM键值,由于键值零碎,位宽有长有窄,条件组合多,带来的TCAM使用量急剧上升,TCAM对应的动作随机存取存储器(Action RAM)也比较大,成本和功耗表现都不乐观。
发明内容
本申请提供了一种报文匹配查表方法、系统、存储介质和终端,能够节省TCAM和Action RAM。
本申请实施例提供的报文匹配查表方法,包括:
对输入的报文的指定部位信息进行按需数据位宽压缩;
从压缩数据中提取N组数据,并在每组数据的组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,N为大于1的整数;
将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找;
根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由Action RAM输出查表请求。
本申请实施例提供的报文匹配查表系统,包括:
字段压缩模块,设置为对输入的报文的指定部位信息进行按需数据位宽压缩;
比较模块,设置为从压缩数据中提取N组数据,并在每组数据的组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,N为大于1的整数;
匹配模块,设置为将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找;
查表请求模块,设置为根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由Action RAM输出查表请求。
本申请实施例还提供了一种计算机可读存储介质,所述介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现如前所述的报文匹配查表方法。
本申请实施例还提供了一种报文匹配查表终端,包括:
存储器,设置为存储计算机可执行指令;
处理器,设置为执行所述计算机可执行指令,以实现如前所述的报文匹配查表方法。
附图说明
图1为本申请实施例提供的报文匹配查表方法流程图;
图2为本申请应用示例利用两级匹配报文匹配查表的流程示意图;
图3为对图2所示的步骤201和步骤202的流程示意图;
图4是对图2所示的步骤203和步骤204的流程示意图;
图5为本申请实施例提供的报文匹配查表系统组成图。
具体实施方式
下文中将结合附图对本申请的实施例进行说明。
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在一些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例提供了一种报文匹配查表方法,如图1所示,所述方法包括:
S101、对输入的报文的指定部位信息进行按需数据位宽压缩。
所述报文的指定部位信息可以是头部信息和报文属性的描述符信息。
如将3Kbit大小的数据压缩到1Kbit,或更少的bit位宽,这些数据包含了报文匹配查表可能需要的信息。
S102、从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接。其中,N为大于1的整数。
比较类型包括>,<,=,!=,>=,<=;每组的比较结果为真true或假false,为真时表示组内数据满足所需的判断逻辑,即满足IF(A)或IF(B)的条件判断,其中,A和B对应本实施例中不同组的比较结果,当A或B为真时,执行后续逻辑。
步骤S101和S102为第一级匹配过程。
S103、将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找。
S104、根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由Action RAM输出查表请求。
步骤S103和S104为第二级匹配过程。
本实施例中,从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,包括:
从压缩数据中提取N组数据,每组包括2至3个数据;
对组内的数据进行两两比较或者将组内的每个数据与立即数比较,获得N组比较结果;
将N组的比较结果进行拼接形成N比特(bit)真值位图(bitmap)组合,如,将64个true/false,合并为一个64bit的2进制数据{true/false,.......,true/false}。
本实施例中,将所述真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找,包括:
将N比特bit真值bitmap组合作为关键字key进行TCAM的匹配查找,TCAM的深度为N*2或N*3,TCAM的宽度为N,即支持2N或3N种任意真值混合的比较,且支持单次多个条目命中,单次多个条目的命中意味IF(A&B&C..)的条件满足。
本实施例中,所述由Action RAM输出查表请求,包括:
由Action RAM并发输出多个查表请求,包括需要查哪种类型的表,如hash表,直接表,acl表,还包括每种表的key值提取原则;
当多个查表请求中有相同的查表请求时,按优先级选取其中一个查表请求。
本申请实施例提供的报文匹配查表方法,对报文匹配查表可能需要的信息进行按需压缩,从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,实现了细分条件判断逻辑,通过二次匹配条件真值,只需深度浅、宽度窄的小型TCAM即可完成并发的查表请求,TCAM对应的Action RAM也比较小,与相关技术将所有的判断条件,报文特征字段信息都作为匹配的TCAM键值相比,具有大量节省TCAM和Action RAM的优势。
下面以一个应用示例对本申请实施例进行说明。
图2是本申请应用示例利用两级匹配报文匹配查表的流程示意图。
步骤201、对入口报文的头部信息和描述符信息进行按需数据位宽压缩。
步骤202、从压缩数据中提取64组数据,每组2~3个数据,在组内进行数据比较,包括>,<,=,!=,>=,<=,获得64个比较后的真值,所述真值为一个2进制数,为1时表示比较结果为真,为0时表示比较结果为假。
步骤203、对64个真值使用TCAM匹配,匹配的结果可以单个命中,也可 以多个命中。
步骤204、根据命中的TCAM地址并行查找Action RAM,由Action RAM获取报文需要查找哪些转发表。
图3是对图2所示的步骤201和步骤202的流程示意图。
步骤301、接收业务报文的头部信息和报文的特征属性信息。
步骤302、根据用户配置,从大位宽的报文信息和特征信息内,压缩选取用户需要的768bit的局部报文字段和特征信息,这些信息用于决定查表请求的满足条件。
步骤303、从压缩后的数据中提取8bit,16bit,32bit这3种类型共64组数据;选取3种位宽的数据是希望做到比较数据位宽可选择。
步骤304、读取64组,每组2个或3个数据,共M*2+(64-M)*3个数据,其中,M组包含2个数据,(64-M)组包含3个数据。
步骤305、并行执行64组。
步骤306、每组的2个或3个数据值和设置的立即数比较,或者两两数据比较,比较逻辑可以是>、<、=、!=、>=、<=。
步骤307、每组比较结果组合选取,可以选择单个满足,同时满足,或都不满足。
步骤308、获得64组的比较结果形成64bit的真值bitmap组合。
图4是对图2所示的步骤203和步骤204的流程示意图:
步骤401、将64bit的判断真值作为key进行TCAM的匹配查找,TCAM的深度可以为N*2或N*3或N*4或N*5,宽度为N=64;深度是由N决定,最大可以是2^N次方,可根据实际需要选择深度值。
步骤402、根据TCAM的命中bit和命中地址,并发查找Action RAM;即允许单个或多个条件为真,实现类似IF(A)或IF(B)的判断结果。
步骤403、由命中地址查找Action RAM,由RAM的配置输出查表请求,可以是多个查表请求并发发起,多个Action RAM的结果有相同的查表请求时,按优先级选取其中一个请求。
本申请实施例还提供了一种报文匹配查表系统,如图5所示,所述系统包 括:
字段压缩模块501,设置为对输入的报文的指定部位信息进行按需数据位宽压缩。所述报文的指定部位信息可以是头部信息和报文属性的描述符信息。如将3Kbit大小的数据压缩到1Kbit,或更少的bit位宽,这些数据包含了报文匹配查表可能需要的信息。
比较模块502,设置为从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,N为大于1的整数;
比较类型包括>,<,=,!=,>=,<=;每组的比较结果为真true或假false,为真时表示组内数据满足所需的判断逻辑,即满足IF(A)或IF(B)的条件判断,其中,A和B对应本实施例中不同组的比较结果,当A或B为真时,执行后续逻辑。
匹配模块503,设置为将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找。
查表请求模块504,设置为根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由Action RAM输出查表请求。
本实施例中,比较模块502,设置为从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,将N组比较结果进行真值拼接,包括:
从压缩数据中提取N组数据,每组包括2至3个数据;
对组内的数据进行两两比较或者将组内的每个数据与立即数比较,获得N组比较结果;
将N组的比较结果进行真值拼接形成Nbit真值bitmap组合,如,将64个true/false,合并为一个64bit的2进制数据{true/false,.......,true/false}。
本实施例中,匹配模块503,设置为将所述真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找,包括:
将Nbit真值作为关键字进行TCAM的匹配查找,TCAM的深度为N*2或N*3,TCAM的宽度为N,即支持2N或3N种任意真值混合的比较,且支持单次多个条目命中,单次多个条目的命中意味IF(A&B&C..)的条件满足。
本实施例中,查表请求模块504,设置为由Action RAM输出查表请求,包 括:
由Action RAM并发输出多个查表请求,包括需要查哪种类型的表,如hash表,直接表,acl表,还包括每种表的key值提取原则;
当多个查表请求中有相同的查表请求时,按优先级选取其中一个查表请求。
本申请实施例提供的报文匹配查表系统,对报文匹配查表可能需要的信息进行按需压缩,从压缩数据中提取N组数据,并在组内进行数据比较,获得N组比较结果,实现了细分条件判断逻辑,通过二次匹配条件真值,只需深度浅、宽度窄的小型TCAM即可完成并发的查表请求,TCAM对应的Action RAM也比较小,与相关技术将所有的判断条件,报文特征字段信息都作为匹配的TCAM键值相比,具有大量节省TCAM和Action RAM的优势。
本申请实施例还提供了一种计算机可读存储介质,所述介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现如前实施例所述的报文匹配查表方法。
本申请实施例还提供了一种报文匹配查表终端,包括:
存储器,设置为存储计算机可执行指令;
处理器,设置为执行所述计算机可执行指令,以实现如前实施例所述的报文匹配查表方法。
上文中所公开方法中的全部或一些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由多种物理组件合作执行。一些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。 计算机存储介质包括随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、闪存或其他存储器技术、便携式紧凑磁盘只读存储器(Compact Disc Read Only Memory,CD-ROM)、数字多功能盘(Digital Video Disk,DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。

Claims (10)

  1. 一种报文匹配查表方法,包括:
    对输入的报文的指定部位信息进行按需数据位宽压缩;
    从压缩数据中提取N组数据,并在每组数据的组内进行数据比较,获得N组比较结果,将所述N组比较结果进行真值拼接,其中,所述N为大于1的整数;
    将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找;
    根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由所述Action RAM输出查表请求。
  2. 根据权利要求1所述的报文匹配查表方法,其中,所述从压缩数据中提取N组数据,并在每组数据的组内进行数据比较,获得N组比较结果,将所述N组比较结果进行真值拼接,包括:
    从所述压缩数据中提取所述N组数据,每组包括2至3个数据;
    对每组数据的组内的数据进行两两比较或者将每组数据的组内的每个数据与立即数比较,获得N组比较结果;
    将所述N组比较结果进行真值拼接形成N比特bit真值位图bitmap组合。
  3. 根据权利要求2所述的报文匹配查表方法,其中,将真值拼接结果作为关键字进行TCAM的匹配查找,包括:
    将所述Nbit真值bitmap组合作为关键字进行TCAM的匹配查找,其中,所述TCAM的深度为N*2或N*3,所述TCAM的宽度为N。
  4. 根据权利要求1所述的报文匹配查表方法,其中,所述由所述Action RAM输出查表请求,包括:
    由所述Action RAM并发输出多个查表请求;
    在所述多个查表请求中包括相同的查表请求的情况下,按优先级选取一个查表请求。
  5. 一种报文匹配查表系统,包括:
    字段压缩模块,设置为对输入的报文的指定部位信息进行按需数据位宽压缩;
    比较模块,设置为从压缩数据中提取N组数据,并在每组数据的组内进行数据比较,获得N组比较结果,将所述N组比较结果进行真值拼接,其中,所述N为大于1的整数;
    匹配模块,设置为将真值拼接结果作为关键字进行三态内容寻址存储器TCAM的匹配查找;
    查表请求模块,设置为根据所述TCAM的匹配命中结果查找动作随机存取存储器Action RAM,由所述Action RAM输出查表请求。
  6. 根据权利要求5所述的报文匹配查表系统,其中,所述比较模块是设置为:
    从所述压缩数据中提取所述N组数据,每组包括2至3个数据;
    对每组数据的组内的数据进行两两比较或者将每组数据的组内的每个数据与立即数比较,获得N组比较结果;
    将所述N组比较结果进行真值拼接形成N比特bit真值位图bitmap组合。
  7. 根据权利要求6所述的报文匹配查表系统,其中,所述匹配模块是设置为:
    将所述Nbit真值bitmap组合作为关键字进行TCAM的匹配查找,其中,所述TCAM的深度为N*2或N*3,所述TCAM的宽度为N。
  8. 根据权利要求5所述的报文匹配查表系统,其中,所述查表请求模块是设置为:
    由所述Action RAM并发输出多个查表请求;
    在所述多个查表请求中包括相同的查表请求的情况下,按优先级选取一个查表请求。
  9. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现如权利要求1至4中任一项所述的报文匹配查表方法。
  10. 一种报文匹配查表终端,包括:
    存储器,设置为存储计算机可执行指令;
    处理器,设置为执行所述计算机可执行指令,以实现如权利要求1至4中任一项所述的报文匹配查表方法。
PCT/CN2020/084405 2019-06-14 2020-04-13 报文匹配查表方法、系统、存储介质和终端 WO2020248690A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US17/613,793 US20220231945A1 (en) 2019-06-14 2020-04-13 Message matching table lookup method, system, storage medium, and terminal
EP20822182.0A EP3964966B1 (en) 2019-06-14 2020-04-13 Message matching table lookup method, system, storage medium, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910517975.4 2019-06-14
CN201910517975.4A CN112087389B (zh) 2019-06-14 2019-06-14 一种报文匹配查表方法、系统、存储介质和终端

Publications (1)

Publication Number Publication Date
WO2020248690A1 true WO2020248690A1 (zh) 2020-12-17

Family

ID=73734409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084405 WO2020248690A1 (zh) 2019-06-14 2020-04-13 报文匹配查表方法、系统、存储介质和终端

Country Status (4)

Country Link
US (1) US20220231945A1 (zh)
EP (1) EP3964966B1 (zh)
CN (1) CN112087389B (zh)
WO (1) WO2020248690A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338528A (zh) * 2021-12-23 2022-04-12 锐捷网络股份有限公司 一种表项的查询方法及装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112994886B (zh) * 2021-05-21 2021-08-06 芯启源(南京)半导体科技有限公司 一种用于生成tcam搜索关键字的硬件及实现方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291301A (zh) * 2011-08-10 2011-12-21 杭州迪普科技有限公司 一种报文特征的匹配方法及装置
CN102377664A (zh) * 2010-08-27 2012-03-14 武汉烽火网络有限责任公司 一种基于tcam的区域匹配装置和方法
US20120096220A1 (en) * 2010-01-08 2012-04-19 Board Of Trustees Of Michigan State University Bit weaving technique for compressing packet classifiers
CN107967219A (zh) * 2017-11-27 2018-04-27 北京理工大学 一种基于tcam的大规模字符串高速查找方法

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1809054A (zh) * 2005-01-21 2006-07-26 华为技术有限公司 基于会话初始协议的消息文本解码器
KR100745693B1 (ko) * 2006-09-29 2007-08-03 한국전자통신연구원 Tcam 테이블 관리 방법
CN101252534B (zh) * 2008-03-28 2010-06-02 清华大学 通过链路层报文合并提高移动自组织网络通信容量的方法
CN101350771B (zh) * 2008-07-07 2010-12-29 中国人民解放军国防科学技术大学 三态内容可寻址存储器条目免排序存储方法及其系统
US8195873B2 (en) * 2009-02-06 2012-06-05 Hillel Gazit Ternary content-addressable memory
US9269411B2 (en) * 2012-03-14 2016-02-23 Broadcom Corporation Organizing data in a hybrid memory for search operations
US8924640B2 (en) * 2012-05-14 2014-12-30 Alcatel Lucent Dynamic allocation of records to clusters in a ternary content addressable memory
US9639501B1 (en) * 2012-10-17 2017-05-02 Firquest Llc Apparatus and methods to compress data in a network device and perform ternary content addressable memory (TCAM) processing
CN103117931B (zh) * 2013-02-21 2015-07-01 烽火通信科技股份有限公司 基于哈希表和tcam表的mac地址硬件学习方法及系统
CN104866502B (zh) * 2014-02-25 2020-10-13 深圳市中兴微电子技术有限公司 数据匹配的方法及装置
US20150326480A1 (en) * 2014-05-07 2015-11-12 Alcatel Lucent Conditional action following tcam filters
US9606861B2 (en) * 2015-03-28 2017-03-28 International Business Machines Corporation Armonk Concurrent error detection in a ternary content-addressable memory (TCAM) device
US10778612B2 (en) * 2016-05-26 2020-09-15 Arista Networks, Inc. Variable TCAM actions
CN108512776B (zh) * 2018-03-07 2021-09-14 深圳市风云实业有限公司 交换芯片中tcam表的灵活组合方法、装置及芯片

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120096220A1 (en) * 2010-01-08 2012-04-19 Board Of Trustees Of Michigan State University Bit weaving technique for compressing packet classifiers
CN102377664A (zh) * 2010-08-27 2012-03-14 武汉烽火网络有限责任公司 一种基于tcam的区域匹配装置和方法
CN102291301A (zh) * 2011-08-10 2011-12-21 杭州迪普科技有限公司 一种报文特征的匹配方法及装置
CN107967219A (zh) * 2017-11-27 2018-04-27 北京理工大学 一种基于tcam的大规模字符串高速查找方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
See also references of EP3964966A4 *
SUN PENGHAO; LAN JULONG; LU XIAOYUAN; HU YUXIANG; MA TENG: "Field-trimming Compression Model for Rule Set of Packet Classification", JOURNAL OF ELECTRONICS & INFORMATION TECHNOLOGY, vol. 39, no. 5, 31 May 2017 (2017-05-31), pages 1185 - 1192, XP009524820, ISSN: 1009-5896 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338528A (zh) * 2021-12-23 2022-04-12 锐捷网络股份有限公司 一种表项的查询方法及装置
CN114338528B (zh) * 2021-12-23 2023-06-16 锐捷网络股份有限公司 一种表项的查询方法及装置

Also Published As

Publication number Publication date
CN112087389A (zh) 2020-12-15
EP3964966A4 (en) 2022-06-22
CN112087389B (zh) 2023-01-24
EP3964966A1 (en) 2022-03-09
US20220231945A1 (en) 2022-07-21
EP3964966B1 (en) 2024-08-14

Similar Documents

Publication Publication Date Title
US11102120B2 (en) Storing keys with variable sizes in a multi-bank database
WO2017133344A1 (zh) 应用于dns查询的ip地址列表存储和查询方法
EP3035613B1 (en) Ccn routing using hardware-assisted hash tables
CN101834802B (zh) 转发数据包的方法及装置
CN113519144B (zh) 用于网络设备的精确匹配和三元内容可寻址存储器(tcam)混合查找
US20100195653A1 (en) System for forwarding a packet with a hierarchically structured variable-length identifier
CN101510855B (zh) 一种QinQ报文的处理方法和装置
US20110125749A1 (en) Method and Apparatus for Storing and Indexing High-Speed Network Traffic Data
US9294390B2 (en) Hash table storage and search methods and devices
Pao et al. Efficient hardware architecture for fast IP address lookup
US8848707B2 (en) Method for IP longest prefix match using prefix length sorting
US8923298B2 (en) Optimized trie-based address lookup
WO2020114239A1 (zh) 组播报文的处理方法及装置、存储介质、处理器
WO2020248690A1 (zh) 报文匹配查表方法、系统、存储介质和终端
WO2021135491A1 (zh) 流表的匹配方法及装置
US9485179B2 (en) Apparatus and method for scalable and flexible table search in a network switch
US7403526B1 (en) Partitioning and filtering a search space of particular use for determining a longest prefix match thereon
US9654397B2 (en) Method for looking up data in hash tables and associated network device
US20230041395A1 (en) Method and Device for Processing Routing Table Entries
WO2016101439A1 (zh) 三态内容寻址存储器tcam空间的处理方法及装置
US7409526B1 (en) Partial key hashing memory
US20080175241A1 (en) System and method for obtaining packet forwarding information
US9219659B1 (en) Policy control list keys for network devices
US9032142B2 (en) System and method for storing integer ranges in a memory
Lin et al. Improved IP lookup technology for trie-based data structures

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20822182

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020822182

Country of ref document: EP

Effective date: 20211202

NENP Non-entry into the national phase

Ref country code: DE