Xen

Introduction
XEN is a free software virtual machine monitor for Intel platform (X86). The Systems Research Group at the University of Cambridge Computer Laboratory originally developed Xen as part of XenoServers project. The project was lead by Ian Pratt, senior lecturer at Cambridge and founder of XenSource Inc. It is designed with minimal performance overhead. As a result the virtualized instances of operating system have a nearly native performance.XEN is a virtual machine hypervisor. This means that it does not run on any OS, but lets OS run on it. Xen runs at the highest priority level the X86 architecture allows i.e. Ring 0. It makes the OS get second highest priority i.e. Ring 1. Xen provides certain libraries to which the OS kernel has to be ported in order to work with Xen. Porting an OS to run on Xen is similar to porting the OS to a new hardware platform; however, the process is simplified because the paravirtual machine architecture is very similar to the underlying native hardware. Although the kernel has to be ported, Xen does not require any modification to user applications, which can run unaltered on a Xen system. 
So far, only open-source operating systems have been ported to Xen. Unless Microsoft releases a Xen-enabled Windows version benefit of a completely virtualized MS Windows cannot be utilised . So far, Linux ports are available, and FreeBSD, NetBSD and Solaris 10 ports are underway.
Method of Operation
Xen achieves virtualization by a technique called para-virtualization. Other traditional Virtual Machine Monitors implement virtualization by emulating full computer system. But this technique has its obvious disadvantages. Since the whole system is emulated, speed of virtual machine is affected badly.X86 processors are not developed to support virtualization. Providing full virtualization of these processors produce some disadvantages. For example certain instructions which occur both in user mode and kernel mode produce different results. A common approach to overcome these problems is to scan the operating system code and modify the offending instruction sequences, either to produce the intended behavior or to force a trap into the VMM. Unfortunately, this patching and trapping approach can cause significant performance penalties.
 
An alternative way of achieving virtualization is to present a VM abstraction that is similar but not identical to the underlying hardware. This approach has been called para virtualization. 
The concept of para virtualization is that a guest operating system and an underlying hypervi¬sor collaborate closely to achieve optimal performance. Many guest operating system instances (of different configurations and types) may run atop the one hypervi¬sor on a given hardware platform. This offers improved performance, although it does require modifications to the guest operating system. 
How Xen Hypervisor deals with virtualization of important system facilities is described below (as mentioned in [8]):-
 i.CPU and Memory Virtualization
In Xen virtualization of CPU, memory, and low level hardware interrupts are provided by a low level, extremely efficient hypervisor layer that is implemented in under 50,000 lines of code. When the OS updates hardware data structures, such as the page table, or initiates a DMA operation, it collaborates with the hypervisor by making calls into an API that is offered by the hypervisor. This, in turn, allows the hypervisor to keep track of all changes made by the OS, and to optimally decide how to manage the state of hardware data structures on context switches. The hypervisor is mapped into the address space of each guest OS, meaning that there is no context switch overhead between any OS and the hypervisor. Finally, by co-operatively working with the guest OSes, the hypervisor gains additional insight into the intentions of the OS, and can make the OS aware of the fact that it has been virtualized. This can be a great advantage to the guest OS – for example the hypervisor can tell the guest that real time has passed between its last run, and its present run, permitting it to make smarter re-scheduling decisions to appropriately respond to a rapidly changing environment.
 ii.I/O Virtualization
Paravirtualization provides significant benefits in terms of I/O virtualization. In the Xen product, I/O is virtualized by using only a single set of drivers for the entire system (across all guests and the hypervisor), unlike emulated virtualization in which each guest has drivers of its own, and the hypervisor has yet another set of drivers for its own use. In each Xen hypervisor guest, simple paravirtualizing device drivers replace hardware-specific drivers for the physical platform. Paravirtualizing drivers are independent of all physical hardware, but represent each type of device (e.g.: block I/O, Ethernet, USB). These drivers enable very high performance, virtualization safe I/O to be accomplished by transferring control of the I/O to the hypervisor, without any complexity in the guest. Moreover, in the Xen architecture the drivers run outside the base hypervisor, at a lower level of protection than the core of the hypervisor itself. In this way the hypervisor can be protected from bugs and crashes in device drivers (they cannot crash Xen technology), and can make use of any device drivers available on the market. Also, the virtualized OS image is much more portable across hardware, since the low levels of the driver and hardware management are modules that run under control of the hypervisor.
Software Performance
Installation of Xen is quite difficult. Installing it is a three way process. First Xen and its user level tools are installed, then boot loader is to be configured (as Xen is a type 1 Hypervisor) and then finally Virtual Machine Configuration File for each Guest OS is to be defined. Performance of hypervisor is commendable and if not native then very good speed is achieved. Xen has, according to a number of benchmarks, considerably out-performed competing commercial and freely available solutions. In all tests conducted, Xen out-performed the other approaches--in standard benchmark tests, such as Spec Int200, Spec Web99, dbench and many more [9].
Main disadvantage of Xen is that porting of OS is required to virtualize it. While it is possible in Open Source Operating Systems but proprietary OS like Windows have not opened up to the concept and are not likely to in near future.
Go Back:Virtualization and Open Source