The rapid expansion of Internet of Things (IoT), edge, and embedded devices in the past decade has introduced numerous challenges in terms of security and configuration management. Simultaneously, advances in cloud-native development practices have greatly enhanced the development experience and facilitated quicker updates, thereby enhancing application security. However, applying these advances to IoT, edge, and embedded devices remains a complex task, primarily due to the heterogeneous environments and the need to support devices with extended lifespans. WebAssembly and the WebAssembly System Interface (WASI) has emerged as a promising technology to bridge this gap. As WebAssembly becomes more popular on IoT, edge, and embedded devices, there is a growing demand for hardware interface support in WebAssembly programs. This work presents WASI proposals and proof-of-concept implementations to enable hardware interaction with I2C and USB, which are two commonly used protocols in IoT, directly from WebAssembly applications. This is achieved by running the device drivers within WebAssembly as well. A thorough evaluation of the proof of concepts shows that WASI-USB introduces a minimal overhead of at most 8% compared to native operating system USB APIs. However, the results show that runtime initialization overhead can be significant in low-latency applications.
翻译:过去十年间,物联网、边缘计算与嵌入式设备的快速扩张,在安全性与配置管理方面带来了诸多挑战。与此同时,云原生开发实践的进步极大地改善了开发体验并促进了更快速的更新,从而提升了应用程序的安全性。然而,将这些进展应用于物联网、边缘计算及嵌入式设备仍是一项复杂任务,这主要源于异构环境的存在以及对长生命周期设备的支持需求。WebAssembly及其系统接口(WASI)已成为弥合这一差距的前沿技术。随着WebAssembly在物联网、边缘计算和嵌入式设备上的日益普及,WebAssembly程序对硬件接口支持的需求也持续增长。本研究提出了WASI提案及概念验证实现,使WebAssembly应用程序能够直接通过I2C和USB这两种物联网常用协议与硬件交互。该功能通过将设备驱动程序同样运行于WebAssembly内部实现。对概念验证系统的全面评估表明,相较于原生操作系统USB API,WASI-USB仅引入最多8%的微小开销。然而,研究结果同时显示,在低延迟应用场景中,运行时初始化开销可能较为显著。