skip to main content

Dependently-typed data plane programming

Published:12 January 2022Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Cisco. 2018. Cisco Nexus 3000 Series Switches. https://www.cisco.com/c/en/us/products/switches/nexus-3000-series-switches/index.htmlGoogle ScholarGoogle Scholar
  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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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.pdfGoogle ScholarGoogle Scholar
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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-lavaudGoogle ScholarGoogle Scholar
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  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 Google ScholarGoogle ScholarCross RefCross Ref
  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 Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Hongwei Xi and Frank Pfenning. 1999. Dependent Types in Practical Programming. In Symposium on Principles of Programming Languages (POPL). 214–227. isbn:1581130953Google ScholarGoogle Scholar

Index Terms

  1. Dependently-typed data plane programming

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!