Composing Dataplane Programs with μP4

ACM SIGCOMM 2020, 2020.

Cited by: 0|Bibtex|Views18
Weibo:
We introduce μP4 which raises the level of abstraction from targetspecific packet-processing pipelines and constructs

Abstract:

Dataplane languages like P4 enable flexible and efficient packetprocessing using domain-specific primitives such as programmable parsers and match-action tables. Unfortunately, P4 programs tend to be monolithic and tightly coupled to the hardware architecture, which makes it hard to write programs in a portable and modular way—e.g., by co...More

Code:

Data:

0
Introduction
  • Over the past few years, the synergistic development of packetprocessing hardware and software has changed how networks are built and run.
  • The Portable Switch Architecture (PSA) [10] models a switch with programmable parsers, programmable ingress and egress pipelines, as well as fixed-function schedulers and queues
  • While this design allows the language to flexibly accommodate a range of targets, it creates a tight coupling between P4 programs and the underlying architectures, which makes it difficult to write, compose, and reuse common code fragments across different programs and architectures.
  • Doing this correctly is non-trivial in P4 today
Highlights
  • Over the past few years, the synergistic development of packetprocessing hardware and software has changed how networks are built and run
  • Homogenize abstract machines for flexibly composing and mapping modules to targets. Primitives such as parsers and match-action tables (MATs) are expressed using different sub-languages of P4, we find that fundamentally these primitives can be implemented by a common abstract machine based on MATs [17]
  • The frontend transforms a μP4 programs into an intermediate representation
  • Our evaluation focuses on two key questions: (i) does μP4 enable dataplane programming in a modular, composable and portable manner (§7.1–§7.2), and (ii) can μP4 programs be run on commodity programmable switches (§7.3)? We answer both these questions positively by implementing a library of widely-used packet-processing functions as independent μP4 modules and composing them to build new dataplane programs
  • The composed programs can perform a variety of functions including Ethernet switching, IPv4 and IPv6 routing, MPLS-based edge routing, Network Address Translation (NAT), IPv6 Network Prefix Translation (NPTv6), Firewall/ACL, and Segment Routing (SRv4 and SRv6)
  • We introduce μP4 which raises the level of abstraction from targetspecific packet-processing pipelines and constructs
Methods
  • Design Overview

    μP4C builds on the P4 reference compiler, p4c [9], and has a modular design consisting of three passes: frontend, midend and backend.
  • The midend pass is target-agnostic and focuses on composition and preprocessing for the backend pass
  • It performs four main transformations: (i) linking μP4-IR for modules, (ii) static analysis (§5.2), (iii) homogenizing parser and control blocks to enable composition (§5.3), and (iv) preprocessing any packet copying constructs—e.g., copy_from—for the backend pass (§5.4).
  • After this pass, the composed μP4-IR contains only control blocks with μPAspecific constructs
Results
  • The authors' evaluation focuses on two key questions: (i) does μP4 enable dataplane programming in a modular, composable and portable manner (§7.1–§7.2), and (ii) can μP4 programs be run on commodity programmable switches (§7.3)? The authors answer both these questions positively by implementing a library of widely-used packet-processing functions as independent μP4 modules and composing them to build new dataplane programs.
  • The authors' evaluation focuses on two key questions: (i) does μP4 enable dataplane programming in a modular, composable and portable manner (§7.1–§7.2), and (ii) can μP4 programs be run on commodity programmable switches (§7.3)?
  • The authors answer both these questions positively by implementing a library of widely-used packet-processing functions as independent μP4 modules and composing them to build new dataplane programs.
  • The composed programs can perform a variety of functions including Ethernet switching, IPv4 and IPv6 routing, MPLS-based edge routing, Network Address Translation (NAT), IPv6 Network Prefix Translation (NPTv6), Firewall/ACL, and Segment Routing (SRv4 and SRv6).
  • The authors verify portability of μP4 programs by reusing the same modules and compiling the composed programs for two architectures: V1Model and TNA
Conclusion
  • Discussion and Future

    Work

    The authors believe μP4 is an important first step toward making modular dataplane programming a reality.
  • The main source of resource overheads with μP4 is μP4C’s transformation ofparsers into MATs as it affects the resource allocation heuristics of the target compiler in several ways.
  • These MATs may introduce new dependencies between parsed headers, subsequent MATs and byte-stack in the composed CFG.
  • The authors believe that μP4 will enable rapid innovation in dataplane programming as users can contribute to and build on portable libraries for packet-processing
