## 4 Implementation and Evaluation
### Implementation
#### 4.2.1. State Search and Insertion Time  
We proposed that MSSA be used to store the state and that the state be expressed with type, offset, and length. This experiment investigates the effects of state number, type, offset, and length on state search/insert time. The purpose of this experiment is to see how the number of states stored in the switch affects state search and insertion time. The global state area in the experiment stored 10, 100, 1000, 10,000, 100,000, and 1,000,000 states, each with a length of 1 byte. In the experiment, packet matching entries used the following actions: (1) OUTPUT(s), where the OUTPUT action must find the state s = {gs, 0, 8} and forward the packet based on the state value; and (2) SET(s, 1), OUTPUT(0), where the SET action inserts a state s = {gs, 0, 8} and the OUTPUT action forwards the packet to port 0. The experimental results show that, regardless of the number of stored states, the forwarding latency of a packet is 13.78 us when searching or inserting a state during the packet processing, indicating that the number of stored states has no effect on the state search/insertion time. Because the {type, offset, length} that represent the state are relative to the state's pointer. Obviously, the number of states stored in the switch has no effect on the time it takes the pointer to read and write data. Because all states are stored in the global state area in this experiment, they are all global states. In Experiment (2), we examined the effect of state type on the time required to search for/insert a state. (2) Type of state  
In this experiment, we used Sprint Testcenter C50 to generate 10 Gbps, 64 bytes, and 5 different IPv4 destination flows, each matching 5 entries. All of these entries use the SET (s, 0), OUTPUT (s) action processing packet. The offset (0) and length (8 bits) of state s are the same in different entries, but the types are different, namely packet header field, packet state, flow state, table state, and global state. Figure 10 depicts the experimental results. The type of state has no effect on the time it takes to search for or insert a state, and the time it takes to search for or insert a state is constant. The reason for this is that, prior to executing the action processing packet, the base \begin{table}
\begin{tabular}{c c} \hline CPU & Intel Xeon CPU E7-4809 v4 @2.10 GHz \\ \hline Caches & 32 k L1 i and L1 d, 256 KB L2, 20 MB L3 \\ \hline Memory & 128 G DDR3 @ 1333 MHz, 4-channels \\ \hline NIC & Intel XL710, PCI Express 3.0/x8, 4*10 Gb \\  & Intel I350, PCI Express 3.0/x8, 4*1 Gb \\ \hline DPDK & v19.11 \\ \hline \end{tabular}
\end{table} 
Table 4: System-under-test data sheet. \begin{table}
\begin{tabular}{c c} \hline \hline
**Category** & **Actions** \\ \hline Arithmetic logic & add, sub, srl, sll, and, or, xor, nor, not, set, insert, del, \\  & calculate\_checksum \\ \hline Forwarding & goto\_table, output, flood \\ \hline Branch & jump, compare\_jump \\ \hline \end{tabular}
\end{table} 
Table 3: Pipeline actions. address of all types of state areas and the packet header were obtained. The subsequent selection of the base address based on the type, as well as the process of searching/inserting the state based on offset and length, have nothing to do with the type. As a result, no matter what type of state has been stored, searched for, and inserted in Experiment (1), it has no effect on the state's search/insertion time. (3) Offset of state  
Use {type, offset, length} to represent the state, which explains the state's position indirectly. The benefit of this method is that the number and type of existing states have no effect on the time it takes to search for and insert states. The offset and length of the state, on the other hand, may affect the search/insertion time. The effect of offset on state search/insertion time was investigated in this experiment. The time required to find/insert the global state with an offset of 0-8 bits and a length of 8 bits was repeated 1,000,000 times in the experiment.