Expand description
Pure-Rust virtual Layer-2 Ethernet switch (switch0) for multi-VM unkernel-rs labs.
Connects 2+ Wasmtime Linux VMs over an in-process learning L2 Ethernet switch with:
- Automatic MAC address learning, unicast forwarding, and broadcast/unknown-unicast flooding.
- Real-time chaos/fault injection per port:
cut_link,reconnect_link,set_drop_rate, andset_delay_ms. - Optional zero-dependency PCAPng packet capture (Wireshark-compatible) recording every Ethernet frame traversing the switch with microsecond timestamps and source-port annotations.
- Optional per-port NAT uplink (
NetStack) so nodes can talk to each other over L2/L3 and optionally reach the internet with full VMI / TLS inspection.
Structs§
- MacTable
Entry - One learned entry in the switch’s L2 MAC forwarding table.
- Switch
Attachment - Attachment parameters passed via
crate::VmConfig::switchto wire a VM onto aVirtualSwitch. - Switch
Port - Guest-side handle representing one port on a
VirtualSwitch. - Switch
Port Stats - Live statistics for a single switch port.
- Virtual
Switch - In-process learning Layer-2 Ethernet switch linking multiple
unkernel-rsVMs.