当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Petr4: Formal Foundations for P4 Data Planes
arXiv - CS - Programming Languages Pub Date : 2020-11-11 , DOI: arxiv-2011.05948
Ryan Doenges, Mina Tahmasbi Arashloo, Santiago Bautista, Alexander Chang, Newton Ni, Samwise Parkinson, Rudy Peterson, Alaia Solko-Breslin, Amanda Xu, Nate Foster

P4 is a domain-specific language for programming and specifying packet-processing systems. It is based on an elegant design with high-level abstractions like parsers and match-action pipelines that can be compiled to efficient implementations in software or hardware. Unfortunately, like many industrial languages, P4 has developed without a formal foundation. The P4 Language Specification is a 160-page document with a mixture of informal prose, graphical diagrams, and pseudocode. The P4 reference implementation is a complex system, running to over 40KLoC of C++ code. Clearly neither of these artifacts is suitable for formal reasoning. This paper presents a new framework, called Petr4, that puts P4 on a solid foundation. Petr4 consists of a clean-slate definitional interpreter and a calculus that models the semantics of a core fragment of P4. Throughout the specification, some aspects of program behavior are left up to targets. Our interpreter is parameterized over a target interface which collects all the target-specific behavior in the specification in a single interface. The specification makes ad-hoc restrictions on the nesting of certain program constructs in order to simplify compilation and avoid the possibility of nonterminating programs. We captured the latter intention in our core calculus by stratifying its type system, rather than imposing unnatural syntactic restrictions, and we proved that all programs in this core calculus terminate. We have validated the interpreter against a suite of over 750 tests from the P4 reference implementation, exercising our target interface with tests for different targets. We established termination for the core calculus by induction on the stratified type system. While developing Petr4, we reported dozens of bugs in the language specification and the reference implementation, many of which have been fixed.

中文翻译:

Petr4:P4 数据平面的正式基础

P4 是一种用于编程和指定数据包处理系统的领域特定语言。它基于优雅的设计,具有高级抽象,如解析器和匹配动作管道,可以编译为软件或硬件中的高效实现。不幸的是,像许多工业语言一样,P4 的开发没有正式的基础。P4 语言规范是一份 160 页的文档,混合了非正式的散文、图形和伪代码。P4 参考实现是一个复杂的系统,运行超过 40KLoC 的 C++ 代码。显然,这些工件都不适合形式推理。本文介绍了一个名为 Petr4 的新框架,它为 P4 奠定了坚实的基础。Petr4 由一个全新的定义解释器和一个模拟 P4 核心片段语义的演算组成。在整个规范中,程序行为的某些方面留给了目标。我们的解释器通过目标接口进行参数化,该接口在单个接口中收集规范中所有特定于目标的行为。该规范对某些程序结构的嵌套进行了特别限制,以简化编译并避免出现非终止程序的可能性。我们通过对其类型系统进行分层,而不是强加不自然的句法限制,在我们的核心演算中捕捉到了后者的意图,并且我们证明了这个核心演算中的所有程序都终止了。我们已经针对来自 P4 参考实现的 750 多个测试套件验证了解释器,通过针对不同目标的测试来练习我们的目标接口。我们通过对分层类型系统的归纳来建立核心微积分的终止。在开发 Petr4 时,我们报告了语言规范和参考实现中的数十个错误,其中许多已得到修复。
更新日期:2020-11-12
down
wechat
bug