paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Safe, modular packet pipeline programming

安全、模块化的包处理流水线编程
POPL 6(POPL)2022匹配度 2/10 · 该论文属于程序语言/类型系统与DSL方向,讨论可编程交换机包处理流水线的静态顺序保证,与用户关注的LLM/Agent程序静态分析、浮点程序分析或贝叶斯程序分析没有直接交叉。其形式化与SMT约束编码有一般性PL方法关联,但应用领域和研究问题均不在用户画像核心范围内。引用 6 inbox
Devon Loehr, David Walker
crossref: 2026-09-10

AI 速览

一句话:提出 Lucid 2.0 语言与类型系统,保证交换机程序一致顺序访问数据,并支持模块化包处理流水线编程。

可编程交换机(如 Intel Tofino)上的 P4 程序虽能定制网络功能,但编译器要求同一交换机内所有计算以一致顺序访问数据结构,否则无法映射到包处理流水线。原有 Lucid 语言虽保证 pipeline-safe,却缺乏模块化构造数据结构库的能力。本文提出 Lucid 2.0,在 Lucid 基础上加入多态与顺序约束以复用代码,引入抽象、层次化的流水线位置与数据类型以支持信息隐藏,提供编译期构造器、向量与循环以构建灵活数据结构,并用类型推断减少标注。作者建立其元理论、证明可靠性,并将约束检查编码为 SMT 问题。最后通过 Bloom filter、sketch、cuckoo 哈希表、分布式防火墙、DNS 反射防御、NAT 和概率流量监控等库与应用展示实用性。

问题
P4 可编程交换机程序必须遵守隐式约束,尤其是同一交换机上的计算需以一致顺序访问数据结构,否则无法布局到包处理流水线;而原 Lucid 语言缺少模块化构造数据结构的库能力。
方法
定义 Lucid 2.0 语言与类型系统,引入多态与顺序约束、抽象层次化流水线位置与数据类型、编译期构造器/向量/循环和类型推断,并证明其可靠性,同时将约束检查编码为 SMT 问题。
评估
通过开发一组网络库与应用,包括 Bloom filter、sketch、cuckoo 哈希表、分布式防火墙、DNS 反射防御、NAT 和概率流量监控,验证 Lucid 2.0 的语言特性与实用性。
原文摘要(Abstract)

The P4 language and programmable switch hardware, like the Intel Tofino, have made it possible for network engineers to write new programs that customize operation of computer networks, thereby improving performance, fault-tolerance, energy use, and security. Unfortunately, possible does not mean easy —there are many implicit constraints that programmers must obey if they wish their programs to compile to specialized networking hardware. In particular, all computations on the same switch must access data structures in a consistent order, or it will not be possible to lay that data out along the switch’s packet-processing pipeline. In this paper, we define Lucid 2.0, a new language and type system that guarantees programs access data in a consistent order and hence are pipeline-safe . Lucid 2.0 builds on top of the original Lucid language, which is also pipeline-safe, but lacks the features needed for modular construction of data structure libraries. Hence, Lucid 2.0 adds (1) polymorphism and ordering constraints for code reuse; (2) abstract, hierarchical pipeline locations and data types to support information hiding; (3) compile-time constructors, vectors and loops to allow for construction of flexible data structures; and (4) type inference to lessen the burden of program annotations. We develop the meta-theory of Lucid 2.0, prove soundness, and show how to encode constraint checking as an SMT problem. We demonstrate the utility of Lucid 2.0 by developing a suite of useful networking libraries and applications that exploit our new language features, including Bloom filters, sketches, cuckoo hash tables, distributed firewalls, DNS reflection defenses, network address translators (NATs) and a probabilistic traffic monitoring service.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1564,
  title = {Safe, modular packet pipeline programming},
  author = {Devon Loehr and David Walker},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498699}
}