A Scalable Architecture For High- Throughput Regular-Expression Pattern Matching Authors : Benjamin C. Brodie, Ron K. Cytron, David E. Taylor Presenter.

Slides:



Advertisements
Similar presentations
4b Lexical analysis Finite Automata
Advertisements

Author : Xinming Chen,Kailin Ge,Zhen Chen and Jun Li Publisher : ANCS, 2011 Presenter : Tsung-Lin Hsieh Date : 2011/12/14 1.
Authors: Wei Lin, Bin Liu Publisher: ICPADS, 2008 (IEEE International Conference on Parallel and Distributed Systems) Presenter: Chia-Yi, Chu Date: 2014/03/05.
© 2004, Robert K. Moniot Binary and Hex How to count like a computer.
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Lecture 24 Coping with NPC and Unsolvable problems. When a problem is unsolvable, that's generally very bad news: it means there is no general algorithm.
DAT2343 Comparison of The LMC and General Computer Models © Alan T. Pinck / Algonquin College; 2003.
A Memory-Efficient Reconfigurable Aho-Corasick FSM Implementation for Intrusion Detection Systems Authors: Seongwook Youn and Dennis McLeod Presenter:
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
1 Searching Very Large Routing Tables in Wide Embedded Memory Author: Jan van Lunteren Publisher: GLOBECOM 2001 Presenter: Han-Chen Chen Date: 2010/01/06.
Advanced Topics Object-Oriented Programming Using C++ Second Edition 13.
CSCI 3 Chapter 1.8 Data Compression. Chapter 1.8 Data Compression  For the purpose of storing or transferring data, it is often helpful to reduce the.
1 FPGA-based ROM-free network intrusion detection using shift-OR circuit Department of Computer Science and Information Engineering National Cheng Kung.
1 Regular expression matching with input compression : a hardware design for use within network intrusion detection systems Department of Computer Science.
Elementary Data Types Scalar Data Types Numerical Data Types Other
1 Performing packet content inspection by longest prefix matching technology Authors: Nen-Fu Huang, Yen-Ming Chu, Yen-Min Wu and Chia- Wen Ho Publisher:
Indexing and Searching
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
1 HEXA : Compact Data Structures for Faster Packet Processing Department of Computer Science and Information Engineering National Cheng Kung University,
CS 255: Database System Principles slides: Variable length data and record By:- Arunesh Joshi( 107) Id: Cs257_107_ch13_13.7.
Data Compression Basics & Huffman Coding
A Fast Algorithm for Multi-Pattern Searching Sun Wu, Udi Manber May 1994.
Rosen 5th ed., ch. 11 Ref: Wikipedia
A High Throughput String Matching Architecture for Intrusion Detection and Prevention Lin Tan, Timothy Sherwood Appeared in ISCA 2005 Presented by: Sailesh.
Invitation to Computer Science 5th Edition
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Number Systems Spring Semester 2013Programming and Data Structure1.
Lecture 23: Finite State Machines with no Outputs Acceptors & Recognizers.
Overview of Previous Lesson(s) Over View  Strategies that have been used to implement and optimize pattern matchers constructed from regular expressions.
An Improved Algorithm to Accelerate Regular Expression Evaluation Author: Michela Becchi, Patrick Crowley Publisher: 3rd ACM/IEEE Symposium on Architecture.
Fast and Memory-Efficient Regular Expression Matching for Deep Packet Inspection Authors: Fang Yu, Zhifeng Chen, Yanlei Diao, T. V. Lakshman, Randy H.
Overview of Previous Lesson(s) Over View  An NFA accepts a string if the symbols of the string specify a path from the start to an accepting state.
TFA : A Tunable Finite Automaton for Regular Expression Matching Author: Yang Xu, Junchen Jiang, Rihua Wei, Tang Song and H. Jonathan Chao Publisher: Technical.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture of a compiler PART II:
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 3, 09/11/2003 Prof. Roy Levow.
CMSC 330: Organization of Programming Languages Finite Automata NFAs  DFAs.
Lexical Analysis S. M. Farhad. Input Buffering Speedup the reading the source program Look one or more characters beyond the next lexeme There are many.
Overview of Previous Lesson(s) Over View  Symbol tables are data structures that are used by compilers to hold information about source-program constructs.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Cross-Product Packet Classification in GNIFS based on Non-overlapping Areas and Equivalence Class Author: Mohua Zhang, Ge Li Publisher: AISS 2012 Presenter:
A Scalable Architecture For High-Throughput Regular-Expression Pattern Matching Yao Song 11/05/2015.
Author : Yang Xu, Lei Ma, Zhaobo Liu, H. Jonathan Chao Publisher : ANCS 2011 Presenter : Jo-Ning Yu Date : 2011/12/28.
Author : Randy Smith & Cristian Estan & Somesh Jha Publisher : IEEE Symposium on Security & privacy,2008 Presenter : Wen-Tse Liang Date : 2010/10/27.
Author : Weirong Jiang, Yi-Hua E. Yang, and Viktor K. Prasanna Publisher : IPDPS 2010 Presenter : Jo-Ning Yu Date : 2012/04/11.
Digital System Design using VHDL
Computing Machinery Chapter 4: Finite State Machines.
TFA: A Tunable Finite Automaton for Regular Expression Matching Author: Yang Xu, Junchen Jiang, Rihua Wei, Yang Song and H. Jonathan Chao Publisher: ACM/IEEE.
A Fast Regular Expression Matching Engine for NIDS Applying Prediction Scheme Author: Lei Jiang, Qiong Dai, Qiu Tang, Jianlong Tan and Binxing Fang Publisher:
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
LaFA Lookahead Finite Automata Scalable Regular Expression Detection Authors : Masanori Bando, N. Sertac Artan, H. Jonathan Chao Masanori Bando N. Sertac.
Chapter 2 Scanning. Dr.Manal AbdulazizCS463 Ch22 The Scanning Process Lexical analysis or scanning has the task of reading the source program as a file.
An Improved DFA for Fast Regular Expression Matching Author : Domenico Ficara 、 Stefano Giordano 、 Gregorio Procissi Fabio Vitucci 、 Gianni Antichi 、 Andrea.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Advanced Algorithms for Fast and Scalable Deep Packet Inspection Author : Sailesh Kumar 、 Jonathan Turner 、 John Williams Publisher : ANCS’06 Presenter.
Invitation to Computer Science, C++ Version, Fourth Edition
Finite State Machines Dr K R Bond 2009
Lecture 5 Transition Diagrams
Chapter 2 Scanning – Part 1 June 10, 2018 Prof. Abdelaziz Khamis.
Lexical analysis Finite Automata
Invitation to Computer Science, Java Version, Third Edition
Indexing and Searching (File Structures)
Regular Expression Matching in Reconfigurable Hardware
4b Lexical analysis Finite Automata
13 Digital Logic Circuits.
4b Lexical analysis Finite Automata
Compact DFA Structure for Multiple Regular Expressions Matching
Finite Automaton with output
Presentation transcript:

