# Secured Real-Time Machine Communication Protocol
## 6 Results and Analysis  
### Local Placement  
Figure 4 presents the results of measuring the time required for a client to connect to the server 100 times using the local loopback address. For ModBus, the connection time ranges from 1.89 ms to 4.79 ms, with an average of 2.72 ms. SRMCP, however, takes much longer, with connection times ranging from 5.20 ms to 8.50 ms and an average of 5.71 ms. This increased time is expected, as ModBus does not involve a TLS handshake, while SRMCP performs both a TLS handshake and a Kyber Key Encapsulation Mechanism (KEM) handshake, adding to the connection overhead. Figure 4: Testing results for connecting the client and server over a local loopback address. The OPC UA exhibits the worst performance due to its highly complex connection procedures, which involve multiple steps before the client is ready for read or write operations. These steps include discovering the server and selecting the endpoint, establishing a secure channel through security policy negotiation, certificate exchange, and asymmetric encryption handshake. Following this, the client creates and activates a session, which includes user authentication, security token exchange, and validation of read/write permissions. The session also initializes any required subscriptions, ensuring that client-server communication is secure and ready for operations. However, integrating user authentication within the communication protocol increases complexity and latency unnecessarily; user authentication is generally better managed at the application layer, separate from the core communication functions. Figure 5 shows the testing results for the client reading multiple variables from the server over the local loopback interface. Although SRMCP involves a dual layer of encryption, its \"Port Hopping\" mechanism allows data to be segmented and transferred simultaneously over multiple connections, with each segment processed in independent queues. Additionally, with RMCP's efficient implementation of JSON serialization, the transmission time is significantly reduced. As a result, SRMCP achieves the best performance with an average read operation time of 1.22 ms, outperforming even the simpler ModBus protocol, which has an average read operation time of 1.92 ms. In contrast, the OPC UA exhibits the worst performance, with an average read operation time of 15.69 ms. This is primarily due to its complex serialization methods and the multi-step read procedures that introduce significant overhead. The OPC UA requires establishing a secure channel, creating and activating a session, validating user permissions, and processing detailed read requests with extensive metadata and security checks. These layers of security and operational checks, while ensuring data integrity and security, result in much higher latency compared to the more streamlined approaches of SRMCP that  
Figure 5: Testing results for reading multiple variables over local loopback address. rely on well-adopted TLS protocol and JSON schema validation for data integrity and type validation. Figure 6 shows the testing results for the client writing a variable to the server over the local loopback address. Similar to the read operation results, SRMCP outperformed the other two protocols due to its \"Port Hopping\" mechanism, where each data packet is divided into smaller segments and transmitted simultaneously over multiple TLS connections. It achieved an average write operation time of 0.81 ms. Modbus followed with an average writing time of 1.99 ms, benefiting from its simplicity and minimal overhead. However, Modbus transmits data packets sequentially over a single TLS connection, which limits its performance compared to SRMCP. In contrast, the OPC UA exhibited the worst performance, with an average write operation time of 15.63 ms.