随着深度包检测规则数目的剧烈增长,为了适应网络处理的需求,必须对表示正则表达式的DFA(deterministicfiniteautomata。确定的有限自动机)进行高效的存储.一方面,对DFA的状态点数目进行压缩,提出了一种复合的FSM(有限自动机)的构造方法,通过对正则表达转化成DFA的状态点数目复杂度的分析,将不同复杂度的正则表达式采用不同的方式构建DFA,使得所有平方级和指数级复杂度的状态点数目降低到了线性级.另一方面.对DFA的状态转移数目进行压缩,给出了一种高效的压缩算法,即WD。FA(weighteddelayedinputDFA,带权延迟DFA)算法,对于任意复杂度的正则表达式都可以将状态转移数目压缩为原来的5%左右,相对于D2FA(delayedinputDFA.延迟的DFA)有更好的压缩能力,并且使得D2FA是WD。FA在权值为0情况下的特例.实验结果表明,有限自动机的状态点数目能够控制在线性级,并且在状态点压缩的基础上将状态转移数目压缩为原来的7%.
With the rapid increase in the number of deep packet inspection rules, it is necessary to store deterministic finite automata (DFA) representations of regular expressions efficiently in order to meet the practical requirements of network processing. First, a new hybrid FSM construction method is proposed for compressing the states of DFA. DFAs are built in different ways for the regular expressions. By analyzing the states of the converted DFAs, the distinguished complexities of DFAs become noticeable. This leads to a change in state of the DFA from a quadratic/exponential expression to a linear expression. Next, an efficient compressing algorithm, called Weighted Delayed Input DFA (WD2FA), is proposed for state transitions of the DFAs. This algorithm can reach a reduction rate of about 95% for the regular expressions with any complexity. The analysis shows that the performance of the WD2FA is better than the delayed input DFA (D2FA), and D2FA is a special case of WD2FA with weight 0. The experimental results show that the number of states for the FSM can be controlled at the level of linearity, and transitions are reduced to 7% based on the compression states.