Repository navigation
Virtual RF: Add userspace Virtual Bluetooth and Virtual Wi-Fi subsystem - #69
Open
yunhanw-google wants to merge 1 commit into
Open
yunhanw-google wants to merge 1 commit into
yunhanw-google wants to merge 1 commit into
Conversation
yunhanw-google
force-pushed
the
feature/virtual-bt-controller-tcp
branch
5 times, most recently
from
September 29, 2026 01:56
73cd085 to
6929f23
Compare
yunhanw-google
force-pushed
the
feature/virtual-bt-controller-tcp
branch
11 times, most recently
from
October 7, 2026 14:27
a76f526 to
0f56b0f
Compare
…ubsystems - Add cirque/virtual_bt/ TCP H4 medium, LinkLayerHub, VirtualBluetoothController, dynamic ATT/GATT server and discovery, and container org.bluez D-Bus + hci0 bridge. - Add cirque/virtual_wifi/ TCP 802.11 medium, IEEE 802.11i WPA2 EAPOL-Key 4-way handshake, userspace DHCP/SLAAC servers, association-gated L2 switch, and container fi.w1.wpa_supplicant1 D-Bus + wlan0 bridge. - Add PcapCapability (DLT 201 HCI H4, DLT 256 LE LL with CRC-24, DLT 1 Ethernet) and AndroidDockerNode KVM emulator integration with PTY HCI and TAP Wi-Fi bridges. - Add cirque/home/virtual_home_topology.py, interactive Virtual Home launcher, CLI validation suites, and GitHub Actions CI workflow. - Update README.md, ARCHITECTURE.md, and docs/VIRTUAL_RF_ARCHITECTURE.md.
yunhanw-google
force-pushed
the
feature/virtual-bt-controller-tcp
branch
from
October 7, 2026 23:59
0f56b0f to
e543821
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds userspace Virtual Bluetooth (
cirque/virtual_bt/) and Virtual Wi-Fi (cirque/virtual_wifi/) radio subsystems, Wireshark PCAP capture (PcapCapability), and headless KVM Android emulator (AndroidDockerNode) support to Cirque, removing the dependency on host kernel radio simulation modules (mac80211_hwsim,wmediumd,btvirt, and hostbluetoothd).Problem
mac80211_hwsim,wmediumd,btvirt) and host-sharedbluetoothdD-Bus state:mac80211_hwsimorbtvirtkernel modules, preventing BLE and Wi-Fi tests from running.bluetoothddaemon across multiple Docker containers causes adapter index collisions and cross-test interference.Solution
cirque/virtual_bt/):hci_h4.py) with segmentedBIND <controller_id>preamble reassembly (server.py), virtual controller state machine (controller.py), BLE link-layer hub (link_layer.py), dynamic ATT/GATT server and attribute discovery (att_db.py,matter_ble_bridge.py), and per-containerorg.bluezD-Bus service (bluez_dbus_daemon.py,bluez_gatt_mixin.py).cirque/virtual_wifi/):wpa2_crypto.py,eapol.py,wpa2_supplicant_sm.py), association-gated Ethernet L2 switch, userspace DHCPv4 (10.0.1.0/24) and ICMPv6 SLAAC (fd11:22::/64) servers (server.py), and a per-containerfi.w1.wpa_supplicant1D-Bus daemon (wpa_dbus_daemon.py,docker_wifi_bridge.py).cirque/capabilities/pcapcapability.py,cirque/pcap/):DLT_BLUETOOTH_HCI_H4_WITH_PHDR= 201), shared BLE link-layer PDUs with a 10-byte RF pseudo-header and CRC-24 (DLT_BLUETOOTH_LE_LL_WITH_PHDR= 256), and Wi-Fi Ethernet/EAPOL/DHCP/UDP frames (DLT_EN10MB= 1), with a summary inspection CLI (cirque.pcap.summarize_pcap).cirque/nodes/androiddockernode.py,cirque/home/virtual_home_topology.py):Pixel_6_API_34) insidecirque-android-runnerwith built-in radio emulation disabled (-feature -BluetoothEmulation -feature -WiFiPacketStream), bridges guest/dev/bluetooth0(bt_vhci_forwarder->/dev/vhci) overpty_bridgetoVirtualBluetoothServer, bridges guestwlan0via-wifi-tap cirque_tap0toVirtualWiFiServer, and provides Flask REST endpoints (/init_android_emulator,/commission_chiptool,/commission_chiptool_thread,/toggle_chiptool,/read_chiptool) and MP4 screen recording during commissioning.cirque/nodes/dockernode.py,cirque/connectivity/homelan.py):bind()preload guard onDockerNodecontainers to clearSO_REUSEPORT/SO_REUSEADDRon ephemeral (port == 0) UDP sockets while preserving fixed-port bindings (5353,5540).Caveats
/dev/kvmaccess on the host; when/dev/kvmis unavailable,AndroidDockerNodeunit tests validate node lifecycle and CLI logic without launching QEMU.Testing
python3 -m unittest discover -s cirque -p 'test_*.py'(218 unit tests coveringvirtual_bt,virtual_wifi,pcapcapability,dockernode,androiddockernode,homelan, andvirtual_home_topology; 99% statement coverage on the Virtual RF and Home Topology gate in.github/workflows/main.yml).examples/validate_virtual_home.shandexamples/test_virtual_home_ble_wifi_e2e.py).examples/run_android_ci_smoke.py) andCHIPTool.apkBLE + Wi-Fi and BLE + Thread commissioning (examples/validate_virtual_android_home.sh).