P4Testgen: An Extensible Test Oracle For P4-16
Fabian Ruffy, Jed Liu, Prathima Kotikalapudi, Vojtech Havel, Hanneli Tavante, Rob Sherwood, Vladyslav Dubina, Volodymyr Peschanenko, Anirudh Sivaraman, Nate Foster
Abstract
We present P4Testgen, a test oracle for the P4 16 language. P4Testgen supports automatic test generation for any P4 target and is designed to be extensible to many P4 targets. It models the complete semantics of the target's packet-processing pipeline including the P4 language, architectures and externs, and target-specific extensions. To handle non-deterministic behaviors and complex externs (e.g., checksums and hash functions), P4Testgen uses taint tracking and concolic execution. It also provides path selection strategies that reduce the number of tests required to achieve full coverage.
We have instantiated P4Testgen for the V1model, eBPF, PNA, and Tofino P4 architectures. Each extension required effort commensurate with the complexity of the target. We validated the tests generated by P4Testgen by running them across the entire P4C test suite as well as the programs supplied with the Tofino P4 Studio. Using the tool, we have also confirmed 25 bugs in mature, production toolchains for BMv2 and Tofino.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 81952004-5dbb-4cfe-ad91-d8a15a0a62abCited by top-tier papers2
- Computing Precise Control Interface SpecificationsEric Hayden Campbell, Hossein Hojjat, Nate FosterOOPSLA 2024 · 1 citation
- P4-SpecTec: Integrating a Language Mechanization Framework into the Real-World P4 SpecificationJaehyun Lee, Seokhun Jeong, Sehyuk Ahn, Haechan Kwon et al.OOPSLA 2026
Builds on8
- Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei et al.CCS 2018 · 753 citations
- Gauntlet: Finding Bugs in Compilers for Programmable Packet ProcessingFabian Ruffy, Tao Wang, Anirudh SivaramanOSDI 2020 · 34 citations
- Aquila: a practically usable verification system for production-scale programmable data planesBingchuan Tian, Jiaqi Gao, Mengqi Liu, Ennan Zhai et al.SIGCOMM 2021 · 28 citations
- Petr4: formal foundations for p4 data planesRyan Doenges, Mina Tahmasbi Arashloo, Santiago Bautista, Alexander Chang et al.POPL 2021 · 24 citations
- Probabilistic profiling of stateful data planes for adversarial testingQiao Kang, Jiarong Xing, Yiming Qiu, Ang ChenASPLOS 2021 · 21 citations
Related papers
- When P4 Meets Run-to-completion ArchitectureHao Zheng, Xin Yan, Wenbo Li, Jiaqi Zheng et al.NSDI 2025 · 5 citations
- Fix with P6: Verifying Programmable Switches at RuntimeApoorv Shukla, Kevin Nico Hudemann, Zsolt Vági, Lily Hügerich et al.INFOCOM 2021 · 13 citations
- HOL4P4: Mechanized Small-Step Semantics for P4Anoud Alshnakat, Didrik Lundberg, Roberto Guanciale, Mads DamOOPSLA 2024 · 6 citations
- Composing Dataplane Programs with μP4Hardik Soni, Myriana Rifai, Praveen Kumar, Ryan Doenges et al.SIGCOMM 2020 · 54 citations
- Failing with Purpose: Dangling Coverage-Guided Negative Test Generation from a Mechanized P4 Type SystemJaehyun Lee, Seokhun Jeong, Sukyoung RyuFSE 2026
