# Length-Bounded Hybrid CPU/GPU Pattern Matching Algorithm for Deep Packet Inspection
## 4 Experiments
### Experimental Results  
Figures 4-8 show the preliminary experiment results, in which the notations \"LHPMA-AC\" and \"HPMA-AC\", respectively, indicate the LHPMA and HPMA matching methods, and both methods ported the AC algorithm to handle the full pattern matching task. On the other hand, the notations \"AC-GPU\" and \"AC-CPU\" are the matching methods that directly inspect the packets by the AC algorithm using the GPU and CPU, respectively. Before exhibiting the result of LHPMA, we first discuss some factors that affect the GPU processing performance. Figure 4 illustrates the data transfer rate between the CPU and GPU with different size of the full matching buffer. The \(x\)-axis represents the buffer sizes, and the \(y\)-axis indicates the average data transfer rates performed in Gbps. It can be observed that the data transfer rate presented was very low when the buffer size was small; namely, few packet payloads were transferred at one time, and the overall GPU overhead would be significantly high. For instance, when the buffer size was 0.25 MB, the data transfer rate was 1.95 Gbps. On the other hand, when the buffer size was large enough, more packet payloads were transferred together at one time, and the performed data transfer rate would be higher. For instance, when the buffer size was 256 MB, the data transfer rate was 35.1 Gbps. Note that the optimal solution is not setting the full matching buffer size as large as possible, since too large a buffer size may cause the packet payloads in this buffer to wait for too much time and thus affect the overall performance. Therefore, the proper choice was located at the turning point of the data transfer rate convergence, 256 MB. Figure 5 illustrates the GPU performance with different sizes of the full matching buffer. The \(x\)-axis represents the buffer sizes, and the \(y\)-axis indicates the average throughputs performed in Gbps. Here, both short (100-byte) and long (1460-byte) packet payload sets were prepared, which were represented with \"AC-GPU-100\" and \"AC-GPU-1460\", respectively. As \begin{table}
\begin{tabular}{c c c} \hline \hline
**Payload Length (Bytes)** & **Count** & **Ratio** \\ \hline \(<\)100 & 3334 & 0.009 \\
100–300 & 6664 & 0.018 \\
300–500 & 32,919 & 0.090 \\
500–700 & 14,670 & 0.040 \\
700–900 & 4326 & 0.012 \\
900–1100 & 3946 & 0.011 \\
1100–1300 & 4441 & 0.012 \\ \(>\)1300 & 297,419 & 0.809 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Payload length distribution of input traffic. Figure 4: The data transfer rate between CPUs and GPUs with different full matching buffer sizes. performance became low with small buffer size, especially in the case of AC-GPU-1460 with 2 MB buffer size. In addition to the data transfer rate, the number of packet payloads were few in this case, resulting in low GPU thread utilization and thus degrading overall performance. In other words, the input payload set length also affects the GPU efficiency. Shorter packets can be collected into a larger number of packets, which is favorable for the parallel processing power of GPU--hence, the efficiency of AC-GPU-100 displayed from 5.37 Gbps to 9.03 Gbps, which was higher than that of AC-GPU-1460, from 2.71 Gbps to 6.10 Gbps. Figure 6 presents the GPU performance with different lengths of payload sets. Here, a total of six payload sets were prepared, which are 250-byte to 1460-byte (the maximum length of payload) long, as represented in the \(x\)-axis. The \(y\)-axis indicates the average throughputs performed in Gbps. The result shows that shorter payloads are favorable to the GPU efficiency, in which the GPU performed up to 8.0 Gbps with a 250-byte set. As the payload length increased, an obvious performance degradation occurred in the case of 750-byte set, and the throughput gradually decreased to 5.9 Gbps with a 1460-byte set.