Summary
  • Introduction:

    Over the past few years, the synergistic development of packetprocessing hardware and software has changed how networks are built and run.
  • The Portable Switch Architecture (PSA) [10] models a switch with programmable parsers, programmable ingress and egress pipelines, as well as fixed-function schedulers and queues
  • While this design allows the language to flexibly accommodate a range of targets, it creates a tight coupling between P4 programs and the underlying architectures, which makes it difficult to write, compose, and reuse common code fragments across different programs and architectures.
  • Doing this correctly is non-trivial in P4 today
  • Objectives:

    One of the goals is to keep the changes to P416 syntax and grammar minimal to ease the adoption of μP4.
  • The authors aim to generate code that is amenable to bf-p4c’s heuristics for constrained resource optimization
  • Methods:

    Design Overview

    μP4C builds on the P4 reference compiler, p4c [9], and has a modular design consisting of three passes: frontend, midend and backend.
  • The midend pass is target-agnostic and focuses on composition and preprocessing for the backend pass
  • It performs four main transformations: (i) linking μP4-IR for modules, (ii) static analysis (§5.2), (iii) homogenizing parser and control blocks to enable composition (§5.3), and (iv) preprocessing any packet copying constructs—e.g., copy_from—for the backend pass (§5.4).
  • After this pass, the composed μP4-IR contains only control blocks with μPAspecific constructs
  • Results:

    The authors' evaluation focuses on two key questions: (i) does μP4 enable dataplane programming in a modular, composable and portable manner (§7.1–§7.2), and (ii) can μP4 programs be run on commodity programmable switches (§7.3)? The authors answer both these questions positively by implementing a library of widely-used packet-processing functions as independent μP4 modules and composing them to build new dataplane programs.
  • The authors' evaluation focuses on two key questions: (i) does μP4 enable dataplane programming in a modular, composable and portable manner (§7.1–§7.2), and (ii) can μP4 programs be run on commodity programmable switches (§7.3)?
  • The authors answer both these questions positively by implementing a library of widely-used packet-processing functions as independent μP4 modules and composing them to build new dataplane programs.
  • The composed programs can perform a variety of functions including Ethernet switching, IPv4 and IPv6 routing, MPLS-based edge routing, Network Address Translation (NAT), IPv6 Network Prefix Translation (NPTv6), Firewall/ACL, and Segment Routing (SRv4 and SRv6).
  • The authors verify portability of μP4 programs by reusing the same modules and compiling the composed programs for two architectures: V1Model and TNA
  • Conclusion:

    Discussion and Future

    Work

    The authors believe μP4 is an important first step toward making modular dataplane programming a reality.
  • The main source of resource overheads with μP4 is μP4C’s transformation ofparsers into MATs as it affects the resource allocation heuristics of the target compiler in several ways.
  • These MATs may introduce new dependencies between parsed headers, subsequent MATs and byte-stack in the composed CFG.
  • The authors believe that μP4 will enable rapid innovation in dataplane programming as users can contribute to and build on portable libraries for packet-processing
Tables
  • Table1: Composing μP4 modules to build dataplane programs
  • Table2: Resource overhead of running μP4 programs relative to their monolithic versions in terms of PHV utilization on Tofino
  • Table3: Number of stages utilized on Tofino
Download tables as Excel
Related work
  • In recent years, there has been a significant effort towards making network programming composable as networks are complex to manage and configure without having a modular approach. These have ranged from composing policies and controllers to dataplanes [2, 12, 15, 18, 22, 25, 26, 35, 37, 38].

    Recent work on composing control planes and network policies [2, 26] focuses on defining a set of composition operators that can be used to describe complex policies from smaller policies in a consistent manner. This approach suits control programs as each program specifies the complete behavior of a network or device. Inspired by these efforts, recent work [18, 37, 38] has tried to define composition operators for dataplane programs based on specific use cases. μP4 fundamentally differs from these as it enables flexible passing of control flow and data between dataplane programs. This allows programmers to reuse fine-grained packet-processing code and define custom forms of composition. Recent work also motivates the need for similar composition by positioning multitenancy of programmable network devices as a primary requirement [35]. Concurrent work on Lyra [16] shares similar goals as μP4, but takes a different approach by defining a one-big-pipeline abstraction that allows users to express their intent.
Funding
  • This work was supported in part by NSF grant CNS-1413972, DARPA grant HR0011-17-C-0047, and gifts from Fujitsu, Google, and InfoSys
