skip to main content

Safe, modular packet pipeline programming

Published:12 January 2022Publication History
Skip Abstract Section

Abstract

The P4 language and programmable switch hardware, like the Intel Tofino, have made it possible for network engineers to write new programs that customize operation of computer networks, thereby improving performance, fault-tolerance, energy use, and security. Unfortunately, possible does not mean easy—there are many implicit constraints that programmers must obey if they wish their programs to compile to specialized networking hardware. In particular, all computations on the same switch must access data structures in a consistent order, or it will not be possible to lay that data out along the switch’s packet-processing pipeline. In this paper, we define Lucid 2.0, a new language and type system that guarantees programs access data in a consistent order and hence are pipeline-safe. Lucid 2.0 builds on top of the original Lucid language, which is also pipeline-safe, but lacks the features needed for modular construction of data structure libraries. Hence, Lucid 2.0 adds (1) polymorphism and ordering constraints for code reuse; (2) abstract, hierarchical pipeline locations and data types to support information hiding; (3) compile-time constructors, vectors and loops to allow for construction of flexible data structures; and (4) type inference to lessen the burden of program annotations. We develop the meta-theory of Lucid 2.0, prove soundness, and show how to encode constraint checking as an SMT problem. We demonstrate the utility of Lucid 2.0 by developing a suite of useful networking libraries and applications that exploit our new language features, including Bloom filters, sketches, cuckoo hash tables, distributed firewalls, DNS reflection defenses, network address translators (NATs) and a probabilistic traffic monitoring service.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a version of the POPL22 paper "Safe, Modular Packet Pipeline Programming" which contains appendices detailing the full formal definition of the language and type system, as well as proofs of language properties and soundness.

