eclipse-cyclonedds / cyclonedds

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

DDS over virtio-vsock (AF_VSOCK) #1144

Closed MatiasVara closed 2 years ago

MatiasVara commented 2 years ago

Hello, I worked on adding the AF_VSOCK as a new transport layer. This is an interesting use-case since clients can run on top of a guest OS without TCP/IP stack or network card. I am attaching the patches but this is much less than a PoC. It works for transmitting a string that says "Hello World" between two guests. This also requires socat in the host as a bridge. I think this work may inspire someone.

Regards,

cyclonedds-pub.xml.txt cyclonedds-sub.xml.txt patchforpublisher.patch.txt patchforsubscriber.patch.txt

eboasson commented 2 years ago

Thanks for suggesting this and showing that it can be made to do "something" fairly easily, @MatiasVara ! And I'm pretty sure this less-than-a-PoC bit works for a lot more than "Hello World" already, as just sending "Hello World" already requires quite a bit of stuff to work.

Never heard of the entire mechanism, but my first impression is that it would allow some interesting use cases with little effort. I don't have the time to dive into it right now, but I'll definitely leave upon the issue as a reminder to myself that something interesting can be done here and I will try to look into it with a bit more care to see how much work it would be to turn it into a viable PR. If it is not too much, perhaps you'd be willing to contribute it?

MatiasVara commented 2 years ago

I would love to contribute but I am having little time to do so. I am afraid that I did not give too many instructions to reproduce, I will add that soon (I think I have a video somewhere). I think a more serious implementation shall be based on udp. I think virtio-vsock just added support for this. However, this would still require some bridge in the host to forward packets between the guests. Note that virtio-vsock only allows communication from/to host. This is why I used socat as a proxy between the guests. A simpler approach would be to let the user define where the server is, i.e. without a discovery mechanism. This is what I did in my PoC. I simply rely on the tcp implementation.

thijsmie commented 2 years ago

We'd still love for you, MatiasVara, to contribute this, or someone else to pick this up. However, I am closing this now since it has been inactive for a while. If anyone wants to work on this, feel free to re-open/create a new ticket.

MatiasVara commented 1 year ago

@thijsmie I might start again to work on this on the coming months. Is someone interested? There have been some improvements in the virtio-vsock that would allow to:

  1. use DGRAM instead of STREAM
  2. communicate between VM thus removing the need of socat.

There is still the issue of discovering since vsock does not support something like BROADCASTING.

thijsmie commented 1 year ago

Hi there! Sounds good, and nice to know you are still interested! I am no longer affiliated with this project so maybe @eboasson can help you out where needed :)

eboasson commented 1 year ago

I am always here to help :)

And I can only second @thijsmie's comment, this would be a really neat. If you want to bounce ideas or need someone to think along, ping me here or on discord. If I don't respond within a reasonable time-frame, just try again ☺️

MatiasVara commented 1 year ago

@eboasson I would like to understand if there is a use-case in which using virtio-vsock as a transport layer may have benefits over virtio-net or other network card.