Reducing P4 Language’s Voluminosity using Higher-Level Constructs
Abstract
Over the last years, P4 has positioned itself as the primary language for data-plane programming. Despite its constant evolution, the P4 language still “suffers” from one significant limitation: the voluminosity of its code. P4 applications easily reach thousands of lines of code, becoming hard to develop, debug, and maintain. The reason is twofold: P4 requires many characters to express individual concepts (verbosity), and it relies on code repetition (lack of parametrization). Today, P4 users overcome this limitation by relying on templating tools, hand-crafted scripts, and complicated macros. Unfortunately, these methods are not optimal: they make the development process difficult and do not generalize well beyond one codebase. In this work, we propose reducing the voluminosity of P4 code by introducing higher-level language constructs. We present O4, an extended version of P4, that includes three such constructs: arrays (which group same-type entities together), loops (which reduce simple repetitions), and factories (which enable code parametrization).
We evaluate O4 on several state-of-the-art programs and show how, with respect to P4: (i) it reduces code volumes by up to 80%, (ii) it decreases code verbosity by 44% on average, and (iii) it cuts duplicated code by 60%. We contribute a compiler implementation that provides said benefits with just a 3.5% increase in compilation time.
Research Area: Network Programmability
People
BibTex
@INPROCEEDINGS{alcoz2022reducing,
isbn = {978-1-4503-9935-7},
doi = {10.1145/3565475.3569078},
year = {2022-12},
booktitle = {EuroP4 '22: Proceedings of the 5th International Workshop on P4 in Europe},
type = {Conference Paper},
author = {Gran Alcoz, Albert and Busse-Grawitz, Coralie and Marty, Eric and Vanbever, Laurent},
abstract = {Over the last years, P4 has positioned itself as the primary language for data-plane programming. Despite its constant evolution, the P4 language still "suffers" from one significant limitation: the voluminosity of its code. P4 applications easily reach thousands of lines of code, becoming hard to develop, debug, and maintain. The reason is twofold: P4 requires many characters to express individual concepts (verbosity), and it relies on code repetition (lack of parametrization).Today, P4 users overcome this limitation by relying on templating tools, hand-crafted scripts, and complicated macros. Unfortunately, these methods are not optimal: they make the development process difficult and do not generalize well beyond one codebase.In this work, we propose reducing the voluminosity of P4 code by introducing higher-level language constructs. We present O4, an extended version of P4, that includes three such constructs: arrays (which group same-type entities together), loops (which reduce simple repetitions), and factories (which enable code parametrization).We evaluate O4 on several state-of-the-art programs and show how, with respect to P4: (i) it reduces code volumes by up to 80%, (ii) it decreases code verbosity by 44% on average, and (iii) it cuts duplicated code by 60%. We contribute a compiler implementation that provides said benefits with just a 3.5% increase in compilation time.},
keywords = {P4 language; programming languages; programmable networks},
language = {en},
address = {New York, NY},
publisher = {Association for Computing Machinery},
title = {Reducing P4 Language’s Voluminosity using Higher-Level Constructs},
PAGES = {19 - 25},
Note = {18th International Conference on emerging Networking EXperiments and Technologies (CoNEXT 2022); Conference Location: Rome, Italy; Conference Date: December 6-9, 2022}
}
Research Collection: 20.500.11850/589735
Slide Sources: https://gitlab.ethz.ch/projects/40921