P4K: A Formal Semantics of P4 and Applications

Ali Kheradmand, Grigore Rosu
4/4/2018
cs.NIcs.PL

Official code: kframework/p4-semantics (20 stars, P4, last commit 2021-05-21).

Abstract

Programmable packet processors and P4 as a programming language for such devices have gained significant interest, because their flexibility enables rapid development of a diverse set of applications that work at line rate. However, this flexibility, combined with the complexity of devices and networks, increases the chance of introducing subtle bugs that are hard to discover manually.

Show full abstract

Worse, this is a domain where bugs can have catastrophic consequences, yet formal analysis tools for P4 programs / networks are missing. We argue that formal analysis tools must be based on a formal semantics of the target language, rather than on its informal specification. To this end, we provide an executable formal semantics of the P4 language in the K framework. Based on this semantics, K provides an interpreter and various analysis tools including a symbolic model checker and a deductive program verifier for P4. This paper overviews our formal K semantics of P4, as well as several P4 language design issues that we found during our formalization process. We also discuss some applications resulting from the tools provided by K for P4 programmers and network administrators as well as language designers and compiler developers, such as detection of unportable code, state space exploration of P4 programs and of networks, bug finding using symbolic execution, data plane verification, program verification, and translation validation.

View on arXivView PDF

Code Implementations(1)

Formal Semantics of P4 in K

203P4, PythonNov 8, 20165 years agoNOASSERTION
formal-semanticsinterpretermodel-checkingp4p4language+3 more

Similar Papers

Cite this paper

@article{kheradmand2018pk,
  title  = {P4K: A Formal Semantics of P4 and Applications},
  author = {Ali Kheradmand and Grigore Rosu},
  year   = {2018},
  eprint = {1804.01468},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1804.01468}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1804.01468.svg)](https://codeofpaper.com/paper/1804.01468)

Discussion