论文标题

物联网微控制器上的最小虚拟机:带RBPF的伯克利数据包过滤器

Minimal Virtual Machines on IoT Microcontrollers: The Case of Berkeley Packet Filters with rBPF

论文作者

Zandberg, Koen, Baccelli, Emmanuel

论文摘要

虚拟机(VM)被广泛用于托管和隔离软件模块。但是,到目前为止,非常小的内存和低能预算阻止了在典型的基于微控制器的物联网设备上广泛使用VM。在本文中,我们探讨了这种低功率硬件的两种最小VM方法的潜力。我们设计了RBPF,这是一种基于寄存器的VM,基于扩展的伯克利数据包过滤器(EBPF)。我们将其与基于嵌入式系统的WebAssembly(WASM)的基于堆栈的VM进行了比较。我们实施了在IoT操作系统Riot中托管的每个VM的原型。我们对商业现成的物联网硬件进行测量。毫不奇怪,我们观察到,与不使用VM相比,WASM和RBPF虚拟机都会产生执行时间和内存开销。但是,我们表明,对于低通量,低能的物联网设备,该执行时间开销是可以忍受的。我们进一步表明,在使用基于WASM的VM的同时,使用基于RBPF的VM使用VM,将简单网络IoT应用程序的内存预算加倍,仅需要可忽略不计的内存开销(不到10%的内存)。因此,RBPF是一种有前途的方法,可以通过低功率网络托管从OS软件中隔离的小型软件模块以及可更新的按需更新的方法。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源