Virtual machines (VM) are widely used to host and isolate software modules. However, extremely small memory and low-energy budgets have so far prevented wide use of VMs on typical microcontroller-based IoT devices. In this paper, we explore the potential of two minimal VM approaches on such low-power hardware. We design rBPF, a register-based VM based on extended Berkeley Packet Filters (eBPF). We compare it with a stack-based VM based on WebAssembly (Wasm) adapted for embedded systems. We implement prototypes of each VM, hosted in the IoT operating system RIOT. We perform measurements on commercial off-the-shelf IoT hardware. Unsurprisingly, we observe that both Wasm and rBPF virtual machines yield execution time and memory overhead, compared to not using a VM. We show however that this execution time overhead is tolerable for low-throughput, low-energy IoT devices. We further show that, while using a VM based on Wasm entails doubling the memory budget for a simple networked IoT application using a 6LoWPAN/CoAP stack, using a VM based on rBPF requires only negligible memory overhead (less than 10% more memory). rBPF is thus a promising approach to host small software modules, isolated from OS software, and updatable on-demand, over low-power networks.
翻译:虚拟机(VM)被广泛用于托管和隔离软件模块。然而,极小的记忆力和低能预算迄今为止阻止了VM在典型的微型控制器IoT设备上的广泛使用。在本文中,我们探索了两种关于这种低功率硬件的最小 VM 方法的潜力。我们设计了基于登记册的VM(基于扩展的伯克利包装过滤器(eBPF)的VM) 。我们把它与基于WebAser(Wasm)的基于嵌入系统的基于堆叠的VM(VM)系统进行比较。我们实施了在IoT操作系统RIOT中托管的每个VM的原型。我们测量了商业上现成的IoT硬件。我们毫不奇怪地发现,Wam和rBPF虚拟机器在这种低功率的软件模块上产生执行时间和记忆管理费。 然而,我们发现,这种执行时间管理费对于低通量、低能IoT设备设备来说是难以承受的。我们进一步表明,使用VMM(WAN)意味着要将记忆预算翻倍增一个简单的IOT-PFFPFS网络的记忆预算,而仅需要一种基于10的10的存储系统。