[网络领域顶会追踪系列#1][NSDI'22] 资源约束下的模块化交换机编程
本系列为个人论文阅读笔记,大多数应该是对顶会摘要的个人菜鸟翻译,旨在让感兴趣的朋友能快速浏览、获取信息。如有错误或心得,欢迎在评论区交流指正!
Modular Switch Programming Under Resource Constraints
背景
可编程网络支持很多应用,包括接入控制、路由、监控、缓存、同步等。随着应用的需求提升,交换机数据面上的资源竞争也随之提升。
挑战
塞应用进交换机会导致很多问题,包含非模块化编程、令人失望的不断地重复编译-debug过程、对资源的非最优利用等问题。
所做工作
- 提出了一个P4交换机的扩展,P4All。P4All允许程序员定义弹性的数据结构,这些数据结构可以自动伸展以充分利用交换机中的可用空间。这些数据结构由符号化原语(可以参数化结构的大小和形状)和目标函数(可以量化形状变化时的收益或损失)定义。一个顶层优化的函数指定了如何在数据结构或应用之间分享资源。
- 通过建立一系列可重用的数据结构,包括哈希表,布隆过滤器,sketch和key-value存储,演示了作者的设计的固有模块化性和高效性,并且使用这些数据结构到很多应用中。
- 通过依赖分析、解循环、线性和非线性约束生成以及约束求解的结合,展示了如何使用P4All编译器。
- 评估了P4All编译器的性能,实验结果表明一系列弹性应用可以在最多几分钟内编译进P4。
原文摘要
Programmable networks support a wide variety of applications, including access control, routing, monitoring, caching, and synchronization. As demand for applications grows, so does resource contention within the switch data plane. Cramming applications onto a switch is a challenging task that often results in non-modular programming, frustrating “trial and error” compile-debug cycles, and suboptimal use of resources. In this paper, we present P4All, an extension of P4 that allows programmers to define elastic data structures that stretch automatically to make optimal use of available switch resources. These data structures are defined using symbolic primitives (that parameterize the size and shape of the structure) and objective functions (that quantify the value gained or lost as that shape changes). A top-level optimization function specifies how to share resources amongst data structures or applications. We demonstrate the inherent modularity and effectiveness of our design by building a range of reusable elastic data structures including hash tables, Bloom filters, sketches, and key-value stores, and using those structures within larger applications. We show how to implement the P4All compiler using a combination of dependency analysis, loop unrolling, linear and non-linear constraint generation, and constraint solving. We evaluate the compiler’s performance, showing that a range of elastic programs can be compiled to P4 in few minutes at most, but usually less.