skip to main content
10.1145/3565475.3569081acmconferencesArticle/Chapter ViewAbstractPublication PagesconextConference Proceedingsconference-collections
research-article
Open access

HOL4P4: semantics for a verified data plane

Published: 06 December 2022 Publication History

Abstract

We introduce a formal semantics of P4 for the HOL4 interactive theorem prover. We exploit properties of the language, like the absence of call by reference and the copy-in/copy-out mechanism, to define a heapless small-step semantics that is abstract enough to simplify verification, but that covers the main aspects of the language: interaction with the architecture via externs, table match, and parsers. Our formalization is written in the Ott metalanguage, which allows us to export definitions to multiple interactive theorem provers. The exported HOL4 semantics allows us to establish machine-checkable proofs regarding the semantics, properties of P4 programs, and soundness of analysis tools.

Supplementary Material

ZIP File (p39-alshnakat.zip)
Supplemental files.

References

[1]
Ryan Beckett, Aarti Gupta, Ratul Mahajan, and David Walker. 2019. Abstract interpretation of distributed network control planes. Proceedings of the ACM on Programming Languages 4, POPL (2019), 1--27.
[2]
Karthikeyan Bhargavan, Barry Bond, Antoine Delignat-Lavaud, Cédric Fournet, Chris Hawblitzel, Catalin Hritcu, Samin Ishtiaq, Markulf Kohlweiss, Rustan Leino, Jay Lorch, et al. 2017. Everest: Towards a verified, drop-in replacement of HTTPS. In 2nd Summit on Advances in Programming Languages (SNAPL 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
[3]
The P4 Language Consortium. 2022. P416 Language Specification. Retrieved 2022-09-22 from https://p4.org/p4-spec/docs/P4-16-v-1.2.3.html
[4]
The HOL4P4 contributors. 2022. HOL4P4. Retrieved 2022-10-26 from https://github.com/kth-step/hol4p4
[5]
Ryan Doenges, Mina Tahmasbi Arashloo, Santiago Bautista, Alexander Chang, Newton Ni, Samwise Parkinson, Rudy Peterson, Alaia Solko-Breslin, Amanda Xu, and Nate Foster. 2021. Petr4: formal foundations for p4 data planes. Proceedings of the ACM on Programming Languages 5, POPL (2021), 1--32.
[6]
Ryan Doenges, Tobias Kappé, John Sarracino, Nate Foster, and Greg Morrisett. 2022. Leapfrog: certified equivalence for protocol parsers. In Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation. 950--965.
[7]
Ari Fogel, Stanley Fung, Luis Pedrosa, Meg Walraed-Sullivan, Ramesh Govindan, Ratul Mahajan, and Todd Millstein. 2015. A general approach to network configuration analysis. In 12th USENIX Symposium on Networked Systems Design and Implementation (NSDI 15). 469--483.
[8]
Lucas Freire, Miguel Neves, Lucas Leal, Kirill Levchenko, Alberto Schaeffer-Filho, and Marinho Barcellos. 2018. Uncovering bugs in p4 programs with assertion-based verification. In Proceedings of the Symposium on SDN Research. 1--7.
[9]
Aaron Gember-Jacobson, Raajay Viswanathan, Aditya Akella, and Ratul Mahajan. 2016. Fast control plane analysis using an abstract representation. In Proceedings of the 2016 ACM SIGCOMM Conference. 300--313.
[10]
The P4.org Architecture Working Group. 2018. P416 Portable Switch Architecture (PSA). Retrieved 2022-09-22 from https://p4.org/p4-spec/docs/PSA-v1.1.0.html
[11]
Ali Kheradmand and Grigore Rosu. 2018. P4K: A formal semantics of P4 and applications. arXiv preprint arXiv:1804.01468 (2018).
[12]
Gerwin Klein, Kevin Elphinstone, Gernot Heiser, June Andronick, David Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, Rafal Kolanski, Michael Norrish, et al. 2009. seL4: Formal verification of an OS kernel. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles. 207--220.
[13]
Diego Kreutz, Fernando MV Ramos, and Paulo Verissimo. 2013. Towards secure and dependable software-defined networks. In Proceedings of the second ACM SIGCOMM workshop on Hot topics in software defined networking. 55--60.
[14]
Xavier Leroy, Sandrine Blazy, Daniel Kästner, Bernhard Schommer, Markus Pister, and Christian Ferdinand. 2016. CompCert-a formally verified optimizing compiler. In ERTS 2016: Embedded Real Time Software and Systems, 8th European Congress.
[15]
Jed Liu, William Hallahan, Cole Schlesinger, Milad Sharif, Jeongkeun Lee, Robert Soulé, Han Wang, Călin Caşcaval, Nick McKeown, and Nate Foster. 2018. P4v: Practical verification for programmable data planes. In Proceedings of the 2018 Conference of the ACM Special Interest Group on data communication. 490--503.
[16]
Nuno Lopes, Nikolaj Bjørner, Nick McKeown, Andrey Rybalchenko, Dan Talayco, and George Varghese. 2016. Automatically verifying reachability and well-formedness in P4 Networks. Technical Report, Tech. Rep (2016).
[17]
Didrik Lundberg, Roberto Guanciale, Andreas Lindner, and Mads Dam. 2020. Hoare-style logic for unstructured programs. In International Conference on Software Engineering and Formal Methods. Springer, 193--213.
[18]
Andres Nötzli, JehandadKhan, Andy Fingerhut, Clark Barrett, and Peter Athanas. 2018. P4pktgen: Automated test case generation for p4 programs. In Proceedings of the Symposium on SDN Research. 1--7.
[19]
p4c contributors. 2021. P4-16 declaration of the P4 v1.0 switch model. Retrieved 2022-09-22 from https://github.com/p4lang/p4c/blob/main/p4include/v1model.p4
[20]
Peter Sewell, Francesco Zappa Nardelli, Scott Owens, Gilles Peskine, Thomas Ridge, Susmit Sarkar, and Rok Strnisa. 2010. Ott: Effective tool support for the working semanticist. Journal of Functional Programming 20, 1 (2010), 71--122.
[21]
Apoorv Shukla, Seifeddine Fathalli, Thomas Zinner, Artur Hecker, and Stefan Schmid. 2020. P4consist: Toward consistent p4 sdns. IEEE Journal on Selected Areas in Communications 38, 7 (2020), 1293--1307.
[22]
Radu Stoenescu, Dragos Dumitrescu, Matei Popovici, Lorina Negreanu, and Costin Raiciu. 2018. Debugging P4 programs with Vera. In Proceedings of the 2018 Conference of the ACM Special Interest Group on Data Communication. 518--532.
[23]
Radu Stoenescu, Matei Popovici, Lorina Negreanu, and Costin Raiciu. 2016. Symnet: Scalable symbolic execution for modern networks. In Proceedings of the 2016 ACM SIGCOMM Conference. 314--327.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
EuroP4 '22: Proceedings of the 5th International Workshop on P4 in Europe
December 2022
154 pages
ISBN:9781450399357
DOI:10.1145/3565475
This work is licensed under a Creative Commons Attribution International 4.0 License.

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 06 December 2022

Check for updates

Author Tags

  1. P4
  2. formal verification
  3. interactive theorem proving
  4. programming language semantics

Qualifiers

  • Research-article

Funding Sources

Conference

CoNEXT '22
Sponsor:

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)223
  • Downloads (Last 6 weeks)38
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media