# Secured Real-Time Machine Communication Protocol
## 3 Methodology-SRMCP Protocol Design
### Phase and Communication Procedure
#### 3.1.4 Communication Phase  
The \"Communication Phase\" facilitates data exchange between the client and server through two operations: read and write. The data on the server are organized as nodes, which will be described in later sections.  
1. **Read**: The read operation starts with the client sending a read request to the server with a node ID indicating the target node. The server then replies with the current value of the node.
2. **Write**: The write operation starts with the client sending a write request to the server with a node ID and a new value. The server updates the node value and sends the current value back to the client for verification.  
All messages during this phase are encrypted with the shared key using the AES-GCM algorithm. Additionally, port hopping is performed for each operation. On the client side, request messages are sent through one of the DLs, chosen randomly. A transaction object is created in the client's memory for each operation, which includes a unique ID, a timeout timer, and pre-allocated memory space for storing message segments. The unique ID is included in the header of the request message. The detailed message structure will be explained in later sections.  
The server breaks the response into multiple segments after encryption, each with a header containing the unique ID and the segment sequence. The server simultaneously sends each segment through a randomly chosen DL. Due to the inherent randomness of networks, each segment arrives at the client in a natural and genuinely random order. Once all segments are received by the client, the client reassembles the response from segments based on their index. Then, the client decrypts the response. If the operation is completed before the timeout timer of the corresponding transaction, the client marks the transaction as successful. Otherwise, the transaction is considered a timeout, and a new request must be made. The transaction procedures are illustrated in Figure 2.  
Figure 2: The transaction procedure of client operation. Blue Arrows: Neutral operations. Green Arrows: Operations when evaluation is true. Red Arrows: Operations when evaluation is false. Blue box: Objects. Yellow box: operations. Orange box: Evaluations. Red box: Critical Evaluations.  
Through the use of transactions and port hopping, the client ensures real-time communication where all responses must be received within a fixed time. Additionally, traffic between the client and server is scattered randomly across multiple TLS connections. The segments of multiple ongoing responses could be received by the client in any order, making it difficult even for AI to capture traffic features, as AI cannot learn from randomness [28]. This also dramatically increases the difficulty of breaching the AES-GCM encryption because the cipher needs to be reassembled from a random order protected by the encrypted header. It leads to a paradox that for attempting the breach of AES-GCM based on ciphers, the AES-GCM must be breached first to obtain the cipher. Additionally, the port hopping mechanism offloads the communication overhead due to message disassembly and assembly by asynchronously utilizing multiple TLS connections, effectively creating independent queues, concurrent transmission, and message handling. This improves performance over protocols that rely on a single port [29].