# Communication Architecture in Mixed-Reality Simulations of Unmanned Systems
## 5 The Proposed Architecture Design
### Routing  
Message routing used in the proposed architectures follows the flowchart depicted in Figure 4. If the target's HW address part corresponds to the HW address of a transmitting entity, a mechanism of local message transport is utilized to deliver the message using the SW address part. We have used a combination of local IP addresses and TCP/UDP ports to represent the SW parts of the addresses and have used socket communication for local message transport. This applies to messages sent among SWEs. On the contrary, if the HW address parts of the target and the transmitting entity are different, a mechanism of remote message transport is employed to send the message to the appropriate HWE or GCS. When the HW part of the addresses is represented by the physical addresses of employed RF modems, the routing functionality provided by the modems can be utilized. If the utilization of specialized routing protocols is required, these protocols should be implemented outside of this  
Figure 3: Dual addressing in MR communication system and distribution of _advertisment_ messages.  
architecture at higher control layers of the entities. Similar procedures are executed at the GCS during the message reception to provide the necessary message routing.  
When using such a system, SWEs need to know where to send packets for the HWEs, since they do not have direct access to the GCS's modem. The following two methods are proposed to provide this information. Both methods can be used for routing messages from SWEs to HWEs via the GCS. Each of the methods has its advantages and disadvantages that are detailed below.  
* **Advertisement altering**--When re-broadcasting advertisements to the SWEs, the GCS changes both address parts of the advertising HWE to SW and HW addresses of this GCS while keeping a list that links the HWE IDs with their real addresses. Then, SWEs keep pairs of the HWEs' IDs linked to the address of the GCS; thus, it sends the message directly to the GCS whenever an SWE has to send a message to an HWE. The main advantage of this approach is that no fixed gateway address needs to be specified for the SW nodes. On the other hand, altering every advertisement message is inefficient in scenarios with many HWEs.
* **Fixed gateway**--In this method, SWEs have a predefined gateway for HW addresses that they cannot connect to directly. In this case, the gateway address is the HW address of the GCS. This approach needs the gateway HW address to be defined and known by all SWEs before the start of the simulation, which may be limiting in some scenarios. However, apart from that, no further actions are needed for the correct message routing. Due to its simplicity and efficiency, this particular method with the fixed gateway for all SWEs is the selected approach adopted in the proposed architecture.  
The routing methods mentioned above allow for the correct operation of the system even in cases when the network is partitioned into several groups, which is one of the requirements of the communication system of the MR simulations specified in Section 4. When two or more HWEs are out of the communication range of the others and/or the simulation platform (GCS), they can still communicate with each other, independently of the platform.