idnits 2.17.1 draft-hsingh-coinrg-p4use-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 10 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (September 30, 2020) is 1303 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 COIN H. Singh 3 Internet-Draft MNK Labs and Consulting 4 Intended status: Informational M-J. Montpetit 5 Expires: April 3, 2021 Concordia Univeristy 6 September 30, 2020 8 Use of P4 Programs in IETF Specifications 9 draft-hsingh-coinrg-p4use-00 11 Abstract 13 The IETF specifies several algorithms operating in the data plane of 14 a network node, including liveliness detection, congestion control, 15 network measurement, security, and load balancing. Such algorithms 16 are commonly specified using English or flow charts. As an 17 alternative, this document proposes that P4 programs can be used to 18 specify some data plane algorithms. P4 is a programming language 19 created in 2014 to program the data plane of network nodes such as 20 switches, routers, smartNICs, and generic compute targets. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on April 3, 2021. 39 Copyright Notice 41 Copyright (c) 2020 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Requirements Language . . . . . . . . . . . . . . . . . . . . 2 57 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 3. Example Use . . . . . . . . . . . . . . . . . . . . . . . . . 2 59 4. Summary of P4 . . . . . . . . . . . . . . . . . . . . . . . . 4 60 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 61 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 62 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 4 63 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 64 8.1. Normative References . . . . . . . . . . . . . . . . . . 4 65 8.2. Informative References . . . . . . . . . . . . . . . . . 5 66 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 5 68 1. Requirements Language 70 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 71 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 72 document are to be interpreted as described in RFC 2119 [RFC2119]. 74 2. Introduction 76 Research papers for data plane algorithms already use P4 programs to 77 specify algorithms. The MIT Domino compiler [MIT-Domino] which 78 synthesizes hardware logic also outputs a P4 program. For example, 79 the HULA [HULA] data plane congestion control algorithm includes P4 80 programming logic in the paper. 82 In another section, this document shows an example for how textual 83 description and flow chart of an algorithm could be augmented or 84 replaced by a P4 program. Lastly, This document presents a summary 85 of the P4 programming language. 87 3. Example Use 89 An IETF document in [I-D.chen-nvo3-load-banlancing] discusses the 90 flowlet algorithm for load balancing. The draft includes description 91 of algorithm in section 4.1 and a state machine diagram in section 5. 92 Further, if other tables are used in conjunction with the flowlet 93 table, in what sequence does one invoke the tables? Specifying the 94 algorithm of the draft as a P4 program is appropriate. Open source 95 P4 compiler (p4c) already includes a P4 program which implements the 96 flowlet algorithm. See 97 https://github.com/p4lang/p4c/blob/master/testdata/p4_16_samples/ 98 flowlet_switching-bmv2.p4 100 The program uses five tables and the ingress control block shows in 101 what order are the tables invoked. The flowlet algorithm exists in 102 the lookup_flow_map and update_flowlet_id P4 actions. The program 103 uses P4 registers to maintain state. The IETF draft uses timers. 104 The P4 code uses timestamps since P4 does not support timer yet. A 105 rudimentary timer in a P4 program can use arithmetic to determine 106 whether it is an even/odd minute based on data plane clock used for 107 timestamping packets. 109 A portion of the P4 program listed above is shown below. The portion 110 shows two P4 actions which implement the flowlet algorithm. 112 action lookup_flowlet_map() { 113 hash(meta.ingress_metadata.flowlet_map_index, 114 HashAlgorithm.crc16, 115 (bit<13>)0, { hdr.ipv4.srcAddr, hdr.ipv4.dstAddr, 116 hdr.ipv4.protocol, hdr.tcp.srcPort, 117 hdr.tcp.dstPort }, (bit<26>)13); 118 flowlet_id.read(meta.ingress_metadata.flowlet_id, 119 (bit<32>)meta.ingress_metadata.flowlet_map_index); 120 meta.ingress_metadata.flow_ipg = 121 (bit<32>)standard_metadata.ingress_global_timestamp; 122 flowlet_lasttime.read( 123 meta.ingress_metadata.flowlet_lasttime, 124 (bit<32>)meta.ingress_metadata.flowlet_map_index); 125 meta.ingress_metadata.flow_ipg = 126 meta.ingress_metadata.flow_ipg - 127 meta.ingress_metadata.flowlet_lasttime; 128 flowlet_lasttime.write( 129 (bit<32>)meta.ingress_metadata.flowlet_map_index, 130 (bit<32>)standard_metadata.ingress_global_timestamp); 131 } 132 action update_flowlet_id() { 133 meta.ingress_metadata.flowlet_id = 134 meta.ingress_metadata.flowlet_id + 16w1; 135 flowlet_id.write( 136 (bit<32>)meta.ingress_metadata.flowlet_map_index, 137 (bit<16>)meta.ingress_metadata.flowlet_id); 138 } 140 Figure 1: Two P4 actions implement the flowlet algorithm 142 The ingress control block invokes table lookup using 'table.apply()'. 144 apply { 145 @atomic { 146 flowlet.apply(); 147 if (meta.ingress_metadata.flow_ipg > 32w50000) 148 new_flowlet.apply(); 149 } 150 ecmp_group.apply(); 151 ecmp_nhop.apply(); 152 forward.apply(); 153 } 155 Figure 2: Code shows order of invocation for table lookup 157 4. Summary of P4 159 First, https://p4.org is a great resource to start with. The website 160 includes specifications, pointers to P4 tutorials, p4c, the P4 161 mailer, P4 Slack Channel, and other details to P4 events, blogs. etc. 162 The README.md file at https://github.com/p4lan/p4c/ includes details 163 on how to compile a P4 program. P4 started with a P4-14 version in 164 2014. Since, May 2017, a new version in P4-16 and compiler are 165 available. A list of hardware targets to use for P4 programming is 166 available here: https://github.com/hesingh/p4-info 168 5. Security Considerations 170 Use IPSec [RFC4301]. 172 6. IANA Considerations 174 None. 176 7. Acknowledgements 178 Thanks (in alphabetical order by first name) to Nick McKeown for 179 encouraging this work. 181 8. References 183 8.1. Normative References 185 [I-D.chen-nvo3-load-banlancing] 186 Chen, H., "Load balancing without packet reordering in 187 NVO3", draft-chen-nvo3-load-banlancing-00 (work in 188 progress), October 2014. 190 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 191 Requirement Levels", BCP 14, RFC 2119, 192 DOI 10.17487/RFC2119, March 1997, 193 . 195 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 196 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 197 December 2005, . 199 8.2. Informative References 201 [HULA] Katta, N., Hira, M., Kim, C., Sivaraman, A., and J. 202 Rexford, "HULA: Scalable Load Balancing Using Programmable 203 Data Planes", March 2016, 204 . 206 [MIT-Domino] 207 Sivaraman, A., Cheung, A., Budiu, M., Kim, C., Alizadeh, 208 M., Balakrishnan, H., Varghese, G., McKeown, N., and S. 209 Licking, "Packet Transactions: High-level Programming for 210 Line-Rate Switches", January 2016, 211 . 213 Authors' Addresses 215 Hemant Singh 216 MNK Labs and Consulting 217 7 Caldwell Drive 218 Westford, MA 01886 219 USA 221 Phone: +1 978 692 2340 222 Email: hemant@mnkcg.com 223 URI: https://mnkcg.com/ 225 Marie-Jose Montpetit 226 Concordia Univeristy 227 1455 Boulevard de Maisonneuve O 228 Montreal, Quebec 01886 229 Canada 231 Email: marie@mjmontpetit.com