References

  1. Mohammad Alizadeh, Tom Edsall, Sarang Dharmapurikar, Ramanan Vaidyanathan, Kevin Chu, Andy Fingerhut, The Vinh Lam, Francis Matus, Rong Pan, Navindra Yadav, and George Varghese. 2014. CONGA: distributed congestion-aware load balancing for datacenters. In ACM SIGCOMM. 503–514. https://doi.org/10.1145/2740070.2626316 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Carolyn Jane Anderson, Nate Foster, Arjun Guha, Jean-Baptiste Jeannin, Dexter Kozen, Cole Schlesinger, and David Walker. 2014. NetKAT: Semantic Foundations for Networks. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 113–126. https://doi.org/10.1145/2578855.2535862 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Mario Baldi. 2020. Pensando Announces P4-programmable Platform and Joins P4 Community. https://opennetworking.org/news-and-events/blog/pensando-announces-p4-programmable-platform-and-joins-p4-community/.Google ScholarGoogle Scholar
  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. ACM SIGCOMM Computer Communication Review, 44, 3 (2014), 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 ACM SIGCOMM. 99–110. https://doi.org/10.1145/2486001.2486011 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2006. What’s Decidable About Arrays? In Verification, Model Checking, and Abstract Interpretation, E. Allen Emerson and Kedar S. Namjoshi (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 427–442. isbn:978-3-540-31622-0 https://doi.org/10.1007/11609773_28 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Leonardo de Moura and Nikolaj Bjørner. 2008. Z3: An Efficient SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems, C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 337–340. isbn:978-3-540-78800-3 https://doi.org/10.5555/1792734.1792766Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Rob DeLine and Manuel Fahndrich. 1999. Natural deduction for intuitionistic non-commutative linear logic. In International Conference on Typed Lambda Calculi and Applications. https://doi.org/10.1016/S1571-0661(04)80088-4 Google ScholarGoogle ScholarCross RefCross Ref
  9. Carl Ebeling, Darren C. Cronquist, and Paul Franklin. 1996. RaPiD - Reconfigurable Pipelined Datapath. In Proceedings of the 6th International Workshop on Field-Programmable Logic, Smart Applications, New Paradigms and Compilers (FPL ’96). Springer-Verlag, Berlin, Heidelberg. 126–135. isbn:3540617302 https://doi.org/10.5555/647923.741212Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Nate Foster, Rob Harrison, Michael J. Freedman, Christopher Monsanto, Jennifer Rexford, Alec Story, and David Walker. 2011. Frenetic: A Network Programming Language. In ACM International Conference on Functional Programming. 279–291. https://doi.org/10.1145/2034574.2034812 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ACM SIGCOMM. 435–450. https://doi.org/10.1145/3387514.3405879 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Xiangyu Gao, Taegyun Kim, Michael D. Wong, Divya Raghunathan, Aatish Kishan Varma, Pravein Govindan Kannan, Anirudh Sivaraman, Srinivas Narayana, and Aarti Gupta. 2020. Switch Code Generation Using Program Synthesis. In ACM SIGCOMM. 44–61. https://doi.org/10.1145/3387514.3405852 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. David K. Gifford and John M. Lucassen. 1986. Integrating Functional and Imperative Programming. In Proceedings of the 1986 ACM Conference on LISP and Functional Programming (LFP ’86). Association for Computing Machinery, New York, NY, USA. 28–38. isbn:0897912004 https://doi.org/10.1145/319838.319848 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jean-Yves Girard. 1987. Linear Logic. Theor. Comput. Sci., 50, 1 (1987), Jan., 1–102. issn:0304-3975 https://doi.org/10.1016/0304-3975(87)90045-4 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Mary Hogan, Shir Landau-Feibish, Mina Tahmasbi Arashloo, Jennifer Rexford, David Walker, and Rob Harrison. 2020. Elastic Switch Programming with P4All. In ACM SIGCOMM HotNets Networks. 168–174. https://doi.org/10.1145/3422604.3425933 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Kuo-Feng Hsu, Ryan Beckett, Ang Chen, Jennifer Rexford, and David Walker. 2020. Contra: A programmable system for performance-aware routing. In USENIX Symposium on Networked Systems Design and Implementation. 701–721.Google ScholarGoogle Scholar
  17. Atsushi Igarashi and Naoki Kobayashi. 2005. Resource Usage Analysis. ACM Trans. Program. Lang. Syst., 27, 2 (2005), March, 264–313. issn:0164-0925 https://doi.org/10.1145/1057387.1057390 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Intel. 2020. Intel Tofino 2. https://www.intel.com/content/www/us/en/products/network-io/programmable-ethernet-switch/tofino-2-series.html.Google ScholarGoogle Scholar
  19. Vimalkumar Jeyakumar, Mohammad Alizadeh, Yilong Geng, Changhoon Kim, and David Mazières. 2014. Millions of Little Minions: Using Packets for Low Latency Network Programming and Visibility. SIGCOMM Comput. Commun. Rev., 44, 4 (2014), Aug., 3–14. issn:0146-4833 https://doi.org/10.1145/2740070.2626292 Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Mohan Kalkunte. 2019. Broadcom’s new Trident 4 and Jericho 2 switch devices offer programmability at scale. https://www.broadcom.com/blog/trident4-and-jericho2-offer-programmability-at-scale.Google ScholarGoogle Scholar
  21. Naga Katta, Mukesh Hira, Changhoon Kim, Anirudh Sivaraman, and Jennifer Rexford. 2016. Hula: Scalable load balancing using programmable data planes. In ACM SIGCOMM Symposium on SDN Research. 1–12. https://doi.org/10.1145/2890955.2890968 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Zaoxing Liu, Hun Namkung, Georgios Nikolaidis, Jeongkeun Lee, Changhoon Kim, Xin Jin, Vladimir Braverman, Minlan Yu, and Vyas Sekar. 2021. Jaqen: A High-Performance Switch-Native Approach for Detecting and Mitigating Volumetric DDoS Attacks with Programmable Switches. In USENIX Security Symposium.Google ScholarGoogle Scholar
  23. Robin Milner. 1978. A theory of type polymorphism in programming. J. Comput. System Sci., 17, 3 (1978), 348–375. issn:0022-0000 https://doi.org/10.1016/0022-0000(78)90014-4 Google ScholarGoogle ScholarCross RefCross Ref
  24. Tim Nelson, Andrew D. Ferguson, Michael J.G. Scheer, and Shriram Krishnamurthi. 2014. Tierless Programming and Reasoning for Software-Defined Networks. In USENIX Networked Systems Design and Implementation. 519–531. https://doi.org/10.5555/2616448.2616496Google ScholarGoogle Scholar
  25. Jeff Polakow and Frank Pfenning. 1999. Natural Deduction for Intuitionistic Non-communicative Linear Logic. In Typed Lambda Calculi and Applications, 4th International Conference, TLCA’99, L’Aquila, Italy, April 7-9, 1999, Proceedings, Jean-Yves Girard (Ed.) (Lecture Notes in Computer Science, Vol. 1581). Springer, 295–309. https://doi.org/10.1016/S1571-0661(04)80088-4 Google ScholarGoogle ScholarCross RefCross Ref
  26. Jeff Polakow and Frank Pfenning. 1999. Natural deduction for intuitionistic non-commutative linear logic. In International Conference on Typed Lambda Calculi and Applications. https://doi.org/10.1016/S1571-0661(04)80088-4 Google ScholarGoogle ScholarCross RefCross Ref
  27. J. Polokow and Frank Pfenning. 1999. Relating Natural Deduction and Sequent Calculus for Intuitionistic Non-Commutative Linear Logic. In Fifteenth Conference on Mathematical Foundations of Progamming Semantics, MFPS 1999, Tulane University, New Orleans, LA, USA, April 28 - May 1, 1999, Stephen D. Brookes, Achim Jung, Michael W. Mislove, and Andre Scedrov (Eds.) (Electronic Notes in Theoretical Computer Science, Vol. 20). Elsevier, 449–466. https://doi.org/10.1016/S1571-0661(04)80088-4 Google ScholarGoogle ScholarCross RefCross Ref
  28. Joshua Reich, Christopher Monsanto, Nate Foster, Jennifer Rexford, and David Walker. 2013. Modular sdn programming with pyretic. Technical Reprot of USENIX, 30.Google ScholarGoogle Scholar
  29. Cole Schlesinger, Michael Greenberg, and David Walker. 2014. Concurrent NetCore: From Policies to Pipelines. In ACM International Conference on Functional Programming. 11–24. https://doi.org/10.1145/2692915.2628157 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Rinku Shah, Vikas Kumar, Mythili Vutukuru, and Purushottam Kulkarni. 2020. TurboEPC: Leveraging Dataplane Programmability to Accelerate the Mobile Packet Core. In ACM Symposium on SDN Research. 83–95. https://doi.org/10.1145/3373360.3380839 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Anirudh Sivaraman, Alvin Cheung, Mihai Budiu, Changhoon Kim, Mohammad Alizadeh, Hari Balakrishnan, George Varghese, Nick McKeown, and Steve Licking. 2016. Packet transactions: High-level programming for line-rate switches. In ACM SIGCOMM. 15–28. https://doi.org/10.1145/2934872.2934900 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. John Sonchack, Devon Loehr, Jennifer Rexford, and David Walker. 2021. Lucid: A Language for Control in the Data Plane. In Proceedings of the 2021 ACM SIGCOMM 2021 Conference (SIGCOMM ’21). Association for Computing Machinery, New York, NY, USA. 731–747. isbn:9781450383837 https://doi.org/10.1145/3452296.3472903 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. John Sonchack, Oliver Michel, Adam J Aviv, Eric Keller, and Jonathan M Smith. 2018. Scaling hardware accelerated network monitoring to concurrent and dynamic queries with *Flow. In USENIX Annual Technical Conference. 823–835. https://doi.org/10.5555/3277355.3277435Google ScholarGoogle Scholar
  34. Mads Tofte and Lars Birkedal. 1998. A Region Inference Algorithm. ACM Trans. Program. Lang. Syst., 20, 4 (1998), July, 724–767. issn:0164-0925 https://doi.org/10.1145/291891.291894 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Mads Tofte and Jean-Pierre Talpin. 1997. Region-Based Memory Management. Inf. Comput., 132, 2 (1997), Feb., 109–176. issn:0890-5401 https://doi.org/10.1006/inco.1996.2613 Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Andreas Voellmy, Junchang Wang, Y Richard Yang, Bryan Ford, and Paul Hudak. 2013. Maple: Simplifying SDN programming using algorithmic policies. In ACM SIGCOMM. 87–98. https://doi.org/10.1145/2534169.2486030 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. David Walker. 2005. Advanced Topics in Types and Programming Languages. The MIT Press, 3–44.Google ScholarGoogle Scholar

Index Terms

  1. Safe, modular packet pipeline 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!