Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Dependently-typed data plane programming

Published: 12 January 2022 Publication History

Abstract

Programming languages like P4 enable specifying the behavior of network data planes in software. However, with increasingly powerful and complex applications running in the network, the risk of faults also increases. Hence, there is growing recognition of the need for methods and tools to statically verify the correctness of P4 code, especially as the language lacks basic safety guarantees. Type systems are a lightweight and compositional way to establish program properties, but there is a significant gap between the kinds of properties that can be proved using simple type systems (e.g., SafeP4) and those that can be obtained using full-blown verification tools (e.g., p4v). In this paper, we close this gap by developing Π4, a dependently-typed version of P4 based on decidable refinements. We motivate the design of Π4, prove the soundness of its type system, develop an SMT-based implementation, and present case studies that illustrate its applicability to a variety of data plane programs.

Supplementary Material

Auxiliary Presentation Video (popl22main-p311-p-video.mp4)
This video provides a high-level overview of our paper on dependently-typed data plane programming.

References

[1]
M. Baldi. 2019. daPIPE a Data Plane Incremental Programming Environment. In Symposium on Architectures for Networking and Communications Systems (ANCS). 1–6. https://doi.org/10.1109/ANCS.2019.8901893
[2]
Ryan Beckett and Ratul Mahajan. 2020. A General Framework for Compositional Network Modeling. In Workshop on Hot Topics in Networks (HotNets). 8–15. https://doi.org/10.1145/3422604.3425930
[3]
Edoardo Biagioni, Robert Harper, Peter Lee, and Brian G. Milnes. 1994. Signatures for a Network Protocol Stack: A Systems Application of Standard ML. In Conference on LISP and Functional Programming (LFP). 55–64. https://doi.org/10.1145/182409.182431
[4]
Pat Bosshart, Dan Daly, Glen Gibb, Martin Izzard, Nick McKeown, Jennifer Rexford, Cole Schlesinger, Dan Talayco, Amin Vahdat, George Varghese, and David Walker. 2014. P4: Programming Protocol-Independent Packet Processors. SIGCOMM Computer Communications Review (CCR), July, 87–95. https://doi.org/10.1145/2656877.2656890
[5]
Pat Bosshart, Glen Gibb, Hun-Seok Kim, George Varghese, Nick McKeown, Martin Izzard, Fernando Mujica, and Mark Horowitz. 2013. Forwarding Metamorphosis: Fast Programmable Match-Action Processing in Hardware for SDN. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 99–110. https://doi.org/10.1145/2486001.2486011
[6]
Janusz A. Brzozowski. 1964. Derivatives of Regular Expressions. J. ACM, 11, 4 (1964), Oct., 481–494. issn:0004-5411 https://doi.org/10.1145/321239.321249
[7]
Giuseppe Castagna, Kim Nguyen, Zhiwu Xu, Hyeonseung Im, Sergueï Lenglet, and Luca Padovani. 2014. Polymorphic Functions with Set-Theoretic Types: Part 1: Syntax, Semantics, and Evaluation. In Symposium on Principles of Programming Languages (POPL). 5–17. https://doi.org/10.1145/2535838.2535840
[8]
Cisco. 2018. Cisco Nexus 3000 Series Switches. https://www.cisco.com/c/en/us/products/switches/nexus-3000-series-switches/index.html
[9]
Jeremy Condit, Matthew Harren, Zachary Anderson, David Gay, and George C. Necula. 2007. Dependent Types for Low-Level Programming. In European Symposium on Programming (ESOP). 520–535. https://doi.org/10.1007/978-3-540-71316-6_35
[10]
Benjamin Delaware, Sorawit Suriyakarn, Clément Pit-Claudel, Qianchuan Ye, and Adam Chlipala. 2019. Narcissus: Correct-by-Construction Derivation of Decoders and Encoders from Binary Formats. Proceedings of the ACM Programming Languages (PACMPL), 3, ICFP (2019), Article 82, July, https://doi.org/10.1145/3341686
[11]
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 (PACMPL), 5, POPL (2021), Article 41, Jan., https://doi.org/10.1145/3434322
[12]
Dragos Dumitrescu, Radu Stoenescu, Lorina Negreanu, and Costin Raiciu. 2020. Bf4: Towards Bug-Free P4 Programs. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 571–585. isbn:9781450379557 https://doi.org/10.1145/3387514.3405888
[13]
Matthias Eichholz, Eric Campbell, Nate Foster, Guido Salvaneschi, and Mira Mezini. 2019. How to Avoid Making a Billion-Dollar Mistake: Type-Safe Data Plane Programming with SafeP4. In European Conference on Object-Oriented Programming (ECOOP). 12:1–12:28. https://doi.org/10.4230/LIPIcs.ECOOP.2019.12
[14]
Robert Ennals, Richard Sharp, and Alan Mycroft. 2004. Linear Types for Packet Processing. In European Symposium on Programming (ESOP). 204–218. https://doi.org/10.1007/978-3-540-24725-8_15
[15]
Kathleen Fisher and Robert Gruber. 2005. PADS: A Domain-Specific Language for Processing Ad Hoc Data. In Conference on Programming Language Design and Implementation (PLDI). 295–304. https://doi.org/10.1145/1065010.1065046
[16]
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 Symposium on SDN Research (SOSR). Article 4, 7 pages. https://doi.org/10.1145/3185467.3185499
[17]
Jiaqi Gao, Ennan Zhai, Hongqiang Harry Liu, Rui Miao, Yu Zhou, Bingchuan Tian, Chen Sun, Dennis Cai, Ming Zhang, and Minlan Yu. 2020. Lyra: A Cross-Platform Language and Compiler for Data Plane Programming on Heterogeneous ASICs. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 435–450. isbn:9781450379557 https://doi.org/10.1145/3387514.3405879
[18]
Vladimir Gapeyev and Benjamin C. Pierce. 2003. Regular Object Types. In European Conference on Object-Oriented Programming (ECOOP). 151–175. https://doi.org/10.1007/978-3-540-45070-2_8
[19]
Patrice Godefroid, Nils Klarlund, and Koushik Sen. 2005. DART: Directed automated random testing. In Conference on Programming Language Design and Implementation (PLDI). 213–223. https://doi.org/10.1145/1065010.1065036
[20]
Toke Høiland-Jørgensen, Jesper Dangaard Brouer, Daniel Borkmann, John Fastabend, Tom Herbert, David Ahern, and David Miller. 2018. The EXpress Data Path: Fast Programmable Packet Processing in the Operating System Kernel. In International Conference on Emerging Networking EXperiments and Technologies (CoNEXT). 54–66. https://doi.org/10.1145/3281411.3281443
[21]
Haruo Hosoya and Benjamin C. Pierce. 2003. XDuce: A Statically Typed XML Processing Language. ACM Transactions on Internet Technology (TOIT), 3, 2 (2003), May, 117–148. https://doi.org/10.1145/767193.767195
[22]
Stephen Ibanez, Gordon Brebner, Nick McKeown, and Noa Zilberman. 2019. The P4->NetFPGA Workflow for Line-Rate Packet Processing. In Symposium on Field-Programmable Gate Arrays (FPGA). 1–9. https://doi.org/10.1145/3289602.3293924
[23]
Trevor Jim, Yitzhak Mandelbaum, and David Walker. 2010. Semantics and Algorithms for Data-Dependent Grammars. In Symposium on Principles of Programming Languages (POPL). 417–430. https://doi.org/10.1145/1706299.1706347
[24]
Xin Jin, Xiaozhou Li, Haoyu Zhang, Robert Soulé, Jeongkeun Lee, Nate Foster, Changhoon Kim, and Ion Stoica. 2017. NetCache: Balancing Key-Value Stores with Fast In-Network Caching. In Symposium on Operating Systems Principles (SOSP). 121–136. https://doi.org/10.1145/3132747.3132764
[25]
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 Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 490–503. https://doi.org/10.1145/3230543.3230582
[26]
Conor McBride. 2001. The derivative of a regular type is its type of one-hole contexts. Extended abstract, available at http://strictlypositive.org/diff.pdf
[27]
Peter J. McCann and Satish Chandra. 2000. Packet Types: Abstract Specification of Network Protocol Messages. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 321–333. https://doi.org/10.1145/347059.347563
[28]
Chitra Muthukrishnan, Vern Paxson, Mark Allman, and Aditya Akella. 2010. Using Strongly Typed Networking to Architect for Tussle. In Workshop on Hot Topics in Networks (HotNets). Article 9, 6 pages. https://doi.org/10.1145/1868447.1868456
[29]
Aleksandar Nanevski, Ruy Ley-Wild, Ilya Sergey, and Germán Andrés Delbianco. 2014. Communicating State Transition Systems for Fine-Grained Concurrent Resources. In European Symposium on Programming (ESOP). 290–310. https://doi.org/10.1007/978-3-642-54833-8_16
[30]
Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. 2006. Polymorphism and Separation in Hoare Type Theory. In International Conference on Functional Programming (ICFP). 62–73. isbn:1595933093 https://doi.org/10.1145/1159803.1159812
[31]
Aleksandar Nanevski, Greg Morrisett, Avraham Shinnar, Paul Govereau, and Lars Birkedal. 2008. Ynot: Dependent Types for Imperative Programs. In International Conference on Functional Programming (ICFP. 229–240. https://doi.org/10.1145/1411204.1411237
[32]
Tahina Ramananandro, Antoine Delignat-Lavaud, Cedric Fournet, Nikhil Swamy, Tej Chajed, Nadim Kobeissi, and Jonathan Protzenko. 2019. EverParse: Verified Secure Zero-Copy Parsers for Authenticated Message Formats. In USENIX Security Symposium (USENIX Security). 1465–1482. isbn:978-1-939133-06-9 https://www.usenix.org/conference/usenixsecurity19/presentation/delignat-lavaud
[33]
Patrick M. Rondon, Ming Kawaguci, and Ranjit Jhala. 2008. Liquid Types. In Conference on Programming Language Design and Implementation (PLDI). 159–169. https://doi.org/10.1145/1375581.1375602
[34]
Hardik Soni, Myriana Rifai, Praveen Kumar, Ryan Doenges, and Nate Foster. 2020. Composing Dataplane Programs with μ P4. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 329–343. https://doi.org/10.1145/3387514.3405872
[35]
Radu Stoenescu, Dragos Dumitrescu, Matei Popovici, Lorina Negreanu, and Costin Raiciu. 2018. Debugging P4 Programs with Vera. In Conference of the Special Interest Group on Data Communication on the Applications, Technologies, Architectures, and Protocols for Computer Communication (SIGCOMM). 518–532. https://doi.org/10.1145/3230543.3230548
[36]
Nikhil Swamy, Cătălin Hriţcu, Chantal Keller, Aseem Rastogi, Antoine Delignat-Lavaud, Simon Forest, Karthikeyan Bhargavan, Cédric Fournet, Pierre-Yves Strub, Markulf Kohlweiss, Jean-Karim Zinzindohoue, and Santiago Zanella-Béguelin. 2016. Dependent Types and Multi-Monadic Effects in F*. In Symposium on Principles of Programming Languages (POPL). 256–270. https://doi.org/10.1145/2837614.2837655
[37]
Sam Tobin-Hochstadt and Matthias Felleisen. 2010. Logical Types for Untyped Languages. In International Conference on Functional Programming (ICFP). 117–128. isbn:978-1-60558-794-3 https://doi.org/10.1145/1863543.1863561
[38]
Niki Vazou, Eric L. Seidel, Ranjit Jhala, Dimitrios Vytiniotis, and Simon Peyton-Jones. 2014. Refinement Types for Haskell. In International Conference on Functional Programming (ICFP). 269–282. https://doi.org/10.1145/2628136.2628161
[39]
Niki Vazou, Éric Tanter, and David Van Horn. 2018. Gradual Liquid Type Inference. Proceedings of the ACM on Programming Languages (PACMPL), 2, OOPSLA (2018), Article 132, Oct., 25 pages. https://doi.org/10.1145/3276502
[40]
Han Wang, Robert Soulé, Huynh Tu Dang, Ki-Suh Lee, Vishal Shrivastav, Nate Foster, and Hakim Weatherspoon. 2017. P4FPGA: A Rapid Prototyping Framework for P4. In Symposium on SDN Research (SOSR). 122–135. https://doi.org/10.1145/3050220.3050234
[41]
Hongwei Xi. 2000. Imperative programming with dependent types. In Symposium on Logic in Computer Science (LICS). 375–387. https://doi.org/10.1109/LICS.2000.855785
[42]
Hongwei Xi and Robert Harper. 2001. A Dependently Typed Assembly Language. In International Conference on Functional Programming (ICFP). 169–180. https://doi.org/10.1145/507635.507657
[43]
Hongwei Xi and Frank Pfenning. 1999. Dependent Types in Practical Programming. In Symposium on Principles of Programming Languages (POPL). 214–227. isbn:1581130953

Cited By

View all
  • (2024)Computing Precise Control Interface SpecificationsProceedings of the ACM on Programming Languages10.1145/36897438:OOPSLA2(905-934)Online publication date: 8-Oct-2024
  • (2024)Synchronous Programming with Refinement TypesProceedings of the ACM on Programming Languages10.1145/36746578:ICFP(938-972)Online publication date: 15-Aug-2024
  • (2024)HOL4P4: Mechanized Small-Step Semantics for P4Proceedings of the ACM on Programming Languages10.1145/36498198:OOPSLA1(223-249)Online publication date: 29-Apr-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 6, Issue POPL
January 2022
1886 pages
EISSN:2475-1421
DOI:10.1145/3511309
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 January 2022
Published in PACMPL Volume 6, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Dependent Types
  2. P4
  3. Software-Defined Networking

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)179
  • Downloads (Last 6 weeks)23
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Computing Precise Control Interface SpecificationsProceedings of the ACM on Programming Languages10.1145/36897438:OOPSLA2(905-934)Online publication date: 8-Oct-2024
  • (2024)Synchronous Programming with Refinement TypesProceedings of the ACM on Programming Languages10.1145/36746578:ICFP(938-972)Online publication date: 15-Aug-2024
  • (2024)HOL4P4: Mechanized Small-Step Semantics for P4Proceedings of the ACM on Programming Languages10.1145/36498198:OOPSLA1(223-249)Online publication date: 29-Apr-2024
  • (2023)P4R-Type: A Verified API for P4 Control Plane ProgramsProceedings of the ACM on Programming Languages10.1145/36228667:OOPSLA2(1935-1963)Online publication date: 16-Oct-2023
  • (2023)SwitchLog: A Logic Programming Language for Network SwitchesPractical Aspects of Declarative Languages10.1007/978-3-031-24841-2_12(180-196)Online publication date: 16-Jan-2023

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media