An excellent example of a device that requires both high sustained throughput and low latency is a network interface card (NIC). Therefore, to understand how hosted device virtualization works and its performance implications, the following sections focus on the specific example of emulating a NIC in VMware Workstation. Figure 3 illustrates the components of the system. The virtual NIC appears to the guest as a full-fledged PCI Ethernet controller, complete with its own MAC address. The NIC emulation can be connected to the host in two ways- it can be bridged to the same physical network as a physical NIC or it can be connected to a virtual network created on the host. In both cases, the connection is implemented by a VMware VMNet driver that is loaded in the host operating system.
A virtual NIC that is bridged to a physical NIC is a true Ethernet bridge in the strictest sense. Its packets are sent on the wire with its own unique MAC address. The VMNet driver runs the bridged physical NIC in promiscuous mode so that replies to that MAC address are picked up. The virtual NIC appears on the local Ethernet segment indistinguishably from any real machine. As a result, a virtual machine with a bridged virtual NIC can fully participate in accessing and providing network services.
A virtual NIC that is connected to a virtual network does not require an Ethernet interface on the host. Unlike the bridged case, the virtual network is completely private within the host and any participating virtual machines. If desired, the host OS can perform routing or IP masquerading to connect a virtual network to any type of external network, even to a non-Ethernet network. This paper will focus only on virtual NICs bridged to a physical NIC.
A virtual NIC itself is implemented via a combination of code in the VMM and the VMApp. The VMM exports a number of virtual I/O ports and a virtual IRQ that represent the virtual network adapter in the virtual machine. Reads and writes to these I/O ports, as well as virtual DMA transfers between the adapter and the virtual machine's memory are semantically equivalent to those of a real network adapter. In VMware Workstation, the virtual NIC models an AMD Lance Am79C970A [1] controller, except that it is not limited to any specific network speed.