P4K: A Formal Semantics of P4 and Applications

04/04/2018
by   Ali Kheradmand, et al.
0

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. 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/17/2018

K-Rust: An Executable Formal Semantics for Rust

Rust is a system programming language designed for providing better memo...
research
06/01/2020

Gauntlet: Finding Bugs in Compilers for Programmable Packet Processing

Programmable packet-processing devices such as programmable switches and...
research
07/11/2019

Executable formal semantics for the POSIX shell

The POSIX shell is a widely deployed, powerful tool for managing compute...
research
06/17/2019

How to Avoid Making a Billion-Dollar Mistake: Type-Safe Data Plane Programming with SafeP4

The P4 programming language offers high-level, declarative abstractions ...
research
09/05/2017

Context Generation from Formal Specifications for C Analysis Tools

Analysis tools like abstract interpreters, symbolic execution tools and ...
research
12/10/2022

A Quantitative Flavour of Robust Reachability

Many software analysis techniques attempt to determine whether bugs are ...
research
08/09/2022

The Right Kind of Non-Determinism: Using Concurrency to Verify C Programs with Underspecified Semantics

We present a novel and well automatable approach to formal verification ...

Please sign up or login with your details

Forgot password? Click here to reset