You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/automotive/openadkit2_virtualplatform/3_aws_setup.md
+262-4Lines changed: 262 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,269 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
9
-
## System Architecture and Component Design
9
+
###System Architecture and Component Design
10
10
11
-
### Deployment of DDS in AWS Environment
11
+
Once we understand Safety Island —- the safety-critical subsystem responsible for executing essential control logic in automotive systems—and the DDS (Data Distribution Service) communication mechanism, we can refactor the original OpenAD Kit architecture, which previously ran on a single instance, by splitting it into two independent execution environments.
12
12
13
-
### Network Latency and Performance Optimization Strategies
13
+
In the previous [learning path](http://learn.arm.com/learning-paths/automotive/openadkit1_container/), OpenAD Kit launched three containers on the same hardware, each responsible for the `Simulation environment`, `Visualization` and `Planning-Control` components.
14
14
15
-
### Advantages and Challenges of This Solution
15
+
In this session, we decouple the simulation and visualization system from the on-vehicle autonomous driving stack, deploying them on two separate Arm-based instances. Communication between the two is facilitated through the ROS 2 software architecture, using DDS as the underlying middleware, which enables real-time data exchange and modular integration across distributed systems.
16
+
17
+
This architecture brings several practical benefits:
18
+
19
+
- Improved system stability: Decoupling reduces the risk of resource contention or runtime interference between visualization workloads and safety-critical components.
20
+
21
+
- Leverages DDS’s QoS and discovery features: Ensures robust, real-time, and scalable communication across nodes without requiring a central broker or manual configuration.
22
+
23
+
- Better scalability and performance tuning: Each instance can be provisioned with resources optimized for its specific task.
24
+
25
+
- Supports modular development and CI/CD: Teams can develop, test, and iterate on components independently, enabling better DevOps practices for autonomous systems.
26
+
27
+
### Networking Setting
28
+
29
+
First, launch two Arm instances (either cloud instances or on-premise servers).
30
+
31
+
The specifications of the two Arm instances don’t need to be identical. In my tests, 16 CPUs and 32GB of RAM have already provided good performance.
32
+
33
+
Once the two machines are up and running, you need to decide where the `Planning-Control` will execute. After making the decision, the other machine will run `Simulation environment` and `Visualization`.
34
+
35
+
In order for the two instances to communicate, you must configure them to allow network access to each other. For example, in AWS EC2, both instances should belong to the same security group.
36
+
37
+
In the AWS EC2 Security Groups inbound rules setting, ensure that there is a rule allowing traffic from other members of the same security group (i.e., the security group itself as a source). Outbound traffic is typically allowed by default and usually does not require modification.
38
+
This setup ensures that both EC2 instances can discover and communicate with each other over the network as required by ROS 2 and DDS.
39
+
40
+
Once both of your machines are set up, please note down the IP addresses of both machines, as you will need them for the upcoming configuration.
41
+
42
+
### New Docker YAML Configur Setting
43
+
44
+
Ensure that Docker is installed on your development environment, then clone the same repository from the previous learning path onto both machines.
First, you need create xml file called `cycloneDDS.xml`
55
+
56
+
This CycloneDDS XML configuration file is used to customize the behavior of the CycloneDDS middleware, which is used in ROS2 for inter-process communication (IPC) and network communication over DDS.
57
+
Please replace the previously written IP addresses of the two machines with the 192.168.xx.yy and 192.168.aa.bb in the configuration.
You can find the more detail about CycloneDDS setting [Configuration](https://cyclonedds.io/docs/cyclonedds/latest/config/config_file_reference.html#cyclonedds-domain-internal-socketreceivebuffersize)
91
+
{{% /notice %}}
92
+
93
+
Next, we need to configure the newly created YML file `docker-compose-2ins.yml`.
94
+
95
+
- Use the host network instead of the docker network bridge.
96
+
This is necessary for allowing the all of three of containers to access the host network interfaces.
97
+
98
+
```YAML
99
+
visualizer:
100
+
network_mode: host
101
+
```
102
+
103
+
- Add the newly created XML file as an environment variable in each container, and mount the current folder as `/root/workspace`. Configure the environment variable CYCLONEDDS_URI in the docker-compose.yaml file for all containers to ensure they use this configuration file.
104
+
105
+
```YAML
106
+
volumes:
107
+
- .:/root/workspace
108
+
environment:
109
+
- CYCLONEDDS_URI=/root/workspace/cycloneDDS.xml
110
+
```
111
+
112
+
- Remove the dependency between the `planning-control` and `simulator containers`.
113
+
Since these containers will now be launched independently, it is necessary to eliminate the dependency configuration between them.
Before moving to the next step, make sure that `docker-compose-2ins.yml` and `cycloneDDS.xml` are already present on both instances.
194
+
195
+
### Network Latency and Performance Optimization
196
+
197
+
This distributed network architecture may lead to IP packet fragmentation, which can consume system memory under certain network conditions.
198
+
199
+
To mitigate issues related to IP fragmentation and socket receive buffer limitations, you can tune the network configuration to support heavy UDP load.
200
+
201
+
```bash
202
+
sudo su
203
+
sysctl net.ipv4.ipfrag_time=3
204
+
sysctl net.ipv4.ipfrag_high_thresh=134217728
205
+
sysctl -w net.core.rmem_max=2147483647
206
+
exit
207
+
```
208
+
209
+
To make the configuration permanent across reboot, modify the create the file `/etc/sysctl.d/10-cyclone-max.conf`:
Once both machines execute their respective scripts, the visualizer will provide a link that can be accessed through the public IP. When you access the link, you will see that the demo execution will be very similar to the [previous learning path](http://learn.arm.com/learning-paths/automotive/openadkit1_container/4_run_openadkit/).
272
+
273
+
The only difference is that the containers are distributed across two physical machines, and at the underlying layer of the demo, there will be frequent packet exchanges.
0 commit comments