Programmable switch hardware makes it possible to move fine-grained control logic inside the network data plane, improving performance for a wide range of applications. However, applications with integrated control are inherently hard to write in existing data-plane programming languages such as P4. This paper presents Lucid, a language that raises the level of abstraction for putting control functionality in the data plane. Lucid introduces abstractions that make it easy to write sophisticated data-plane applications with interleaved packet-handling and control logic, specialized type and syntax systems that prevent programmer bugs related to data-plane state, and an open-sourced compiler that translates Lucid programs into P4 optimized for the Intel Tofino. These features make Lucid general and easy to use, as we demonstrate by writing a suite of ten different data-plane applications in Lucid. Working prototypes take well under an hour to write, even for a programmer without prior Tofino experience, have around 10x fewer lines of code compared to P4, and compile efficiently to real hardware. In a stateful firewall written in Lucid, we find that moving control from a switch's CPU to its data-plane processor using Lucid reduces the latency of performance-sensitive operations by over 300X.
翻译:可编程的开关硬件使得有可能在网络数据平面内移动精细的控控逻辑,提高各种应用的性能。然而,具有集成控件的应用程序本身很难用P4等现有数据平板编程语言写成。 本文展示了Lucid, 这是一种提高数据平面设置控制功能的抽象程度的语言。 Lucid 引入了抽象功能, 使得它能够方便地在网络数据平面内移动精密的数据平板应用程序, 并使用内部包处理和控制逻辑、 专门类型和同步系统, 防止与数据平面状态有关的程序错误, 以及一个将 Lucid 程序转换为P4 优化到 Intel Tofino 的开放源编程编译器。 这些功能使得Lucid 通用且易于使用, 正如我们在Lucid 写了一套十种不同的数据平板应用程序。 工作原型在不到一小时的时间内就可以写, 即使没有托菲诺经验的程序员, 也比P4 的代码减少了大约10x线, 并有效地编译成真实硬件。 在Lucid 写入的状态的防火墙中, 我们发现, 将一个对 C- pain- plan 的操作从C- plan 的操作从一个转换到对 C- pal- plan 降低了对 C- sal- prog- prog- progmental 的操作的操作的操作。