idnits 2.17.1 draft-ietf-tsvwg-aqm-dualq-coupled-02.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 (October 30, 2017) is 2342 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 1269 -- Looks like a reference, but probably isn't: '1' on line 1269 == Outdated reference: A later version (-07) exists of draft-ietf-tcpm-cubic-06 == Outdated reference: A later version (-08) exists of draft-ietf-tsvwg-ecn-experimentation-00 == Outdated reference: A later version (-29) exists of draft-ietf-tsvwg-ecn-l4s-id-00 == Outdated reference: A later version (-20) exists of draft-ietf-tsvwg-l4s-arch-00 -- Obsolete informational reference (is this intentional?): RFC 2309 (Obsoleted by RFC 7567) Summary: 0 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Transport Area working group (tsvwg) K. De Schepper 3 Internet-Draft Nokia Bell Labs 4 Intended status: Experimental B. Briscoe, Ed. 5 Expires: May 3, 2018 CableLabs 6 O. Bondarenko 7 Simula Research Lab 8 I. Tsang 9 Nokia Bell Labs 10 October 30, 2017 12 DualQ Coupled AQMs for Low Latency, Low Loss and Scalable Throughput 13 (L4S) 14 draft-ietf-tsvwg-aqm-dualq-coupled-02 16 Abstract 18 Data Centre TCP (DCTCP) was designed to provide predictably low 19 queuing latency, near-zero loss, and throughput scalability using 20 explicit congestion notification (ECN) and an extremely simple 21 marking behaviour on switches. However, DCTCP does not co-exist with 22 existing TCP traffic---DCTCP is so aggressive that existing TCP 23 algorithms approach starvation. So, until now, DCTCP could only be 24 deployed where a clean-slate environment could be arranged, such as 25 in private data centres. This specification defines `DualQ Coupled 26 Active Queue Management (AQM)' to allow scalable congestion controls 27 like DCTCP to safely co-exist with classic Internet traffic. The 28 Coupled AQM ensures that a flow runs at about the same rate whether 29 it uses DCTCP or TCP Reno/Cubic, but without inspecting transport 30 layer flow identifiers. When tested in a residential broadband 31 setting, DCTCP achieved sub-millisecond average queuing delay and 32 zero congestion loss under a wide range of mixes of DCTCP and 33 `Classic' broadband Internet traffic, without compromising the 34 performance of the Classic traffic. The solution also reduces 35 network complexity and eliminates network configuration. 37 Status of This Memo 39 This Internet-Draft is submitted in full conformance with the 40 provisions of BCP 78 and BCP 79. 42 Internet-Drafts are working documents of the Internet Engineering 43 Task Force (IETF). Note that other groups may also distribute 44 working documents as Internet-Drafts. The list of current Internet- 45 Drafts is at https://datatracker.ietf.org/drafts/current/. 47 Internet-Drafts are draft documents valid for a maximum of six months 48 and may be updated, replaced, or obsoleted by other documents at any 49 time. It is inappropriate to use Internet-Drafts as reference 50 material or to cite them other than as "work in progress." 52 This Internet-Draft will expire on May 3, 2018. 54 Copyright Notice 56 Copyright (c) 2017 IETF Trust and the persons identified as the 57 document authors. All rights reserved. 59 This document is subject to BCP 78 and the IETF Trust's Legal 60 Provisions Relating to IETF Documents 61 (https://trustee.ietf.org/license-info) in effect on the date of 62 publication of this document. Please review these documents 63 carefully, as they describe your rights and restrictions with respect 64 to this document. Code Components extracted from this document must 65 include Simplified BSD License text as described in Section 4.e of 66 the Trust Legal Provisions and are provided without warranty as 67 described in the Simplified BSD License. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 72 1.1. Problem and Scope . . . . . . . . . . . . . . . . . . . . 3 73 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 74 1.3. Features . . . . . . . . . . . . . . . . . . . . . . . . 6 75 2. DualQ Coupled AQM . . . . . . . . . . . . . . . . . . . . . . 7 76 2.1. Coupled AQM . . . . . . . . . . . . . . . . . . . . . . . 7 77 2.2. Dual Queue . . . . . . . . . . . . . . . . . . . . . . . 8 78 2.3. Traffic Classification . . . . . . . . . . . . . . . . . 8 79 2.4. Overall DualQ Coupled AQM Structure . . . . . . . . . . . 8 80 2.5. Normative Requirements for a DualQ Coupled AQM . . . . . 10 81 2.5.1. Functional Requirements . . . . . . . . . . . . . . . 10 82 2.5.2. Management Requirements . . . . . . . . . . . . . . . 11 83 3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 84 4. Security Considerations . . . . . . . . . . . . . . . . . . . 12 85 4.1. Overload Handling . . . . . . . . . . . . . . . . . . . . 12 86 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 14 87 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 88 6.1. Normative References . . . . . . . . . . . . . . . . . . 14 89 6.2. Informative References . . . . . . . . . . . . . . . . . 14 90 Appendix A. Example DualQ Coupled PI2 Algorithm . . . . . . . . 17 91 A.1. Pass #1: Core Concepts . . . . . . . . . . . . . . . . . 17 92 A.2. Pass #2: Overload Details . . . . . . . . . . . . . . . . 22 93 Appendix B. Example DualQ Coupled Curvy RED Algorithm . . . . . 25 94 Appendix C. Guidance on Controlling Throughput Equivalence . . . 31 95 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 97 1. Introduction 99 1.1. Problem and Scope 101 Latency is becoming the critical performance factor for many (most?) 102 applications on the public Internet, e.g. interactive Web, Web 103 services, voice, conversational video, interactive video, interactive 104 remote presence, instant messaging, online gaming, remote desktop, 105 cloud-based applications, and video-assisted remote control of 106 machinery and industrial processes. In the developed world, further 107 increases in access network bit-rate offer diminishing returns, 108 whereas latency is still a multi-faceted problem. In the last decade 109 or so, much has been done to reduce propagation time by placing 110 caches or servers closer to users. However, queuing remains a major 111 component of latency. 113 The Diffserv architecture provides Expedited Forwarding [RFC3246], so 114 that low latency traffic can jump the queue of other traffic. 115 However, on access links dedicated to individual sites (homes, small 116 enterprises or mobile devices), often all traffic at any one time 117 will be latency-sensitive and, if all the traffic on a link is marked 118 as EF, Diffserv cannot reduce the delay of any of it. In contrast, 119 the Low Latency Low Loss Scalable throughput (L4S) approach removes 120 the causes of any unnecessary queuing delay. 122 The bufferbloat project has shown that excessively-large buffering 123 (`bufferbloat') has been introducing significantly more delay than 124 the underlying propagation time. These delays appear only 125 intermittently--only when a capacity-seeking (e.g. TCP) flow is long 126 enough for the queue to fill the buffer, making every packet in other 127 flows sharing the buffer sit through the queue. 129 Active queue management (AQM) was originally developed to solve this 130 problem (and others). Unlike Diffserv, which gives low latency to 131 some traffic at the expense of others, AQM controls latency for _all_ 132 traffic in a class. In general, AQMs introduce an increasing level 133 of discard from the buffer the longer the queue persists above a 134 shallow threshold. This gives sufficient signals to capacity-seeking 135 (aka. greedy) flows to keep the buffer empty for its intended 136 purpose: absorbing bursts. However, RED [RFC2309] and other 137 algorithms from the 1990s were sensitive to their configuration and 138 hard to set correctly. So, AQM was not widely deployed. 140 More recent state-of-the-art AQMs, e.g. 141 fq_CoDel [I-D.ietf-aqm-fq-codel], PIE [RFC8033], Adaptive 142 RED [ARED01], are easier to configure, because they define the 143 queuing threshold in time not bytes, so it is invariant for different 144 link rates. However, no matter how good the AQM, the sawtoothing 145 rate of TCP will either cause queuing delay to vary or cause the link 146 to be under-utilized. Even with a perfectly tuned AQM, the 147 additional queuing delay will be of the same order as the underlying 148 speed-of-light delay across the network. Flow-queuing can isolate 149 one flow from another, but it cannot isolate a TCP flow from the 150 delay variations it inflicts on itself, and it has other problems - 151 it overrides the flow rate decisions of variable rate video 152 applications, it does not recognise the flows within IPSec VPN 153 tunnels and it is relatively expensive to implement. 155 It seems that further changes to the network alone will now yield 156 diminishing returns. Data Centre TCP (DCTCP [RFC8257]) teaches us 157 that a small but radical change to TCP is needed to cut two major 158 outstanding causes of queuing delay variability: 160 1. the `sawtooth' varying rate of TCP itself; 162 2. the smoothing delay deliberately introduced into AQMs to permit 163 bursts without triggering losses. 165 The former causes a flow's round trip time (RTT) to vary from about 1 166 to 2 times the base RTT between the machines in question. The latter 167 delays the system's response to change by a worst-case 168 (transcontinental) RTT, which could be hundreds of times the actual 169 RTT of typical traffic from localized CDNs. 171 Latency is not our only concern: 173 3. It was known when TCP was first developed that it would not scale 174 to high bandwidth-delay products. 176 Given regular broadband bit-rates over WAN distances are 177 already [RFC3649] beyond the scaling range of `classic' TCP Reno, 178 `less unscalable' Cubic [I-D.ietf-tcpm-cubic] and 179 Compound [I-D.sridharan-tcpm-ctcp] variants of TCP have been 180 successfully deployed. However, these are now approaching their 181 scaling limits. Unfortunately, fully scalable TCPs such as DCTCP 182 cause `classic' TCP to starve itself, which is why they have been 183 confined to private data centres or research testbeds (until now). 185 This document specifies a `DualQ Coupled AQM' extension that solves 186 the problem of coexistence between scalable and classic flows, 187 without having to inspect flow identifiers. The AQM is not like 188 flow-queuing approaches [I-D.ietf-aqm-fq-codel] that classify packets 189 by flow identifier into numerous separate queues in order to isolate 190 sparse flows from the higher latency in the queues assigned to 191 heavier flow. In contrast, the AQM exploits the behaviour of 192 scalable congestion controls like DCTCP so that every packet in every 193 flow sharing the queue for DCTCP-like traffic can be served with very 194 low latency. 196 This AQM extension can be combined with any single queue AQM that 197 generates a statistical or deterministic mark/drop probability driven 198 by the queue dynamics. In many cases it simplifies the basic control 199 algorithm, and requires little extra processing. Therefore it is 200 believed the Coupled AQM would be applicable and easy to deploy in 201 all types of buffers; buffers in cost-reduced mass-market residential 202 equipment; buffers in end-system stacks; buffers in carrier-scale 203 equipment including remote access servers, routers, firewalls and 204 Ethernet switches; buffers in network interface cards, buffers in 205 virtualized network appliances, hypervisors, and so on. 207 The overall L4S architecture is described in 208 [I-D.ietf-tsvwg-l4s-arch]. The supporting papers [PI2] and [DCttH15] 209 give the full rationale for the AQM's design, both discursively and 210 in more precise mathematical form. 212 1.2. Terminology 214 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 215 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 216 document are to be interpreted as described in [RFC2119]. In this 217 document, these words will appear with that interpretation only when 218 in ALL CAPS. Lower case uses of these words are not to be 219 interpreted as carrying RFC-2119 significance. 221 The DualQ Coupled AQM uses two queues for two services. Each of the 222 following terms identifies both the service and the queue that 223 provides the service: 225 Classic (denoted by subscript C): The `Classic' service is intended 226 for all the behaviours that currently co-exist with TCP Reno (TCP 227 Cubic, Compound, SCTP, etc). 229 Low-Latency, Low-Loss and Scalable (L4S, denoted by subscript L): 230 The `L4S' service is intended for a set of congestion controls 231 with scalable properties such as DCTCP (e.g. 232 Relentless [Mathis09]). 234 Either service can cope with a proportion of unresponsive or less- 235 responsive traffic as well (e.g. DNS, VoIP, etc), just as a single 236 queue AQM can. The DualQ Coupled AQM behaviour is similar to a 237 single FIFO queue with respect to unresponsive and overload traffic. 239 1.3. Features 241 The AQM couples marking and/or dropping across the two queues such 242 that a flow will get roughly the same throughput whichever it uses. 243 Therefore both queues can feed into the full capacity of a link and 244 no rates need to be configured for the queues. The L4S queue enables 245 scalable congestion controls like DCTCP to give stunningly low and 246 predictably low latency, without compromising the performance of 247 competing 'Classic' Internet traffic. Thousands of tests have been 248 conducted in a typical fixed residential broadband setting. Typical 249 experiments used base round trip delays up to 100ms between the data 250 centre and home network, and large amounts of background traffic in 251 both queues. For every L4S packet, the AQM kept the average queuing 252 delay below 1ms (or 2 packets if serialization delay is bigger for 253 slow links), and no losses at all were introduced by the AQM. 254 Details of the extensive experiments will be made available [PI2] 255 [DCttH15]. 257 Subjective testing was also conducted using a demanding panoramic 258 interactive video application run over a stack with DCTCP enabled and 259 deployed on the testbed. Each user could pan or zoom their own high 260 definition (HD) sub-window of a larger video scene from a football 261 match. Even though the user was also downloading large amounts of 262 L4S and Classic data, latency was so low that the picture appeared to 263 stick to their finger on the touchpad (all the L4S data achieved the 264 same ultra-low latency). With an alternative AQM, the video 265 noticeably lagged behind the finger gestures. 267 Unlike Diffserv Expedited Forwarding, the L4S queue does not have to 268 be limited to a small proportion of the link capacity in order to 269 achieve low delay. The L4S queue can be filled with a heavy load of 270 capacity-seeking flows like DCTCP and still achieve low delay. The 271 L4S queue does not rely on the presence of other traffic in the 272 Classic queue that can be 'overtaken'. It gives low latency to L4S 273 traffic whether or not there is Classic traffic, and the latency of 274 Classic traffic does not suffer when a proportion of the traffic is 275 L4S. The two queues are only necessary because DCTCP-like flows 276 cannot keep latency predictably low and keep utilization high if they 277 are mixed with legacy TCP flows, 279 The experiments used the Linux implementation of DCTCP that is 280 deployed in private data centres, without any modification despite 281 its known deficiencies. Nonetheless, certain modifications will be 282 necessary before DCTCP is safe to use on the Internet, which are 283 recorded in Appendix A of [I-D.ietf-tsvwg-ecn-l4s-id]. However, the 284 focus of this specification is to get the network service in place. 285 Then, without any management intervention, applications can exploit 286 it by migrating to scalable controls like DCTCP, which can then 287 evolve _while_ their benefits are being enjoyed by everyone on the 288 Internet. 290 2. DualQ Coupled AQM 292 There are two main aspects to the approach: 294 o the Coupled AQM that addresses throughput equivalence between 295 Classic (e.g. Reno, Cubic) flows and L4S (e.g. DCTCP) flows 297 o the Dual Queue structure that provides latency separation for L4S 298 flows to isolate them from the typically large Classic queue. 300 2.1. Coupled AQM 302 In the 1990s, the `TCP formula' was derived for the relationship 303 between TCP's congestion window, cwnd, and its drop probability, p. 304 To a first order approximation, cwnd of TCP Reno is inversely 305 proportional to the square root of p. 307 TCP Cubic implements a Reno-compatibility mode, which is the only 308 relevant mode for typical RTTs under 20ms as long as the throughput 309 of a single flow is less than about 500Mb/s. Therefore it can be 310 assumed that Cubic traffic behaves similar to Reno (but with a 311 slightly different constant of proportionality), and the term 312 'Classic' will be used for the collection of Reno-friendly traffic 313 including Cubic in Reno mode. 315 The supporting paper [PI2] includes the derivation of the equivalent 316 rate equation for DCTCP, for which cwnd is inversely proportional to 317 p (not the square root), where in this case p is the ECN marking 318 probability. DCTCP is not the only congestion control that behaves 319 like this, so the term 'L4S' traffic will be used for all similar 320 behaviour. 322 In order to make a DCTCP flow run at roughly the same rate as a Reno 323 TCP flow (all other factors being equal), the drop or marking 324 probability for Classic traffic, p_C has to be distinct from the 325 marking probability for L4S traffic, p_L (in contrast to RFC3168 326 which requires them to be the same). It is necessary to make the 327 Classic drop probability p_C proportional to the square of the L4S 328 marking probability p_L. This makes the Reno flow rate roughly equal 329 the DCTCP flow rate, because it squares the square root of p_C in the 330 Reno rate equation to make it proportional to the straight p_L in the 331 DCTCP rate equation. 333 Stating this as a formula, the relation between Classic drop 334 probability, p_C, and L4S marking probability, p_L needs to take the 335 form: 337 p_C = ( p_L / k )^2 (1) 339 where k is the constant of proportionality. 341 2.2. Dual Queue 343 Classic traffic typically builds a large queue to prevent under- 344 utilization. Therefore a separate queue is provided for L4S traffic, 345 and it is scheduled with priority over Classic. Priority is 346 conditional to prevent starvation of Classic traffic. 348 Nonetheless, coupled marking ensures that giving priority to L4S 349 traffic still leaves the right amount of spare scheduling time for 350 Classic flows to each get equivalent throughput to DCTCP flows (all 351 other factors such as RTT being equal). The algorithm achieves this 352 without having to inspect flow identifiers. 354 2.3. Traffic Classification 356 Both the Coupled AQM and DualQ mechanisms need an identifier to 357 distinguish L and C packets. A separate draft 358 [I-D.ietf-tsvwg-ecn-l4s-id] recommends using the ECT(1) codepoint of 359 the ECN field as this identifier, having assessed various 360 alternatives. An additional process document has proved necessary to 361 make the ECT(1) codepoint available for experimentation 362 [I-D.ietf-tsvwg-ecn-experimentation]. 364 2.4. Overall DualQ Coupled AQM Structure 366 Figure 1 shows the overall structure that any DualQ Coupled AQM is 367 likely to have. This schematic is intended to aid understanding of 368 the current designs of DualQ Coupled AQMs. However, it is not 369 intended to preclude other innovative ways of satisfying the 370 normative requirements in Section 2.5 that minimally define a DualQ 371 Coupled AQM. 373 The classifier on the left separates incoming traffic between the two 374 queues (L and C). Each queue has its own AQM that determines the 375 likelihood of dropping or marking (p_L and p_C). Nonetheless, the 376 AQM for Classic traffic is implemented in two stages: i) a base stage 377 that outputs an internal probability p; and ii) a squaring stage that 378 outputs p_C, where 380 p_C = p^2. 382 This allows p_L to be coupled to p_C by marking L4S traffic 383 proportionately to the intermediate output from the first stage where 385 p_L = k*p 387 By substituting for p from the latter to the former equation, it can 388 be seen that these two transformations of p implement the required 389 coupling given in equation (1) earlier: 391 p_C = ( p_L / k )^2 393 The actual L4S marking probability p_L is a combination of this 394 output (k*p) and the output of a native L4S AQM, shown as a logical 395 (OR) function. Then, after the AQMs have applied their dropping or 396 marking, the scheduler forwards their packets to the link, giving 397 conditional priority to L4S traffic. 399 _________ 400 | | ,------. 401 L4S queue | |==>| ECN | 402 ,'| _______|_| |marker|\ 403 <' | | `------'\\ 404 //`' v ^ p_L \\ 405 // ,-------. | \\ 406 // |Native | | \\,. 407 // | L4S |->(OR) < | ___ 408 ,----------.// | AQM | ^ `\|.'Cond-`. 409 | IP-ECN |/ `-------' | / itional \ 410 ==>|Classifier| ,-------. (k*p) [ priority]==> 411 | |\ | Base | | \scheduler/ 412 `----------'\\ | AQM |-->: ,'|`-.___.-' 413 \\ | |p | <' | 414 \\ `-------' (p^2) //`' 415 \\ ^ | // 416 \\,. | v p_C // 417 < | _________ .------.// 418 `\| | | | Drop |/ 419 Classic |queue |==>|/mark | 420 __|______| `------' 422 Legend: ===> traffic flow; ---> control dependency. 424 Figure 1: DualQ Coupled AQM Schematic 426 Example DualQ Coupled AQM algorithms called DualPI2 and Curvy RED are 427 given in Appendix A and Appendix B. Either example AQM can be used 428 to couple packet marking and dropping across a dual Q. 430 DualPI2 uses a Proportional-Integral (PI) controller as the Base AQM. 431 It is a principled simplification of PIE [RFC8033] that is both more 432 responsive and more stable in the face of dynamically varying load. 433 Indeed, this Base AQM with just the squared output and no L4S queue 434 can be used as a drop-in replacement for PIE, in which case we call 435 it just PI2 [PI2]. 437 Curvy RED is derived from RED [RFC2309], but its configuration 438 parameters are insensitive to link rate and it requires less 439 operations per packet. However, DualPI2 is more responsive and 440 stable over a wider range of RTTs than Curvy RED. As a consequence, 441 DualPI2 has attracted more development attention than Curvy RED, 442 leaving the Curvy RED design incomplete and not so fully evaluated. 444 Both AQMs regulate their queue in units of time not bytes. As 445 already explained, this ensures configuration can be invariant for 446 different drain rates. With the dualQ this is particularly important 447 because the drain rate of each queue can vary rapidly as flows for 448 the two queues arrive and depart, even if the combined link rate is 449 constant. 451 It would be possible to control the queues with other alternative 452 AQMs, as long as the normative requirements (those expressed in 453 capitals) in Section 2.5 are observed. 455 2.5. Normative Requirements for a DualQ Coupled AQM 457 The following requirements are intended to capture only the essential 458 aspects of a DualQ Coupled AQM. They are intended to be independent 459 of the particular AQMs used for each queue. 461 2.5.1. Functional Requirements 463 In the Dual Queue, L4S packets MUST be given priority over Classic, 464 although priority SHOULD {ToDo: MUST?} be bounded in order not to 465 starve Classic traffic. 467 All L4S traffic MUST be ECN-capable. Some Classic traffic might also 468 be ECN-capable. 470 Whatever identifier is used for L4S experiments, 471 [I-D.ietf-tsvwg-ecn-l4s-id] defines the meaning of an ECN marking on 472 L4S traffic, relative to drop of Classic traffic. In order to 473 prevent starvation of Classic traffic by scalable L4S traffic, it 474 says, "The likelihood that an AQM drops a Not-ECT Classic packet 475 (p_C) MUST be roughly proportional to the square of the likelihood 476 that it would have marked it if it had been an L4S packet (p_L)." In 477 other words, in any DualQ Coupled AQM, the power to which p_L is 478 raised in Eqn. (1) MUST be 2. The term 'likelihood' is used to allow 479 for marking and dropping to be either probabilistic or deterministic. 481 The constant of proportionality, k, in Eqn (1) determines the 482 relative flow rates of Classic and L4S flows when the AQM concerned 483 is the bottleneck (all other factors being equal). 484 [I-D.ietf-tsvwg-ecn-l4s-id] says, "The constant of proportionality 485 (k) does not have to be standardised for interoperability, but a 486 value of 2 is RECOMMENDED." 488 Assuming scalable congestion controls for the Internet will be as 489 aggressive as DCTCP, this will ensure their congestion window will be 490 roughly the same as that of a standards track TCP congestion control 491 (Reno) [RFC5681] and other so-called TCP-friendly controls, such as 492 TCP Cubic in its TCP-friendly mode. 494 {ToDo: The requirements for scalable congestion controls on the 495 Internet (termed the TCP Prague requirements) 496 [I-D.ietf-tsvwg-ecn-l4s-id] are not necessarily final. If the 497 aggressiveness of DCTCP is not defined as the benchmark for scalable 498 controls on the Internet, the recommended value of k will also be 499 subject to change.} 501 The choice of k is a matter of operator policy, and operators MAY 502 choose a different value using Table 1 and the guidelines in 503 Appendix C. 505 If multiple users share capacity at a bottleneck (e.g. in the 506 Internet access link of a campus network), the operator's choice of k 507 will determine capacity sharing between the flows of different users. 508 However, on the public Internet, access network operators typically 509 isolate customers from each other with some form of layer-2 510 multiplexing (TDM in DOCSIS, CDMA in 3G) or L3 scheduling (WRR in 511 DSL), rather than relying on TCP to share capacity between customers 512 [RFC0970]. In such cases, the choice of k will solely affect 513 relative flow rates within each customer's access capacity, not 514 between customers. Also, k will not affect relative flow rates at 515 any times when all flows are Classic or all L4S, and it will not 516 affect small flows. 518 2.5.2. Management Requirements 520 By default, a DualQ Coupled AQM SHOULD NOT need any configuration for 521 use at a bottleneck on the public Internet [RFC7567]. The following 522 parameters MAY be operator-configurable, e.g. for use in non-Internet 523 settings: 525 o Optional packet classifier(s) to use in addition to the ECN field; 526 o Expected typical RTT (a parameter for typical or target queuing 527 delay in each queue might be configurable instead); 529 o Expected maximum RTT (a stability parameter that depends on 530 maximum RTT might be configurable instead); 532 o Coupling factor, k; 534 o The limit to the conditional priority of L4S (e.g. the Classic 535 queuing delay beyond which L4S packets no longer have priority); 537 o The maximum Classic ECN marking probability, p_Cmax, before 538 switching over to drop. 540 An experimental DualQ Coupled AQM SHOULD allow the operator to 541 monitor the following operational statistics: 543 o Bits forwarded (total and per queue per sample interval), from 544 which utilization can be calculated 546 o Q delay (per queue over sample interval) 548 o Total packets arriving, enqueued and dequeued (per queue per 549 sample interval) 551 o ECN packets marked, non-ECN packets dropped, ECN packets dropped 552 (per queue per sample interval), from which marking and dropping 553 probabilities can be calculated 555 o Time and duration of each overload event. 557 The type of statistics produced for variables like Q delay (mean, 558 percentiles, etc.) will depend on implementation constraints. 560 3. IANA Considerations 562 This specification contains no IANA considerations. 564 4. Security Considerations 566 4.1. Overload Handling 568 Where the interests of users or flows might conflict, it could be 569 necessary to police traffic to isolate any harm to performance. This 570 is a policy issue that needs to be separable from a basic AQM, but an 571 AQM does need to handle overload. A trade-off needs to be made 572 between complexity and the risk of either class harming the other. 573 It is an operator policy to define what must happen if the service 574 time of the classic queue becomes too great. In the following 575 subsections three optional non-exclusive overload protections are 576 defined. Their objective is for the overload behaviour of the DualQ 577 AQM to be similar to a single queue AQM. The example implementation 578 in Appendix A implements the 'delay on overload' policy. Other 579 overload protections can be envisaged: 581 Minimum throughput service: By replacing the priority scheduler 582 with a weighted round robin scheduler, a minimum throughput 583 service can be guaranteed for Classic traffic. Typically the 584 scheduling weight of the Classic queue will be small (e.g. 5%) to 585 avoid interference with the coupling but big enough to avoid 586 complete starvation of Classic traffic. In practice it will be 587 hard to set the scheduling weights to give each queue a useful 588 share of the link for any traffic scenario, so this approach is 589 not recommended. 591 Delay on overload: To control milder overload of responsive traffic, 592 particularly when close to the maximum congestion signal, delay 593 can be used as an alternative congestion control mechanism. The 594 Dual Queue Coupled AQM can be made to behave like a single First- 595 In First-Out (FIFO) queue with different service times by 596 replacing the priority scheduler with a very simple scheduler that 597 could be called a "time-shifted FIFO", which is the same as the 598 Modifier Earliest Deadline First (MEDF) scheduler of [MEDF]. The 599 scheduler adds tshift to the queue delay of the next L4S packet, 600 before comparing it with the queue delay of the next Classic 601 packet, then it selects the packet with the greater adjusted queue 602 delay. Under regular conditions, this time-shifted FIFO scheduler 603 behaves just like a strict priority scheduler. But under moderate 604 or high overload it prevents starvation of the Classic queue, 605 because the time-shift defines the maximum extra queuing delay 606 (tshift) of Classic packets relative to L4S. 608 Drop on overload: On severe overload, e.g. due to non responsive 609 traffic, queues will typically overflow and packet drop will be 610 unavoidable. It is important to avoid unresponsive ECN traffic 611 (either Classic or L4S) driving the AQM to 100% drop and mark 612 probability. Congestion controls that have a minimum congestion 613 window will become unresponsive to ECN marking when the marking 614 probability is high. This situation can be avoided by applying 615 the drop probability to all packets of all traffic types when it 616 exceeds a certain threshold or by limiting the drop and marking 617 probabilities to a lower maximum value (up to where 'fairness' 618 between the different traffic types is still guaranteed) and rely 619 on delay to control temporary high congestion and eventually queue 620 overflow. If the classic drop probability is applied to all types 621 of traffic when it is higher than a threshold probability the 622 queueing delay can be controlled up to any overload situation, and 623 no further measures are required. If a maximum classic and 624 coupled L4S probability of less than 100% is used, both queues 625 need scheduling opportunities and should eventually experience 626 drop. This can be achieved with a scheduler that guarantees a 627 minimum throughput for each queue, such as a weighted round robin 628 or time-shifted FIFO scheduler. In that case a common queue limit 629 can be configured that will drop packets of both types of 630 traffic.{ToDo: reword this bullet to improve comprehensibility} 632 To keep the throughput of both L4S and Classic flows equal over the 633 full load range, a different control strategy needs to be defined 634 above the point where one congestion control first saturates to a 635 probability of 100% (if k>1, L4S will saturate first). Possible 636 strategies include: also dropping L4S; increasing the queueing delay 637 for both; or ensuring that L4S traffic still responds to marking 638 below a window of 2 segments (see [I-D.ietf-tsvwg-ecn-l4s-id]). 640 5. Acknowledgements 642 Thanks to Anil Agarwal, Sowmini Varadhan's and Gabi Bracha for 643 detailed review comments particularly of the appendices and 644 suggestions on how to make our explanation clearer. 646 The authors' contributions are part-funded by the European Community 647 under its Seventh Framework Programme through the Reducing Internet 648 Transport Latency (RITE) project (ICT-317700). Bob Briscoe's 649 contribution was also part-funded by the Research Council of Norway 650 through the TimeIn project. The views expressed here are solely 651 those of the authors. 653 6. References 655 6.1. Normative References 657 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 658 Requirement Levels", BCP 14, RFC 2119, 659 DOI 10.17487/RFC2119, March 1997, 660 . 662 6.2. Informative References 664 [ARED01] Floyd, S., Gummadi, R., and S. Shenker, "Adaptive RED: An 665 Algorithm for Increasing the Robustness of RED's Active 666 Queue Management", ACIRI Technical Report , August 2001, 667 . 669 [CoDel] Nichols, K. and V. Jacobson, "Controlling Queue Delay", 670 ACM Queue 10(5), May 2012, 671 . 673 [CRED_Insights] 674 Briscoe, B., "Insights from Curvy RED (Random Early 675 Detection)", BT Technical Report TR-TUB8-2015-003, July 676 2015, 677 . 679 [DCttH15] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 680 Tsang, "`Data Centre to the Home': Ultra-Low Latency for 681 All", 2015, . 684 (Under submission) 686 [I-D.ietf-aqm-fq-codel] 687 Hoeiland-Joergensen, T., McKenney, P., 688 dave.taht@gmail.com, d., Gettys, J., and E. Dumazet, "The 689 FlowQueue-CoDel Packet Scheduler and Active Queue 690 Management Algorithm", draft-ietf-aqm-fq-codel-06 (work in 691 progress), March 2016. 693 [I-D.ietf-tcpm-cubic] 694 Rhee, I., Xu, L., Ha, S., Zimmermann, A., Eggert, L., and 695 R. Scheffenegger, "CUBIC for Fast Long-Distance Networks", 696 draft-ietf-tcpm-cubic-06 (work in progress), September 697 2017. 699 [I-D.ietf-tsvwg-ecn-experimentation] 700 Black, D., "Explicit Congestion Notification (ECN) 701 Experimentation", draft-ietf-tsvwg-ecn-experimentation-00 702 (work in progress), November 2016. 704 [I-D.ietf-tsvwg-ecn-l4s-id] 705 Schepper, K., Briscoe, B., and I. Tsang, "Identifying 706 Modified Explicit Congestion Notification (ECN) Semantics 707 for Ultra-Low Queuing Delay", draft-ietf-tsvwg-ecn-l4s- 708 id-00 (work in progress), November 2016. 710 [I-D.ietf-tsvwg-l4s-arch] 711 Briscoe, B., Schepper, K., and M. Bagnulo, "Low Latency, 712 Low Loss, Scalable Throughput (L4S) Internet Service: 713 Architecture", draft-ietf-tsvwg-l4s-arch-00 (work in 714 progress), November 2016. 716 [I-D.sridharan-tcpm-ctcp] 717 Sridharan, M., Tan, K., Bansal, D., and D. Thaler, 718 "Compound TCP: A New TCP Congestion Control for High-Speed 719 and Long Distance Networks", draft-sridharan-tcpm-ctcp-02 720 (work in progress), November 2008. 722 [Mathis09] 723 Mathis, M., "Relentless Congestion Control", PFLDNeT'09 , 724 May 2009, . 727 [MEDF] Menth, M., Schmid, M., Heiss, H., and T. Reim, "MEDF - a 728 simple scheduling algorithm for two real-time transport 729 service classes with application in the UTRAN", Proc. IEEE 730 Conference on Computer Communications (INFOCOM'03) Vol.2 731 pp.1116-1122, March 2003. 733 [PI2] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 734 Tsang, "PI2: A Linearized AQM for both Classic and 735 Scalable TCP", ACM CoNEXT'16 , December 2016, 736 . 739 (To appear) 741 [RFC0970] Nagle, J., "On Packet Switches With Infinite Storage", 742 RFC 970, DOI 10.17487/RFC0970, December 1985, 743 . 745 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 746 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 747 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 748 S., Wroclawski, J., and L. Zhang, "Recommendations on 749 Queue Management and Congestion Avoidance in the 750 Internet", RFC 2309, DOI 10.17487/RFC2309, April 1998, 751 . 753 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 754 of Explicit Congestion Notification (ECN) to IP", 755 RFC 3168, DOI 10.17487/RFC3168, September 2001, 756 . 758 [RFC3246] Davie, B., Charny, A., Bennet, J., Benson, K., Le Boudec, 759 J., Courtney, W., Davari, S., Firoiu, V., and D. 760 Stiliadis, "An Expedited Forwarding PHB (Per-Hop 761 Behavior)", RFC 3246, DOI 10.17487/RFC3246, March 2002, 762 . 764 [RFC3649] Floyd, S., "HighSpeed TCP for Large Congestion Windows", 765 RFC 3649, DOI 10.17487/RFC3649, December 2003, 766 . 768 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 769 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 770 . 772 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 773 Recommendations Regarding Active Queue Management", 774 BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 775 . 777 [RFC8033] Pan, R., Natarajan, P., Baker, F., and G. White, 778 "Proportional Integral Controller Enhanced (PIE): A 779 Lightweight Control Scheme to Address the Bufferbloat 780 Problem", RFC 8033, DOI 10.17487/RFC8033, February 2017, 781 . 783 [RFC8257] Bensley, S., Thaler, D., Balasubramanian, P., Eggert, L., 784 and G. Judd, "Data Center TCP (DCTCP): TCP Congestion 785 Control for Data Centers", RFC 8257, DOI 10.17487/RFC8257, 786 October 2017, . 788 Appendix A. Example DualQ Coupled PI2 Algorithm 790 As a first concrete example, the pseudocode below gives the DualPI2 791 algorithm. DualPI2 follows the structure of the DualQ Coupled AQM 792 framework in Figure 1. A simple step threshold (in units of queuing 793 time) is used for the Native L4S AQM. And the PI2 algorithm [PI2] is 794 used for the Classic AQM. PI2 is an improved variant of the PIE AQM 795 [RFC8033]. 797 We will introduce the pseudocode in two passes. The first pass 798 explains the core concepts, deferring handling of overload to the 799 second pass. To aid comparison, line numbers are kept in step 800 between the two passes by using letter suffixes where the longer code 801 needs extra lines. 803 A full open source implementation for Linux is available at: 804 https://github.com/olgabo/dualpi2. 806 A.1. Pass #1: Core Concepts 808 The pseudocode manipulates three main structures of variables: the 809 packet (pkt), the L4S queue (lq) and the Classic queue (cq). The 810 pseudocode consists of the following four functions: 812 o initialization code (Figure 2) that sets parameter defaults (the 813 API for setting non-default values is omitted for brevity) 815 o enqueue code (Figure 3) 817 o dequeue code (Figure 4) 819 o code to regularly update the base probability (p) used in the 820 dequeue code (Figure 5). 822 It also uses the following functions that are not shown in full here: 824 o cq.time() or lq.time() returns the current queuing delay (aka. 825 sojourn time or service time) of the relevant queue in units of 826 time; 828 o cq.len() or lq.len() returns the current length (aka. backlog) of 829 the relevant queue in bytes; 831 In our experiments so far (building on experiments with PIE) on 832 broadband access links ranging from 4 Mb/s to 200 Mb/s with base RTTs 833 from 5 ms to 100 ms, DualPI2 achieves good results with the default 834 parameters in Figure 2. The parameters are categorised by whether 835 they relate to the Base PI2 AQM, the L4S AQM or the framework 836 coupling them together. Variables derived from these parameters are 837 also included at the end of each category. Each parameter is 838 explained as it is encountered in the walk-through of the pseudocode 839 below. 841 1: dualpi2_params_init(...) { % Set input parameter defaults 842 2: % PI2 AQM parameters 843 3: target = 15 ms % PI AQM Classic queue delay target 844 4: Tupdate = 16 ms % PI Classic queue sampling interval 845 5: alpha = 10 Hz^2 % PI integral gain 846 6: beta = 100 Hz^2 % PI proportional gain 847 7: p_Cmax = 1/4 % Max Classic drop/mark prob 848 8: % Derived PI2 AQM variables 849 9: alpha_U = alpha *Tupdate % PI integral gain per update interval 850 10: beta_U = beta * Tupdate % PI prop'nal gain per update interval 851 11: 852 12: % DualQ Coupled framework parameters 853 13: k = 2 % Coupling factor 854 14: tshift = 2 * target % Scheduler time bias 855 15: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 856 16: 857 17: % L4S AQM parameters 858 18: T_time = 1 ms % L4S marking threshold in time 859 19: T_len = 2 * MTU % Min L4S marking threshold in bytes 860 20: % Derived L4S AQM variables 861 21: p_Lmax = min(k*sqrt(p_Cmax), 1) % Max L4S marking prob 862 22: } 864 Figure 2: Example Header Pseudocode for DualQ Coupled PI2 AQM 866 The base probability (p) is an internal variable from which the 867 marking and dropping probabilities for L4S and Classic traffic (p_L 868 and p_C) are derived, as shown in Figure 1. These probabilities are 869 derived in lines 3, 4 and 5 of the dualpi2_update() function 870 (Figure 5) then used in the dualpi2_dequeue() function (Figure 4). 872 1: dualpi2_enqueue(lq, cq, pkt) { % Test limit and classify lq or cq 873 2: stamp(pkt) % attach arrival time to packet 874 3: if ( lq.len() + cq.len() > limit ) 875 4: drop(pkt) % drop packet if buffer is full 876 5: else { % Packet classifier 877 6: if ( ecn(pkt) modulo 2 == 1 ) % ECN bits = ECT(1) or CE 878 7: lq.enqueue(pkt) 879 8: else % ECN bits = not-ECT or ECT(0) 880 9: cq.enqueue(pkt) 881 10: } 882 11: } 884 Figure 3: Example Enqueue Pseudocode for DualQ Coupled PI2 AQM 886 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 887 2: while ( lq.len() + cq.len() > 0 ) 888 3: if ( lq.time() + tshift >= cq.time() ) { % time-shifted FIFO 889 4: lq.dequeue(pkt) 890 5: if ( ((pkt.time() > T_time) % step marking ... 891 6: AND (lq.len() > T_len)) 892 7: OR (p_L > rand()) ) % ...or linear marking 893 8: mark(pkt) 894 9: } else { 895 10: cq.dequeue(pkt) 896 11: if ( p_C > rand() ) { % probability p_C = p^2 897 12: if ( ecn(pkt) == 0 ) { % if ECN field = not-ECT 898 13: drop(pkt) % squared drop 899 14: continue % continue to the top of the while loop 900 15: } 901 16: mark(pkt) % squared mark 902 17: } 903 18: } 904 19: return(pkt) % return the packet and stop 905 20: } 906 21: return(NULL) % no packet to dequeue 907 22: } 909 Figure 4: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 911 1: dualpi2_update(lq, cq, target) { % Update p every Tupdate 912 2: curq = cq.time() % use queuing time of first-in Classic packet 913 3: p = p + alpha_U * (curq - target) + beta_U * (curq - prevq) 914 4: p_L = p * k % L4S prob = base prob * coupling factor 915 5: p_C = p^2 % Classic prob = (base prob)^2 916 6: prevq = curq 917 7: } 919 Figure 5: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 921 When packets arrive, first a common queue limit is checked as shown 922 in line 3 of the enqueuing pseudocode in Figure 3. Note that the 923 limit is deliberately tested before enqueue to avoid any bias against 924 larger packets (so the actual buffer has to be one packet larger than 925 limit). If limit is not exceeded, the packet will be classified and 926 enqueued to the Classic or L4S queue dependent on the least 927 significant bit of the ECN field in the IP header (line 6). Packets 928 with a codepoint having an LSB of 0 (Not-ECT and ECT(0)) will be 929 enqueued in the Classic queue. Otherwise, ECT(1) and CE packets will 930 be enqueued in the L4S queue. Optional additional packet 931 classification flexibility is omitted for brevity. 933 The dequeue pseudocode schedules one packet for dequeuing (or zero if 934 the queue is empty). It also makes all the AQM decisions on dropping 935 and marking. It is contained within a large while loop so that if it 936 decides to drop a packet, it will continue until it selects a packet 937 to schedule. Line 3 of the dequeue pseudocode implements time- 938 shifted FIFO scheduling. It takes the packet that waited the 939 longest, biased against the Classic traffic by a time-shift of 940 tshift. 942 o If an L4S packet is scheduled, lines 5 to 8 mark the packet if 943 either the L4S threshold (T_time) is exceeded, or if a random 944 marking decision is drawn according to p_L (maintained by the 945 dualpi2_update() function discussed below). The L4S threshold is 946 usually in units of time (default T_time = 1 ms). However, on 947 slow links the packet serialization time can approach the 948 threshold T_time, so line 6 sets a floor of 2 MTU to the 949 threshold. 951 o If a Classic packet is scheduled, lines 10 to 17 drop or mark the 952 packet based on the squared probability p_C. 954 The probability p is kept up to date by the core PI algorithm in 955 Figure 5, which is executed every Tupdate ([RFC8033] now recommends 956 16ms). The algorithm centres on line 3, which is a classical 957 Proportional-Integral (PI) controller that alters p dependent on a) 958 the error between the current queuing delay (curq) and the target 959 queuing delay (target) as defined in [RFC8033] and b) the change in 960 queuing delay since the last sample. The name 'PI' represents the 961 fact that the second factor is _P_roportional to load while the first 962 is the _I_ntegral of the load (so it removes any standing queue). 964 Note that p solely depends on the queuing time in the Classic queue. 965 In line 2, the current queuing delay (curq) is evaluated by 966 inspecting the timestamp of the next packet to schedule in the 967 Classic queue. The function cq.time() subtracts the time stamped at 968 enqueue from the current time and implicitly takes the current 969 queuing delay as 0 if the queue is empty. 971 The two 'gain factors' in line 3, alpha_U and beta_U, respectively 972 weight how strongly each of these elements ((a) and (b)) alters p. 973 They are in units of 'per second of delay' or Hz, because they 974 transform differences in queueing delay into changes in probability. 975 The suffix '_U' represents 'per update time' (Tupdate). They are 976 derived from the input parameters alpha and beta recommended from the 977 stability analysis in [PI2]. alpha and beta can be thought of as gain 978 factors per unit time, as if Tupdate were 1s. If a briefer update 979 time is configured, alpha and beta do not need to change, but alpha_U 980 and beta_U are automatically scaled down to ensure that the same 981 response is given over the same time, but just in finer steps (see 982 lines 9 and 10 of Figure 2). 984 In corner cases, p can overflow the range [0,1] so the resulting 985 value of p has to be bounded (omitted from the pseudocode). Then, as 986 already explained, the L4S and Classic probabilities are derived from 987 the new p in lines 4 and 5 as p_L=k*p and p_C=p^2. 989 Because the L4S marking probability (p_L) is factored up by k, the 990 dynamic gain parameters alpha and beta are also inherently factored 991 up by k for the L4S queue, which is necessary to ensure that Classic 992 TCP and DCTCP controls have the same stability. So, if alpha is 10 993 Hz^2, the effective gain factor for the L4S queue is k*alpha, which 994 is 20 Hz^2 with the default coupling factor of k=2. 996 Unlike in PIE [RFC8033], alpha_U and beta_U do not need to be tuned 997 every Tupdate dependent on p. Instead, in PI2, alpha_U and beta_U 998 are independent of p because the squaring applied to Classic traffic 999 tunes them inherently. This is explained in [PI2], which also 1000 explains why this more principled approach removes the need for most 1001 of the heuristics that had to be added to PIE. 1003 A.2. Pass #2: Overload Details 1005 Figure 6 repeats the dequeue function of Figure 4, but with overload 1006 details added. Similarly Figure 7 repeats the core PI algorithm of 1007 Figure 5 with overload details added. The initialization and enqueue 1008 functions are unchanged. 1010 In line 7 of the initialization function (Figure 2), the default 1011 maximum Classic drop probability p_Cmax = 1/4 or 25%. This is the 1012 point at which it is deemed that the Classic queue has become 1013 persistently overloaded, so it switches to using solely drop, even 1014 for ECN-capable packets. This protects the queue against any 1015 unresponsive traffic that falsely claims that it is responsive to ECN 1016 marking, as required by [RFC3168] and [RFC7567]. 1018 Line 21 of the initialization function translates this into a maximum 1019 L4S marking probability (p_Lmax) by rearranging Equation (1). With a 1020 coupling factor of k=2 (the default) or greater, this translates to a 1021 maximum L4S marking probability of 1 (or 100%). This is intended to 1022 ensure that the L4S queue starts to introduce dropping once marking 1023 saturates and can rise no further. The 'TCP Prague' requirements 1024 [I-D.ietf-tsvwg-ecn-l4s-id] state that, when an L4S congestion 1025 control detects a drop, it falls back to a response that coexists 1026 with 'Classic' TCP. So it is correct that the L4S queue drops 1027 packets proportional to p^2, as if they are Classic packets. 1029 Both these switch-overs are triggered by the tests for overload 1030 introduced in lines 4b and 12b of the dequeue function (Figure 6). 1031 Lines 8c to 8g drop L4S packets with probability p^2. Lines 8h to 8i 1032 mark the remaining packets with probability p_L. 1034 Lines 2c to 2d in the core PI algorithm (Figure 7) deal with overload 1035 of the L4S queue when there is no Classic traffic. This is 1036 necessary, because the core PI algorithm maintains the appropriate 1037 drop probability to regulate overload, but it depends on the length 1038 of the Classic queue. If there is no Classic queue the naive 1039 algorithm in Figure 5 drops nothing, even if the L4S queue is 1040 overloaded - so tail drop would have to take over (lines 3 and 4 of 1041 Figure 3). 1043 If the test at line 2a finds that the Classic queue is empty, line 2d 1044 measures the current queue delay using the L4S queue instead. While 1045 the L4S queue is not overloaded, its delay will always be tiny 1046 compared to the target Classic queue delay. So p_L will be driven to 1047 zero, and the L4S queue will naturally be governed solely by 1048 threshold marking (lines 5 and 6 of the dequeue algorithm in 1049 Figure 6). But, if unresponsive L4S source(s) cause overload, the 1050 DualQ transitions smoothly to L4S marking based on the PI algorithm. 1051 And as overload increases, it naturally transitions from marking to 1052 dropping by the switch-over mechanism already described. 1054 1: dualpi2_dequeue(lq, cq) { % Couples L4S & Classic queues, lq & cq 1055 2: while ( lq.len() + cq.len() > 0 ) 1056 3: if ( lq.time() + tshift >= cq.time() ) { % time-shifted FIFO 1057 4a: lq.dequeue(pkt) 1058 4b: if ( p_L < p_Lmax ) { % Check for overload saturation 1059 5: if ( ((pkt.time() > T_time) % step marking ... 1060 6: AND (lq.len > T_len)) 1061 7: OR (p_L > rand()) ) % ...or linear marking 1062 8a: mark(pkt) 1063 8b: } else { % overload saturation 1064 8c: if ( p_C > rand() ) { % probability p_C = p^2 1065 8e: drop(pkt) % revert to Classic drop due to overload 1066 8f: continue % continue to the top of the while loop 1067 8g: } 1068 8h: if ( p_L > rand() ) % probability p_L = k * p 1069 8i: mark(pkt) % linear marking of remaining packets 1070 8j: } 1071 9: } else { 1072 10: cq.dequeue(pkt) 1073 11: if ( p_C > rand() ) { % probability p_C = p^2 1074 12a: if ( (ecn(pkt) == 0) % ECN field = not-ECT 1075 12b: OR (p_C >= p_Cmax) ) { % Overload disables ECN 1076 13: drop(pkt) % squared drop, redo loop 1077 14: continue % continue to the top of the while loop 1078 15: } 1079 16: mark(pkt) % squared mark 1080 17: } 1081 18: } 1082 19: return(pkt) % return the packet and stop 1083 20: } 1084 21: return(NULL) % no packet to dequeue 1085 22: } 1087 Figure 6: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1088 (Including Integer Arithmetic and Overload Code) 1090 1: dualpi2_update(lq, cq, target) { % Update p every Tupdate 1091 2a: if ( cq.len() > 0 ) 1092 2b: curq = cq.time() %use queuing time of first-in Classic packet 1093 2c: else % Classic queue empty 1094 2d: curq = lq.time() % use queuing time of first-in L4S packet 1095 3: p = p + alpha_U * (curq - target) + beta_U * (curq - prevq) 1096 4: p_L = p * k % L4S prob = base prob * coupling factor 1097 5: p_C = p^2 % Classic prob = (base prob)^2 1098 6: prevq = curq 1099 7: } 1101 Figure 7: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1102 (Including Overload Code) 1104 Appendix B. Example DualQ Coupled Curvy RED Algorithm 1106 As another example of a DualQ Coupled AQM algorithm, the pseudocode 1107 below gives the Curvy RED based algorithm we used and tested. 1108 Although we designed the AQM to be efficient in integer arithmetic, 1109 to aid understanding it is first given using real-number arithmetic. 1110 Then, one possible optimization for integer arithmetic is given, also 1111 in pseudocode. To aid comparison, the line numbers are kept in step 1112 between the two by using letter suffixes where the longer code needs 1113 extra lines. 1115 1: dualq_dequeue(lq, cq) { % Couples L4S & Classic queues, lq & cq 1116 2: if ( lq.dequeue(pkt) ) { 1117 3a: p_L = cq.sec() / 2^S_L 1118 3b: if ( lq.byt() > T ) 1119 3c: mark(pkt) 1120 3d: elif ( p_L > maxrand(U) ) 1121 4: mark(pkt) 1122 5: return(pkt) % return the packet and stop here 1123 6: } 1124 7: while ( cq.dequeue(pkt) ) { 1125 8a: alpha = 2^(-f_C) 1126 8b: Q_C = alpha * pkt.sec() + (1-alpha)* Q_C % Classic Q EWMA 1127 9a: sqrt_p_C = Q_C / 2^S_C 1128 9b: if ( sqrt_p_C > maxrand(2*U) ) 1129 10: drop(pkt) % Squared drop, redo loop 1130 11: else 1131 12: return(pkt) % return the packet and stop here 1132 13: } 1133 14: return(NULL) % no packet to dequeue 1134 15: } 1136 16: maxrand(u) { % return the max of u random numbers 1137 17: maxr=0 1138 18: while (u-- > 0) 1139 19: maxr = max(maxr, rand()) % 0 <= rand() < 1 1140 20: return(maxr) 1141 21: } 1143 Figure 8: Example Dequeue Pseudocode for DualQ Coupled Curvy RED AQM 1145 Packet classification code is not shown, as it is no different from 1146 Figure 3. Potential classification schemes are discussed in 1147 Section 2. The Curvy RED algorithm has not been maintained to the 1148 same degree as the DualPI2 algorithm. Some ideas used in DualPI2 1149 would need to be translated into Curvy RED, such as i) the time- 1150 shifted FIFO scheduler ii) the time-based L4S threshold; iii) turning 1151 off ECN as overload protection; iv) Classic ECN support. These are 1152 not shown in the Curvy RED pseudocode, but would need to be 1153 implemented for production. {ToDo} 1155 At the outer level, the structure of dualq_dequeue() implements 1156 strict priority scheduling. The code is written assuming the AQM is 1157 applied on dequeue (Note 1) . Every time dualq_dequeue() is called, 1158 the if-block in lines 2-6 determines whether there is an L4S packet 1159 to dequeue by calling lq.dequeue(pkt), and otherwise the while-block 1160 in lines 7-13 determines whether there is a Classic packet to 1161 dequeue, by calling cq.dequeue(pkt). (Note 2) 1162 In the lower priority Classic queue, a while loop is used so that, if 1163 the AQM determines that a classic packet should be dropped, it 1164 continues to test for classic packets deciding whether to drop each 1165 until it actually forwards one. Thus, every call to dualq_dequeue() 1166 returns one packet if at least one is present in either queue, 1167 otherwise it returns NULL at line 14. (Note 3) 1169 Within each queue, the decision whether to drop or mark is taken as 1170 follows (to simplify the explanation, it is assumed that U=1): 1172 L4S: If the test at line 2 determines there is an L4S packet to 1173 dequeue, the tests at lines 3a and 3c determine whether to mark 1174 it. The first is a simple test of whether the L4S queue (lq.byt() 1175 in bytes) is greater than a step threshold T in bytes (Note 4). 1176 The second test is similar to the random ECN marking in RED, but 1177 with the following differences: i) the marking function does not 1178 start with a plateau of zero marking until a minimum threshold, 1179 rather the marking probability starts to increase as soon as the 1180 queue is positive; ii) marking depends on queuing time, not bytes, 1181 in order to scale for any link rate without being reconfigured; 1182 iii) marking of the L4S queue does not depend on itself, it 1183 depends on the queuing time of the _other_ (Classic) queue, where 1184 cq.sec() is the queuing time of the packet at the head of the 1185 Classic queue (zero if empty); iv) marking depends on the 1186 instantaneous queuing time (of the other Classic queue), not a 1187 smoothed average; v) the queue is compared with the maximum of U 1188 random numbers (but if U=1, this is the same as the single random 1189 number used in RED). 1191 Specifically, in line 3a the marking probability p_L is set to the 1192 Classic queueing time qc.sec() in seconds divided by the L4S 1193 scaling parameter 2^S_L, which represents the queuing time (in 1194 seconds) at which marking probability would hit 100%. Then in line 1195 3d (if U=1) the result is compared with a uniformly distributed 1196 random number between 0 and 1, which ensures that marking 1197 probability will linearly increase with queueing time. The 1198 scaling parameter is expressed as a power of 2 so that division 1199 can be implemented as a right bit-shift (>>) in line 3 of the 1200 integer variant of the pseudocode (Figure 9). 1202 Classic: If the test at line 7 determines that there is at least one 1203 Classic packet to dequeue, the test at line 9b determines whether 1204 to drop it. But before that, line 8b updates Q_C, which is an 1205 exponentially weighted moving average (Note 5) of the queuing time 1206 in the Classic queue, where pkt.sec() is the instantaneous 1207 queueing time of the current Classic packet and alpha is the EWMA 1208 constant for the classic queue. In line 8a, alpha is represented 1209 as an integer power of 2, so that in line 8 of the integer code 1210 the division needed to weight the moving average can be 1211 implemented by a right bit-shift (>> f_C). 1213 Lines 9a and 9b implement the drop function. In line 9a the 1214 averaged queuing time Q_C is divided by the Classic scaling 1215 parameter 2^S_C, in the same way that queuing time was scaled for 1216 L4S marking. This scaled queuing time is given the variable name 1217 sqrt_p_C because it will be squared to compute Classic drop 1218 probability, so before it is squared it is effectively the square 1219 root of the drop probability. The squaring is done by comparing 1220 it with the maximum out of two random numbers (assuming U=1). 1221 Comparing it with the maximum out of two is the same as the 1222 logical `AND' of two tests, which ensures drop probability rises 1223 with the square of queuing time (Note 6). Again, the scaling 1224 parameter is expressed as a power of 2 so that division can be 1225 implemented as a right bit-shift in line 9 of the integer 1226 pseudocode. 1228 The marking/dropping functions in each queue (lines 3 & 9) are two 1229 cases of a new generalization of RED called Curvy RED, motivated as 1230 follows. When we compared the performance of our AQM with fq_CoDel 1231 and PIE, we came to the conclusion that their goal of holding queuing 1232 delay to a fixed target is misguided [CRED_Insights]. As the number 1233 of flows increases, if the AQM does not allow TCP to increase queuing 1234 delay, it has to introduce abnormally high levels of loss. Then loss 1235 rather than queuing becomes the dominant cause of delay for short 1236 flows, due to timeouts and tail losses. 1238 Curvy RED constrains delay with a softened target that allows some 1239 increase in delay as load increases. This is achieved by increasing 1240 drop probability on a convex curve relative to queue growth (the 1241 square curve in the Classic queue, if U=1). Like RED, the curve hugs 1242 the zero axis while the queue is shallow. Then, as load increases, 1243 it introduces a growing barrier to higher delay. But, unlike RED, it 1244 requires only one parameter, the scaling, not three. The diadvantage 1245 of Curvy RED is that it is not adapted to a wide range of RTTs. 1246 Curvy RED can be used as is when the RTT range to support is limited 1247 otherwise an adaptation mechanism is required. 1249 There follows a summary listing of the two parameters used for each 1250 of the two queues: 1252 Classic: 1254 S_C : The scaling factor of the dropping function scales Classic 1255 queuing times in the range [0, 2^(S_C)] seconds into a dropping 1256 probability in the range [0,1]. To make division efficient, it 1257 is constrained to be an integer power of two; 1259 f_C : To smooth the queuing time of the Classic queue and make 1260 multiplication efficient, we use a negative integer power of 1261 two for the dimensionless EWMA constant, which we define as 1262 alpha = 2^(-f_C). 1264 L4S : 1266 S_L (and k'): As for the Classic queue, the scaling factor of 1267 the L4S marking function scales Classic queueing times in the 1268 range [0, 2^(S_L)] seconds into a probability in the range 1269 [0,1]. Note that S_L = S_C + k', where k' is the coupling 1270 between the queues. So S_L and k' count as only one parameter; 1271 k' is related to k in Equation (1) (Section 2.1) by k=2^k', 1272 where both k and k' are constants. Then implementations can 1273 avoid costly division by shifting p_L by k' bits to the right. 1275 T : The queue size in bytes at which step threshold marking 1276 starts in the L4S queue. 1278 {ToDo: These are the raw parameters used within the algorithm. A 1279 configuration front-end could accept more meaningful parameters and 1280 convert them into these raw parameters.} 1282 From our experiments so far, recommended values for these parameters 1283 are: S_C = -1; f_C = 5; T = 5 * MTU for the range of base RTTs 1284 typical on the public Internet. [CRED_Insights] explains why these 1285 parameters are applicable whatever rate link this AQM implementation 1286 is deployed on and how the parameters would need to be adjusted for a 1287 scenario with a different range of RTTs (e.g. a data centre) {ToDo 1288 incorporate a summary of that report into this draft}. The setting of 1289 k depends on policy (see Section 2.5 and Appendix C respectively for 1290 its recommended setting and guidance on alternatives). 1292 There is also a cUrviness parameter, U, which is a small positive 1293 integer. It is likely to take the same hard-coded value for all 1294 implementations, once experiments have determined a good value. We 1295 have solely used U=1 in our experiments so far, but results might be 1296 even better with U=2 or higher. 1298 Note that the dropping function at line 9 calls maxrand(2*U), which 1299 gives twice as much curviness as the call to maxrand(U) in the 1300 marking function at line 3. This is the trick that implements the 1301 square rule in equation (1) (Section 2.1). This is based on the fact 1302 that, given a number X from 1 to 6, the probability that two dice 1303 throws will both be less than X is the square of the probability that 1304 one throw will be less than X. So, when U=1, the L4S marking 1305 function is linear and the Classic dropping function is squared. If 1306 U=2, L4S would be a square function and Classic would be quartic. 1307 And so on. 1309 The maxrand(u) function in lines 16-21 simply generates u random 1310 numbers and returns the maximum (Note 7). Typically, maxrand(u) 1311 could be run in parallel out of band. For instance, if U=1, the 1312 Classic queue would require the maximum of two random numbers. So, 1313 instead of calling maxrand(2*U) in-band, the maximum of every pair of 1314 values from a pseudorandom number generator could be generated out- 1315 of-band, and held in a buffer ready for the Classic queue to consume. 1317 1: dualq_dequeue(lq, cq) { % Couples L4S & Classic queues, lq & cq 1318 2: if ( lq.dequeue(pkt) ) { 1319 3: if ((lq.byt() > T) || ((cq.ns() >> (S_L-2)) > maxrand(U))) 1320 4: mark(pkt) 1321 5: return(pkt) % return the packet and stop here 1322 6: } 1323 7: while ( cq.dequeue(pkt) ) { 1324 8: Q_C += (pkt.ns() - Q_C) >> f_C % Classic Q EWMA 1325 9: if ( (Q_C >> (S_C-2) ) > maxrand(2*U) ) 1326 10: drop(pkt) % Squared drop, redo loop 1327 11: else 1328 12: return(pkt) % return the packet and stop here 1329 13: } 1330 14: return(NULL) % no packet to dequeue 1331 15: } 1333 Figure 9: Optimised Example Dequeue Pseudocode for Coupled DualQ AQM 1334 using Integer Arithmetic 1336 Notes: 1338 1. The drain rate of the queue can vary if it is scheduled relative 1339 to other queues, or to cater for fluctuations in a wireless 1340 medium. To auto-adjust to changes in drain rate, the queue must 1341 be measured in time, not bytes or packets [CoDel]. In our Linux 1342 implementation, it was easiest to measure queuing time at 1343 dequeue. Queuing time can be estimated when a packet is enqueued 1344 by measuring the queue length in bytes and dividing by the recent 1345 drain rate. 1347 2. An implementation has to use priority queueing, but it need not 1348 implement strict priority. 1350 3. If packets can be enqueued while processing dequeue code, an 1351 implementer might prefer to place the while loop around both 1352 queues so that it goes back to test again whether any L4S packets 1353 arrived while it was dropping a Classic packet. 1355 4. In order not to change too many factors at once, for now, we keep 1356 the marking function for DCTCP-only traffic as similar as 1357 possible to DCTCP. However, unlike DCTCP, all processing is at 1358 dequeue, so we determine whether to mark a packet at the head of 1359 the queue by the byte-length of the queue _behind_ it. We plan 1360 to test whether using queuing time will work in all 1361 circumstances, and if we find that the step can cause 1362 oscillations, we will investigate replacing it with a steep 1363 random marking curve. 1365 5. An EWMA is only one possible way to filter bursts; other more 1366 adaptive smoothing methods could be valid and it might be 1367 appropriate to decrease the EWMA faster than it increases. 1369 6. In practice at line 10 the Classic queue would probably test for 1370 ECN capability on the packet to determine whether to drop or mark 1371 the packet. However, for brevity such detail is omitted. All 1372 packets classified into the L4S queue have to be ECN-capable, so 1373 no dropping logic is necessary at line 3. Nonetheless, L4S 1374 packets could be dropped by overload code (see Section 4.1). 1376 7. In the integer variant of the pseudocode (Figure 9) real numbers 1377 are all represented as integers scaled up by 2^32. In lines 3 & 1378 9 the function maxrand() is arranged to return an integer in the 1379 range 0 <= maxrand() < 2^32. Queuing times are also scaled up by 1380 2^32, but in two stages: i) In lines 3 and 8 queuing times 1381 cq.ns() and pkt.ns() are returned in integer nanoseconds, making 1382 the values about 2^30 times larger than when the units were 1383 seconds, ii) then in lines 3 and 9 an adjustment of -2 to the 1384 right bit-shift multiplies the result by 2^2, to complete the 1385 scaling by 2^32. 1387 Appendix C. Guidance on Controlling Throughput Equivalence 1389 +---------------+------+-------+ 1390 | RTT_C / RTT_L | Reno | Cubic | 1391 +---------------+------+-------+ 1392 | 1 | k'=1 | k'=0 | 1393 | 2 | k'=2 | k'=1 | 1394 | 3 | k'=2 | k'=2 | 1395 | 4 | k'=3 | k'=2 | 1396 | 5 | k'=3 | k'=3 | 1397 +---------------+------+-------+ 1399 Table 1: Value of k' for which DCTCP throughput is roughly the same 1400 as Reno or Cubic, for some example RTT ratios 1402 k' is related to k in Equation (1) (Section 2.1) by k=2^k'. 1404 To determine the appropriate policy, the operator first has to judge 1405 whether it wants DCTCP flows to have roughly equal throughput with 1406 Reno or with Cubic (because, even in its Reno-compatibility mode, 1407 Cubic is about 1.4 times more aggressive than Reno). Then the 1408 operator needs to decide at what ratio of RTTs it wants DCTCP and 1409 Classic flows to have roughly equal throughput. For example choosing 1410 k'=0 (equivalent to k=1) will make DCTCP throughput roughly the same 1411 as Cubic, _if their RTTs are the same_. 1413 However, even if the base RTTs are the same, the actual RTTs are 1414 unlikely to be the same, because Classic (Cubic or Reno) traffic 1415 needs a large queue to avoid under-utilization and excess drop, 1416 whereas L4S (DCTCP) does not. The operator might still choose this 1417 policy if it judges that DCTCP throughput should be rewarded for 1418 keeping its own queue short. 1420 On the other hand, the operator will choose one of the higher values 1421 for k', if it wants to slow DCTCP down to roughly the same throughput 1422 as Classic flows, to compensate for Classic flows slowing themselves 1423 down by causing themselves extra queuing delay. 1425 The values for k' in the table are derived from the formulae, which 1426 was developed in [DCttH15]: 1428 2^k' = 1.64 (RTT_reno / RTT_dc) (2) 1429 2^k' = 1.19 (RTT_cubic / RTT_dc ) (3) 1431 For localized traffic from a particular ISP's data centre, we used 1432 the measured RTTs to calculate that a value of k'=3 (equivalant to 1433 k=8) would achieve throughput equivalence, and our experiments 1434 verified the formula very closely. 1436 For a typical mix of RTTs from local data centres and across the 1437 general Internet, a value of k'=1 (equivalent to k=2) is recommended 1438 as a good workable compromise. 1440 Authors' Addresses 1442 Koen De Schepper 1443 Nokia Bell Labs 1444 Antwerp 1445 Belgium 1447 Email: koen.de_schepper@nokia.com 1448 URI: https://www.bell-labs.com/usr/koen.de_schepper 1449 Bob Briscoe (editor) 1450 CableLabs 1451 UK 1453 Email: ietf@bobbriscoe.net 1454 URI: http://bobbriscoe.net/ 1456 Olga Bondarenko 1457 Simula Research Lab 1458 Lysaker 1459 Norway 1461 Email: olgabnd@gmail.com 1462 URI: https://www.simula.no/people/olgabo 1464 Ing-jyh Tsang 1465 Nokia Bell Labs 1466 Antwerp 1467 Belgium 1469 Email: ing-jyh.tsang@nokia.com