idnits 2.17.1 draft-ietf-tsvwg-aqm-dualq-coupled-12.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 (July 27, 2020) is 1370 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 2317 -- Looks like a reference, but probably isn't: '1' on line 2317 == Outdated reference: A later version (-29) exists of draft-ietf-tsvwg-ecn-l4s-id-10 == Outdated reference: A later version (-02) exists of draft-cardwell-iccrg-bbr-congestion-control-00 == Outdated reference: A later version (-07) exists of draft-briscoe-docsis-q-protection-00 == Outdated reference: A later version (-20) exists of draft-ietf-tsvwg-l4s-arch-06 == Outdated reference: A later version (-22) exists of draft-ietf-tsvwg-nqb-01 -- Obsolete informational reference (is this intentional?): RFC 2309 (Obsoleted by RFC 7567) -- Obsolete informational reference (is this intentional?): RFC 8312 (Obsoleted by RFC 9438) Summary: 0 errors (**), 0 flaws (~~), 6 warnings (==), 5 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: January 28, 2021 Independent 6 G. White 7 CableLabs 8 July 27, 2020 10 DualQ Coupled AQMs for Low Latency, Low Loss and Scalable Throughput 11 (L4S) 12 draft-ietf-tsvwg-aqm-dualq-coupled-12 14 Abstract 16 The Low Latency Low Loss Scalable Throughput (L4S) architecture 17 allows data flows over the public Internet to achieve consistent low 18 queuing latency, generally zero congestion loss and scaling of per- 19 flow throughput without the scaling problems of standard TCP Reno- 20 friendly congestion controls. To achieve this, L4S data flows have 21 to use one of the family of 'Scalable' congestion controls (TCP 22 Prague and Data Center TCP are examples) and a form of Explicit 23 Congestion Notification (ECN) with modified behaviour. However, 24 until now, Scalable congestion controls did not co-exist with 25 existing Reno/Cubic traffic --- Scalable controls are so aggressive 26 that 'Classic' (e.g. Reno-friendly) algorithms sharing an ECN- 27 capable queue would drive themselves to a small capacity share. 28 Therefore, until now, L4S controls could only be deployed where a 29 clean-slate environment could be arranged, such as in private data 30 centres (hence the name DCTCP). This specification defines `DualQ 31 Coupled Active Queue Management (AQM)', which enables Scalable 32 congestion controls that comply with the Prague L4S requirements to 33 co-exist safely with Classic Internet traffic. 35 Analytical study and implementation testing of the Coupled AQM have 36 shown that Scalable and Classic flows competing under similar 37 conditions run at roughly the same rate. It achieves this 38 indirectly, without having to inspect transport layer flow 39 identifiers. When tested in a residential broadband setting, DCTCP 40 also achieves sub-millisecond average queuing delay and zero 41 congestion loss under a wide range of mixes of DCTCP and `Classic' 42 broadband Internet traffic, without compromising the performance of 43 the Classic traffic. The solution has low complexity and requires no 44 configuration for the public Internet. 46 Status of This Memo 48 This Internet-Draft is submitted in full conformance with the 49 provisions of BCP 78 and BCP 79. 51 Internet-Drafts are working documents of the Internet Engineering 52 Task Force (IETF). Note that other groups may also distribute 53 working documents as Internet-Drafts. The list of current Internet- 54 Drafts is at https://datatracker.ietf.org/drafts/current/. 56 Internet-Drafts are draft documents valid for a maximum of six months 57 and may be updated, replaced, or obsoleted by other documents at any 58 time. It is inappropriate to use Internet-Drafts as reference 59 material or to cite them other than as "work in progress." 61 This Internet-Draft will expire on January 28, 2021. 63 Copyright Notice 65 Copyright (c) 2020 IETF Trust and the persons identified as the 66 document authors. All rights reserved. 68 This document is subject to BCP 78 and the IETF Trust's Legal 69 Provisions Relating to IETF Documents 70 (https://trustee.ietf.org/license-info) in effect on the date of 71 publication of this document. Please review these documents 72 carefully, as they describe your rights and restrictions with respect 73 to this document. Code Components extracted from this document must 74 include Simplified BSD License text as described in Section 4.e of 75 the Trust Legal Provisions and are provided without warranty as 76 described in the Simplified BSD License. 78 Table of Contents 80 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 81 1.1. Outline of the Problem . . . . . . . . . . . . . . . . . 3 82 1.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 6 83 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 7 84 1.4. Features . . . . . . . . . . . . . . . . . . . . . . . . 9 85 2. DualQ Coupled AQM . . . . . . . . . . . . . . . . . . . . . . 10 86 2.1. Coupled AQM . . . . . . . . . . . . . . . . . . . . . . . 10 87 2.2. Dual Queue . . . . . . . . . . . . . . . . . . . . . . . 12 88 2.3. Traffic Classification . . . . . . . . . . . . . . . . . 12 89 2.4. Overall DualQ Coupled AQM Structure . . . . . . . . . . . 13 90 2.5. Normative Requirements for a DualQ Coupled AQM . . . . . 16 91 2.5.1. Functional Requirements . . . . . . . . . . . . . . . 16 92 2.5.1.1. Requirements in Unexpected Cases . . . . . . . . 17 93 2.5.2. Management Requirements . . . . . . . . . . . . . . . 18 94 2.5.2.1. Configuration . . . . . . . . . . . . . . . . . . 18 95 2.5.2.2. Monitoring . . . . . . . . . . . . . . . . . . . 19 96 2.5.2.3. Anomaly Detection . . . . . . . . . . . . . . . . 20 97 2.5.2.4. Deployment, Coexistence and Scaling . . . . . . . 20 98 3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 99 4. Security Considerations . . . . . . . . . . . . . . . . . . . 21 100 4.1. Overload Handling . . . . . . . . . . . . . . . . . . . . 21 101 4.1.1. Avoiding Classic Starvation: Sacrifice L4S Throughput 102 or Delay? . . . . . . . . . . . . . . . . . . . . . . 21 103 4.1.2. Congestion Signal Saturation: Introduce L4S Drop or 104 Delay? . . . . . . . . . . . . . . . . . . . . . . . 23 105 4.1.3. Protecting against Unresponsive ECN-Capable Traffic . 24 106 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 24 107 6. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 24 108 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 109 7.1. Normative References . . . . . . . . . . . . . . . . . . 25 110 7.2. Informative References . . . . . . . . . . . . . . . . . 26 111 Appendix A. Example DualQ Coupled PI2 Algorithm . . . . . . . . 30 112 A.1. Pass #1: Core Concepts . . . . . . . . . . . . . . . . . 31 113 A.2. Pass #2: Overload Details . . . . . . . . . . . . . . . . 39 114 Appendix B. Example DualQ Coupled Curvy RED Algorithm . . . . . 43 115 B.1. Curvy RED in Pseudocode . . . . . . . . . . . . . . . . . 43 116 B.2. Efficient Implementation of Curvy RED . . . . . . . . . . 49 117 Appendix C. Choice of Coupling Factor, k . . . . . . . . . . . . 51 118 C.1. RTT-Dependence . . . . . . . . . . . . . . . . . . . . . 51 119 C.2. Guidance on Controlling Throughput Equivalence . . . . . 52 120 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 53 122 1. Introduction 124 This document specifies a framework for DualQ Coupled AQMs, which is 125 the network part of the L4S architecture [I-D.ietf-tsvwg-l4s-arch]. 126 L4S enables both ultra-low queuing latency (sub-millisecond on 127 average) and high throughput at the same time, for ad hoc numbers of 128 capacity-seeking applications all sharing the same capacity. 130 1.1. Outline of the Problem 132 Latency is becoming the critical performance factor for many (most?) 133 applications on the public Internet, e.g. interactive Web, Web 134 services, voice, conversational video, interactive video, interactive 135 remote presence, instant messaging, online gaming, remote desktop, 136 cloud-based applications, and video-assisted remote control of 137 machinery and industrial processes. In the developed world, further 138 increases in access network bit-rate offer diminishing returns, 139 whereas latency is still a multi-faceted problem. In the last decade 140 or so, much has been done to reduce propagation time by placing 141 caches or servers closer to users. However, queuing remains a major 142 intermittent component of latency. 144 Traditionally ultra-low latency has only been available for a few 145 selected low rate applications, that confine their sending rate 146 within a specially carved-off portion of capacity, which is 147 prioritized over other traffic, e.g. Diffserv EF [RFC3246]. Up to 148 now it has not been possible to allow any number of low latency, high 149 throughput applications to seek to fully utilize available capacity, 150 because the capacity-seeking process itself causes too much queuing 151 delay. 153 To reduce this queuing delay caused by the capacity seeking process, 154 changes either to the network alone or to end-systems alone are in 155 progress. L4S involves a recognition that both approaches are 156 yielding diminishing returns: 158 o Recent state-of-the-art active queue management (AQM) in the 159 network, e.g. fq_CoDel [RFC8290], PIE [RFC8033], Adaptive 160 RED [ARED01] ) has reduced queuing delay for all traffic, not just 161 a select few applications. However, no matter how good the AQM, 162 the capacity-seeking (sawtoothing) rate of TCP-like congestion 163 controls represents a lower limit that will either cause queuing 164 delay to vary or cause the link to be under-utilized. These AQMs 165 are tuned to allow a typical capacity-seeking Reno-friendly flow 166 to induce an average queue that roughly doubles the base RTT, 167 adding 5-15 ms of queuing on average (cf. 500 microseconds with 168 L4S for the same mix of long-running and web traffic). However, 169 for many applications low delay is not useful unless it is 170 consistently low. With these AQMs, 99th percentile queuing delay 171 is 20-30 ms (cf. 2 ms with the same traffic over L4S). 173 o Similarly, recent research into using e2e congestion control 174 without needing an AQM in the network (e.g.BBRv1 [BBRv1]) seems to 175 have hit a similar lower limit to queuing delay of about 20ms on 176 average (and any additional BBRv1 flow adds another 20ms of 177 queuing) but there are also regular 25ms delay spikes due to 178 bandwidth probes and 60ms spikes due to flow-starts. 180 L4S learns from the experience of Data Center TCP [RFC8257], which 181 shows the power of complementary changes both in the network and on 182 end-systems. DCTCP teaches us that two small but radical changes to 183 congestion control are needed to cut the two major outstanding causes 184 of queuing delay variability: 186 1. Far smaller rate variations (sawteeth) than Reno-friendly 187 congestion controls; 189 2. A shift of smoothing and hence smoothing delay from network to 190 sender. 192 Without the former, a 'Classic' (e.g. Reno-friendly) flow's round 193 trip time (RTT) varies between roughly 1 and 2 times the base RTT 194 between the machines in question. Without the latter a 'Classic' 195 flow's response to changing events is delayed by a worst-case 196 (transcontinental) RTT, which could be hundreds of times the actual 197 smoothing delay needed for the RTT of typical traffic from localized 198 CDNs. 200 These changes are the two main features of the family of so-called 201 'Scalable' congestion controls (which includes DCTCP). Both these 202 changes only reduce delay in combination with a complementary change 203 in the network and they are both only feasible with ECN, not drop, 204 for the signalling: 206 1. The smaller sawteeth allow an extremely shallow ECN packet- 207 marking threshold in the queue. 209 2. And no smoothing in the network means that every fluctuation of 210 the queue is signalled immediately. 212 Without ECN, either of these would lead to very high loss levels. 213 But, with ECN, the resulting high marking levels are just signals, 214 not impairments. 216 However, until now, Scalable congestion controls (like DCTCP) did not 217 co-exist well in a shared ECN-capable queue with existing ECN-capable 218 TCP Reno [RFC5681] or Cubic [RFC8312] congestion controls --- 219 Scalable controls are so aggressive that these 'Classic' algorithms 220 would drive themselves to a small capacity share. Therefore, until 221 now, L4S controls could only be deployed where a clean-slate 222 environment could be arranged, such as in private data centres (hence 223 the name DCTCP). 225 This document specifies a `DualQ Coupled AQM' extension that solves 226 the problem of coexistence between Scalable and Classic flows, 227 without having to inspect flow identifiers. It is not like flow- 228 queuing approaches [RFC8290] that classify packets by flow identifier 229 into separate queues in order to isolate sparse flows from the higher 230 latency in the queues assigned to heavier flows. If a flow needs 231 both low delay and high throughput, having a queue to itself does not 232 isolate it from the harm it causes to itself. In contrast, L4S 233 addresses the root cause of the latency problem --- it is an enabler 234 for the smooth low latency scalable behaviour of Scalable congestion 235 controls, so that every packet in every flow can enjoy very low 236 latency, then there is no need to isolate each flow into a separate 237 queue. 239 1.2. Scope 241 L4S involves complementary changes in the network and on end-systems: 243 Network: A DualQ Coupled AQM (defined in the present document); 245 End-system: A Scalable congestion control (defined in Section 2.1). 247 Packet identifier: The network and end-system parts of L4S can be 248 deployed incrementally, because they both identify L4S packets 249 using the experimentally assigned explicit congestion notification 250 (ECN) codepoints in the IP header: ECT(1) and CE [RFC8311] 251 [I-D.ietf-tsvwg-ecn-l4s-id]. 253 Data Center TCP (DCTCP [RFC8257]) is an example of a Scalable 254 congestion control that has been deployed for some time in Linux, 255 Windows and FreeBSD operating systems and Relentless TCP [Mathis09] 256 is another example. During the progress of this document through the 257 IETF a number of other Scalable congestion controls were implemented, 258 e.g. TCP Prague [PragueLinux], QUIC Prague and the L4S variant of 259 SCREAM for real-time media [RFC8298]. (Note: after the v3.19 Linux 260 kernel, bugs were introduced into DCTCP's scalable behaviour and not 261 all the patches applied for L4S evaluation had been applied to the 262 mainline Linux kernel, which was at v5.5 at the time of writing. TCP 263 Prague includes these patches and is available for all these Linux 264 kernels). 266 The focus of this specification is to enable deployment of the 267 network part of the L4S service. Then, without any management 268 intervention, applications can exploit this new network capability as 269 their operating systems migrate to Scalable congestion controls, 270 which can then evolve _while_ their benefits are being enjoyed by 271 everyone on the Internet. 273 The DualQ Coupled AQM framework can incorporate any AQM designed for 274 a single queue that generates a statistical or deterministic mark/ 275 drop probability driven by the queue dynamics. Pseudocode examples 276 of two different DualQ Coupled AQMs are given in the appendices. In 277 many cases the framework simplifies the basic control algorithm, and 278 requires little extra processing. Therefore it is believed the 279 Coupled AQM would be applicable and easy to deploy in all types of 280 buffers; buffers in cost-reduced mass-market residential equipment; 281 buffers in end-system stacks; buffers in carrier-scale equipment 282 including remote access servers, routers, firewalls and Ethernet 283 switches; buffers in network interface cards, buffers in virtualized 284 network appliances, hypervisors, and so on. 286 For the public Internet, nearly all the benefit will typically be 287 achieved by deploying the Coupled AQM into either end of the access 288 link between a 'site' and the Internet, which is invariably the 289 bottleneck. Here, the term 'site' is used loosely to mean a home, an 290 office, a campus or mobile user equipment. 292 Latency is not the only concern of L4S: 294 o The 'Low Loss" part of the name denotes that L4S generally 295 achieves zero congestion loss (which would otherwise cause 296 retransmission delays), due to its use of ECN. 298 o The "Scalable throughput" part of the name denotes that the per- 299 flow throughput of Scalable congestion controls should scale 300 indefinitely, avoiding the imminent scaling problems with 'TCP- 301 Friendly' congestion control algorithms [RFC3649]. 303 The former is clearly in scope of this AQM document. However, the 304 latter is an outcome of the end-system behaviour, and therefore 305 outside the scope of this AQM document, even though the AQM is an 306 enabler. 308 The overall L4S architecture [I-D.ietf-tsvwg-l4s-arch] gives more 309 detail, including on wider deployment aspects such as backwards 310 compatibility of Scalable congestion controls in bottlenecks where a 311 DualQ Coupled AQM has not been deployed. The supporting papers [PI2] 312 and [DCttH15] give the full rationale for the AQM's design, both 313 discursively and in more precise mathematical form. 315 1.3. Terminology 317 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 318 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 319 document are to be interpreted as described in [RFC2119] when, and 320 only when, they appear in all capitals, as shown here. 322 The DualQ Coupled AQM uses two queues for two services. Each of the 323 following terms identifies both the service and the queue that 324 provides the service: 326 Classic service/queue: The Classic service is intended for all the 327 congestion control behaviours that co-exist with Reno [RFC5681] 328 (e.g. Reno itself, Cubic [RFC8312], TFRC [RFC5348]). 330 Low-Latency, Low-Loss Scalable throughput (L4S) service/queue: The 331 'L4S' service is intended for traffic from scalable congestion 332 control algorithms, such as Data Center TCP [RFC8257]. The L4S 333 service is for more general traffic than just DCTCP--it allows the 334 set of congestion controls with similar scaling properties to 335 DCTCP to evolve (e.g. Relentless TCP [Mathis09], TCP Prague 336 [PragueLinux] and the L4S variant of SCREAM for real-time media 337 [RFC8298]). 339 Classic Congestion Control: A congestion control behaviour that can 340 co-exist with standard TCP Reno [RFC5681] without causing 341 significantly negative impact on its flow rate [RFC5033]. With 342 Classic congestion controls, as flow rate scales, the number of 343 round trips between congestion signals (losses or ECN marks) rises 344 with the flow rate. So it takes longer and longer to recover 345 after each congestion event. Therefore control of queuing and 346 utilization becomes very slack, and the slightest disturbance 347 prevents a high rate from being attained [RFC3649]. 349 Scalable Congestion Control: A congestion control where the average 350 time from one congestion signal to the next (the recovery time) 351 remains invariant as the flow rate scales, all other factors being 352 equal. This maintains the same degree of control over queueing 353 and utilization whatever the flow rate, as well as ensuring that 354 high throughput is robust to disturbances. For instance, DCTCP 355 averages 2 congestion signals per round-trip whatever the flow 356 rate. For the public Internet a Scalable transport has to comply 357 with the requirements in Section 4 of [I-D.ietf-tsvwg-ecn-l4s-id] 358 (aka. the 'Prague L4S requirements'). 360 C: Abbreviation for Classic, e.g. when used as a subscript. 362 L: Abbreviation for L4S, e.g. when used as a subscript. 364 The terms Classic or L4S can also qualify other nouns, such as 365 'codepoint', 'identifier', 'classification', 'packet', 'flow'. 366 For example: an L4S packet means a packet with an L4S identifier 367 sent from an L4S congestion control. 369 Both Classic and L4S queues can cope with a proportion of 370 unresponsive or less-responsive traffic as well (e.g. DNS, VoIP, 371 game sync datagrams), just as a single queue AQM can if this 372 traffic makes minimal contribution to queuing. The DualQ Coupled 373 AQM behaviour is defined to be similar to a single FIFO queue with 374 respect to unresponsive and overload traffic. 376 Reno-friendly: The subset of Classic traffic that excludes 377 unresponsive traffic and excludes experimental congestion controls 378 intended to coexist with Reno but without always being strictly 379 friendly to it (as allowed by [RFC5033]). Reno-friendly is used 380 in place of 'TCP-friendly', given that the TCP protocol is used 381 with many different congestion control behaviours. 383 Classic ECN: The original Explicit Congestion Notification (ECN) 384 protocol [RFC3168], which requires ECN signals to be treated the 385 same as drops, both when generated in the network and when 386 responded to by the sender. 388 The names used for the four codepoints of the 2-bit IP-ECN field 389 are as defined in [RFC3168]: Not ECT, ECT(0), ECT(1) and CE, where 390 ECT stands for ECN-Capable Transport and CE stands for Congestion 391 Experienced. 393 1.4. Features 395 The AQM couples marking and/or dropping from the Classic queue to the 396 L4S queue in such a way that a flow will get roughly the same 397 throughput whichever it uses. Therefore both queues can feed into 398 the full capacity of a link and no rates need to be configured for 399 the queues. The L4S queue enables Scalable congestion controls like 400 DCTCP or TCP Prague to give ultra-low and predictably low latency, 401 without compromising the performance of competing 'Classic' Internet 402 traffic. 404 Thousands of tests have been conducted in a typical fixed residential 405 broadband setting. Experiments used a range of base round trip 406 delays up to 100ms and link rates up to 200 Mb/s between the data 407 centre and home network, with varying amounts of background traffic 408 in both queues. For every L4S packet, the AQM kept the average 409 queuing delay below 1ms (or 2 packets where serialization delay 410 exceeded 1ms on slower links), with 99th percentile no worse than 411 2ms. No losses at all were introduced by the L4S AQM. Details of 412 the extensive experiments are available [PI2] [DCttH15]. 414 Subjective testing was also conducted by multiple people all 415 simultaneously using very demanding high bandwidth low latency 416 applications over a single shared access link [L4Sdemo16]. In one 417 application, each user could use finger gestures to pan or zoom their 418 own high definition (HD) sub-window of a larger video scene generated 419 on the fly in 'the cloud' from a football match. Another user 420 wearing VR goggles was remotely receiving a feed from a 360-degree 421 camera in a racing car, again with the sub-window in their field of 422 vision generated on the fly in 'the cloud' dependent on their head 423 movements. Even though other users were also downloading large 424 amounts of L4S and Classic data, playing a gaming benchmark and 425 watchings videos over the same 40Mb/s downstream broadband link, 426 latency was so low that the football picture appeared to stick to the 427 user's finger on the touchpad and the experience fed from the remote 428 camera did not noticeably lag head movements. All the L4S data (even 429 including the downloads) achieved the same ultra-low latency. With 430 an alternative AQM, the video noticeably lagged behind the finger 431 gestures and head movements. 433 Unlike Diffserv Expedited Forwarding, the L4S queue does not have to 434 be limited to a small proportion of the link capacity in order to 435 achieve low delay. The L4S queue can be filled with a heavy load of 436 capacity-seeking flows (TCP Prague etc.) and still achieve low delay. 437 The L4S queue does not rely on the presence of other traffic in the 438 Classic queue that can be 'overtaken'. It gives low latency to L4S 439 traffic whether or not there is Classic traffic, and the latency of 440 Classic traffic does not suffer when a proportion of the traffic is 441 L4S. 443 The two queues are only necessary because: 445 o the large variations (sawteeth) of Classic flows need roughly a 446 base RTT of queuing delay to ensure full utilization 448 o Scalable flows do not need a queue to keep utilization high, but 449 they cannot keep latency predictably low if they are mixed with 450 Classic traffic, 452 The L4S queue has latency priority, but the coupling from the Classic 453 to the L4S AQM (explained below) ensures that it does not have 454 bandwidth priority over the Classic queue. 456 2. DualQ Coupled AQM 458 There are two main aspects to the approach: 460 o the Coupled AQM that addresses throughput equivalence between 461 Classic (e.g. Reno, Cubic) flows and L4S flows (that satisfy the 462 Prague L4S requirements). 464 o the Dual Queue structure that provides latency separation for L4S 465 flows to isolate them from the typically large Classic queue. 467 2.1. Coupled AQM 469 In the 1990s, the `TCP formula' was derived for the relationship 470 between the steady-state congestion window, cwnd, and the drop 471 probability, p of standard Reno congestion control [RFC5681] . To a 472 first order approximation, the steady-state cwnd of Reno is inversely 473 proportional to the square root of p. 475 The design focuses on Reno as the worst case, because if it does no 476 harm to Reno, it will not harm Cubic or any traffic designed to be 477 friendly to Reno. TCP Cubic implements a Reno-compatibility mode, 478 which is relevant for typical RTTs under 20ms as long as the 479 throughput of a single flow is less than about 700Mb/s. In such 480 cases it can be assumed that Cubic traffic behaves similarly to Reno 481 (but with a slightly different constant of proportionality). The 482 term 'Classic' will be used for the collection of Reno-friendly 483 traffic including Cubic and potentially other experimental congestion 484 controls intended not to significantly impact the flow rate of Reno. 486 A supporting paper [PI2] includes the derivation of the equivalent 487 rate equation for DCTCP, for which cwnd is inversely proportional to 488 p (not the square root), where in this case p is the ECN marking 489 probability. DCTCP is not the only congestion control that behaves 490 like this, so the term 'Scalable' will be used for all similar 491 congestion control behaviours (see examples in Section 1.2). The 492 term 'L4S' is also used for traffic driven by a Scalable congestion 493 control that also complies with the additional 'Prague L4S' 494 requirements [I-D.ietf-tsvwg-ecn-l4s-id]. 496 For safe co-existence, under stationary conditions, a Scalable flow 497 has to run at roughly the same rate as a Reno TCP flow (all other 498 factors being equal). So the drop or marking probability for Classic 499 traffic, p_C has to be distinct from the marking probability for L4S 500 traffic, p_L. The original ECN specification [RFC3168] required 501 these probabilities to be the same, but [RFC8311] updates RFC 3168 to 502 enable experiments in which these probabilities are different. 504 Also, to remain stable, Classic sources need the network to smooth 505 p_C so it changes relatively slowly. It is hard for a network node 506 to know the RTTs of all the flows, so a Classic AQM adds a _worst- 507 case_ RTT of smoothing delay (about 100-200 ms). In contrast, L4S 508 shifts responsibility for smoothing ECN feedback to the sender, which 509 only delays its response by its _own_ RTT, as well as allowing a more 510 immediate response if necessary. 512 The Coupled AQM achieves safe coexistence by making the Classic drop 513 probability p_C proportional to the square of the coupled L4S 514 probability p_CL. p_CL is an input to the instantaneous L4S marking 515 probability p_L but it changes as slowly as p_C. This makes the Reno 516 flow rate roughly equal the DCTCP flow rate, because the squaring of 517 p_CL counterbalances the square root of p_C in the 'TCP formula' of 518 Classic Reno congestion control. 520 Stating this as a formula, the relation between Classic drop 521 probability, p_C, and the coupled L4S probability p_CL needs to take 522 the form: 524 p_C = ( p_CL / k )^2 (1) 526 where k is the constant of proportionality, which is termed the 527 coupling factor. 529 2.2. Dual Queue 531 Classic traffic needs to build a large queue to prevent under- 532 utilization. Therefore a separate queue is provided for L4S traffic, 533 and it is scheduled with priority over the Classic queue. Priority 534 is conditional to prevent starvation of Classic traffic. 536 Nonetheless, coupled marking ensures that giving priority to L4S 537 traffic still leaves the right amount of spare scheduling time for 538 Classic flows to each get equivalent throughput to DCTCP flows (all 539 other factors such as RTT being equal). 541 2.3. Traffic Classification 543 Both the Coupled AQM and DualQ mechanisms need an identifier to 544 distinguish L4S (L) and Classic (C) packets. Then the coupling 545 algorithm can achieve coexistence without having to inspect flow 546 identifiers, because it can apply the appropriate marking or dropping 547 probability to all flows of each type. A separate 548 specification [I-D.ietf-tsvwg-ecn-l4s-id] requires the network to 549 treat the ECT(1) and CE codepoints of the ECN field as this 550 identifier, having assessed various alternatives. An additional 551 process document has proved necessary to make the ECT(1) codepoint 552 available for experimentation [RFC8311]. 554 For policy reasons, an operator might choose to steer certain packets 555 (e.g. from certain flows or with certain addresses) out of the L 556 queue, even though they identify themselves as L4S by their ECN 557 codepoints. In such cases, [I-D.ietf-tsvwg-ecn-l4s-id] says that the 558 device "MUST NOT alter the end-to-end L4S ECN identifier", so that it 559 is preserved end-to-end. The aim is that each operator can choose 560 how it treats L4S traffic locally, but an individual operator does 561 not alter the identification of L4S packets, which would prevent 562 other operators downstream from making their own choices on how to 563 treat L4S traffic. 565 In addition, an operator could use other identifiers to classify 566 certain additional packet types into the L queue that it deems will 567 not risk harm to the L4S service. For instance addresses of specific 568 applications or hosts (see [I-D.ietf-tsvwg-ecn-l4s-id]), specific 569 Diffserv codepoints such as EF (Expedited Forwarding) and Voice-Admit 570 service classes (see [I-D.briscoe-tsvwg-l4s-diffserv]), the Non- 571 Queue-Building (NQB) per-hop behaviour [I-D.ietf-tsvwg-nqb] or 572 certain protocols (e.g. ARP, DNS). Note that the mechanism only 573 reads these identifiers. [I-D.ietf-tsvwg-ecn-l4s-id] says it "MUST 574 NOT alter these non-ECN identifiers". Thus, the L queue is not soley 575 an L4S queue, it can be consider more generally as a low latency 576 queue. 578 2.4. Overall DualQ Coupled AQM Structure 580 Figure 1 shows the overall structure that any DualQ Coupled AQM is 581 likely to have. This schematic is intended to aid understanding of 582 the current designs of DualQ Coupled AQMs. However, it is not 583 intended to preclude other innovative ways of satisfying the 584 normative requirements in Section 2.5 that minimally define a DualQ 585 Coupled AQM. 587 The classifier on the left separates incoming traffic between the two 588 queues (L and C). Each queue has its own AQM that determines the 589 likelihood of marking or dropping (p_L and p_C). It has been 590 proved [PI2] that it is preferable to control load with a linear 591 controller, then square the output before applying it as a drop 592 probability to Reno-friendly traffic (because Reno congestion control 593 decreases its load proportional to the square-root of the increase in 594 drop). So, the AQM for Classic traffic needs to be implemented in 595 two stages: i) a base stage that outputs an internal probability p' 596 (pronounced p-prime); and ii) a squaring stage that outputs p_C, 597 where 599 p_C = (p')^2. (2) 601 Substituting for p_C in Eqn (1) gives: 603 p' = p_CL / k 605 So the slow-moving input to ECN marking in the L queue (the coupled 606 L4S probability) is: 608 p_CL = k*p'. (3) 610 The actual ECN marking probability p_L that is applied to the L queue 611 needs to track the immediate L queue delay under L-only congestion 612 conditions, as well as track p_CL under coupled congestion 613 conditions. So the L queue uses a native AQM that calculates a 614 probability p'_L as a function of the instantaneous L queue delay. 615 And, given the L queue has conditional priority over the C queue, 616 whenever the L queue grows, the AQM ought to apply marking 617 probability p'_L, but p_L ought not to fall below p_CL. This 618 suggests: 620 p_L = max(p'_L, p_CL), (4) 622 which has also been found to work very well in practice. 624 The two transformations of p' in equations (2) and (3) implement the 625 required coupling given in equation (1) earlier. 627 The constant of proportionality or coupling factor, k, in equation 628 (1) determines the ratio between the congestion probabilities (loss 629 or marking) experienced by L4S and Classic traffic. Thus k 630 indirectly determines the ratio between L4S and Classic flow rates, 631 because flows (assuming they are responsive) adjust their rate in 632 response to congestion probability. Appendix C.2 gives guidance on 633 the choice of k and its effect on relative flow rates. 635 _________ 636 | | ,------. 637 L4S queue | |===>| ECN | 638 ,'| _______|_| |marker|\ 639 <' | | `------'\\ 640 //`' v ^ p_L \\ 641 // ,-------. | \\ 642 // |Native |p'_L | \\,. 643 // | L4S |--->(MAX) < | ___ 644 ,----------.// | AQM | ^ p_CL `\|.'Cond-`. 645 | IP-ECN |/ `-------' | / itional \ 646 ==>|Classifier| ,-------. (k*p') [ priority]==> 647 | |\ | Base | | \scheduler/ 648 `----------'\\ | AQM |---->: ,'|`-.___.-' 649 \\ | |p' | <' | 650 \\ `-------' (p'^2) //`' 651 \\ ^ | // 652 \\,. | v p_C // 653 < | _________ .------.// 654 `\| | | | Drop |/ 655 Classic |queue |===>|/mark | 656 __|______| `------' 658 Legend: ===> traffic flow; ---> control dependency. 660 Figure 1: DualQ Coupled AQM Schematic 662 After the AQMs have applied their dropping or marking, the scheduler 663 forwards their packets to the link. Even though the scheduler gives 664 priority to the L queue, it is not as strong as the coupling from the 665 C queue. This is because, as the C queue grows, the base AQM applies 666 more congestion signals to L traffic (as well as C). As L flows 667 reduce their rate in response, they use less than the scheduling 668 share for L traffic. So, because the scheduler is work preserving, 669 it schedules any C traffic in the gaps. 671 Giving priority to the L queue has the benefit of very low L queue 672 delay, because the L queue is kept empty whenever L traffic is 673 controlled by the coupling. Also there only has to be a coupling in 674 one direction - from Classic to L4S. Priority has to be conditional 675 in some way to prevent the C queue starving under overload conditions 676 (see Section 4.1). With normal responsive traffic simple strict 677 priority would work, but it would make new Classic traffic wait until 678 its queue activated the coupling and L4S flows had in turn reduced 679 their rate enough to drain the L queue so that Classic traffic could 680 be scheduled. Giving a small weight or limited waiting time for C 681 traffic improves response times for short Classic messages, such as 682 DNS requests and improves Classic flow startup because immediate 683 capacity is available. 685 Example DualQ Coupled AQM algorithms called DualPI2 and Curvy RED are 686 given in Appendix A and Appendix B. Either example AQM can be used 687 to couple packet marking and dropping across a dual Q. 689 DualPI2 uses a Proportional-Integral (PI) controller as the Base AQM. 690 Indeed, this Base AQM with just the squared output and no L4S queue 691 can be used as a drop-in replacement for PIE [RFC8033], in which case 692 it is just called PI2 [PI2]. PI2 is a principled simplification of 693 PIE that is both more responsive and more stable in the face of 694 dynamically varying load. 696 Curvy RED is derived from RED [RFC2309], but its configuration 697 parameters are insensitive to link rate and it requires less 698 operations per packet. However, DualPI2 is more responsive and 699 stable over a wider range of RTTs than Curvy RED. As a consequence, 700 DualPI2 has attracted more development and evaluation attention than 701 Curvy RED, leaving the Curvy RED design incomplete and not so fully 702 evaluated. 704 Both AQMs regulate their queue in units of time rather than bytes. 705 As already explained, this ensures configuration can be invariant for 706 different drain rates. With AQMs in a dualQ structure this is 707 particularly important because the drain rate of each queue can vary 708 rapidly as flows for the two queues arrive and depart, even if the 709 combined link rate is constant. 711 It would be possible to control the queues with other alternative 712 AQMs, as long as the normative requirements (those expressed in 713 capitals) in Section 2.5 are observed. 715 2.5. Normative Requirements for a DualQ Coupled AQM 717 The following requirements are intended to capture only the essential 718 aspects of a DualQ Coupled AQM. They are intended to be independent 719 of the particular AQMs used for each queue. 721 2.5.1. Functional Requirements 723 A Dual Queue Coupled AQM implementation MUST utilize two queues, each 724 with an AQM algorithm. The two queues can be part of a larger 725 queuing hierarchy [I-D.briscoe-tsvwg-l4s-diffserv]. 727 The AQM algorithm for the low latency (L) queue MUST be able to apply 728 ECN marking to ECN-capable packets. 730 The scheduler draining the two queues MUST give L4S packets priority 731 over Classic, although priority MUST be bounded in order not to 732 starve Classic traffic. The scheduler SHOULD be work-conserving. 734 [I-D.ietf-tsvwg-ecn-l4s-id] defines the meaning of an ECN marking on 735 L4S traffic, relative to drop of Classic traffic. In order to ensure 736 coexistence of Classic and Scalable L4S traffic, it says, "The 737 likelihood that an AQM drops a Not-ECT Classic packet (p_C) MUST be 738 roughly proportional to the square of the likelihood that it would 739 have marked it if it had been an L4S packet (p_L)." The term 740 'likelihood' is used to allow for marking and dropping to be either 741 probabilistic or deterministic. 743 For the current specification, this translates into the following 744 requirement. A DualQ Coupled AQM MUST apply ECN marking to traffic 745 in the L queue that is no lower than that derived from the likelihood 746 of drop (or ECN marking) in the Classic queue using Eqn. (1). 748 The constant of proportionality, k, in Eqn (1) determines the 749 relative flow rates of Classic and L4S flows when the AQM concerned 750 is the bottleneck (all other factors being equal). 751 [I-D.ietf-tsvwg-ecn-l4s-id] says, "The constant of proportionality 752 (k) does not have to be standardised for interoperability, but a 753 value of 2 is RECOMMENDED." 755 Assuming Scalable congestion controls for the Internet will be as 756 aggressive as DCTCP, this will ensure their congestion window will be 757 roughly the same as that of a standards track TCP Reno congestion 758 control (Reno) [RFC5681] and other Reno-friendly controls, such as 759 TCP Cubic in its Reno-compatibility mode. 761 The choice of k is a matter of operator policy, and operators MAY 762 choose a different value using Table 1 and the guidelines in 763 Appendix C.2. 765 If multiple customers or users share capacity at a bottleneck (e.g. 766 in the Internet access link of a campus network), the operator's 767 choice of k will determine capacity sharing between the flows of 768 different customers. However, on the public Internet, access network 769 operators typically isolate customers from each other with some form 770 of layer-2 multiplexing (OFDM(A) in DOCSIS3.1, CDMA in 3G, SC-FDMA in 771 LTE) or L3 scheduling (WRR in DSL), rather than relying on host 772 congestion controls to share capacity between customers [RFC0970]. 773 In such cases, the choice of k will solely affect relative flow rates 774 within each customer's access capacity, not between customers. Also, 775 k will not affect relative flow rates at any times when all flows are 776 Classic or all flows are L4S, and it will not affect the relative 777 throughput of small flows. 779 2.5.1.1. Requirements in Unexpected Cases 781 The flexibility to allow operator-specific classifiers (Section 2.3) 782 leads to the need to specify what the AQM in each queue ought to do 783 with packets that do not carry the ECN field expected for that queue. 784 It is expected that the AQM in each queue will inspect the ECN field 785 to determine what sort of congestion notification to signal, then it 786 will decide whether to apply congestion notification to this 787 particular packet, as follows: 789 o If a packet that does not carry an ECT(1) or CE codepoint is 790 classified into the L queue: 792 * if the packet is ECT(0), the L AQM SHOULD apply CE-marking 793 using a probability appropriate to Classic congestion control 794 and appropriate to the target delay in the L queue 796 * if the packet is Not-ECT, the appropriate action depends on 797 whether some other function is protecting the L queue from 798 misbehaving flows (e.g. per-flow queue protection 799 [I-D.briscoe-docsis-q-protection] or latency policing): 801 + If separate queue protection is provided, the L AQM SHOULD 802 ignore the packet and forward it unchanged, meaning it 803 should not calculate whether to apply congestion 804 notification and it should neither drop nor CE-mark the 805 packet (for instance, the operator might classify EF traffic 806 that is unresponsive to drop into the L queue, alongside 807 responsive L4S-ECN traffic) 809 + if separate queue protection is not provided, the L AQM 810 SHOULD apply drop using a drop probability appropriate to 811 Classic congestion control and appropriate to the target 812 delay in the L queue 814 o If a packet that carries an ECT(1) codepoint is classified into 815 the C queue: 817 * the C AQM SHOULD apply CE-marking using the coupled AQM 818 probability p_CL (= k*p'). 820 The above requirements are worded as "SHOULDs", because operator- 821 specific classifiers are for flexibility, by definition. Therefore, 822 alternative actions might be appropriate in the operator's specific 823 circumstances. An example would be where the operator knows that 824 certain legacy traffic marked with one codepoint actually has a 825 congestion response associated with another codepoint. 827 If the DualQ Coupled AQM has detected overload, it SHOULD signal 828 congestion solely using drop, irrespective of the ECN field. 829 Switching to drop if ECN marking is persistently high is required by 830 Section 7 of [RFC3168] and Section 4.2.1 of [RFC7567]. 832 2.5.2. Management Requirements 834 2.5.2.1. Configuration 836 By default, a DualQ Coupled AQM SHOULD NOT need any configuration for 837 use at a bottleneck on the public Internet [RFC7567]. The following 838 parameters MAY be operator-configurable, e.g. to tune for non- 839 Internet settings: 841 o Optional packet classifier(s) to use in addition to the ECN field 842 (see Section 2.3); 844 o Expected typical RTT, which can be used to determine the queuing 845 delay of the Classic AQM at its operating point, in order to 846 prevent typical lone flows from under-utilizing capacity. For 847 example: 849 * for the PI2 algorithm (Appendix A) the queuing delay target is 850 set to the typical RTT; 852 * for the Curvy RED algorithm (Appendix B) the queuing delay at 853 the desired operating point of the curvy ramp is configured to 854 encompass a typical RTT; 856 * if another Classic AQM was used, it would be likely to need an 857 operating point for the queue based on the typical RTT, and if 858 so it SHOULD be expressed in units of time. 860 An operating point that is manually calculated might be directly 861 configurable instead, e.g. for links with large numbers of flows 862 where under-utilization by a single flow would be unlikely. 864 o Expected maximum RTT, which can be used to set the stability 865 parameter(s) of the Classic AQM. For example: 867 * for the PI2 algorithm (Appendix A), the gain parameters of the 868 PI algorithm depend on the maximum RTT. 870 * for the Curvy RED algorithm (Appendix B) the smoothing 871 parameter is chosen to filter out transients in the queue 872 within a maximum RTT. 874 Stability parameter(s) that are manually calculated assuming a 875 maximum RTT might be directly configurable instead. 877 o Coupling factor, k (see Appendix C.2); 879 o A limit to the conditional priority of L4S. This is scheduler- 880 dependent, but it SHOULD be expressed as a relation between the 881 max delay of a C packet and an L packet. For example: 883 * for a WRR scheduler a weight ratio between L and C of w:1 means 884 that the maximum delay to a C packet is w times that of an L 885 packet. 887 * for a time-shifted FIFO (TS-FIFO) scheduler (see Section 4.1.1) 888 a time-shift of tshift means that the maximum delay to a C 889 packet is tshift greater than that of an L packet. tshift could 890 be expressed as a multiple of the typical RTT rather than as an 891 absolute delay. 893 o The maximum Classic ECN marking probability, p_Cmax, before 894 switching over to drop. 896 2.5.2.2. Monitoring 898 An experimental DualQ Coupled AQM SHOULD allow the operator to 899 monitor each of the following operational statistics on demand, per 900 queue and per configurable sample interval, for performance 901 monitoring and perhaps also for accounting in some cases: 903 o Bits forwarded, from which utilization can be calculated; 904 o Total packets in the three categories: arrived, presented to the 905 AQM, and forwarded. The difference between the first two will 906 measure any non-AQM tail discard. The difference between the last 907 two will measure proactive AQM discard; 909 o ECN packets marked, non-ECN packets dropped, ECN packets dropped, 910 which can be combined with the three total packet counts above to 911 calculate marking and dropping probabilities; 913 o Queue delay (not including serialization delay of the head packet 914 or medium acquisition delay) - see further notes below. 916 Unlike the other statistics, queue delay cannot be captured in a 917 simple accumulating counter. Therefore the type of queue delay 918 statistics produced (mean, percentiles, etc.) will depend on 919 implementation constraints. To facilitate comparative evaluation 920 of different implementations and approaches, an implementation 921 SHOULD allow mean and 99th percentile queue delay to be derived 922 (per queue per sample interval). A relatively simple way to do 923 this would be to store a coarse-grained histogram of queue delay. 924 This could be done with a small number of bins with configurable 925 edges that represent contiguous ranges of queue delay. Then, over 926 a sample interval, each bin would accumulate a count of the number 927 of packets that had fallen within each range. The maximum queue 928 delay per queue per interval MAY also be recorded. 930 2.5.2.3. Anomaly Detection 932 An experimental DualQ Coupled AQM SHOULD asynchronously report the 933 following data about anomalous conditions: 935 o Start-time and duration of overload state. 937 A hysteresis mechanism SHOULD be used to prevent flapping in and 938 out of overload causing an event storm. For instance, exit from 939 overload state could trigger one report, but also latch a timer. 940 Then, during that time, if the AQM enters and exits overload state 941 any number of times, the duration in overload state is accumulated 942 but no new report is generated until the first time the AQM is out 943 of overload once the timer has expired. 945 2.5.2.4. Deployment, Coexistence and Scaling 947 [RFC5706] suggests that deployment, coexistence and scaling should 948 also be covered as management requirements. The raison d'etre of the 949 DualQ Coupled AQM is to enable deployment and coexistence of Scalable 950 congestion controls - as incremental replacements for today's Reno- 951 friendly controls that do not scale with bandwidth-delay product. 953 Therefore there is no need to repeat these motivating issues here 954 given they are already explained in the Introduction and detailed in 955 the L4S architecture [I-D.ietf-tsvwg-l4s-arch]. 957 The descriptions of specific DualQ Coupled AQM algorithms in the 958 appendices cover scaling of their configuration parameters, e.g. with 959 respect to RTT and sampling frequency. 961 3. IANA Considerations 963 This specification contains no IANA considerations. 965 4. Security Considerations 967 4.1. Overload Handling 969 Where the interests of users or flows might conflict, it could be 970 necessary to police traffic to isolate any harm to the performance of 971 individual flows. However it is hard to avoid unintended side- 972 effects with policing, and in a trusted environment policing is not 973 necessary. Therefore per-flow policing (e.g. 974 [I-D.briscoe-docsis-q-protection]) needs to be separable from a basic 975 AQM, as an option under policy control. 977 However, a basic DualQ AQM does at least need to handle overload. A 978 useful objective would be for the overload behaviour of the DualQ AQM 979 to be at least no worse than a single queue AQM. However, a trade- 980 off needs to be made between complexity and the risk of either 981 traffic class harming the other. In each of the following three 982 subsections, an overload issue specific to the DualQ is described, 983 followed by proposed solution(s). 985 Under overload the higher priority L4S service will have to sacrifice 986 some aspect of its performance. Alternative solutions are provided 987 below that each relax a different factor: e.g. throughput, delay, 988 drop. These choices need to be made either by the developer or by 989 operator policy, rather than by the IETF. 991 4.1.1. Avoiding Classic Starvation: Sacrifice L4S Throughput or Delay? 993 Priority of L4S is required to be conditional to avoid total 994 starvation of Classic by heavy L4S traffic. This raises the question 995 of whether to sacrifice L4S throughput or L4S delay (or some other 996 policy) to mitigate starvation of Classic: 998 Sacrifice L4S throughput: By using weighted round robin as the 999 conditional priority scheduler, the L4S service can sacrifice some 1000 throughput during overload. This can either be thought of as 1001 guaranteeing a minimum throughput service for Classic traffic, or 1002 as guaranteeing a maximum delay for a packet at the head of the 1003 Classic queue. 1005 The scheduling weight of the Classic queue should be small (e.g. 1006 1/16). Then, in most traffic scenarios the scheduler will not 1007 interfere and it will not need to - the coupling mechanism and the 1008 end-systems will share out the capacity across both queues as if 1009 it were a single pool. However, because the congestion coupling 1010 only applies in one direction (from C to L), if L4S traffic is 1011 over-aggressive or unresponsive, the scheduler weight for Classic 1012 traffic will at least be large enough to ensure it does not 1013 starve. 1015 In cases where the ratio of L4S to Classic flows (e.g. 19:1) is 1016 greater than the ratio of their scheduler weights (e.g. 15:1), the 1017 L4S flows will get less than an equal share of the capacity, but 1018 only slightly. For instance, with the example numbers given, each 1019 L4S flow will get (15/16)/19 = 4.9% when ideally each would get 1020 1/20=5%. In the rather specific case of an unresponsive flow 1021 taking up just less than the capacity set aside for L4S (e.g. 1022 14/16 in the above example), using WRR could significantly reduce 1023 the capacity left for any responsive L4S flows. 1025 The scheduling weight of the Classic queue should not be too 1026 small, otherwise a C packet at the head of the queue could be 1027 excessively delayed by a continually busy L queue. For instance 1028 if the Classic weight is 1/16, the maximum that a Classic packet 1029 at the head of the queue can be delayed by L traffic is the 1030 serialization delay of 15 MTU-sized packets. 1032 Sacrifice L4S Delay: To control milder overload of responsive 1033 traffic, particularly when close to the maximum congestion signal, 1034 the operator could choose to control overload of the Classic queue 1035 by allowing some delay to 'leak' across to the L4S queue. The 1036 scheduler can be made to behave like a single First-In First-Out 1037 (FIFO) queue with different service times by implementing a very 1038 simple conditional priority scheduler that could be called a 1039 "time-shifted FIFO" (see the Modifier Earliest Deadline First 1040 (MEDF) scheduler of [MEDF]). This scheduler adds tshift to the 1041 queue delay of the next L4S packet, before comparing it with the 1042 queue delay of the next Classic packet, then it selects the packet 1043 with the greater adjusted queue delay. Under regular conditions, 1044 this time-shifted FIFO scheduler behaves just like a strict 1045 priority scheduler. But under moderate or high overload it 1046 prevents starvation of the Classic queue, because the time-shift 1047 (tshift) defines the maximum extra queuing delay of Classic 1048 packets relative to L4S. 1050 The example implementations in Appendix A and Appendix B could both 1051 be implemented with either policy. 1053 4.1.2. Congestion Signal Saturation: Introduce L4S Drop or Delay? 1055 To keep the throughput of both L4S and Classic flows roughly equal 1056 over the full load range, a different control strategy needs to be 1057 defined above the point where one AQM first saturates to a 1058 probability of 100% leaving no room to push back the load any harder. 1059 If k>1, L4S will saturate first, even though saturation could be 1060 caused by unresponsive traffic in either queue. 1062 The term 'unresponsive' includes cases where a flow becomes 1063 temporarily unresponsive, for instance, a real-time flow that takes a 1064 while to adapt its rate in response to congestion, or a standard Reno 1065 flow that is normally responsive, but above a certain congestion 1066 level it will not be able to reduce its congestion window below the 1067 allowed minimum of 2 segments [RFC5681], effectively becoming 1068 unresponsive. (Note that L4S traffic ought to remain responsive 1069 below a window of 2 segments (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1071 Saturation raises the question of whether to relieve congestion by 1072 introducing some drop into the L4S queue or by allowing delay to grow 1073 in both queues (which could eventually lead to tail drop too): 1075 Drop on Saturation: Saturation can be avoided by setting a maximum 1076 threshold for L4S ECN marking (assuming k>1) before saturation 1077 starts to make the flow rates of the different traffic types 1078 diverge. Above that the drop probability of Classic traffic is 1079 applied to all packets of all traffic types. Then experiments 1080 have shown that queueing delay can be kept at the target in any 1081 overload situation, including with unresponsive traffic, and no 1082 further measures are required [DualQ-Test]. 1084 Delay on Saturation: When L4S marking saturates, instead of 1085 switching to drop, the drop and marking probabilities could be 1086 capped. Beyond that, delay will grow either solely in the queue 1087 with unresponsive traffic (if WRR is used), or in both queues (if 1088 time-shifted FIFO is used). In either case, the higher delay 1089 ought to control temporary high congestion. If the overload is 1090 more persistent, eventually the combined DualQ will overflow and 1091 tail drop will control congestion. 1093 The example implementation in Appendix A solely applies the "drop on 1094 saturation" policy. The DOCSIS specification of a DualQ Coupled AQM 1095 [DOCSIS3.1] also implements the 'drop on saturation' policy with a 1096 very shallow L buffer. However, the addition of DOCSIS per-flow 1097 Queue Protection [I-D.briscoe-docsis-q-protection] turns this into 1098 'delay on saturation' by redirecting some packets of the flow(s) most 1099 responsible for L queue overload into the C queue, which has a higher 1100 delay target. If overload continues, this again becomes 'drop on 1101 saturation' as the level of drop in the C queue rises to maintain the 1102 target delay of the C queue. 1104 4.1.3. Protecting against Unresponsive ECN-Capable Traffic 1106 Unresponsive traffic has a greater advantage if it is also ECN- 1107 capable. The advantage is undetectable at normal low levels of drop/ 1108 marking, but it becomes significant with the higher levels of drop/ 1109 marking typical during overload. This is an issue whether the ECN- 1110 capable traffic is L4S or Classic. 1112 This raises the question of whether and when to switch off ECN 1113 marking and use solely drop instead, as required by both Section 7 of 1114 [RFC3168] and Section 4.2.1 of [RFC7567]. 1116 Experiments with the DualPI2 AQM (Appendix A) have shown that 1117 introducing 'drop on saturation' at 100% L4S marking addresses this 1118 problem with unresponsive ECN as well as addressing the saturation 1119 problem. It leaves only a small range of congestion levels where 1120 unresponsive traffic gains any advantage from using the ECN 1121 capability, and the advantage is hardly detectable [DualQ-Test]. 1123 5. Acknowledgements 1125 Thanks to Anil Agarwal, Sowmini Varadhan's, Gabi Bracha, Nicolas 1126 Kuhn, Greg Skinner, Tom Henderson and David Pullen for detailed 1127 review comments particularly of the appendices and suggestions on how 1128 to make the explanations clearer. Thanks also to Tom Henderson for 1129 insights on the choice of schedulers and queue delay measurement 1130 techniques. 1132 The early contributions of Koen De Schepper, Bob Briscoe, Olga 1133 Bondarenko and Inton Tsang were part-funded by the European Community 1134 under its Seventh Framework Programme through the Reducing Internet 1135 Transport Latency (RITE) project (ICT-317700). Bob Briscoe's 1136 contribution was also part-funded by the Comcast Innovation Fund and 1137 the Research Council of Norway through the TimeIn project. The views 1138 expressed here are solely those of the authors. 1140 6. Contributors 1142 The following contributed implementations and evaluations that 1143 validated and helped to improve this specification: 1145 Olga Albisser of Simula Research Lab, Norway 1146 (Olga Bondarenko during early drafts) implemented the prototype 1147 DualPI2 AQM for Linux with Koen De Schepper and conducted 1148 extensive evaluations as well as implementing the live performance 1149 visualization GUI [L4Sdemo16]. 1151 Olivier Tilmans of Nokia 1152 Bell Labs, Belgium prepared and maintains the Linux implementation 1153 of DualPI2 for upstreaming. 1155 Tom Henderson of CableLabs, US implemented various 1156 DualQ Coupled AQMs for ns3, including DualPI2 and DualPIE over 1157 point to point and DOCSIS 3.1 link models and conducted extensive 1158 evaluations. 1160 Ing Jyh (Inton) Tsang of Nokia, Belgium built the End-to-End Data 1161 Centre to the Home broadband testbed on which DualQ Coupled AQM 1162 implementations were tested. 1164 7. References 1166 7.1. Normative References 1168 [I-D.ietf-tsvwg-ecn-l4s-id] 1169 Schepper, K. and B. Briscoe, "Identifying Modified 1170 Explicit Congestion Notification (ECN) Semantics for 1171 Ultra-Low Queuing Delay (L4S)", draft-ietf-tsvwg-ecn-l4s- 1172 id-10 (work in progress), March 2020. 1174 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1175 Requirement Levels", BCP 14, RFC 2119, 1176 DOI 10.17487/RFC2119, March 1997, 1177 . 1179 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 1180 of Explicit Congestion Notification (ECN) to IP", 1181 RFC 3168, DOI 10.17487/RFC3168, September 2001, 1182 . 1184 [RFC8311] Black, D., "Relaxing Restrictions on Explicit Congestion 1185 Notification (ECN) Experimentation", RFC 8311, 1186 DOI 10.17487/RFC8311, January 2018, 1187 . 1189 7.2. Informative References 1191 [Alizadeh-stability] 1192 Alizadeh, M., Javanmard, A., and B. Prabhakar, "Analysis 1193 of DCTCP: Stability, Convergence, and Fairness", ACM 1194 SIGMETRICS 2011 , June 2011, 1195 . 1197 [AQMmetrics] 1198 Kwon, M. and S. Fahmy, "A Comparison of Load-based and 1199 Queue- based Active Queue Management Algorithms", Proc. 1200 Int'l Soc. for Optical Engineering (SPIE) 4866:35--46 DOI: 1201 10.1117/12.473021, 2002, 1202 . 1204 [ARED01] Floyd, S., Gummadi, R., and S. Shenker, "Adaptive RED: An 1205 Algorithm for Increasing the Robustness of RED's Active 1206 Queue Management", ACIRI Technical Report , August 2001, 1207 . 1209 [BBRv1] Cardwell, N., Cheng, Y., Hassas Yeganeh, S., and V. 1210 Jacobson, "BBR Congestion Control", Internet Draft draft- 1211 cardwell-iccrg-bbr-congestion-control-00, July 2017, 1212 . 1215 [CoDel] Nichols, K. and V. Jacobson, "Controlling Queue Delay", 1216 ACM Queue 10(5), May 2012, 1217 . 1219 [CRED_Insights] 1220 Briscoe, B., "Insights from Curvy RED (Random Early 1221 Detection)", BT Technical Report TR-TUB8-2015-003 1222 arXiv:1904.07339 [cs.NI], July 2015, 1223 . 1225 [DCttH15] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 1226 Tsang, "`Data Centre to the Home': Ultra-Low Latency for 1227 All", RITE project Technical Report , 2015, 1228 . 1230 [DOCSIS3.1] 1231 CableLabs, "MAC and Upper Layer Protocols Interface 1232 (MULPI) Specification, CM-SP-MULPIv3.1", Data-Over-Cable 1233 Service Interface Specifications DOCSIS(R) 3.1 Version i17 1234 or later, January 2019, . 1237 [DualPI2Linux] 1238 Albisser, O., De Schepper, K., Briscoe, B., Tilmans, O., 1239 and H. Steen, "DUALPI2 - Low Latency, Low Loss and 1240 Scalable (L4S) AQM", Proc. Linux Netdev 0x13 , March 2019, 1241 . 1244 [DualQ-Test] 1245 Steen, H., "Destruction Testing: Ultra-Low Delay using 1246 Dual Queue Coupled Active Queue Management", Masters 1247 Thesis, Dept of Informatics, Uni Oslo , May 2017. 1249 [I-D.briscoe-docsis-q-protection] 1250 Briscoe, B. and G. White, "Queue Protection to Preserve 1251 Low Latency", draft-briscoe-docsis-q-protection-00 (work 1252 in progress), July 2019. 1254 [I-D.briscoe-tsvwg-l4s-diffserv] 1255 Briscoe, B., "Interactions between Low Latency, Low Loss, 1256 Scalable Throughput (L4S) and Differentiated Services", 1257 draft-briscoe-tsvwg-l4s-diffserv-02 (work in progress), 1258 November 2018. 1260 [I-D.ietf-tsvwg-l4s-arch] 1261 Briscoe, B., Schepper, K., Bagnulo, M., and G. White, "Low 1262 Latency, Low Loss, Scalable Throughput (L4S) Internet 1263 Service: Architecture", draft-ietf-tsvwg-l4s-arch-06 (work 1264 in progress), March 2020. 1266 [I-D.ietf-tsvwg-nqb] 1267 White, G. and T. Fossati, "A Non-Queue-Building Per-Hop 1268 Behavior (NQB PHB) for Differentiated Services", draft- 1269 ietf-tsvwg-nqb-01 (work in progress), March 2020. 1271 [L4Sdemo16] 1272 Bondarenko, O., De Schepper, K., Tsang, I., and B. 1273 Briscoe, "Ultra-Low Delay for All: Live Experience, Live 1274 Analysis", Proc. MMSYS'16 pp33:1--33:4, May 2016, 1275 . 1279 [LLD] White, G., Sundaresan, K., and B. Briscoe, "Low Latency 1280 DOCSIS: Technology Overview", CableLabs White Paper , 1281 February 2019, . 1284 [Mathis09] 1285 Mathis, M., "Relentless Congestion Control", PFLDNeT'09 , 1286 May 2009, . 1289 [MEDF] Menth, M., Schmid, M., Heiss, H., and T. Reim, "MEDF - a 1290 simple scheduling algorithm for two real-time transport 1291 service classes with application in the UTRAN", Proc. IEEE 1292 Conference on Computer Communications (INFOCOM'03) Vol.2 1293 pp.1116-1122, March 2003. 1295 [PI2] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 1296 Tsang, "PI2: A Linearized AQM for both Classic and 1297 Scalable TCP", ACM CoNEXT'16 , December 2016, 1298 . 1301 [PragueLinux] 1302 Briscoe, B., De Schepper, K., Albisser, O., Misund, J., 1303 Tilmans, O., Kuehlewind, M., and A. Ahmed, "Implementing 1304 the `TCP Prague' Requirements for Low Latency Low Loss 1305 Scalable Throughput (L4S)", Proc. Linux Netdev 0x13 , 1306 March 2019, . 1309 [RFC0970] Nagle, J., "On Packet Switches With Infinite Storage", 1310 RFC 970, DOI 10.17487/RFC0970, December 1985, 1311 . 1313 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 1314 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 1315 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 1316 S., Wroclawski, J., and L. Zhang, "Recommendations on 1317 Queue Management and Congestion Avoidance in the 1318 Internet", RFC 2309, DOI 10.17487/RFC2309, April 1998, 1319 . 1321 [RFC3246] Davie, B., Charny, A., Bennet, J., Benson, K., Le Boudec, 1322 J., Courtney, W., Davari, S., Firoiu, V., and D. 1323 Stiliadis, "An Expedited Forwarding PHB (Per-Hop 1324 Behavior)", RFC 3246, DOI 10.17487/RFC3246, March 2002, 1325 . 1327 [RFC3649] Floyd, S., "HighSpeed TCP for Large Congestion Windows", 1328 RFC 3649, DOI 10.17487/RFC3649, December 2003, 1329 . 1331 [RFC5033] Floyd, S. and M. Allman, "Specifying New Congestion 1332 Control Algorithms", BCP 133, RFC 5033, 1333 DOI 10.17487/RFC5033, August 2007, 1334 . 1336 [RFC5348] Floyd, S., Handley, M., Padhye, J., and J. Widmer, "TCP 1337 Friendly Rate Control (TFRC): Protocol Specification", 1338 RFC 5348, DOI 10.17487/RFC5348, September 2008, 1339 . 1341 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 1342 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 1343 . 1345 [RFC5706] Harrington, D., "Guidelines for Considering Operations and 1346 Management of New Protocols and Protocol Extensions", 1347 RFC 5706, DOI 10.17487/RFC5706, November 2009, 1348 . 1350 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 1351 Recommendations Regarding Active Queue Management", 1352 BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 1353 . 1355 [RFC8033] Pan, R., Natarajan, P., Baker, F., and G. White, 1356 "Proportional Integral Controller Enhanced (PIE): A 1357 Lightweight Control Scheme to Address the Bufferbloat 1358 Problem", RFC 8033, DOI 10.17487/RFC8033, February 2017, 1359 . 1361 [RFC8034] White, G. and R. Pan, "Active Queue Management (AQM) Based 1362 on Proportional Integral Controller Enhanced PIE) for 1363 Data-Over-Cable Service Interface Specifications (DOCSIS) 1364 Cable Modems", RFC 8034, DOI 10.17487/RFC8034, February 1365 2017, . 1367 [RFC8257] Bensley, S., Thaler, D., Balasubramanian, P., Eggert, L., 1368 and G. Judd, "Data Center TCP (DCTCP): TCP Congestion 1369 Control for Data Centers", RFC 8257, DOI 10.17487/RFC8257, 1370 October 2017, . 1372 [RFC8290] Hoeiland-Joergensen, T., McKenney, P., Taht, D., Gettys, 1373 J., and E. Dumazet, "The Flow Queue CoDel Packet Scheduler 1374 and Active Queue Management Algorithm", RFC 8290, 1375 DOI 10.17487/RFC8290, January 2018, 1376 . 1378 [RFC8298] Johansson, I. and Z. Sarker, "Self-Clocked Rate Adaptation 1379 for Multimedia", RFC 8298, DOI 10.17487/RFC8298, December 1380 2017, . 1382 [RFC8312] Rhee, I., Xu, L., Ha, S., Zimmermann, A., Eggert, L., and 1383 R. Scheffenegger, "CUBIC for Fast Long-Distance Networks", 1384 RFC 8312, DOI 10.17487/RFC8312, February 2018, 1385 . 1387 [SigQ-Dyn] 1388 Briscoe, B., "Rapid Signalling of Queue Dynamics", 1389 Technical Report TR-BB-2017-001 arXiv:1904.07044 [cs.NI], 1390 September 2017, . 1392 Appendix A. Example DualQ Coupled PI2 Algorithm 1394 As a first concrete example, the pseudocode below gives the DualPI2 1395 algorithm. DualPI2 follows the structure of the DualQ Coupled AQM 1396 framework in Figure 1. A simple ramp function (configured in units 1397 of queuing time) with unsmoothed ECN marking is used for the Native 1398 L4S AQM. The ramp can also be configured as a step function. The 1399 PI2 algorithm [PI2] is used for the Classic AQM. PI2 is an improved 1400 variant of the PIE AQM [RFC8033]. 1402 The pseudocode will be introduced in two passes. The first pass 1403 explains the core concepts, deferring handling of overload to the 1404 second pass. To aid comparison, line numbers are kept in step 1405 between the two passes by using letter suffixes where the longer code 1406 needs extra lines. 1408 All variables are assumed to be floating point in their basic units 1409 (size in bytes, time in seconds, rates in bytes/second, alpha and 1410 beta in Hz, and probabilities from 0 to 1. Constants expressed in k 1411 (kilo), M (mega), G (giga), u (micro), m (milli) , %, ... are assumed 1412 to be converted to their appropriate multiple or fraction to 1413 represent the basic units. A real implementation that wants to use 1414 integer values needs to handle appropriate scaling factors and allow 1415 accordingly appropriate resolution of its integer types (including 1416 temporary internal values during calculations). 1418 A full open source implementation for Linux is available at: 1419 https://github.com/L4STeam/sch_dualpi2_upstream and explained in 1420 [DualPI2Linux]. The specification of the DualQ Coupled AQM for 1421 DOCSIS cable modems and CMTSs is available in [DOCSIS3.1] and 1422 explained in [LLD]. 1424 A.1. Pass #1: Core Concepts 1426 The pseudocode manipulates three main structures of variables: the 1427 packet (pkt), the L4S queue (lq) and the Classic queue (cq). The 1428 pseudocode consists of the following six functions: 1430 o the initialization function dualpi2_params_init(...) (Figure 2) 1431 that sets parameter defaults (the API for setting non-default 1432 values is omitted for brevity) 1434 o the enqueue function dualpi2_enqueue(lq, cq, pkt) (Figure 3) 1436 o the dequeue function dualpi2_dequeue(lq, cq, pkt) (Figure 4) 1438 o recur(q, likelihood) for de-randomized ECN marking (shown at the 1439 end of Figure 4). 1441 o the L4S AQM function laqm(qdelay) (Figure 5) used to calculate the 1442 ECN-marking probability for the L4S queue 1444 o the base AQM function that implements the PI algorithm 1445 dualpi2_update(lq, cq) (Figure 6) used to regularly update the 1446 base probability (p'), which is squared for the Classic AQM as 1447 well as being coupled across to the L4S queue. 1449 It also uses the following functions that are not shown in full here: 1451 o scheduler(), which selects between the head packets of the two 1452 queues; the choice of scheduler technology is discussed later; 1454 o cq.len() or lq.len() returns the current length (aka. backlog) of 1455 the relevant queue in bytes; 1457 o cq.time() or lq.time() returns the current queuing delay (aka. 1458 sojourn time or service time) of the relevant queue in units of 1459 time (see Note a); 1461 o mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 1463 In experiments so far (building on experiments with PIE) on broadband 1464 access links ranging from 4 Mb/s to 200 Mb/s with base RTTs from 5 ms 1465 to 100 ms, DualPI2 achieves good results with the default parameters 1466 in Figure 2. The parameters are categorised by whether they relate 1467 to the Base PI2 AQM, the L4S AQM or the framework coupling them 1468 together. Constants and variables derived from these parameters are 1469 also included at the end of each category. Each parameter is 1470 explained as it is encountered in the walk-through of the pseudocode 1471 below. 1473 1: dualpi2_params_init(...) { % Set input parameter defaults 1474 2: % DualQ Coupled framework parameters 1475 5: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 1476 3: k = 2 % Coupling factor 1477 4: % NOT SHOWN % scheduler-dependent weight or equival't parameter 1478 6: 1479 7: % PI2 AQM parameters 1480 8: RTT_max = 100 ms % Worst case RTT expected 1481 9: RTT_typ = 15 ms % Typical RTT 1482 11: % PI2 constants derived from above PI2 parameters 1483 10: p_Cmax = min(1/k^2, 1) % Max Classic drop/mark prob 1484 12: target = RTT_typ % PI AQM Classic queue delay target 1485 13: Tupdate = min(RTT_typ, RTT_max/3) % PI sampling interval 1486 14: alpha = 0.1 * Tupdate / RTT_max^2 % PI integral gain in Hz 1487 15: beta = 0.3 / RTT_max % PI proportional gain in Hz 1488 16: 1489 17: % L4S ramp AQM parameters 1490 18: minTh = 800 us % L4S min marking threshold in time units 1491 19: range = 400 us % Range of L4S ramp in time units 1492 20: Th_len = 2 * MTU % Min L4S marking threshold in bytes 1493 21: % L4S constants incl. those derived from other parameters 1494 22: p_Lmax = 1 % Max L4S marking prob 1495 23: floor = Th_len / MIN_LINK_RATE 1496 24: if (minTh < floor) { 1497 25: % Shift ramp so minTh >= serialization time of 2 MTU 1498 26: minTh = floor 1499 27: } 1500 28: maxTh = minTh+range % L4S max marking threshold in time units 1501 29: } 1503 Figure 2: Example Header Pseudocode for DualQ Coupled PI2 AQM 1505 The overall goal of the code is to maintain the base probability (p', 1506 p-prime as in Section 2.4), which is an internal variable from which 1507 the marking and dropping probabilities for L4S and Classic traffic 1508 (p_L and p_C) are derived, with p_L in turn being derived from p_CL. 1509 The probabilities p_CL and p_C are derived in lines 4 and 5 of the 1510 dualpi2_update() function (Figure 6) then used in the 1511 dualpi2_dequeue() function where p_L is also derived from p_CL at 1512 line 6 (Figure 4). The code walk-through below builds up to 1513 explaining that part of the code eventually, but it starts from 1514 packet arrival. 1516 1: dualpi2_enqueue(lq, cq, pkt) { % Test limit and classify lq or cq 1517 2: if ( lq.len() + cq.len() + MTU > limit) 1518 3: drop(pkt) % drop packet if buffer is full 1519 4: timestamp(pkt) % attach arrival time to packet 1520 5: % Packet classifier 1521 6: if ( ecn(pkt) modulo 2 == 1 ) % ECN bits = ECT(1) or CE 1522 7: lq.enqueue(pkt) 1523 8: else % ECN bits = not-ECT or ECT(0) 1524 9: cq.enqueue(pkt) 1525 10: } 1527 Figure 3: Example Enqueue Pseudocode for DualQ Coupled PI2 AQM 1529 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 1530 2: while ( lq.len() + cq.len() > 0 ) { 1531 3: if ( scheduler() == lq ) { 1532 4: lq.dequeue(pkt) % Scheduler chooses lq 1533 5: p'_L = laqm(lq.time()) % Native L4S AQM 1534 6: p_L = max(p'_L, p_CL) % Combining function 1535 7: if ( recur(lq, p_L) ) % Linear marking 1536 8: mark(pkt) 1537 9: } else { 1538 10: cq.dequeue(pkt) % Scheduler chooses cq 1539 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 1540 12: if ( ecn(pkt) == 0 ) { % if ECN field = not-ECT 1541 13: drop(pkt) % squared drop 1542 14: continue % continue to the top of the while loop 1543 15: } 1544 16: mark(pkt) % squared mark 1545 17: } 1546 18: } 1547 19: return(pkt) % return the packet and stop 1548 20: } 1549 21: return(NULL) % no packet to dequeue 1550 22: } 1552 23: recur(q, likelihood) { % Returns TRUE with a certain likelihood 1553 24: q.count += likelihood 1554 25: if (q.count > 1) { 1555 26: q.count -= 1 1556 27: return TRUE 1557 28: } 1558 29: return FALSE 1559 30: } 1561 Figure 4: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1563 When packets arrive, first a common queue limit is checked as shown 1564 in line 2 of the enqueuing pseudocode in Figure 3. This assumes a 1565 shared buffer for the two queues (Note b discusses the merits of 1566 separate buffers). In order to avoid any bias against larger 1567 packets, 1 MTU of space is always allowed and the limit is 1568 deliberately tested before enqueue. 1570 If limit is not exceeded, the packet is timestamped in line 4. This 1571 assumes that queue delay is measured using the sojourn time technique 1572 (see Note a for alternatives). 1574 At lines 5-9, the packet is classified and enqueued to the Classic or 1575 L4S queue dependent on the least significant bit of the ECN field in 1576 the IP header (line 6). Packets with a codepoint having an LSB of 0 1577 (Not-ECT and ECT(0)) will be enqueued in the Classic queue. 1578 Otherwise, ECT(1) and CE packets will be enqueued in the L4S queue. 1579 Optional additional packet classification flexibility is omitted for 1580 brevity (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1582 The dequeue pseudocode (Figure 4) is repeatedly called whenever the 1583 lower layer is ready to forward a packet. It schedules one packet 1584 for dequeuing (or zero if the queue is empty) then returns control to 1585 the caller, so that it does not block while that packet is being 1586 forwarded. While making this dequeue decision, it also makes the 1587 necessary AQM decisions on dropping or marking. The alternative of 1588 applying the AQMs at enqueue would shift some processing from the 1589 critical time when each packet is dequeued. However, it would also 1590 add a whole queue of delay to the control signals, making the control 1591 loop sloppier (for a typical RTT it would double the Classic queue's 1592 feedback delay). 1594 All the dequeue code is contained within a large while loop so that 1595 if it decides to drop a packet, it will continue until it selects a 1596 packet to schedule. Line 3 of the dequeue pseudocode is where the 1597 scheduler chooses between the L4S queue (lq) and the Classic queue 1598 (cq). Detailed implementation of the scheduler is not shown (see 1599 discussion later). 1601 o If an L4S packet is scheduled, in lines 7 and 8 the packet is ECN- 1602 marked with likelihood p_L. The recur() function at the end of 1603 Figure 4 is used, which is preferred over random marking because 1604 it avoids delay due to randomization when interpreting congestion 1605 signals, but it still desynchronizes the saw-teeth of the flows. 1606 Line 6 calculates p_L as the maximum of the coupled L4S 1607 probability p_CL and the probability from the native L4S AQM p'_L. 1608 This implements the max() function shown in Figure 1 to couple the 1609 outputs of the two AQMs together. Of the two probabilities input 1610 to p_L in line 6: 1612 * p'_L is calculated per packet in line 5 by the laqm() function 1613 (see Figure 5), 1615 * whereas p_CL is maintained by the dualpi2_update() function 1616 which runs every Tupdate (Tupdate is set in line 13 of 1617 Figure 2. It defaults to 16 ms in the reference Linux 1618 implementation because it has to be rounded to a multiple of 4 1619 ms). 1621 o If a Classic packet is scheduled, lines 10 to 17 drop or mark the 1622 packet with probability p_C. 1624 The Native L4S AQM algorithm (Figure 5) is a ramp function, similar 1625 to the RED algorithm, but simplified as follows: 1627 o The extent of the ramp is defined in units of queuing delay, not 1628 bytes, so that configuration remains invariant as the queue 1629 departure rate varies. 1631 o It uses instantaneous queueing delay, which avoids the complexity 1632 of smoothing, but also avoids embedding a worst-case RTT of 1633 smoothing delay in the network (see Section 2.1). 1635 o The ramp rises linearly directly from 0 to 1, not to an 1636 intermediate value of p'_L as RED would, because there is no need 1637 to keep ECN marking probability low. 1639 o Marking does not have to be randomized. Determinism is used 1640 instead of randomness; to reduce the delay necessary to smooth out 1641 the noise of randomness from the signal. 1643 The ramp function requires two configuration parameters, the minimum 1644 threshold (minTh) and the width of the ramp (range), both in units of 1645 queuing time), as shown in lines 18 & 19 of the initialization 1646 function in Figure 2. The ramp function can be configured as a step 1647 (see Note c). 1649 Although the DCTCP paper [Alizadeh-stability] recommends an ECN 1650 marking threshold of 0.17*RTT_typ, it also shows that the threshold 1651 can be much shallower with hardly any worse under-utilization of the 1652 link (because the amplitude of DCTCP's sawteeth is so small). Based 1653 on extensive experiments, for the public Internet the default minimum 1654 ECN marking threshold in Figure 2 is considered a good compromise, 1655 even though it is significantly smaller fraction of RTT_typ. 1657 A minimum marking threshold parameter (Th_len) in transmission units 1658 (default 2 MTU) is also necessary to ensure that the ramp does not 1659 trigger excessive marking on slow links. The code in lines 24-27 of 1660 the initialization function (Figure 2) converts 2 MTU into time units 1661 and shifts the ramp so that the min threshold is no shallower than 1662 this floor. 1664 1: laqm(qdelay) { % Returns native L4S AQM probability 1665 2: if (qdelay >= maxTh) 1666 3: return 1 1667 4: else if (qdelay > minTh) 1668 5: return (qdelay - minTh)/range % Divide could use a bit-shift 1669 6: else 1670 7: return 0 1671 8: } 1673 Figure 5: Example Pseudocode for the Native L4S AQM 1675 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 1676 2: curq = cq.time() % use queuing time of first-in Classic packet 1677 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 1678 4: p_CL = k * p' % Coupled L4S prob = base prob * coupling factor 1679 5: p_C = p'^2 % Classic prob = (base prob)^2 1680 6: prevq = curq 1681 7: } 1683 (Clamping p' within the range [0,1] omitted for clarity - see text) 1685 Figure 6: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1687 The coupled marking probability, p_CL depends on the base probability 1688 (p'), which is kept up to date by the core PI algorithm in Figure 6 1689 executed every Tupdate. 1691 Note that p' solely depends on the queuing time in the Classic queue. 1692 In line 2, the current queuing delay (curq) is evaluated from how 1693 long the head packet was in the Classic queue (cq). The function 1694 cq.time() (not shown) subtracts the time stamped at enqueue from the 1695 current time (see Note a) and implicitly takes the current queuing 1696 delay as 0 if the queue is empty. 1698 The algorithm centres on line 3, which is a classical Proportional- 1699 Integral (PI) controller that alters p' dependent on: a) the error 1700 between the current queuing delay (curq) and the target queuing delay 1701 ('target' - see [RFC8033]); and b) the change in queuing delay since 1702 the last sample. The name 'PI' represents the fact that the second 1703 factor (how fast the queue is growing) is _P_roportional to load 1704 while the first is the _I_ntegral of the load (so it removes any 1705 standing queue in excess of the target). 1707 The two 'gain factors' in line 3, alpha and beta, respectively weight 1708 how strongly each of these elements ((a) and (b)) alters p'. They 1709 are in units of 'per second of delay' or Hz, because they transform 1710 differences in queueing delay into changes in probability (assuming 1711 probability has a value from 0 to 1). 1713 alpha and beta determine how much p' ought to change after each 1714 update interval (Tupdate). For smaller Tupdate, p' should change by 1715 the same amount per second, but in finer more frequent steps. So 1716 alpha depends on Tupdate (see line 14 of the initialization function 1717 in Figure 2). It is best to update p' as frequently as possible, but 1718 Tupdate will probably be constrained by hardware performance. As 1719 shown in line 13, the update interval should be at least as frequent 1720 as once per the RTT of a typical flow (RTT_typ) as long as it does 1721 not exceed roughly RTT_max/3. For link rates from 4 - 200 Mb/s, a 1722 target RTT of 15ms and a maximum RTT of 100ms, it has been verified 1723 through extensive testing that Tupdate=16ms (as recommended in 1724 [RFC8033]) is sufficient. 1726 The choice of alpha and beta also determines the AQM's stable 1727 operating range. The AQM ought to change p' as fast as possible in 1728 response to changes in load without over-compensating and therefore 1729 causing oscillations in the queue. Therefore, the values of alpha 1730 and beta also depend on the RTT of the expected worst-case flow 1731 (RTT_max). 1733 Recommended derivations of the gain constants alpha and beta can be 1734 approximated for Reno over a PI2 AQM as: alpha = 0.1 * Tupdate / 1735 RTT_max^2; beta = 0.3 / RTT_max, as shown in lines 14 & 15 of 1736 Figure 2. These are derived from the stability analysis in [PI2]. 1737 For the default values of Tupdate=16 ms and RTT_max = 100 ms, they 1738 result in alpha = 0.16; beta = 3.2 (discrepancies are due to 1739 rounding). These defaults have been verified with a wide range of 1740 link rates, target delays and a range of traffic models with mixed 1741 and similar RTTs, short and long flows, etc. 1743 In corner cases, p' can overflow the range [0,1] so the resulting 1744 value of p' has to be bounded (omitted from the pseudocode). Then, 1745 as already explained, the coupled and Classic probabilities are 1746 derived from the new p' in lines 4 and 5 of Figure 6 as p_CL = k*p' 1747 and p_C = p'^2. 1749 Because the coupled L4S marking probability (p_CL) is factored up by 1750 k, the dynamic gain parameters alpha and beta are also inherently 1751 factored up by k for the L4S queue. So, the effective gain factor 1752 for the L4S queue is k*alpha (with defaults alpha = 0.16 Hz and k=2, 1753 effective L4S alpha = 0.32 Hz). 1755 Unlike in PIE [RFC8033], alpha and beta do not need to be tuned every 1756 Tupdate dependent on p'. Instead, in PI2, alpha and beta are 1757 independent of p' because the squaring applied to Classic traffic 1758 tunes them inherently. This is explained in [PI2], which also 1759 explains why this more principled approach removes the need for most 1760 of the heuristics that had to be added to PIE. 1762 Nonetheless, an implementer might wish to add selected heuristics to 1763 either AQM. For instance the Linux reference DualPI2 implementation 1764 includes the following: 1766 o Prior to enqueuing an L4S packet, if the L queue contains <2 1767 packets, the packet is flagged to suppress any native L4S AQM 1768 marking at dequeue (which depends on sojourn time); 1770 o Classic and coupled marking or dropping (i.e. based on p_C and 1771 p_CL from the PI controller) is only applied to a packet if the 1772 respective queue length in bytes is > 2 MTU (prior to enqueueing 1773 the packet or after dequeuing it, depending on whether the AQM is 1774 configured to be applied at enqueue or dequeue); 1776 o In the WRR scheduler, the 'credit' indicating which queue should 1777 transmit is only changed if there are packets in both queues (i.e. 1778 if there is actual resource contention). This means that a 1779 properly paced L flow might never be delayed by the WRR. The WRR 1780 credit is reset in favour of the L queue when the link is idle. 1782 An implementer might also wish to add other heuristics, e.g. burst 1783 protection [RFC8033] or enhanced burst protection [RFC8034]. 1785 Notes: 1787 a. The drain rate of the queue can vary if it is scheduled relative 1788 to other queues, or to cater for fluctuations in a wireless 1789 medium. To auto-adjust to changes in drain rate, the queue needs 1790 to be measured in time, not bytes or packets [AQMmetrics] 1791 [CoDel]. Queuing delay could be measured directly by storing a 1792 per-packet time-stamp as each packet is enqueued, and subtracting 1793 this from the system time when the packet is dequeued. If time- 1794 stamping is not easy to introduce with certain hardware, queuing 1795 delay could be predicted indirectly by dividing the size of the 1796 queue by the predicted departure rate, which might be known 1797 precisely for some link technologies (see for example [RFC8034]). 1799 b. Line 2 of the dualpi2_enqueue() function (Figure 3) assumes an 1800 implementation where lq and cq share common buffer memory. An 1801 alternative implementation could use separate buffers for each 1802 queue, in which case the arriving packet would have to be 1803 classified first to determine which buffer to check for available 1804 space. The choice is a trade off; a shared buffer can use less 1805 memory whereas separate buffers isolate the L4S queue from tail- 1806 drop due to large bursts of Classic traffic (e.g. a Classic Reno 1807 TCP during slow-start over a long RTT). 1809 c. There has been some concern that using the step function of DCTCP 1810 for the Native L4S AQM requires end-systems to smooth the signal 1811 for an unnecessarily large number of round trips to ensure 1812 sufficient fidelity. A ramp is no worse than a step in initial 1813 experiments with existing DCTCP. Therefore, it is recommended 1814 that a ramp is configured in place of a step, which will allow 1815 congestion control algorithms to investigate faster smoothing 1816 algorithms. 1818 A ramp is more general that a step, because an operator can 1819 effectively turn the ramp into a step function, as used by DCTCP, 1820 by setting the range to zero. There will not be a divide by zero 1821 problem at line 5 of Figure 5 because, if minTh is equal to 1822 maxTh, the condition for this ramp calculation cannot arise. 1824 A.2. Pass #2: Overload Details 1826 Figure 7 repeats the dequeue function of Figure 4, but with overload 1827 details added. Similarly Figure 8 repeats the core PI algorithm of 1828 Figure 6 with overload details added. The initialization, enqueue, 1829 L4S AQM and recur functions are unchanged. 1831 In line 10 of the initialization function (Figure 2), the maximum 1832 Classic drop probability p_Cmax = min(1/k^2, 1) or 1/4 for the 1833 default coupling factor k=2. p_Cmax is the point at which it is 1834 deemed that the Classic queue has become persistently overloaded, so 1835 it switches to using drop, even for ECN-capable packets. ECT packets 1836 that are not dropped can still be ECN-marked. 1838 In practice, 25% has been found to be a good threshold to preserve 1839 fairness between ECN capable and non ECN capable traffic. This 1840 protects the queues against both temporary overload from responsive 1841 flows and more persistent overload from any unresponsive traffic that 1842 falsely claims to be responsive to ECN. 1844 When the Classic ECN marking probability reaches the p_Cmax threshold 1845 (1/k^2), the marking probability coupled to the L4S queue, p_CL will 1846 always be 100% for any k (by equation (1) in Section 2). So, for 1847 readability, the constant p_Lmax is defined as 1 in line 22 of the 1848 initialization function (Figure 2). This is intended to ensure that 1849 the L4S queue starts to introduce dropping once ECN-marking saturates 1850 at 100% and can rise no further. The 'Prague L4S' requirements 1852 [I-D.ietf-tsvwg-ecn-l4s-id] state that, when an L4S congestion 1853 control detects a drop, it falls back to a response that coexists 1854 with 'Classic' Reno congestion control. So it is correct that, when 1855 the L4S queue drops packets, it drops them proportional to p'^2, as 1856 if they are Classic packets. 1858 Both these switch-overs are triggered by the tests for overload 1859 introduced in lines 4b and 12b of the dequeue function (Figure 7). 1860 Lines 8c to 8g drop L4S packets with probability p'^2. Lines 8h to 1861 8i mark the remaining packets with probability p_CL. Given p_Lmax = 1862 1, all remaining packets will be marked because, to have reached the 1863 else block at line 8b, p_CL >= 1. 1865 Lines 2c to 2d in the core PI algorithm (Figure 8) deal with overload 1866 of the L4S queue when there is no Classic traffic. This is 1867 necessary, because the core PI algorithm maintains the appropriate 1868 drop probability to regulate overload, but it depends on the length 1869 of the Classic queue. If there is no Classic queue the naive PI 1870 update function in Figure 6 would drop nothing, even if the L4S queue 1871 were overloaded - so tail drop would have to take over (lines 2 and 3 1872 of Figure 3). 1874 Instead, the test at line 2a of the full PI update function in 1875 Figure 8 keeps delay on target using drop. If the test at line 2a of 1876 Figure 8 finds that the Classic queue is empty, line 2d measures the 1877 current queue delay using the L4S queue instead. While the L4S queue 1878 is not overloaded, its delay will always be tiny compared to the 1879 target Classic queue delay. So p_CL will be driven to zero, and the 1880 L4S queue will naturally be governed solely by p'_L from the native 1881 L4S AQM (lines 5 and 6 of the dequeue algorithm in Figure 7). But, 1882 if unresponsive L4S source(s) cause overload, the DualQ transitions 1883 smoothly to L4S marking based on the PI algorithm. If overload 1884 increases further, it naturally transitions from marking to dropping 1885 by the switch-over mechanism already described. 1887 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 1888 2: while ( lq.len() + cq.len() > 0 ) { 1889 3: if ( scheduler() == lq ) { 1890 4a: lq.dequeue(pkt) % L4S scheduled 1891 4b: if ( p_CL < p_Lmax ) { % Check for overload saturation 1892 5: p'_L = laqm(lq.time()) % Native L4S AQM 1893 6: p_L = max(p'_L, p_CL) % Combining function 1894 7: if ( recur(lq, p_L) ) % Linear marking 1895 8a: mark(pkt) 1896 8b: } else { % overload saturation 1897 8c: if ( recur(lq, p_C) ) { % probability p_C = p'^2 1898 8e: drop(pkt) % revert to Classic drop due to overload 1899 8f: continue % continue to the top of the while loop 1900 8g: } 1901 8h: if ( recur(lq, p_CL) ) % probability p_CL = k * p' 1902 8i: mark(pkt) % linear marking of remaining packets 1903 8j: } 1904 9: } else { 1905 10: cq.dequeue(pkt) % Classic scheduled 1906 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 1907 12a: if ( (ecn(pkt) == 0) % ECN field = not-ECT 1908 12b: OR (p_C >= p_Cmax) ) { % Overload disables ECN 1909 13: drop(pkt) % squared drop, redo loop 1910 14: continue % continue to the top of the while loop 1911 15: } 1912 16: mark(pkt) % squared mark 1913 17: } 1914 18: } 1915 19: return(pkt) % return the packet and stop 1916 20: } 1917 21: return(NULL) % no packet to dequeue 1918 22: } 1920 Figure 7: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1921 (Including Overload Code) 1923 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 1924 2a: if ( cq.len() > 0 ) 1925 2b: curq = cq.time() %use queuing time of first-in Classic packet 1926 2c: else % Classic queue empty 1927 2d: curq = lq.time() % use queuing time of first-in L4S packet 1928 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 1929 4: p_CL = p' * k % Coupled L4S prob = base prob * coupling factor 1930 5: p_C = p'^2 % Classic prob = (base prob)^2 1931 6: prevq = curq 1932 7: } 1934 Figure 8: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1935 (Including Overload Code) 1937 The choice of scheduler technology is critical to overload protection 1938 (see Section 4.1). 1940 o A well-understood weighted scheduler such as weighted round robin 1941 (WRR) is recommended. As long as the scheduler weight for Classic 1942 is small (e.g. 1/16), its exact value is unimportant because it 1943 does not normally determine capacity shares. The weight is only 1944 important to prevent unresponsive L4S traffic starving Classic 1945 traffic. This is because capacity sharing between the queues is 1946 normally determined by the coupled congestion signal, which 1947 overrides the scheduler, by making L4S sources leave roughly equal 1948 per-flow capacity available for Classic flows. 1950 o Alternatively, a time-shifted FIFO (TS-FIFO) could be used. It 1951 works by selecting the head packet that has waited the longest, 1952 biased against the Classic traffic by a time-shift of tshift. To 1953 implement time-shifted FIFO, the scheduler() function in line 3 of 1954 the dequeue code would simply be implemented as the scheduler() 1955 function at the bottom of Figure 10 in Appendix B. For the public 1956 Internet a good value for tshift is 50ms. For private networks 1957 with smaller diameter, about 4*target would be reasonable. TS- 1958 FIFO is a very simple scheduler, but complexity might need to be 1959 added to address some deficiencies (which is why it is not 1960 recommended over WRR): 1962 * TS-FIFO does not fully isolate latency in the L4S queue from 1963 uncontrolled bursts in the Classic queue; 1965 * TS-FIFO is only appropriate if time-stamping of packets is 1966 feasible; 1968 * Even if time-stamping is supported, the sojourn time of the 1969 head packet is always stale. For instance, if a burst arrives 1970 at an empty queue, the sojourn time will only measure the delay 1971 of the burst once the burst is over, even though the queue knew 1972 about it from the start. At the cost of more operations and 1973 more storage, a 'scaled sojourn time' metric of queue delay can 1974 be used, which is the sojourn time of a packet scaled by the 1975 ratio of the queue sizes when the packet departed and arrived 1976 [SigQ-Dyn]. 1978 o A strict priority scheduler would be inappropriate, because it 1979 would starve Classic if L4S was overloaded. 1981 Appendix B. Example DualQ Coupled Curvy RED Algorithm 1983 As another example of a DualQ Coupled AQM algorithm, the pseudocode 1984 below gives the Curvy RED based algorithm. Although the AQM was 1985 designed to be efficient in integer arithmetic, to aid understanding 1986 it is first given using floating point arithmetic (Figure 10). Then, 1987 one possible optimization for integer arithmetic is given, also in 1988 pseudocode (Figure 11). To aid comparison, the line numbers are kept 1989 in step between the two by using letter suffixes where the longer 1990 code needs extra lines. 1992 B.1. Curvy RED in Pseudocode 1994 The pseudocode manipulates three main structures of variables: the 1995 packet (pkt), the L4S queue (lq) and the Classic queue (cq) and 1996 consists of the following five functions: 1998 o the initialization function cred_params_init(...) (Figure 2) that 1999 sets parameter defaults (the API for setting non-default values is 2000 omitted for brevity); 2002 o the dequeue function cred_dequeue(lq, cq, pkt) (Figure 4); 2004 o the scheduling function scheduler(), which selects between the 2005 head packets of the two queues. 2007 It also uses the following functions that are either shown elsewhere, 2008 or not shown in full here: 2010 o the enqueue function, which is identical to that used for DualPI2, 2011 dualpi2_enqueue(lq, cq, pkt) in Figure 3; 2013 o mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 2015 o cq.len() or lq.len() returns the current length (aka. backlog) of 2016 the relevant queue in bytes; 2018 o cq.time() or lq.time() returns the current queuing delay (aka. 2019 sojourn time or service time) of the relevant queue in units of 2020 time (see Note a in Appendix A.1). 2022 Because Curvy RED was evaluated before DualPI2, certain improvements 2023 introduced for DualPI2 were not evaluated for Curvy RED. In the 2024 pseudocode below, the straightforward improvements have been added on 2025 the assumption they will provide similar benefits, but that has not 2026 been proven experimentally. They are: i) a conditional priority 2027 scheduler instead of strict priority ii) a time-based threshold for 2028 the native L4S AQM; iii) ECN support for the Classic AQM. A recent 2029 evaluation has proved that a minimum ECN-marking threshold (minTh) 2030 greatly improves performance, so this is also included in the 2031 pseudocode. 2033 Overload protection has not been added to the Curvy RED pseudocode 2034 below so as not to detract from the main features. It would be added 2035 in exactly the same way as in Appendix A.2 for the DualPI2 2036 pseudocode. The native L4S AQM uses a step threshold, but a ramp 2037 like that described for DualPI2 could be used instead. The scheduler 2038 uses the simple TS-FIFO algorithm, but it could be replaced with WRR. 2040 The Curvy RED algorithm has not been maintained or evaluated to the 2041 same degree as the DualPI2 algorithm. In initial experiments on 2042 broadband access links ranging from 4 Mb/s to 200 Mb/s with base RTTs 2043 from 5 ms to 100 ms, Curvy RED achieved good results with the default 2044 parameters in Figure 9. 2046 The parameters are categorised by whether they relate to the Classic 2047 AQM, the L4S AQM or the framework coupling them together. Constants 2048 and variables derived from these parameters are also included at the 2049 end of each category. These are the raw input parameters for the 2050 algorithm. A configuration front-end could accept more meaningful 2051 parameters (e.g. RTT_max and RTT_typ) and convert them into these 2052 raw parameters, as has been done for DualPI2 in Appendix A. Where 2053 necessary, parameters are explained further in the walk-through of 2054 the pseudocode below. 2056 1: cred_params_init(...) { % Set input parameter defaults 2057 2: % DualQ Coupled framework parameters 2058 3: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 2059 4: k' = 1 % Coupling factor as a power of 2 2060 5: tshift = 50 ms % Time shift of TS-FIFO scheduler 2061 6: % Constants derived from Classic AQM parameters 2062 7: k = 2^k' % Coupling factor from Equation (1) 2063 6: 2064 7: % Classic AQM parameters 2065 8: g_C = 5 % EWMA smoothing parameter as a power of 1/2 2066 9: S_C = -1 % Classic ramp scaling factor as a power of 2 2067 10: minTh = 500 ms % No Classic drop/mark below this queue delay 2068 11: % Constants derived from Classic AQM parameters 2069 12: gamma = 2^(-g_C) % EWMA smoothing parameter 2070 13: range_C = 2^S_C % Range of Classic ramp 2071 14: 2072 15: % L4S AQM parameters 2073 16: T = 1 ms % Queue delay threshold for native L4S AQM 2074 17: % Constants derived from above parameters 2075 18: S_L = S_C - k' % L4S ramp scaling factor as a power of 2 2076 19: range_L = 2^S_L % Range of L4S ramp 2077 20: } 2079 Figure 9: Example Header Pseudocode for DualQ Coupled Curvy RED AQM 2081 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2082 2: while ( lq.len() + cq.len() > 0 ) { 2083 3: if ( scheduler() == lq ) { 2084 4: lq.dequeue(pkt) % L4S scheduled 2085 5a: p_CL = (Q_C - minTh) / range_L 2086 5b: if ( ( lq.time() > T ) 2087 5c: OR ( p_CL > maxrand(U) ) ) 2088 6: mark(pkt) 2089 7: } else { 2090 8: cq.dequeue(pkt) % Classic scheduled 2091 9a: Q_C = gamma * cq.time() + (1-gamma) * Q_C % Classic Q EWMA 2092 10a: sqrt_p_C = (Q_C - minTh) / range_C 2093 10b: if ( sqrt_p_C > maxrand(2*U) ) { 2094 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2095 12: drop(pkt) % Squared drop, redo loop 2096 13: continue % continue to the top of the while loop 2097 14: } 2098 15: mark(pkt) 2099 16: } 2100 17: } 2101 18: return(pkt) % return the packet and stop here 2102 19: } 2103 20: return(NULL) % no packet to dequeue 2104 21: } 2106 22: maxrand(u) { % return the max of u random numbers 2107 23: maxr=0 2108 24: while (u-- > 0) 2109 25: maxr = max(maxr, rand()) % 0 <= rand() < 1 2110 26: return(maxr) 2111 27: } 2113 28: scheduler() { 2114 29: if ( lq.time() + tshift >= cq.time() ) 2115 30: return lq; 2116 31: else 2117 32: return cq; 2118 33: } 2120 Figure 10: Example Dequeue Pseudocode for DualQ Coupled Curvy RED AQM 2122 The dequeue pseudocode (Figure 10) is repeatedly called whenever the 2123 lower layer is ready to forward a packet. It schedules one packet 2124 for dequeuing (or zero if the queue is empty) then returns control to 2125 the caller, so that it does not block while that packet is being 2126 forwarded. While making this dequeue decision, it also makes the 2127 necessary AQM decisions on dropping or marking. The alternative of 2128 applying the AQMs at enqueue would shift some processing from the 2129 critical time when each packet is dequeued. However, it would also 2130 add a whole queue of delay to the control signals, making the control 2131 loop very sloppy. 2133 The code is written assuming the AQMs are applied on dequeue (Note 2134 1). All the dequeue code is contained within a large while loop so 2135 that if it decides to drop a packet, it will continue until it 2136 selects a packet to schedule. If both queues are empty, the routine 2137 returns NULL at line 20. Line 3 of the dequeue pseudocode is where 2138 the conditional priority scheduler chooses between the L4S queue (lq) 2139 and the Classic queue (cq). The time-shifted FIFO scheduler is shown 2140 at lines 28-33, which would be suitable if simplicity is paramount 2141 (see Note 2). 2143 Within each queue, the decision whether to forward, drop or mark is 2144 taken as follows (to simplify the explanation, it is assumed that 2145 U=1): 2147 L4S: If the test at line 3 determines there is an L4S packet to 2148 dequeue, the tests at lines 5b and 5c determine whether to mark 2149 it. The first is a simple test of whether the L4S queue delay 2150 (lq.time()) is greater than a step threshold T (Note 3). The 2151 second test is similar to the random ECN marking in RED, but with 2152 the following differences: i) marking depends on queuing time, not 2153 bytes, in order to scale for any link rate without being 2154 reconfigured; ii) marking of the L4S queue depends on a logical OR 2155 of two tests; one against its own queuing time and one against the 2156 queuing time of the _other_ (Classic) queue; iii) the tests are 2157 against the instantaneous queuing time of the L4S queue, but a 2158 smoothed average of the other (Classic) queue; iv) the queue is 2159 compared with the maximum of U random numbers (but if U=1, this is 2160 the same as the single random number used in RED). 2162 Specifically, in line 5a the coupled marking probability p_CL is 2163 set to the amount by which the averaged Classic queueing delay Q_C 2164 exceeds the minimum queuing delay threshold (minTh) all divided by 2165 the L4S scaling parameter range_L. range_L represents the queuing 2166 delay (in seconds) added to minTh at which marking probability 2167 would hit 100%. Then in line 5c (if U=1) the result is compared 2168 with a uniformly distributed random number between 0 and 1, which 2169 ensures that, over range_L, marking probability will linearly 2170 increase with queueing time. 2172 Classic: If the scheduler at line 3 chooses to dequeue a Classic 2173 packet and jumps to line 7, the test at line 10b determines 2174 whether to drop or mark it. But before that, line 9a updates Q_C, 2175 which is an exponentially weighted moving average (Note 4) of the 2176 queuing time of the Classic queue, where cq.time() is the current 2177 instantaneous queueing time of the packet at the head of the 2178 Classic queue (zero if empty) and gamma is the EWMA constant 2179 (default 1/32, see line 12 of the initialization function). 2181 Lines 10a and 10b implement the Classic AQM. In line 10a the 2182 averaged queuing time Q_C is divided by the Classic scaling 2183 parameter range_C, in the same way that queuing time was scaled 2184 for L4S marking. This scaled queuing time will be squared to 2185 compute Classic drop probability so, before it is squared, it is 2186 effectively the square root of the drop probability, hence it is 2187 given the variable name sqrt_p_C. The squaring is done by 2188 comparing it with the maximum out of two random numbers (assuming 2189 U=1). Comparing it with the maximum out of two is the same as the 2190 logical `AND' of two tests, which ensures drop probability rises 2191 with the square of queuing time. 2193 The AQM functions in each queue (lines 5c & 10b) are two cases of a 2194 new generalization of RED called Curvy RED, motivated as follows. 2195 When the performance of this AQM was compared with fq_CoDel and PIE, 2196 their goal of holding queuing delay to a fixed target seemed 2197 misguided [CRED_Insights]. As the number of flows increases, if the 2198 AQM does not allow host congestion controllers to increase queuing 2199 delay, it has to introduce abnormally high levels of loss. Then loss 2200 rather than queuing becomes the dominant cause of delay for short 2201 flows, due to timeouts and tail losses. 2203 Curvy RED constrains delay with a softened target that allows some 2204 increase in delay as load increases. This is achieved by increasing 2205 drop probability on a convex curve relative to queue growth (the 2206 square curve in the Classic queue, if U=1). Like RED, the curve hugs 2207 the zero axis while the queue is shallow. Then, as load increases, 2208 it introduces a growing barrier to higher delay. But, unlike RED, it 2209 requires only two parameters, not three. The disadvantage of Curvy 2210 RED (compared to a PI controller for example) is that it is not 2211 adapted to a wide range of RTTs. Curvy RED can be used as is when 2212 the RTT range to be supported is limited, otherwise an adaptation 2213 mechanism is required. 2215 From our limited experiments with Curvy RED so far, recommended 2216 values of these parameters are: S_C = -1; g_C = 5; T = 5 * MTU at the 2217 link rate (about 1ms at 60Mb/s) for the range of base RTTs typical on 2218 the public Internet. [CRED_Insights] explains why these parameters 2219 are applicable whatever rate link this AQM implementation is deployed 2220 on and how the parameters would need to be adjusted for a scenario 2221 with a different range of RTTs (e.g. a data centre). The setting of 2222 k depends on policy (see Section 2.5 and Appendix C.2 respectively 2223 for its recommended setting and guidance on alternatives). 2225 There is also a cUrviness parameter, U, which is a small positive 2226 integer. It is likely to take the same hard-coded value for all 2227 implementations, once experiments have determined a good value. Only 2228 U=1 has been used in experiments so far, but results might be even 2229 better with U=2 or higher. 2231 Notes: 2233 1. The alternative of applying the AQMs at enqueue would shift some 2234 processing from the critical time when each packet is dequeued. 2235 However, it would also add a whole queue of delay to the control 2236 signals, making the control loop sloppier (for a typical RTT it 2237 would double the Classic queue's feedback delay). On a platform 2238 where packet timestamping is feasible, e.g. Linux, it is also 2239 easiest to apply the AQMs at dequeue because that is where 2240 queuing time is also measured. 2242 2. WRR better isolates the L4S queue from large delay bursts in the 2243 Classic queue, but it is slightly less simple than TS-FIFO. If 2244 WRR were used, a low default Classic weight (e.g. 1/16) would 2245 need to be configured in place of the time shift in line 5 of the 2246 initialization function (Figure 9). 2248 3. A step function is shown for simplicity. A ramp function (see 2249 Figure 5 and the discussion around it in Appendix A.1) is 2250 recommended, because it is more general than a step and has the 2251 potential to enable L4S congestion controls to converge more 2252 rapidly. 2254 4. An EWMA is only one possible way to filter bursts; other more 2255 adaptive smoothing methods could be valid and it might be 2256 appropriate to decrease the EWMA faster than it increases, e.g. 2257 by using the minimum of the smoothed and instantaneous queue 2258 delays, min(Q_C, qc.time()). 2260 B.2. Efficient Implementation of Curvy RED 2262 Although code optimization depends on the platform, the following 2263 notes explain where the design of Curvy RED was particularly 2264 motivated by efficient implementation. 2266 The Classic AQM at line 10b calls maxrand(2*U), which gives twice as 2267 much curviness as the call to maxrand(U) in the marking function at 2268 line 5c. This is the trick that implements the square rule in 2269 equation (1) (Section 2.1). This is based on the fact that, given a 2270 number X from 1 to 6, the probability that two dice throws will both 2271 be less than X is the square of the probability that one throw will 2272 be less than X. So, when U=1, the L4S marking function is linear and 2273 the Classic dropping function is squared. If U=2, L4S would be a 2274 square function and Classic would be quartic. And so on. 2276 The maxrand(u) function in lines 16-21 simply generates u random 2277 numbers and returns the maximum. Typically, maxrand(u) could be run 2278 in parallel out of band. For instance, if U=1, the Classic queue 2279 would require the maximum of two random numbers. So, instead of 2280 calling maxrand(2*U) in-band, the maximum of every pair of values 2281 from a pseudorandom number generator could be generated out-of-band, 2282 and held in a buffer ready for the Classic queue to consume. 2284 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2285 2: while ( lq.len() + cq.len() > 0 ) { 2286 3: if ( scheduler() == lq ) { 2287 4: lq.dequeue(pkt) % L4S scheduled 2288 5: if ((lq.time() > T) OR (Q_C >> (S_L-2) > maxrand(U))) 2289 6: mark(pkt) 2290 7: } else { 2291 8: cq.dequeue(pkt) % Classic scheduled 2292 9: Q_C += (qc.ns() - Q_C) >> g_C % Classic Q EWMA 2293 10: if ( (Q_C >> (S_C-2) ) > maxrand(2*U) ) { 2294 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2295 12: drop(pkt) % Squared drop, redo loop 2296 13: continue % continue to the top of the while loop 2297 14: } 2298 15: mark(pkt) 2299 16: } 2300 17: } 2301 18: return(pkt) % return the packet and stop here 2302 19: } 2303 20: return(NULL) % no packet to dequeue 2304 21: } 2306 Figure 11: Optimised Example Dequeue Pseudocode for Coupled DualQ AQM 2307 using Integer Arithmetic 2309 The two ranges, range_L and range_C are expressed as powers of 2 so 2310 that division can be implemented as a right bit-shift (>>) in lines 5 2311 and 10 of the integer variant of the pseudocode (Figure 11). 2313 For the integer variant of the pseudocode, an integer version of the 2314 rand() function used at line 25 of the maxrand(function) in Figure 10 2315 would be arranged to return an integer in the range 0 <= maxrand() < 2316 2^32 (not shown). This would scale up all the floating point 2317 probabilities in the range [0,1] by 2^32. 2319 Queuing delays are also scaled up by 2^32, but in two stages: i) In 2320 line 9 queuing time qc.ns() is returned in integer nanoseconds, 2321 making the value about 2^30 times larger than when the units were 2322 seconds, ii) then in lines 5 and 10 an adjustment of -2 to the right 2323 bit-shift multiplies the result by 2^2, to complete the scaling by 2324 2^32. 2326 In line 8 of the initialization function, the EWMA constant gamma is 2327 represented as an integer power of 2, g_C, so that in line 9 of the 2328 integer code the division needed to weight the moving average can be 2329 implemented by a right bit-shift (>> g_C). 2331 Appendix C. Choice of Coupling Factor, k 2333 C.1. RTT-Dependence 2335 Where Classic flows compete for the same capacity, their relative 2336 flow rates depend not only on the congestion probability, but also on 2337 their end-to-end RTT (= base RTT + queue delay). The rates of 2338 competing Reno [RFC5681] flows are roughly inversely proportional to 2339 their RTTs. Cubic exhibits similar RTT-dependence when in Reno- 2340 compatibility mode, but is less RTT-dependent otherwise. 2342 Until the early experiments with the DualQ Coupled AQM, the 2343 importance of the reasonably large Classic queue in mitigating RTT- 2344 dependence had not been appreciated. Appendix A.1.5 of 2345 [I-D.ietf-tsvwg-ecn-l4s-id] uses numerical examples to explain why 2346 bloated buffers had concealed the RTT-dependence of Classic 2347 congestion controls before that time. Then it explains why, the more 2348 that queuing delays have reduced, the more that RTT-dependence has 2349 surfaced as a potential starvation problem for long RTT flows. 2351 Given that congestion control on end-systems is voluntary, there is 2352 no reason why it has to be voluntarily RTT-dependent. Therefore 2353 [I-D.ietf-tsvwg-ecn-l4s-id] requires L4S congestion controls to be 2354 significantly less RTT-dependent than the standard Reno congestion 2355 control [RFC5681]. Following this approach means there is no need 2356 for network devices to address RTT-dependence, although there would 2357 be no harm if they did, which per-flow queuing inherently does. 2359 At the time of writing, the range of approaches to RTT-dependence in 2360 L4S congestion controls has not settled. Therefore, the guidance on 2361 the choice of the coupling factor in Appendix C.2 is given against 2362 DCTCP [RFC8257], which has well-understood RTT-dependence. The 2363 guidance is given for various RTT ratios, so that it can be adapted 2364 to future circumstances. 2366 C.2. Guidance on Controlling Throughput Equivalence 2368 +---------------+------+-------+ 2369 | RTT_C / RTT_L | Reno | Cubic | 2370 +---------------+------+-------+ 2371 | 1 | k'=1 | k'=0 | 2372 | 2 | k'=2 | k'=1 | 2373 | 3 | k'=2 | k'=2 | 2374 | 4 | k'=3 | k'=2 | 2375 | 5 | k'=3 | k'=3 | 2376 +---------------+------+-------+ 2378 Table 1: Value of k' for which DCTCP throughput is roughly the same 2379 as Reno or Cubic, for some example RTT ratios 2381 In the above appendices that give example DualQ Coupled algorithms, 2382 to aid efficient implementation, a coupling factor that is an integer 2383 power of 2 is always used. k' is always used to denote the power. k' 2384 is related to the coupling factor k in Equation (1) (Section 2.1) by 2385 k=2^k'. 2387 To determine the appropriate coupling factor policy, the operator 2388 first has to judge whether it wants DCTCP flows to have roughly equal 2389 throughput with Reno or with Cubic (because, even in its Reno- 2390 compatibility mode, Cubic is about 1.4 times more aggressive than 2391 Reno). Then the operator needs to decide at what ratio of RTTs it 2392 wants DCTCP and Classic flows to have roughly equal throughput. For 2393 example choosing k'=0 (equivalent to k=1) will make DCTCP throughput 2394 roughly the same as Cubic, _if their RTTs are the same_. 2396 However, even if the base RTTs are the same, the actual RTTs are 2397 unlikely to be the same, because Classic (Cubic or Reno) traffic 2398 needs roughly a typical base round trip of queue to avoid under- 2399 utilization and excess drop. Whereas L4S (DCTCP) does not. The 2400 operator might still choose this policy if it judges that DCTCP 2401 throughput should be rewarded for keeping its own queue short. 2403 On the other hand, the operator will choose one of the higher values 2404 for k', if it wants to slow DCTCP down to roughly the same throughput 2405 as Classic flows, to compensate for Classic flows slowing themselves 2406 down by causing themselves extra queuing delay. 2408 The values for k' in the table are derived from the formulae below, 2409 which were developed in [DCttH15]: 2411 2^k' = 1.64 (RTT_reno / RTT_dc) (5) 2412 2^k' = 1.19 (RTT_cubic / RTT_dc ) (6) 2414 For localized traffic from a particular ISP's data centre, using the 2415 measured RTTs, it was calculated that a value of k'=3 (equivalant to 2416 k=8) would achieve throughput equivalence, and experiments verified 2417 the formula very closely. 2419 For a typical mix of RTTs from local data centres and across the 2420 general Internet, a value of k'=1 (equivalent to k=2) is recommended 2421 as a good workable compromise. 2423 Authors' Addresses 2425 Koen De Schepper 2426 Nokia Bell Labs 2427 Antwerp 2428 Belgium 2430 Email: koen.de_schepper@nokia.com 2431 URI: https://www.bell-labs.com/usr/koen.de_schepper 2433 Bob Briscoe (editor) 2434 Independent 2435 UK 2437 Email: ietf@bobbriscoe.net 2438 URI: http://bobbriscoe.net/ 2440 Greg White 2441 CableLabs 2442 Louisville, CO 2443 US 2445 Email: G.White@CableLabs.com