virtual wifi: bring virtualization from wired to wireless
TRANSCRIPT
Virtual WiFi: Bring Virtualization Virtual WiFi: Bring Virtualization from Wired to Wireless
Lei Xia, Sanjay Kumar, Xue Yang
Praveen Gopalakrishnan, York Liu,
S b ti S h b Xi GSebastian Schoenberg, Xingang Guo
Northwestern University EECSNorthwestern University, EECS
Intel Labs, Hillsboro, OR
This work was done in Intel Labs during Xia’s internship th
Virtual WiFi
• New virtualization approach suitable for i l LAN i t li tiwireless LAN virtualization
• Full wireless LAN functionalities are supported inside VMsMultiple separate wireless LAN connections are supported • Multiple separate wireless LAN connections are supported through one physical wireless LAN network interface
Wireless VirtualizationWireless driver stack sits in Host OS onlyVMs see only wired NIC
Wireless driver stack runs inside the Guest as well
Wireless functionality invisible to Guest
Providing rich wireless functionalities to Guest
Wireless Driver
Wireless ProfileGuest OS
Wireless Driver
Wireless ProfileGuest OS
Ethernet Driver
Wireless ProfileGuest OS
Ethernet Driver
Wireless ProfileGuest OS
VMMWireless MultiplexingWireless Multiplexing
Host OS
VMMEthernet EmulationEthernet Emulation
Host OS
VMM
Virtualization Augmented Wireless Driver
VMM
Wireless Device Driver
VVirtualization enabledWireless NICWireless NIC
Today Virtual WiFiToday Virtual WiFi
Why we need virtual WiFi?y
• Client Virtualization
• Enterprise IT: Separate enterprise & personal applications, data and configurations
User ITUser VM
ITVM
Intel Confidential
Company PrivateNetwork
Guest Network
Why we need virtual WiFi?y
• Mobile and ultra-mobile devicesMobile and ultra mobile devices• Separate work from play• User connect exclusively through wirelessUser connect exclusively through wireless• Software tools depend on WiFi connectivity
• WiFi-based Location-Aware SystemWiFi based Location Aware System• Maps WiFi hotspots to determine location
Intel Confidential
Wireless LAN Specific Features
• Complex management functions that affect the functionalities of WLAN devicesfunctionalities of WLAN devices.
• Scan/Associate to specific access pointR t d ti• Rate adaption
• Dynamic switching data rates to match the channel conditionsconditions
• Power management• Device driver can control how long and how often the g
radio needs to be on to save battery
• ……
• Device driver has to be involved in many of those management decisions
Intel Confidential
Required Hardware Support
• Multiple virtual MACs in wireless NICA il bl f i l WiFi d i F • Available on most of commercial WiFi devices, For example, used in Intel MyWiFi technology
i l i i d h h l• Virtual WiFi extends such technology• To support wireless virtualization, multiple MAC entities maintain their independent associations with maintain their independent associations with corresponding APs
• Number of independent associations dependent on number of vMACsnumber of vMACs
Intel Confidential
Virtual WiFi: System Architecturey
Virtual WiFi: Architecture
• VMs run native Intel WiFi device driverUsing WiFi features from device driver• Using WiFi features from device driver
• Guest manage its own WiFi connections
Intel Confidential
Virtual WiFi: Architecture
• VMs run native Intel WiFi device driver
d l l• Device Model exposes same virtual WiFi device to VM as physical device
• Commands from guest can be pass to physical device without translation
f• Device model (VMM) knows few about device-specific knowledgeWi l d i i ll d d t f VMM • Wireless vendor minimally dependent of VMM vendor
Intel Confidential
Virtual WiFi: Architecture• VMs run native Intel WiFi device driver
• Expose same virtual WiFi device to VM as physical device
• Virtualization Augmented host Wireless device driver device driver
• Management functions of virtualized wireless interfaces
• Logically assigns vMAC to a VM• Processing commands from device model
• Forwarding them directly or with consolidation or• Emulated some locally
• Forwarding receive network packet to VMs• Mapping table between vMAC and VM
Configuration/connection status/state machine for
Intel Confidential
• Configuration/connection status/state machine for each vMAC/VM pair
Virtual WiFi: Architecture
• Address Translation• Commands from guest: GPA->HPACommands from guest: GPA >HPA
• Avoids extra memory copy for TX packets• Either Software/Hardware IOMMU• Either Software/Hardware IOMMU• Enable VT-d table to support multi-domain for
single devicesingle device• Collapse multiple page tables to single
address translation table in VT-d
Intel Confidential
Augmented Host Device Driver Commands HandlingHandling
• TX command• Pass it directly to associated vMAC on WiFi NIC
• Rate Control Command• Only update the rate table associated with the specific VM-
ID
• Device Initialization• Start a new vMAC, and starting state/information mapping
to new vMAC
• Scan request• Consolidate properly of scan requests from different VMs• May return previous stored scan results to VMs
Intel Confidential
• And a lot more ……
Performance• Benchmarks
• Chariot benchmark tool• Metrics: TCP & UDP throughputs, • Ping round-trip latency
• Setup• HP EliteBook 6930p Laptop with Intel Core2 Duo CPU
2 53GH ( d) 4GB RAM 80GB HD2.53GHz (one core used), 4GB RAM, 80GB HD• Intel WiFi 5300 AGN Card + Cisco WAP410N AP• KVM + Qemu + Linux 2 6 33 1KVM + Qemu + Linux 2.6.33.1
• Comparing GroupsVirtual WiFi: VM with virtual WiFi system• Virtual WiFi: VM with virtual WiFi system
• Native: Linux with Native WiFi driver• Passthrough: VM with direct assigned WiFi devicePassthrough: VM with direct assigned WiFi device
Performance – TCP Throughputs
20
15
s
10
Mbp
s TX
RX
5
0
Native Passthrough Virtual WiFi
Performance - UDP Throughputs
20
15
bps
TX
10M RX
0
5
0Native Passthrough Virtual WiFi
Virtual WiFi: Performance - Latency
8
6
s
4ms
2
0Native Passthrough Virtual WiFi Virtual WiFi(VT‐d)
VM Additional Latency on TX-path
Host DriverGpa->Hpa
60,000 Gpa >HpaUser/Kernel SwitchDevice Model
40,000
Cyc
les Kernel/User Switch
KVM HandlingAddress translation takes
CPU
C Address translation takes almost half of the time
20,000
0
Intel Confidential
Software VT-d
System Overall CPU Cost( i l 2 53GH )(single core, 2.53GHz)
60.0
50.4 50.0
40.0
23.1
19.3 20 0
30.0
CPU %
9.9 10.0
20.0
4.8
0.0
Virtual WiFi Passthrough Native VM‐Idle System‐Idle
Major Virtualization Overheads
• Address translationAddress translation• Solution: Hardware IOMMU
• IOMMU hw do the address translationIOMMU hw do the address translation• Reduce the VM additional latency/CPU usage
Intel Confidential
Major Virtualization Overheads
• Address translationAddress translation• Solution: Hardware IOMMU
• Interrupt Handling • Coalesce interrupts disabled in host device driver• Each physical interrupt leads to more
synchronization & signal VMs and kernel• Solution: Interrupt coalescing in device model
Intel Confidential
Major Virtualization Overheads
• Address translationAddress translation• Solution: Hardware IOMMU
• Interrupt Handling • Solution: Interrupt coalescing in device model
• I/O handling • MMIO handling• MMIO handling
•Context switches, Threads synchronization overhead for each TX/RX packetoverhead for each TX/RX packet
• Solution: Fast data pass-through (Future Work)• Data traffic passthrough into physical device through • Data traffic passthrough into physical device through
separate queueIntel Confidential
CPU Usage with Optimizations
Virtual WiFi consumed 9% more CPU h i
60CPU than native
50
40
%
30
CP
U
%
0
20
C
0
10
Intel Confidential
0Original Coalese HW IOMMU Coalese+hw
IOMMUNative
Related Work
• MultiNet (Microsoft vWiFi)A f l h b h i l LAN d • A software layer that abstracts the wireless LAN card hardware into multiple virtual adapters
• Continuously switch the wireless card across multiple wireless Co uous y s c e e ess ca d ac oss u p e e essnetworks
• Virtual Pass-through IO (VPIO)• A modeling-based approach to high performance I/O
i t li tivirtualization• Device is directly assigned to guest• Most of IOs from a guest are directly applied on physical Most of IOs from a guest are directly applied on physical
device, no VMM inventions. • VMM uses a behavior model to determine when IO has to be
i t t d f it d d i it hiintercepted for security and device switching
Intel Confidential
Summary• Virtual WiFi: new virtualization approach for
wireless LAN device• Support fully wireless functionalities inside VMs• Separate wireless connections among VMs through
one ph si al i eless inte fa eone physical wireless interface
• Prototype system using virtual WiFi• Native throughputs with 7% extra latency• Less than 9% more CPU cost
Lei Xia Ph.D candidate, Northwestern University
http://www.cs.northwestern.edu/~lxi990
http://v3vee.org
Intel Confidential
Backup SlidesBackup Slides
Backup Slides
Backup SlidesBackup Slides
Intel Confidential
Current Wireless virtualization
• Map network connections to virtual wired Map network connections to virtual wired Ethernet device
W k ll f d t t f• Works well for data transfer
• But downsides for wireless connectionu do d o o o
• Feature of network infrastructure can not be controlled from inside VMnot be controlled from inside VM
• Wireless NIC has to be configured and gmanaged by VMM
Intel Confidential
System profiling setup
• Profiling Components for virtual WiFi systemProfiling Components for virtual WiFi system• Kernel: App-specific, kernel-general
Kernel modules: KVM driver• Kernel modules: KVM, driver• Application-level: Endpoint, Qemu, Guest
• Presented test results based on KVM/QEMU; Presented test results based on KVM/QEMU; similar evaluations need to be performed for other VMM software, such as Xen.for other VMM software, such as Xen.
Comparing Groups
Native:
Endpoint
Native:Linux with
native driver
Host Linux Kernel
Endpoint
WiFi Driver
Kernel
WiFi Device
(Original Driver)
WiFi Device
Comparing Groups
Qemu
Endpoint
Guest OS
Device Model
WiFi DriverVirtual WiFi
Endpoint
Host Linux Kernel
KVM
Device Model
WiFi Driver
Kernel
WiFi Device
(Augmented Driver)
WiFi Device
Comparing Groups
Qemu Guest OS
WiFi DriverPassthrough
Endpoint
Host Linux Kernel
irtual WiFi Device MoKVMirtual WiFi Device Mo
WiFi Device
Virtual WiFi: Implementation
Qemu Guest OS
Virtual WiFi
Native WiFi Driver
A li ti
Host Kernel
KVM
Device ModelApplication
Augmented WiFi Driver
KVM
WiFi Device µCode
• Type II hosted VMM
C b il d T I b • Can be easily ported to Type I bare metal VMM
Implementation
• Virtual WiFi Device Model• Expose only PCI config and MMIO mapping• Tag command with VM-ID, Injecting virtual interrupt to
VMsVMs.
Intel Confidential
Implementation
• Virtual WiFi Device Model
• Augmented WiFi Device driver• Forwarding commands directly to physical WiFi g y p y
device, or Emulated some locally• Receive network packet from WiFi interface,
Identify destination VM, signal device model
Intel Confidential
Implementation
• Vdel
• Augmented WiFi Device driver
Augmented NIC• Augmented NIC• Only uCode update needed
l dd d d• Virtualization extension added to uCode
Intel Confidential
The CPU Usage Matters!
• ScalabilityScalability• From 802.11g (50Mbps) to 802.11n (up to
500Mbps)p )• CPU usage grows with throughput
M bil l tf• Mobile platform• Limited processor resources
• User experience
CPU Usage breakdown (Chariot TX)
• Virtualization directed overhead: Guest, Qemu and KVM overhead (20%)
60 Chariot
• VM Kernel consumes more than Native case (9%)
Guest
Qemu
k• VM-PT needs very few KVM and Kernel involvement
40
%
kvm
Kernel-App
Kernel-General
CP
U Kernel-General
driver
20
0
vWiFi Passthrough Native VM-Idle System-Idle
CPU Usage breakdown:KVM and Host Kernel (by Oprofile)( y p )
Future Works
• Data Pass-through• Data traffic passthrough into physical device
through separate queue• Control/management commands go through device
model/augmented driver
• Apply on next generation WiFi standards• WiFi 802.11nWiFi 802.11n• Expected throughput: ~500Mbps
Related Work
• Full-virtualization by emulating– Large performance overhead, Many development efforts,
Lack of device datasheets
• Para-virtualization• Need guest modification/new para-virtualized device driver• WLAN device specific features are closed to VMM vendor for
back-end driver
• SR-IOV: hardware support virtualization• Costly/complexity/Time line
Intel Confidential