A Scalable Architecture For High- Throughput Regular-Expression Pattern Matching Authors : Benjamin C. Brodie, Ron K. Cytron, David E. Taylor Presenter : Yu-Tso Chen Date : September 10, 2007 Publisher : ISCA’06

2 Outline Introduction Regular expression Approach and architecture Optimizations Performance

3 Introduction The problem of discovering credit card numbers, currency values, or telephone numbers requires a more general specification mechanism. For such applications, the most widely used pattern- specification language is regular expressions.

4 Introduction We describe a new high throughput FSM representation and its construction algorithm. State transitions are triggered by a sequence of m symbols, rather than by a single symbol. Character and sequence encoding to reduce a transition table’s column count, run-length coding to compress the transition table.

5 Regular expression \$[0 - 9]+(\.[0 - 9]{2}){0,1} A match must begin with ‘$’. The match continues only by the appearance of one or more decimal digits. Optionally, the match may continue with a decimal point followed by exactly two decimal digits. EX: “$3”, “$34”, “$347”, “$347.12”

6 FSM example Regular expression: \$[0 - 9]+(\.[0 - 9]{2}){0,1} (a) symbol “ ∼ ” denotes all symbols not in{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, $,. } (b) Transition table for the FSM; if Σ is the ASCII character set, then the table has 256 columns.

7 Approach A set of regular expressions is presented to the Regular Expression Compiler. Generating three tables: symbol ECI (Equivalence Class Identifier) table, indirection table, transition table. The Regular Expression Circuits implement high- throughput FSMs.

8 Overall Architecture Regular Expression Compiler Regular Expression Circuits

9 A High-Throughput FSM Modern interconnection interfaces transport multiple bytes per cycle, making the FSM the “bottleneck” in terms of achieving higher throughput. We consider an extension of the FSM that allows it to perform a single transition based on a string of m symbols. EX: Based on the table in Figure 2(b), if the current state is E, then the input sequence “2$” would result in a transition to state B: δ 2 (E, 2$) = δ(δ(E, 2), $) = B.

