Programming languages like P4 enable specifying the behavior of network data planes in software. However, with increasingly powerful and complex applications running in the network, the risk of faults also increases. Hence, there is growing recognition of the need for methods and tools to statically verify the correctness of P4 code, especially as the language lacks basic safety guarantees. Type systems are a lightweight and compositional way to establish program properties, but there is a significant gap between the kinds of properties that can be proved using simple type systems (e.g., SafeP4) and those that can be obtained using full-blown verification tools (e.g., p4v). In this paper, we close this gap by developing $\Pi$4, a dependently-typed version of P4 based on decidable refinements. We motivate the design of $\Pi$4, prove the soundness of its type system, develop an SMT-based implementation, and present case studies that illustrate its applicability to a variety of data plane programs.
翻译:P4 等编程语言有助于在软件中具体说明网络数据平面的行为。然而,随着网络中日益强大和复杂的应用,故障的风险也随之增加。因此,人们日益认识到需要各种方法和工具静态地核查P4代码的正确性,特别是因为语言缺乏基本的安全保障。类型系统是建立程序属性的轻量级和构成方式,但使用简单类型系统(例如SafeP4)可以证明的属性类型与使用全面核查工具(例如,p4v)可以获得的属性之间存在巨大差距。在本文中,我们通过开发$\Pi$4来弥补这一差距,这是一种依赖型式的P4,基于分层的改进。我们鼓励设计$\Pi4,证明其类型系统的正确性,开发一个基于SMT的应用程序,并提出案例研究,说明其对各种数据平面程序的适用性。