## 6 Performance Results
### Network and Encryption Latency  
Table 3 lists network latency results for all cases mentioned in Table 2. The network and encryption latency is defined as the time which passes from the time when the TCP/UDP packet starts in the encryption process to the time when decryption of the same packet is finished on the receiving end of the setup. These values are logged on real-time devices used during the tests. Table 3 shows that all tests without encryption have lower latencies when compared to tests with encryption. The maximum difference is lower than 1 ms (Case 11). This proves that having encryption of the data does not have a large influence to overall video latency. Summarized results for Group s1, 2 and 3 are shown in Figures 14-16, respectively. Figure 14: Internet network latency (128 bytes encryption). Figure 15: Internet network latency (256 bytes encryption). \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multicolumn{2}{c}{**Test Name**} & \multicolumn{1}{c}{**Protocol**} & \multicolumn{1}{c}{**Encoding**} & \multicolumn{1}{c}{**Encrypted**} & \multicolumn{1}{c}{**Data Length**} & \multicolumn{1}{c}{**Arithmetic Mean [ms]**} & \multicolumn{1}{c}{**Median [ms]**} & \multicolumn{1}{c}{**Min Value [ms]**} & \multicolumn{1}{c}{**Max Value [ms]**} & \multicolumn{1}{c}{**Standard Deviation [ms]**} \\ \hline \multirow{4}{*}{Group 1} & Case 1 & TCP & H264 & No & 128 & 19.38 & 18.74 & 6.19 & 67.64 & 9.16 \\  & TCP & H264 & Yes & 128 & 20.68 & 19.57 & 6.94 & 69.84 & 6.99 \\ \cline{2-10}  & Case 2 & UDP & H264 & No & 128 & 12.56 & 11.36 & 7.54 & 39.52 & 4.45 \\  & UDP & H264 & Yes & 128 & 16.41 & 15.05 & 7.71 & 47.42 & 6.26 \\ \cline{2-10}  & Case 3 & TCP & MJPEG & No & 128 & 29.73 & 29.07 & 6.18 & 71.86 & 13.54 \\  & TCP & MJPEG & Yes & 128 & 31.45 & 30.73 & 6.94 & 73.68 & 11.47 \\ \cline{2-10}  & Case 4 & UDP & MJPEG & No & 128 & 18.80 & 18.08 & 8.73 & 48.98 & 6.34 \\  & UDP & MJPEG & Yes & 128 & 26.22 & 25.74 & 12.00 & 58.99 & 8.58 \\ \hline \multirow{4}{*}{Group 2} & Case 5 & TCP & H264 & No & 256 & 16.30 & 15.33 & 7.27 & 64.00 & 7.17 \\  & TCP & H264 & Yes & 256 & 16.93 & 16.60 & 8.13 & 38.92 & 5.23 \\ \cline{2-10}  & Case 6 & UDP & H264 & No & 256 & 10.56 & 9.76 & 7.43 & 27.51 & 2.77 \\  & UDP & H264 By looking at the network latency information, it is possible to get a deeper insight into the causes of the overall latency of the video. Network latency itself results from several factors: packet processing, egress and ingress delays, packets queuing delay and transmission and propagation delays. However, the measurements presented here correspond to network latency of the packets together with the time taken for the encryption/decryption process. Similarly, for video latency measurements in this scenario, all cases have a mean latency value lower in tests without encryption than in tests with encryption. In this scenario, for each transport protocol and encoding algorithm, six tests were conducted: three tests with unencrypted video streams and three tests using encryption. The difference between the three tests was in the encrypted string length (128, 256 and 512 bytes). Although it was not found that the video latency in cases with 128 and 256 bytes string lengths performed worse than the video latency in cases with 512 bytes string length, the option with 512 bytes string length is preferred because of lower count of encryption/decryption calls. Having larger chunks of data is beneficial because of the issue known as the \"small-packet problem\" for UDP. The TCP protocol implements [PERSON]'s algorithm which deals with the problem by buffering packets and sending several small packets as one [52]. The equipment configuration, shown in Figure 9, is used for testing in the non-symmetrical scenario. Here, the camera client and decrypt application nodes run on a NI myRIO, while the camera server and encrypt application nodes run on a NI cRIO (compactRIO) device, and only a 128 byte string length is used due to the limits of the FPGA chip area in the NI myRIO.