10 New FSM Because it performs multiple transitions per cycle, the higher throughput FSM can traverse an accepting state of the original FSM during a transition. Each “accept” may be required to report the origination point of the match in the target. To support recognition of accept and restart conditions, we augment the traditional transition function with two flags (bits): The first flag indicates a restart transition and the second flag indicates an accept transition. (like Moore or Mealy model?) The automaton includes state variables b and e to record the beginning and end of a match; initially, b =e = 0, and the index of the first symbol of the target is 1.

11 black: e is advanced by m. A match is in progress and the portion of the target string participating thus far begins at position b and ends at position e, inclusively. red only: e is advanced by m and a match is declared. The target substring causing the match starts at position b and ends at position e. green only: b is advanced by m and e is set to b. The automaton is restarting the match process. red and green: The red action is performed before the green action. Transition on a red edge indicate a pattern match Transition on a green edge indicates the first symbol of a new potential match.

12 Alphabet Encoding The size of a FSM’s transition table (δ) increases exponentially with the length of the input sequence consumed in each cycle. Given a transition table δ : Q × Σ → Q, an O(|Σ|2|Q|) algorithm for partitioning Σ into a (typically) reduced set of equivalence classes. We call the index into the encoded table an ECI (Equivalence class Identifier). Of the 16 possible two-character input sequences, the transition table requires only 8 columns due to the ECI mapping.

13 Example

14 High-Throughput with Encoding 1. The FSM d is constructed for r (regular expression) in the usual way. 2. A set of transitions ρ is computed that would allow the automaton to accept based on starting at any position in the target. This is accomplished by simulating for each state a λ- transition to q0. Specifically, ρ is computed as follows: ρ ← ∅ foreach p ∈ Q do foreach a ∈ Σ do ρ ← ρ ∪ {(p, a) → δ(q0, a) }

15 High-Throughput with Encoding 3. From d and ρ, the base FSM 1 is constructed by the algorithm in Figure 8. The results of that algorithm are shown in Figure 5 for our running example. 4. State minimization is performed on a high-throughput FSM by the standard algorithm, except that states are initially split by incoming edge color (black, green, red), instead of by whether they are final or nonfinal states in a traditional FSM. 5. Given a FSM k, a higher throughput FSM 2k with alphabet encoding is constructed by the stride-doubling algorithm.

16 The Symbol ECI Encoding Block Transforming a sequence of m symbols into an ECI, suitable for presentation to a transition table.

17 Transition Table Compression via Run- Length Coding Run-length coding is a simple technique that can reduce the storage requirements for a sequence of symbols EX: String: aaaabbbcbbaaa Run-length coding: 4(a)3(b)1(c)2(b)3(a)

18 Supporting Variable-Length Columns in Memory The entire table will typically be too large to be fetched in one memory access. Transition Table Memory (TTM) x is the number of entries per memory word in the TTM. The compressed columns should be placed in physical memory as compactly as possible.

19 Supporting Variable-Length Columns in Memory Indirection table Once the Indirection Table entry is retrieved using the input symbol ECI, the pointer is used to read the first memory word from the TTM. An entire column is accessed by starting at address index and reading w consecutive words from the TTM, where w is given by: The index and count values determine which entries in the first and last memory words participate in the column

20 Supporting Variable-Length Columns in Memory

21 Supporting Variable-Length Columns in Memory State Selection Precompute prefix sums of the compressed entries The old count value is translated into Word Count and Terminal Index values. The Initial Index is used to retrieve a set of mask bits from the Initial Index Mask ROM. These bits are used to mask off preceding entries in the memory word that are not part of the transition table column. Terminal index = (count + index - 1) mod x

22 Supporting Variable-Length Columns in Memory The run-length sums for entries that are not part of the transition table column are forced to the value of the Max Run-Length Register. Forcing the run-length sums of trailing entries to be the maximum run-length sum value simplifies the Priority Encoder that generates the select bits for the multiplexor that selects the next state.

23 State select block

24 Optimizations Improving the effectiveness of run-length coding State reordering (knapsack problem)

25 Optimizations Memory packing For example, the compressed column associated with ECI 1 in Figure 11 occupies 3 entries and could fit in a single word of the TTM. However, the column began at a location that caused it to span 2 memory words instead of 1. This problem is a variant of the classical fractional knapsack problem The basic idea is to find the longest run-length encoded column and chose it first. We pack it into memory words guaranteeing that it achieves the best possible packing. We then take the number of remaining entries in the last column and apply subset sum on it with the remaining run-length encoded columns. (greedy)

26 Performance Snort 是一套開放原始碼 (open source) 的網路入侵預防 軟體 (IPS) 與網路入侵偵測軟體 (IDS)