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