Reference
  • Barefoot Academy. 2019. Introduction to Data Plane Development with P416, Tofino and P4 Studio SDE. https://barefootnetworks.com/barefoot-academy/.
    Findings
  • Carolyn Jane Anderson, Nate Foster, Arjun Guha, Jean-Baptiste Jeannin, Dexter Kozen, Cole Schlesinger, and David Walker. 2014. NetKAT: Semantic Foundations for Networks. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14). ACM, San Diego, California, USA, 113–126.
    Google ScholarLocate open access versionFindings
  • 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 Comput. Commun. Rev. 44, 3 (July 2014), 87–95.
    Google ScholarLocate open access versionFindings
  • 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 Proceedings of the 2013 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’13). ACM, Hong Kong, China, 99–110.
    Google ScholarLocate open access versionFindings
  • Sharad Chole, Andy Fingerhut, Sha Ma, Anirudh Sivaraman, Shay Vargaftik, Alon Berger, Gal Mendelson, Mohammad Alizadeh, Shang-Tse Chuang, Isaac Keslassy, et al. 2017. dRMT: Disaggregated Programmable Switching. In Proceedings of the 2017 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’17). ACM, Los Angeles, CA, USA, 1–14.
    Google ScholarLocate open access versionFindings
  • The P4 Language Consortium. 2013. switch.p4 program. https://github.com/p4lang/switch/.
    Findings
  • The P4 Language Consortium. 2018. P416 Language Specification. https://p4.org/p4-spec/docs/P4-16-v1.1.0-spec.html.
    Findings
  • The P4 Language Consortium. 2019. The BMv2 Simple Switch target. https://github.com/p4lang/behavioral-model/blob/master/docs/simple_switch.md.
    Findings
  • The P4 Language Consortium. 201P416 Reference Compiler. https://github.com/p4lang/p4c.
    Findings
  • The P4 Language Consortium. 2019. P416 Portable Switch Architecture (PSA). https://p4.org/p4-spec/docs/PSA-v1.1.0.html.
    Findings
  • The P4 Language Consortium. 2019. v1model.p4 - Architecture for simple_switch. https://github.com/p4lang/p4c/blob/master/p4include/v1model.p4.
    Findings
  • Advait Dixit, Kirill Kogan, and Patrick Eugster. 2014. Composing Heterogeneous SDN Controllers with Flowbricks. In IEEE 22nd International Conference on Network Protocols (ICNP ’14). IEEE, Raleigh, NC, USA, 287–292.
    Google ScholarLocate open access versionFindings
  • Michael D. Ernst, Greg J. Badros, and David Notkin. 2002. An Empirical Analysis of C Preprocessor Use. IEEE Transactions on Software Engineering 28, 12 (2002), 1146–1170.
    Google ScholarLocate open access versionFindings
  • Jeanne Ferrante, Karl J. Ottenstein, and Joe D. Warren. 1987. The Program Dependence Graph and Its Use in Optimization. ACM Transactions on Programming Languages and Systems (TOPLAS) 9, 3 (July 1987), 319–349.
    Google ScholarLocate open access versionFindings
  • Nate Foster, Rob Harrison, Michael J. Freedman, Christopher Monsanto, Jennifer Rexford, Alec Story, and David Walker. 2011. Frenetic: A Network Programming Language. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming (ICFP ’11). ACM, Tokyo, Japan, 279–291.
    Google ScholarLocate open access versionFindings
  • 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 Proceedings of the 2020 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’20). ACM, Virtual Event, NY, USA, 1–14.
    Google ScholarLocate open access versionFindings
  • Glen Gibb, George Varghese, Mark Horowitz, and Nick McKeown. 2013. Design principles for packet parsers. In ACM/IEEE Symposium on Architectures for Networking and Communications Systems (ANCS). ACM/IEEE, San Jose, CA, USA, 13–24.
    Google ScholarFindings
  • David Hancock and Jacobus van der Merwe. 2016. HyPer4: Using P4 to Virtualize the Programmable Data Plane. In Proceedings of the 12th International Conference on Emerging Networking EXperiments and Technologies (CoNEXT ’16). ACM, Irvine, CA, USA, 35–49.
    Google ScholarLocate open access versionFindings
  • Stephen Ibanez, Gordon Brebner, Nick McKeown, and Noa Zilberman. 20The P4->NetFPGA Workflow for Line-Rate Packet Processing. In Proceedings of the 2019 ACM/SIGDA International Symposium on Field-Programmable Gate Arrays (FPGA ’19). ACM, Seaside, CA, USA, 1–9.
    Google ScholarLocate open access versionFindings
  • Internet Engineering Task Force (IETF). 2019. IPv6 Segment Routing Header (SRH). https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-22.
    Findings
  • Internet Engineering Task Force (IETF). 2020. SRv6 Network Programming. https://tools.ietf.org/html/draft-ietf-spring-srv6-network-programming-15.
    Findings
  • Xin Jin, Jennifer Gossels, Jennifer Rexford, and David Walker. 2015. CoVisor: A Compositional Hypervisor for Software-Defined Networks. In 12th USENIX Symposium on Networked Systems Design and Implementation (NSDI ’15). USENIX Association, Oakland, CA, 87–101.
    Google ScholarLocate open access versionFindings
  • Lavanya Jose, Lisa Yan, George Varghese, and Nick McKeown. 2015. Compiling Packet Programs to Reconfigurable Switches. In 12th USENIX Symposium on Networked Systems Design and Implementation (NSDI ’15). USENIX Association, Oakland, CA, 103–115.
    Google ScholarLocate open access versionFindings
  • Eddie Kohler, Robert Morris, Benjie Chen, John Jannotti, and M. Frans Kaashoek. 2000. The Click Modular Router. ACM Transactions on Computer Systems 18, 3 (Aug. 2000), 263–297.
    Google ScholarLocate open access versionFindings
  • Jeffrey C. Mogul, Alvin AuYoung, Sujata Banerjee, Lucian Popa, Jeongkeun Lee, Jayaram Mudigonda, Puneet Sharma, and Yoshio Turner. 2013. Corybantic: Towards the Modular Composition of SDN Control Programs. In Proceedings of the Twelfth ACM Workshop on Hot Topics in Networks (HotNets-XII). ACM, College Park, MD, USA, 1–7.
    Google ScholarLocate open access versionFindings
  • Christopher Monsanto, Joshua Reich, Nate Foster, Jennifer Rexford, and David Walker. 2013. Composing Software Defined Networks. In 10th USENIX Symposium on Networked Systems Design and Implementation (NSDI ’13). USENIX Association, Lombard, IL, USA, 1–13.
    Google ScholarLocate open access versionFindings
  • Barefoot Networks. 2019. Tofino. https://barefootnetworks.com/products/brieftofino/.
    Locate open access versionFindings
  • David A. Padua and Michael J. Wolfe. 1986. Advanced Compiler Optimizations for Supercomputers. Communications of the ACM (CACM) 29, 12 (Dec. 1986), 1184–1201.
    Google ScholarLocate open access versionFindings
  • Milad Sharif. 2018. Programmable Data Plane at Terabit Speeds. https://conferences.sigcomm.org/sigcomm/2018/files/slides/p4/P4Barefoot.pdf.
    Findings
  • 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 Proceedings of the 2016 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’16). ACM, Florianopolis, Brazil, 15–28.
    Google ScholarLocate open access versionFindings
  • Anirudh Sivaraman, Suvinay Subramanian, Mohammad Alizadeh, Sharad Chole, Shang-Tse Chuang, Anurag Agrawal, Hari Balakrishnan, Tom Edsall, Sachin Katti, and Nick McKeown. 2016. Programmable Packet Scheduling at Line Rate. In Proceedings of the 2016 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’16). ACM, Florianopolis, Brazil, 44–57.
    Google ScholarLocate open access versionFindings
  • Hardik Soni, Myriana Rifai, Praveen Kumar, Ryan Doenges, and Nate Foster. 2020. μP4. https://github.com/cornell-netlab/MicroP4.
    Findings
  • Hardik Soni, Thierry Turletti, and Walid Dabbous. 2018. P4Bricks: Enabling multiprocessing using linker-based network data plane architecture. (Feb. 2018). https://hal.inria.fr/hal-01632431 (working paper or preprint).
    Findings
  • Radu Stoenescu, Dragos Dumitrescu, Matei Popovici, Lorina Negreanu, and Costin Raiciu. 2018. Debugging P4 Programs with Vera. In Proceedings of the 2018 Conference of the ACM Special Interest Group on Data Communication (SIGCOMM ’18). ACM, Budapest, Hungary, 518–532.
    Google ScholarLocate open access versionFindings
  • Tao Wang, Hang Zhu, Fabian Ruffy, Xin Jin, Anirudh Sivaraman, Dan RK Ports, and Aurojit Panda. 2020. Multitenancy for Fast and Programmable Networks in the Cloud. In 12th USENIX Workshop on Hot Topics in Cloud Computing (HotCloud ’20). USENIX Association, Virtual Conference, 8.
    Google ScholarLocate open access versionFindings
  • Mark Weiser. 1981. Program Slicing. In Proceedings of the 5th International Conference on Software Engineering (ICSE ’81). IEEE Press, Piscataway, NJ, USA, 439–449.
    Google ScholarLocate open access versionFindings
  • Cheng Zhang, Jun Bi, Yu Zhou, Abdul Basit Dogar, and Jianping Wu. 2017. HyperV: A High Performance Hypervisor for Virtualization of the Programmable Data Plane. In 26th International Conference on Computer Communication and Networks (ICCCN ’17). IEEE, Vancouver, BC, Canada, 1–9.
    Google ScholarLocate open access versionFindings
  • Peng Zheng, Theophilus Benson, and Chengchen Hu. 2018. P4Visor: Lightweight Virtualization and Composition Primitives for Building and Testing Modular Programs. In Proceedings of the 14th International Conference on Emerging Networking EXperiments and Technologies (CoNEXT ’18). ACM, Heraklion, Greece, 98–111.
    Google ScholarLocate open access versionFindings
Full Text
Your rating :
0

 

Tags
Comments