基于逆向工程ESP32-C3 Wi-Fi驱动程序的间歇供电系统静态最坏情况分析
Reverse Engineering the ESP32-C3 Wi-Fi Drivers for Static Worst-Case Analysis of Intermittently-Powered Systems
摘要 Abstract
无电池物联网革命性地推动了可持续通信的发展,因为它依赖于收集的能量。然而,这种收集的能量受到不可预测环境条件的影响;因此,包括网络堆栈在内的设备操作必须能够抵御电源故障。通过监测储存在电容器中的收集能量来实现电源故障通知,从而提供一种解决方案。然而,为了利用这一电源故障通知并保证任务的向前进展,系统必须将任务分解为原子事务,并在能量耗尽之前可预测地完成这些事务。因此,静态程序代码分析必须确定所有事务的最坏情况下的能量消耗(WCEC)。对于具备Wi-Fi功能的设备,由于驱动程序通常是闭源的,静态分析需要代码及其语义,因此无法确定事务的WCEC界限。在这项工作中,我们将一个节能的网络堆栈与逆向工程的Wi-Fi驱动程序集成,以实现对物理传输和接收数据包的全栈WCEC分析。此外,我们扩展了一个静态最坏情况分析工具,加入了我们自己的Wi-Fi驱动程序的资源消耗模型。通过对基于RISC-V的ESP32-C3平台进行评估,我们的静态分析方法为完整的通信堆栈事务提供了最坏情况的界限,表明基于Wi-Fi的反应式间歇计算是可行的。
The Internet of Batteryless Things revolutionizes sustainable communication as it operates on harvested energy. This harvested energy is dependent on unpredictable environmental conditions; therefore, device operations, including those of its networking stack, must be resilient to power failures. Reactive intermittent computing provides an approach for solving this by notifications of impending power failures, which is implemented by monitoring the harvested energy buffered in a capacitor. However, to use this power-failure notification and guarantee forward progress, systems must break down tasks into atomic transactions that can be predictably finished before the energy runs out. Thus, static program-code analysis must determine the worst-case energy consumption (WCEC) of all transactions. In Wi-Fi-capable devices, drivers are often closed-source, which avoids the determination of WCEC bounds for transactions since static analysis requires all code along with its semantics. In this work, we integrate an energy-aware networking stack with reverse-engineered Wi-Fi drivers to enable full-stack WCEC analysis for physical transmission and reception of packets. Further, we extended a static worst-case analysis tool with a resource-consumption model of our Wi-Fi driver. Our evaluation with the RISC-V-based ESP32-C3 platform gives worst-case bounds with our static analysis approach for the transactions of the full communication stack, therefore showing that Wi-Fi-based reactive intermittent computing is feasible.