eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
854 stars 352 forks source link

What happens when iceoryx is used and a distant subscriber connects? #1919

Open timbeyl opened 8 months ago

timbeyl commented 8 months ago

Hi Cyclonedds developer,

Fantastic work that you are doing. I am using Cyclonedds with iceoryx and it's a pleasure to use.

It is understood that Cyclonedds with iceoryx / shm only works when publisher and subscriber are on the same machine.

It is still somehow unclear to me what happens when a subscriber tries to connect via ethernet. Which of the following happens?

  1. Iceoryx is not used anymore and cyclone switches to network based communication
  2. Iceoryx publishes to iceoryx and network simultaneously. Local subscribers use iceoryx and distant subscribers use the network. Because of serialisation and the time it takes, the performance of shm communication is reduced.
  3. Like two but a mechanism is used so that network based communication and shm publishing are decoupled and shm performs as if there was no distant subscriber while the distant subscribers do not notice the presence of shm.

Could somebody please shed some light on this topic?

Many thanks in advance!

eboasson commented 8 months ago

It is your option 2, assuming you meant:

Cyclone publishes to iceoryx and network simultaneously. Local subscribers use iceoryx and distant subscribers use the network. Because of serialisation and the time it takes, the performance of shm communication is reduced

In 0.10.x it publishes to the network before it publishes via Iceoryx. So your "Iceoryx latency" goes up by the the cost of serailization plus the cost of generating the network packets.

There was a reason for this choice, but it never actually happened. The idea was that there is a small (but meaningful) set of scenarios and data types where you can send the data to the network directly from the shared memory. In practice that's so tricky that it has not been done. So ...

In master it first publishes via Iceoryx, then sends the data over the network. It does still serialize first (primarily because there are cases where it simply has to serialize before sending to Iceoryx and this reduces the number of different paths). The cost of sending the data over the network is higher than the cost of serializing it, so this change already improves the latency over Iceoryx.