# NetAP: Adaptive Polling Technique for Network Packet Processing in Virtualized Environments
## 3 Design
### Adaptation Using Golden-Section Search
#### 3.4.1 Considerations for Alternative Algorithms
When the corresponding VM is selected by the CPU scheduler, the VM can generate a vIRQ, Therefore, the time is not deterministic. This causes fluctuating end-user latency. In contrast, NetAP offers stable and low latency by operating at periodic intervals determined by the searching algorithm, thereby increasing the efficiency of packet processing. ### Third Experiment: Different Packet Sizes and System Environments

In this experiment, we evaluated NetAP for different packet sizes and system environments. We intended to demonstrate that NetAP with the current parameters is effective in different environments, and that, consequently, many of the pre-examination and workload analysis steps are not mandatory. First, we evaluated NetAP for various packet sizes: 128, 256, 512, and 1024 B. In this experiment, we ran a single VM executing Netperf while using a single thread for 60 s and applied NetAP after 20 s, the same as in the previous experiments described in Section 4.2. Figure 5 shows that performance decreases briefly when NetAP starts to run at 20 s in order to determine the near-optimal interval; then, the performance increases significantly. Table 5 depicts the relative bandwidth, CPU utilization, and latency compared to the unmodified VirtIO, which shows that NetAP improves the performance by at least 53.53% and by a maximum of 148.83%. The results of unmodified VirtIO were collected in the first 20 s, and the results of NetAP were collected in last 20 s. The CPU utilization of the host drastically decreased while the overall performance increased. Such efficient CPU utilization is an important factor in the cloud system, which indicates that NetAP more efficiently handles network packets, allowing for other CPU-intensive threads or different VMs to use more CPU resources. In addition, the average latency decreased by 15.36%. For 256-B packets, the standard deviation of latency increased by 15.36%, but the average latency decreased significantly, by 52.22%. As a result, NetAP provides higher network performance with fewer CPU resources for both large packets and the small packets that incur severe CPU contention. Second, we constructed an additional experimental setup, as follows: two servers equipped with Intel Xeon E5-2650 v2 CPUs (8 cores, 3.4 GHz) and 64 GB of memory were connected to a 10 GbE \begin{table}
\begin{tabular}{c c c c c c c c c} \hline  & \multicolumn{4}{c}{**4 VMs, 2 Threads Each**} & \multicolumn{4}{c}{**5 VMs, 1 Thread Each**} \\ \hline
**Period** & **VirtIO** & **Adapting** & **Adapted** & **Cf.** & **VirtIO** & **Adapting** & **Adapted** & **Cf.** \\ \hline Bandwidth (Gbps) & 5.02 & 5.76 & 5.73 & 114.16\% & 3.86 & 4.93 & 5.04 & 130.37\% \\ \hline CPU-guest (\%) & 558.42 & 572.88 & 573.24 & 102.65\% & 513.06 & 520.50 & 519.30 & 101.22\% \\ \hline CPU-host (\%) & 32.10 & 19.62 & 21.36 & 66.54\% & 72.00 & 37.98 & 39.54 & 54.70\% \\ \hline Latency-mean (us) & 0.79 & 0.69 & 0.69 & 87.36\% & 0.65 & 0.50 & 0.49 & 75.93\% \\ \hline Latency-stddev (us) & 52.08 & 45.73 & 44.24 & 84.94\% & 24.69 & 12.31 & 10.08 & 40.82\% \\ \hline \end{tabular}
\end{table} 
Table 4: Detailed performance and CPU utilization in 4 VM-1T and 5 VM-1T. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline  & \multicolumn{4}{c}{**2 VMs, 4 Threads Each**} & \multicolumn{4}{c}{**3 VMs, 3 Threads Each**} \\ \hline
**Period** & **VirtIO** & **Adapting** & **Adapted** & **Cf.** & **VirtIO** & **Adapting** & **Adapted** & **Cf.** \\ \hline Bandwidth (Gbps) & 5.27 & 5.88 & 6.05 & 114.91\% & 5.34 & 5.93 & 5.89 & 110.31\% \\ \hline CPU-guest (\%) & 549.36 & 552.66 & 570.06 & 103.77\% & 561.66 & 568.44 & 574.86 & 102.35\% \\ \hline CPU-host (\%) & 36.36 & 11.34 & 12.78 & 35.15\% & 31.32 & 18.24 & 17.10 & 54.60\% \\ \hline Latency-mean (us) & 0.76 & 0.67 & 0.67 & 87.21\% & 0.85 & 0.76 & 0.76 & 89.49\% \\ \hline Latency-stddev (us) & 49.69 & 53.87 & 47.92 & 96.44\% & 60.86 & 61.35 & 54.06 & 88.82\% \\ \hline \end{tabular}
\end{table} 
Table 3: Detailed performance and CPU utilization in for 2 VM-4T and 3 VM-3T. switch.