A fast and transparent communication protocol for co-resident virtual machines

Yi Ren, Ling Liu, Xiaojian Liu, Jinzhu Kong, Huadong Dai, Qingbo Wu, Yuan Li

Introduction

In modern cloud data centers, virtual machines (VMs) frequently communicate with one another. A significant portion of this traffic occurs between VMs residing on the same physical host (co-resident VMs). Despite their physical proximity, these VMs typically rely on the standard TCP/IP stack for communication. This approach is inherently inefficient, introducing a "tax" on performance due to complex protocol layers, multiple context switches, and hypervisor overhead.

The Problem: The "Co-Residency Tax"

When two VMs on the same host communicate via standard methods, data must traverse a "long path." This involves the network protocol stack of the source VM, the frontend driver, a shared I/O ring, the backend driver in a privileged management domain (like Dom0 or an Isolated Driver Domain - IDD), and finally the destination VM's stack.

Standard Xen network architecture illustrating the indirect communication path between co-resident VMs.

This path triggers numerous hypercalls and context switches, leading to high latency and reduced throughput. Existing solutions often require either rewriting applications to use new APIs or modifying and recompiling the guest OS kernel, which hinders broad adoption in production environments.

Methodology: The XenVMC Architecture

To address these inefficiencies while maintaining full transparency, the authors developed XenVMC. Implemented as a self-contained Linux kernel module, XenVMC bypasses the traditional network stack for co-resident traffic without requiring changes to the application, kernel, or hypervisor.

The XenVMC architecture, highlighting the kernel module components and their interaction with the OS kernel and VMM.

Key Design Principles

  • Layer 2 Interception: XenVMC operates below the socket layer but above the transport layer. By intercepting data before it is encapsulated in TCP/IP headers, it avoids significant processing overhead while preserving the standard socket interface for applications.
  • Transparent Hooking: The module hooks into the system call table by temporarily making it writable (modifying the cr0 register). This allows it to redirect network-related system calls to optimized handlers.
  • Shared Memory FIFO: Upon detecting a co-resident peer, XenVMC establishes a circular FIFO buffer in shared memory using Xen’s grant tables and event channels. Data is copied directly between VMs, completely bypassing the privileged domain (Dom0/IDD).
  • Residency Awareness: The protocol dynamically detects VM migration. If a VM moves to a different host, XenVMC transparently reverts to the standard TCP/IP path, ensuring connection persistence.

Performance Evaluation

The system was evaluated using the Netperf benchmark suite on a Xen-based environment (CentOS 5.5 guests on an Intel Core i5 host).

  • Throughput: XenVMC achieved up to a 9x improvement in inter-VM throughput for message sizes exceeding 512 bytes. The gains were most significant for larger messages where the overhead of the traditional stack is most pronounced.
  • Latency: Round-trip latency was reduced by a factor of 6. XenVMC’s latency ranged from only 16% to 40% of the standard Xen frontend-backend path.

Conclusion

XenVMC demonstrates that it is possible to achieve near-native communication performance between co-resident VMs without sacrificing transparency. By leveraging a Layer 2 shared-memory approach and clever kernel hooking, it provides a high-performance alternative to the standard TCP/IP stack that is ready for deployment in existing cloud infrastructures. Future work includes extending support to UDP and conducting broader comparisons with other research prototypes.

Summary updated

BibTeX
@inproceedings{ren2012fast,
  author = {Yi Ren and Ling Liu and Xiaojian Liu and Jinzhu Kong and Huadong Dai and Qingbo Wu and Yuan Li},
  title = {{A fast and transparent communication protocol for co-resident virtual machines}},
  booktitle = {CollaborateCom},
  year = {2012},
  doi = {10.4108/icst.collaboratecom.2012.250405},
}
Figure