Internships/ProjectIdeas/VsockSiblingCommunication: Difference between revisions

From QEMU
(Created page with "=== Sibling VM communication in vhost-user-vsock === '''Summary:''' Extend the existing vhost-user-vsock Rust application to support sibling VM communication During GSoC 2021, we developed vhost-user-vsock application in Rust. It leveraged the vhost-user protocol to emulate a virtio-vsock device in an external process. It provides the hybrid VSOCK interface over AF_UNIX introduced by Firecracker. The current implementation supports a single virtual machine (VM) per pr...")
 
Line 14: Line 14:
available in the rust-vmm/vhost-device workspace to support multiple VMs
available in the rust-vmm/vhost-device workspace to support multiple VMs
per instance and allow communication between sibling VMs.
per instance and allow communication between sibling VMs.
vsock is usually used as a communication channel between the host and
the guest running in a VM. Recently it has been proposed to extend
vsock to also allow communication between VMs running on the same host
(sibling VMs).
Usually <code>struct sockaddr_vm { .svm_cid = 42, .svm_port = 1234 }</code>
address inside a VM is used to communicate with a nested VM, but a new flag
is recently added to allow sibling VM communication.
So by setting <code>.svm_flags = VMADDR_FLAG_TO_HOST</code>, the connection
will be forwarded to the host, allowing communication with the sibling
VM that has CID 42 (if the device supports it).
AF_VSOCK in Linux already supports it, but the vhost-user-vsock application
still does not support it, so we want to extend it.


This project will allow you to learn more about the virtio-vsock
This project will allow you to learn more about the virtio-vsock
Line 20: Line 35:


This work will be done in Rust, but we may need to patch the
This work will be done in Rust, but we may need to patch the
virtio-vsock driver or vsock core in Linux if we will find some issues.
virtio-vsock driver or the AF_VSOCK core in Linux if we will find some issues.
AF_VSOCK in Linux already supports the VMADDR_FLAG_TO_HOST flag to be
used in the struct sockaddr_vm to communicate with sibling VMs.


Goals:
Goals:
* Understand how a virtio-vsock device works
* Understand how a virtio-vsock device works
* Refactor vhost-user-vsock code to allow multiple virtio-vsock device instances
* Refactor vhost-user-vsock code to allow multiple virtio-vsock device instances
* Extend the vhost-user-vsock CLI
* Extend the vhost-user-vsock CLI to define sibling VMs
* Implement sibling VM communication
* Implement sibling VM communication
* (optional) Support adding new VMs at runtime
* (optional) Support adding new VMs at runtime

Revision as of 17:35, 17 February 2023

Sibling VM communication in vhost-user-vsock

Summary: Extend the existing vhost-user-vsock Rust application to support sibling VM communication

During GSoC 2021, we developed vhost-user-vsock application in Rust. It leveraged the vhost-user protocol to emulate a virtio-vsock device in an external process. It provides the hybrid VSOCK interface over AF_UNIX introduced by Firecracker.

The current implementation supports a single virtual machine (VM) per process instance. The idea of this project is to extend the vhost-user-vsock crate available in the rust-vmm/vhost-device workspace to support multiple VMs per instance and allow communication between sibling VMs.

vsock is usually used as a communication channel between the host and the guest running in a VM. Recently it has been proposed to extend vsock to also allow communication between VMs running on the same host (sibling VMs).

Usually struct sockaddr_vm { .svm_cid = 42, .svm_port = 1234 } address inside a VM is used to communicate with a nested VM, but a new flag is recently added to allow sibling VM communication. So by setting .svm_flags = VMADDR_FLAG_TO_HOST, the connection will be forwarded to the host, allowing communication with the sibling VM that has CID 42 (if the device supports it).

AF_VSOCK in Linux already supports it, but the vhost-user-vsock application still does not support it, so we want to extend it.

This project will allow you to learn more about the virtio-vsock specification, rust-vmm crates, and vhost-user protocol to interface with QEMU.

This work will be done in Rust, but we may need to patch the virtio-vsock driver or the AF_VSOCK core in Linux if we will find some issues.

Goals:

  • Understand how a virtio-vsock device works
  • Refactor vhost-user-vsock code to allow multiple virtio-vsock device instances
  • Extend the vhost-user-vsock CLI to define sibling VMs
  • Implement sibling VM communication
  • (optional) Support adding new VMs at runtime

Links:

Details:

  • Project size: 350 hours
  • Skill level: intermediate (knowledge of Rust and virtualization)
  • Language: Rust
  • Mentor: Stefano Garzarella <sgarzare@redhat.com>
    • IRC: sgarzare / Matrix: @sgarzare:matrix.org
  • Suggested by: Stefano Garzarella <sgarzare@redhat.com>