idnits 2.17.1 draft-morton-tsvwg-cheap-nasty-queueing-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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (22 July 2019) is 1734 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Transport Working Group J. Morton 3 Internet-Draft P. Heist 4 Intended status: Informational 22 July 2019 5 Expires: 23 January 2020 7 Cheap Nasty Queueing 8 draft-morton-tsvwg-cheap-nasty-queueing-00 10 Abstract 12 This note presents Cheap Nasty Queueing (CNQ), a queueing algorithm 13 intended as a bare-minimum functionality standard for hardware 14 implementations. It provides stateless or single-instance AQM and 15 basic sparse-flow prioritisation. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at https://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on 23 January 2020. 34 Copyright Notice 36 Copyright (c) 2019 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 41 license-info) in effect on the date of publication of this document. 42 Please review these documents carefully, as they describe your rights 43 and restrictions with respect to this document. Code Components 44 extracted from this document must include Simplified BSD License text 45 as described in Section 4.e of the Trust Legal Provisions and are 46 provided without warranty as described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Background . . . . . . . . . . . . . . . . . . . . . . . . . 2 52 3. The Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 3 53 3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 3 54 3.2. Declarations . . . . . . . . . . . . . . . . . . . . . . 4 55 3.3. Pseudo-code . . . . . . . . . . . . . . . . . . . . . . . 5 56 4. Security Considerations . . . . . . . . . . . . . . . . . . . 8 57 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 58 6. Informative References . . . . . . . . . . . . . . . . . . . 8 59 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 61 1. Introduction 63 Flow isolation is a powerful tool for congestion management in 64 today's Internet. Unfortunately, the relatively complex algorithms 65 and considerable dynamic state of a DRR++ queue set with individual 66 AQM (Active Queue Management) [RFC7567] instances has proved 67 disheartening to hardware implementors, and thus to deployment on 68 high-capacity links and in consumer-grade hardware. 70 This note therefore presents CNQ, a queueing algorithm suitable for 71 implementation in low-cost hardware, providing the absolute minimum 72 functionality to improve perceived network performance over that of a 73 dumb FIFO. 75 2. Background 77 CNQ is inspired by DRR++'s facility for identifying "sparse" flows 78 and giving them strict priority over "saturating" flows. DRR++ does 79 this by maintaining separate lists of queues (each queue containing 80 one flow) meeting "sparseness" criteria or not. 82 Queues are first placed into the sparse list when they become non- 83 empty, then moved to the saturating list when their deficit exceeds a 84 threshold called "quantum". Every queue's deficit is incremented by 85 the packet size when packets are delivered from it, and decremented 86 by the quantum when they come up in the list rotation. Queues are 87 removed from the saturating list only when they are found empty for a 88 full rotation. 90 This "sparseness" heuristic over observed per-flow queue occupancy 91 characteristics is relatively robust, compared to relying on the 92 correct behaviour of each source's congestion control algorithms and/ 93 or explicit traffic marking. This is especially relevant with the 94 recent development of high-fidelity congestion signalling schemes, 95 such as DCTCP [RFC8257] and SCE (Some Congestion Experienced), whose 96 expected congestion-signal response is markedly different from 97 previous standards. 99 In fq_codel [RFC8290] and Cake [CAKE], AQM is applied individually to 100 each DRR++ flow, thus avoiding unnecessary leakage of AQM action from 101 flows requiring it to well-behaved traffic which does not. This 102 arrangement has been shown to work well in practice, and is widely 103 deployed as part of the Linux kernel, including in many CPE devices. 104 However the per-queue AQM state dominates the memory requirements of 105 DRR++. 107 CNQ attempts to retain some of these characteristics while 108 simplifying implementation requirements considerably. This still 109 requires identifying individual traffic flows and keeping some per- 110 flow state, but there is no longer an individual queue per state nor 111 any lists of such queues. Instead there are only two queues and at 112 most one set of AQM state. The operations required are believed to 113 be amenable to low-cost hardware implementation. 115 3. The Algorithm 117 3.1. Overview 119 Unlike conventional fair queueing, with Cheap Nasty Queueing, packets 120 are not distributed to queues by a flow mapping, but by a sparseness 121 metric associated with that mapping. Thus, the number of queues is 122 reduced to two. 124 The number of flows which can be handled is far greater, however, 125 being limited by the number of flow buckets indexed by the flow hash. 126 An implementation might define a flow as traffic to one subscriber, 127 and provide a perfect mapping between subscribers and buckets. 128 Alternatively it might provide a stochastic mapping based on the 129 traditional 5-tuple of addresses, port numbers, and protocol number. 130 The latter would be appropriate for low-cost consumer hardware, in 131 which the notion of a "subscriber" is neither well-defined nor 132 useful. 134 The per-flow state is just one unsigned integer, in contrast to DRR++ 135 which requires a whole queue and a set of AQM state per flow. This 136 integer is B, tracking the backlog of the flow in packets. This 137 small per-flow state makes tracking a large number of flows 138 practical. 140 The two queues provided are SQ and BQ: 142 SQ is the "sparse queue" which handles flows classed as sparse, 143 including the first packets in newly active flows. This queue tends 144 to remain short and drain quickly, which are ideal characteristics 145 for latency-sensitive traffic, and young flows still establishing 146 connections or probing for capacity. This queue does not maintain 147 AQM state nor apply AQM signals. 149 BQ is the "bulk queue" which handles all traffic not classed as 150 sparse, including at least the second and subsequent packets in a 151 burst. An AQM algorithm is applied to all traffic delivered from it. 153 To prevent well-paced traffic from dominating the queue by keeping 154 exactly one packet in SQ at all times, a dummy packet is sent into BQ 155 in parallel with every packet enqueued in SQ, and the B value for the 156 flow is double-incremented to match. A flow is therefore considered 157 sparse IFF the interval between its packets is longer than the 158 sojourn time of packets in BQ. This can be a much stricter criterion 159 than for true derivatives of DRR++ such as LFQ. 161 In case of queue overflow, packets are removed from the "head" of BQ 162 to make room for the new arrivals; this head-dropping behaviour 163 minimises the delay before the lost packets can be retransmitted. 165 This simplification of state and algorithm has some drawbacks in 166 terms of resultant behaviour. The sharing of link capacity between 167 flows is dependent mainly on the RTT-fair properties of the flows' 168 own congestion control, in response to congestion signalling from the 169 single AQM. 171 3.2. Declarations 173 The following queues are defined: 175 ------------------------------- 176 --> | | | | --> 177 ------------------------------- 178 SQ: the Sparse Queue, containing packets from flows with no more 179 than one packet in the queue at a time (no AQM for this queue). 181 ------------------------------- 182 --> | | | | | | | | | | | --> 183 ------------------------------- 184 BQ: the Bulk Queue, containing packets from flows that build up a 185 multi-packet backlog (AQM managed queue). 187 The following constants and variables are defined: 189 * B: the flow backlog, in packets 190 * N: the number of flow buckets (each bucket containing a value of 191 B) 193 * S: the size of a packet 195 * T: the packet's timestamp, for later use by AQM 197 * H: the packet's flow hash, cached 199 * MAXSIZE: the maximum size for all packets in the queue 201 * NOW: the current timestamp 203 Finally, the hash function FH() maps a packet to a flow bucket: 205 +---+ 206 /--- | B | 207 / +---+ 208 / 209 +------+ / +---+ 210 ----- Packet -----> | FH() | ------- | B | 211 +------+ \ +---+ 212 \ 213 \ 214 \--- ... N 216 3.3. Pseudo-code 218 In the following pseudo-code: 220 * Lowercase is used for internal variables, and uppercase for 221 constants, variables and queues defined in Section 3.2. 223 * The send() function transmits the packet. 225 * The aqm_action() function updates the AQM state (if any) based on 226 the current sojourn time, and returns an action code indicating 227 whether a CE or SCE mark (or no mark) should be applied. This 228 function may be stateless and merely return results from a 229 threshold function or probability ramp, or it may implement Codel 230 or similar stateful AQMs, or a hybrid of the two for separate CE 231 and SCE marking strategies. 233 The following functions and variables are defined for both the sparse 234 and bulk queues: 236 * The push() function adds a packet to the tail of the specified 237 queue. 239 * The pop() function removes and returns the packet from the head of 240 the specified queue. 242 * The .size variable (BQ.size and SQ.size) refers to the sum of the 243 sizes of all packets in the queue, and may be maintained during 244 push(), pop(). 246 * The .head variable is the current head pointer for the queue. 248 The logic for the enqueue operation is as follows: 250 enqueue(packet p) { 251 while (SQ.size + BQ.size + S > MAXSIZE) { 252 ; Queue overflow - drop from BQ head, then from SQ 253 dp := pop(BQ) 254 if (!dp) 255 dp := pop(SQ) 256 bkt := dp.H 257 bkt.B -= 1 258 } 260 bkt := FH(p) 261 p.T = NOW 262 p.H = bkt 263 if (bkt.B == 0) { 264 push(SQ, p) 265 dp := zero-length dummy packet 266 dp.T = NOW 267 dp.H = bkt 268 push(BQ, dp) 269 bkt.B += 2 270 } else { 271 push(BQ, p) 272 bkt.B += 1 273 } 274 } 276 The logic for the dequeue operation is as follows: 278 dequeue() { 279 ; SQ gets strict priority 280 p := pop(SQ) 281 if (p) { 282 send(p) 283 bkt := p.H 284 bkt.B -= 1 285 return 286 } 287 ; Process BQ if SQ was empty 288 repeat { 289 p := pop(BQ) 290 if (!p) { 291 ; Queue is empty 292 return 293 } 295 bkt := p.H 296 bkt.B -= 1 298 if (p.S == 0) { 299 ; Dummy packet for sparseness metric - drop 300 continue 301 } 303 ; Apply AQM logic based on sojourn time 304 t := NOW - p.T 306 ; drop unresponsive traffic 307 if (t > 500ms) 308 continue 310 switch(aqm_action(t)) { 311 case MARK_CE: 312 ; legacy congestion signalling 313 if (t.ECN == Not-ECT) 314 continue 315 ; RFC-3168 316 if (t.ECN == ECT || t.ECN == SCE) 317 t.ECN = CE ; and update IP header checksum 318 break 320 case MARK_SCE: 321 ; Some Congestion Experienced 322 if (t.ECN == ECT) 323 t.ECN = SCE ; and update IP header checksum 324 break 326 default: 327 ; no marking request 328 break 329 } 331 send(p) 332 return 333 } 334 } 336 4. Security Considerations 338 This is a very weak FQ algorithm, not much better than a dumb FIFO - 339 but still better. 341 5. IANA Considerations 343 There are no IANA considerations. 345 6. Informative References 347 [CAKE] Hoiland-Jorgensen, T., Taht, D., and J. Morton, "Piece of 348 CAKE: A Comprehensive Queue Management Solution for Home 349 Gateways", May 2018, . 351 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 352 Recommendations Regarding Active Queue Management", 353 BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 354 . 356 [RFC8257] Bensley, S., Thaler, D., Balasubramanian, P., Eggert, L., 357 and G. Judd, "Data Center TCP (DCTCP): TCP Congestion 358 Control for Data Centers", RFC 8257, DOI 10.17487/RFC8257, 359 October 2017, . 361 [RFC8290] Hoeiland-Joergensen, T., McKenney, P., Taht, D., Gettys, 362 J., and E. Dumazet, "The Flow Queue CoDel Packet Scheduler 363 and Active Queue Management Algorithm", RFC 8290, 364 DOI 10.17487/RFC8290, January 2018, 365 . 367 Authors' Addresses 369 Jonathan Morton 370 Kokkonranta 21 371 FI-31520 Pitkajarvi 372 Finland 374 Phone: +358 44 927 2377 375 Email: chromatix99@gmail.com 377 Peter G. Heist 378 Redacted 379 463 11 Liberec 30 380 Czech Republic 382 Email: pete@heistp.net