Towards Fast and Optimal Grouping of Regular Expressions via DFA Size Estimation

Tingwen Liu, Alex X. Liu, Jinqiao Shi, Yong Sun, Li Guo
2014 IEEE Journal on Selected Areas in Communications  
Regular Expression (RegEx) matching, as a core operation in many network and security applications, is typically performed on Deterministic Finite Automata (DFA) to process packets at wire speed; however, DFA size is often exponential in the number of RegExes. RegEx grouping is the practical way to address DFA state explosion. Prior RegEx grouping algorithms are extremely slow and memory intensive. In this paper, we first propose DFAestimator, an algorithm that can quickly estimate DFA size for
more » ... a given RegEx set without building the actual DFA. Second, we propose RegexGrouper, a RegEx grouping algorithm based on DFA size estimation. In terms of speed and memory consumption, our work is orders of magnitude more efficient than prior art because DFA size estimation is much faster and memory efficient than DFA construction. In terms of the resulting size sum of DFAs, our work is significantly more effective than prior art because we use a much finer grained quantification of the degree of interaction between two RegExes. For example, to divide the RegEx set of the L7-filter system into 7 groups, prior art uses 279.3 minutes and the resulting 7 DFAs have a total of 29047 states, whereas RegexGrouper uses 3.2 minutes and the resulting 7 DFAs have a total of 15578 states. Index Terms-Deep packet inspection, regular expression matching, intrusion prevention systems. Manuscript
doi:10.1109/jsac.2014.2358839 fatcat:uysdrjcrj5edrdqnvvitufdvfi