## 3 A Novel Multi-Pattern-Matching Algorithm
### Proposed Algorithm  
Figure 6 shows the automaton of the pattern-matching algorithm proposed in this study. A state can represent more than one character in the automaton created using the \"ABKKLMN\", \"ABKXYZMNOP\", and \"ABKXYZABCD\" sample patterns. In this direction, the automaton created can process more than one packet payload character at once. The character block, which needs to be processed while moving from one state to another, is obtained from the subpattern table. State and character block fields in this table allow proceeding through the automaton. For example, switching from State 1 to State 3 enables the processing of the KXYZ character block (Figure 6). As seen in Figure 6, the number of characters processed in a transition between two states depends on whether the patterns that form the automaton have common roots. For instance, since the common root of the \"ABKKLMN\", \"ABKXYZMNOP\", and \"ABKXYZABCD\" patterns is \"AB\", the character block consisting of two characters is processed in the transition from State 0 to 1. Again, since the common root of the \"ABKXYZMNOP\" and \"ABKXYZABCD\" patterns is \"ABKXYZ\", the character block \"KXYZ\" comprising four characters is processed in the transition from State 1 to 3. If a pattern does not have a common root with other patterns, only one state is formed for the pattern, and the character block consisting of all the characters of the pattern is processed in the transition from State 0 to the created state. Figure 5: AC automaton created using sample patterns “ABKKLMN”, “ABKXYZMNOP”, and “ABKXYZABCD”. The PA performs the memory reduction twice on the traditional automaton. The first memory reduction operation relates to the ability of the algorithm to process multiple bytes at once. Since a state can represent more than one byte in the proposed automaton, there are fewer states compared to the traditional automaton. The automatons in Figures 5 and 6 are examples of this situation. While the number of states is five (Figure 6) in the PA automaton, it is 19 in the AC automaton (Figure 5) created with the same patterns. As a result, the memory requirement for storing the states in the PA automaton is less than that of the traditional one. The second memory reduction operation is to generate a code representing all the transitions for each state and apply this process to the PA. A code is generated using the P\({}^{3}\)FSM algorithm. With the P\({}^{3}\)FSM approach, only one entry is stored in memory for each state in a DFA. This entry stores the possible transitions for the state it represents and is called the state code. Storing only one entry in memory for each state in a DFA instead of storing all DFA transitions in different memory entries makes it possible to store state transitions in a minimum-level memory space. The process of generating state codes has been explained through the automaton created using the \"HERS\", \"HIS\", and \"SHE\" sample patterns (Figure 7). Figure 6: Automaton created using sample patterns “ABCKLMN”, “ABKXYZMNOP”, and “ABKXYZABCD”. Figure 7: DFA created using sample patterns “HERS”, “HIS”, and “SHE”. The first step in generating state codes is to obtain groups from the DFA. Groups are formed by combining states leading to the same states. In this direction, the G1[S0][H], G2[S0][S], G3[S1][E], G4[S1, S5][I], G5[S2, S7, S9][H], G6 [S3, S8][R], G7[S4][S], G8[S5][E], and G9[S6][S] groups are formed. The next step after the creation of the groups is the creation of clusters. The C1'[G1, G5][S0, S2, S7, S9][H], C2'[G2, G7, G9][S0, S4, S6][S], C3'[G3, G8][S1, S5][E], C4'[G4][S1, S5][I], and C5'[G6][S3, S8][R] clusters are formed by combining groups with the same character. The next step is to merge all clusters that do not have a common state. Accordingly, the C1[C1', C2', C3', C5'][G1, G5, G2, G7, G9, G3, G8, G6][S0, S2, S7, S9, S4, S6, S1, S5, S3, S8][H, S, E, R], and C2[C4'][G4][S1, S5][I] clusters are formed. After reducing the number of clusters to two, the next step is to generate group codes (Table 1).