作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2011, Vol. 37 ›› Issue (13): 52-54. doi: 10.3969/j.issn.1000-3428.2011.13.015

• 软件技术与数据库 • 上一篇    下一篇

基于三态内容寻址存储器的多模式匹配算法

陈 围,莫尧平,陈庶樵   

  1. (国家数字交换系统工程技术研究中心,郑州 450002)
  • 收稿日期:2011-01-10 出版日期:2011-07-05 发布日期:2011-07-05
  • 作者简介:陈 围(1985-),男,硕士研究生,主研方向:多模式匹配,深度包检测;莫尧平,硕士研究生;陈庶樵,副教授
  • 基金资助:
    国家“863”计划基金资助项目(2009AA01A346)

Multi-pattern Matching Algorithm Based on Ternary Content Addressable Memory

CHEN Wei, MO Yao-ping, CHEN Shu-qiao   

  1. (National Digital Switching System Engineering and Technological Research Center, Zhengzhou 450002, China)
  • Received:2011-01-10 Online:2011-07-05 Published:2011-07-05

摘要: 传统模式匹配算法在高速环境下无法实现数据包的实时处理。为此,提出一种基于三态内容寻址存储器(TCAM)的快速多模式匹配算法,通过模式移位将长模式截取为若干个子串,第1级TCAM存储子串,第2级TCAM存储子串的序列编号。搜索模式时,第1级TCAM向后端输出命中表项的编号,第2级TCAM实现序列编号的匹配,从而获得长模式的匹配信息,并通过编号空间划分方法压缩表项数目以提高资源利用率。实验结果表明,该算法可以实现网络数据的高速匹配处理,与基于hash标识的移位存储算法相比,具有空间消耗少的优势。

关键词: 多模式匹配, 三态内容寻址存储器, 空间压缩, 静态随机存取存储器

Abstract: Traditional pattern matching algorithms can not process packet at line-speed under the high speed environment. This paper presents a fast multi-pattern matching algorithm based on Ternary Content Addressable Memory(TCAM) which cuts long pattern to short sub-string stored in the first TCAM by pattern shifting, and stores number in the second TCAM. In the search pattern process, the first TCAM returns the number of matching entry, the second TCAM matches the serial numbers and gives long pattern matching information. This paper proposes a space dividing method to compress the number of TCAM entries and improves the utilized rate of resources. Experimental results show that this algorithm can achieve high-speed packet processing and has lower space consumption compared with the pattern-shifted storing algorithm based on hash mark.

Key words: multi-pattern matching, Ternary Content Addressable Memory(TCAM), space compression, Static Random Access Memory(SRAM)

中图分类号: