1 / 30

High-Speed Regular Expression Matching Engine Using Multi-Character NFA

High-Speed Regular Expression Matching Engine Using Multi-Character NFA. Authors: Norio Yamagaki, Reetinder Sidhu , Satoshi Kamiya Publisher: International Conference on Field Programmable Logic and Applications 2008(FPL ' 2008) Present : Chen-Rong Chang Date: April , 15, 2009.

torin
Download Presentation

High-Speed Regular Expression Matching Engine Using Multi-Character NFA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. High-Speed Regular Expression Matching Engine Using Multi-Character NFA Authors: Norio Yamagaki, Reetinder Sidhu , Satoshi Kamiya Publisher: International Conference on Field Programmable Logic and Applications 2008(FPL ' 2008) Present:Chen-Rong Chang Date:April, 15, 2009 Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C.

  2. Outline • Proposed Method • Phase 1: Regular Expression to 1-Character NFA • Phase 2: 1-character to Multi-character NFA • Performance Comparison

  3. Proposed Method • NFA construction task consists of two sub-tasks which are described in the following sections: • Phase 1: • Conversion of a regex in post-order into its NFA graph that processes a single character every clock cycle. • Phase 2: • Conversion of the above 1-character NFA graph into an NFA graph that can process 2k characters (for desired natural number k) characters every clock cycle.

  4. Phase 1: Regular Expression to 1-Character NFA(1/3)

  5. Phase 1: Regular Expression to 1-Character NFA(2/3) Regex : “a(bc)*(d|e)” Post-order : “abc·*·de|·”

  6. Phase 1: Regular Expression to 1-Character NFA(3/3)

  7. Phase 2: 1-character to Multi-character NFA

  8. N=0 i n j 4 XX 0 1 2 3 6 7 5 Example of NFA construction for the regex “a(bc)*(d|e)”

  9. N=1 n j Xa 4 i XX 0 1 2 3 6 7 Xa 5 Xa

  10. N=2 Xa ab 4 cb XX 0 1 2 3 6 7 Xa 5 Xa

  11. N=3 Xa bc bc ab 4 cb XX 0 1 2 3 6 7 bc Xa 5 Xa

  12. N=4 Xa bc bc ab 4 cb XX cd 0 1 2 3 6 7 bc ad Xa 5 Xa

  13. N=5 Xa bc bc ab 4 cb XX cd,ce 0 1 2 3 6 7 bc ad,ae Xa 5 Xa

  14. N=6 Xa dX bc bc ab 4 cb XX cd,ce 0 1 2 3 6 7 bc ad,ae Xa 5 eX Xa Each final state corresponding to a character position, enabling multiple matches at different positions in the same clock cycle to be accurately reported.

  15. Non-match mode Xa dX bc bc ab 4 cb XX cd,ce 0 1 2 3 6 bc ad,ae Xa 5 eX Xa If only information about whether the input string matches a regex or not is required.

  16. 4-character NFA dXXX XXab XadX Xabc 4 bcbc bcdX abcb cbcb cdXX, ceXX bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 Xabc bcbc bceX Xabc abcd, abce 5 XaeX eXXX XXad, XXae adXX, aeXX

  17. Performance Evaluation(1/3)

  18. Performance Evaluation(2/3)

  19. Performance Evaluation(3/3)

  20. NO!

  21. Range Matching (1/2) Consider an n-bit input I composed of bits xn-1 (MSB) to x0 (LSB). Now consider the Boolean function I ≦ C (C is an n-bit constant, 0≦ C≦ 2n-1) which is 1 for all I ≦ C and 0 otherwise. For I ≧ C: For I ≦ C:

  22. Range Matching (2/2) 0 1 0 0 1 1 0 1

  23. N=0 4 XXXX 0 1 2 3 6 8 7 9 5

  24. N=1 XXab 4 XXXX 0 1 2 3 6 8 7 9 5 XXad, XXae

  25. N=2 XXab Xabc 4 bcbc bcbc XXXX 0 1 2 3 6 8 7 9 bcbc Xabc Xabc 5 XXad, XXae

  26. N=3 XXab Xabc 4 bcbc cbcb abcb bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 bcbc abcd, abce Xabc Xabc 5 XXad, XXae

  27. N=4 XXab XadX Xabc 4 bcdX bcbc abcb cbcb bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 bcbc abcd, abce Xabc Xabc 5 XXad, XXae

  28. N=5 XXab XadX Xabc 4 bcdX bcbc abcb cbcb bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 abcd, abce Xabc bcbc Xabc bceX 5 XaeX XXad, XXae

  29. N=6 XXab XadX Xabc 4 bcdX bcbc abcb cbcb cdXX, ceXX bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 abcd, abce Xabc bcbc Xabc bceX 5 XaeX XXad, XXae adXX, aeXX

  30. N=7 dXXX XXab XadX Xabc 4 bcdX bcbc abcb cbcb cdXX, ceXX bcbc XXXX cbcd, cbce 0 1 2 3 6 8 7 9 abcd, abce Xabc bcbc Xabc bceX 5 XaeX XXad, XXae adXX, aeXX eXXX

More Related