idnits 2.17.1 draft-ietf-tsvwg-aqm-dualq-coupled-15.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 (May 21, 2021) is 1070 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 2334 -- Looks like a reference, but probably isn't: '1' on line 2334 == Outdated reference: A later version (-29) exists of draft-ietf-tsvwg-ecn-l4s-id-14 == 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-05 -- 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: November 22, 2021 Independent 6 G. White 7 CableLabs 8 May 21, 2021 10 DualQ Coupled AQMs for Low Latency, Low Loss and Scalable Throughput 11 (L4S) 12 draft-ietf-tsvwg-aqm-dualq-coupled-15 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 November 22, 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 very 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 very 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 very 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 very low latency. With an 432 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. An additional process document has proved necessary to 553 make the ECT(1) codepoint available for experimentation [RFC8311]. 555 For policy reasons, an operator might choose to steer certain packets 556 (e.g. from certain flows or with certain addresses) out of the L 557 queue, even though they identify themselves as L4S by their ECN 558 codepoints. In such cases, [I-D.ietf-tsvwg-ecn-l4s-id] says that the 559 device "MUST NOT alter the end-to-end L4S ECN identifier", so that it 560 is preserved end-to-end. The aim is that each operator can choose 561 how it treats L4S traffic locally, but an individual operator does 562 not alter the identification of L4S packets, which would prevent 563 other operators downstream from making their own choices on how to 564 treat L4S traffic. 566 In addition, an operator could use other identifiers to classify 567 certain additional packet types into the L queue that it deems will 568 not risk harm to the L4S service. For instance addresses of specific 569 applications or hosts (see [I-D.ietf-tsvwg-ecn-l4s-id]), specific 570 Diffserv codepoints such as EF (Expedited Forwarding) and Voice-Admit 571 service classes (see [I-D.briscoe-tsvwg-l4s-diffserv]), the Non- 572 Queue-Building (NQB) per-hop behaviour [I-D.ietf-tsvwg-nqb] or 573 certain protocols (e.g. ARP, DNS). Note that the mechanism only 574 reads these identifiers. [I-D.ietf-tsvwg-ecn-l4s-id] says it "MUST 575 NOT alter these non-ECN identifiers". Thus, the L queue is not 576 solely an L4S queue, it can be consider more generally as a low 577 latency queue. 579 2.4. Overall DualQ Coupled AQM Structure 581 Figure 1 shows the overall structure that any DualQ Coupled AQM is 582 likely to have. This schematic is intended to aid understanding of 583 the current designs of DualQ Coupled AQMs. However, it is not 584 intended to preclude other innovative ways of satisfying the 585 normative requirements in Section 2.5 that minimally define a DualQ 586 Coupled AQM. 588 The classifier on the left separates incoming traffic between the two 589 queues (L and C). Each queue has its own AQM that determines the 590 likelihood of marking or dropping (p_L and p_C). It has been 591 proved [PI2] that it is preferable to control load with a linear 592 controller, then square the output before applying it as a drop 593 probability to Reno-friendly traffic (because Reno congestion control 594 decreases its load proportional to the square-root of the increase in 595 drop). So, the AQM for Classic traffic needs to be implemented in 596 two stages: i) a base stage that outputs an internal probability p' 597 (pronounced p-prime); and ii) a squaring stage that outputs p_C, 598 where 600 p_C = (p')^2. (2) 602 Substituting for p_C in Eqn (1) gives: 604 p' = p_CL / k 606 So the slow-moving input to ECN marking in the L queue (the coupled 607 L4S probability) is: 609 p_CL = k*p'. (3) 611 The actual ECN marking probability p_L that is applied to the L queue 612 needs to track the immediate L queue delay under L-only congestion 613 conditions, as well as track p_CL under coupled congestion 614 conditions. So the L queue uses a native AQM that calculates a 615 probability p'_L as a function of the instantaneous L queue delay. 616 And, given the L queue has conditional priority over the C queue, 617 whenever the L queue grows, the AQM ought to apply marking 618 probability p'_L, but p_L ought not to fall below p_CL. This 619 suggests: 621 p_L = max(p'_L, p_CL), (4) 623 which has also been found to work very well in practice. 625 The two transformations of p' in equations (2) and (3) implement the 626 required coupling given in equation (1) earlier. 628 The constant of proportionality or coupling factor, k, in equation 629 (1) determines the ratio between the congestion probabilities (loss 630 or marking) experienced by L4S and Classic traffic. Thus k 631 indirectly determines the ratio between L4S and Classic flow rates, 632 because flows (assuming they are responsive) adjust their rate in 633 response to congestion probability. Appendix C.2 gives guidance on 634 the choice of k and its effect on relative flow rates. 636 _________ 637 | | ,------. 638 L4S queue | |===>| ECN | 639 ,'| _______|_| |marker|\ 640 <' | | `------'\\ 641 //`' v ^ p_L \\ 642 // ,-------. | \\ 643 // |Native |p'_L | \\,. 644 // | L4S |--->(MAX) < | ___ 645 ,----------.// | AQM | ^ p_CL `\|.'Cond-`. 646 | IP-ECN |/ `-------' | / itional \ 647 ==>|Classifier| ,-------. (k*p') [ priority]==> 648 | |\ | Base | | \scheduler/ 649 `----------'\\ | AQM |---->: ,'|`-.___.-' 650 \\ | |p' | <' | 651 \\ `-------' (p'^2) //`' 652 \\ ^ | // 653 \\,. | v p_C // 654 < | _________ .------.// 655 `\| | | | Drop |/ 656 Classic |queue |===>|/mark | 657 __|______| `------' 659 Legend: ===> traffic flow; ---> control dependency. 661 Figure 1: DualQ Coupled AQM Schematic 663 After the AQMs have applied their dropping or marking, the scheduler 664 forwards their packets to the link. Even though the scheduler gives 665 priority to the L queue, it is not as strong as the coupling from the 666 C queue. This is because, as the C queue grows, the base AQM applies 667 more congestion signals to L traffic (as well as C). As L flows 668 reduce their rate in response, they use less than the scheduling 669 share for L traffic. So, because the scheduler is work preserving, 670 it schedules any C traffic in the gaps. 672 Giving priority to the L queue has the benefit of very low L queue 673 delay, because the L queue is kept empty whenever L traffic is 674 controlled by the coupling. Also there only has to be a coupling in 675 one direction - from Classic to L4S. Priority has to be conditional 676 in some way to prevent the C queue starving under overload conditions 677 (see Section 4.1). With normal responsive traffic simple strict 678 priority would work, but it would make new Classic traffic wait until 679 its queue activated the coupling and L4S flows had in turn reduced 680 their rate enough to drain the L queue so that Classic traffic could 681 be scheduled. Giving a small weight or limited waiting time for C 682 traffic improves response times for short Classic messages, such as 683 DNS requests and improves Classic flow startup because immediate 684 capacity is available. 686 Example DualQ Coupled AQM algorithms called DualPI2 and Curvy RED are 687 given in Appendix A and Appendix B. Either example AQM can be used 688 to couple packet marking and dropping across a dual Q. 690 DualPI2 uses a Proportional-Integral (PI) controller as the Base AQM. 691 Indeed, this Base AQM with just the squared output and no L4S queue 692 can be used as a drop-in replacement for PIE [RFC8033], in which case 693 it is just called PI2 [PI2]. PI2 is a principled simplification of 694 PIE that is both more responsive and more stable in the face of 695 dynamically varying load. 697 Curvy RED is derived from RED [RFC2309], but its configuration 698 parameters are insensitive to link rate and it requires less 699 operations per packet. However, DualPI2 is more responsive and 700 stable over a wider range of RTTs than Curvy RED. As a consequence, 701 at the time of writing, DualPI2 has attracted more development and 702 evaluation attention than Curvy RED, leaving the Curvy RED design 703 incomplete and not so fully evaluated. 705 Both AQMs regulate their queue in units of time rather than bytes. 706 As already explained, this ensures configuration can be invariant for 707 different drain rates. With AQMs in a dualQ structure this is 708 particularly important because the drain rate of each queue can vary 709 rapidly as flows for the two queues arrive and depart, even if the 710 combined link rate is constant. 712 It would be possible to control the queues with other alternative 713 AQMs, as long as the normative requirements (those expressed in 714 capitals) in Section 2.5 are observed. 716 2.5. Normative Requirements for a DualQ Coupled AQM 718 The following requirements are intended to capture only the essential 719 aspects of a DualQ Coupled AQM. They are intended to be independent 720 of the particular AQMs used for each queue. 722 2.5.1. Functional Requirements 724 A Dual Queue Coupled AQM implementation MUST comply with the 725 prerequisite L4S behaviours for any L4S network node (not just a 726 DualQ) as specified in section 5 of [I-D.ietf-tsvwg-ecn-l4s-id]. 727 These primarily concern classification and remarking as briefly 728 summarized in Section 2.3 earlier. But there is also a subsection 729 (5.5) giving guidance on reducing the burstiness of the link 730 technology underlying any L4S AQM. 732 A Dual Queue Coupled AQM implementation MUST utilize two queues, each 733 with an AQM algorithm. The two queues can be part of a larger 734 queuing hierarchy [I-D.briscoe-tsvwg-l4s-diffserv]. 736 The AQM algorithm for the low latency (L) queue MUST be able to apply 737 ECN marking to ECN-capable packets. 739 The scheduler draining the two queues MUST give L4S packets priority 740 over Classic, although priority MUST be bounded in order not to 741 starve Classic traffic. The scheduler SHOULD be work-conserving. 743 [I-D.ietf-tsvwg-ecn-l4s-id] defines the meaning of an ECN marking on 744 L4S traffic, relative to drop of Classic traffic. In order to ensure 745 coexistence of Classic and Scalable L4S traffic, it says, "The 746 likelihood that an AQM drops a Not-ECT Classic packet (p_C) MUST be 747 roughly proportional to the square of the likelihood that it would 748 have marked it if it had been an L4S packet (p_L)." The term 749 'likelihood' is used to allow for marking and dropping to be either 750 probabilistic or deterministic. 752 For the current specification, this translates into the following 753 requirement. A DualQ Coupled AQM MUST apply ECN marking to traffic 754 in the L queue that is no lower than that derived from the likelihood 755 of drop (or ECN marking) in the Classic queue using Eqn. (1). 757 The constant of proportionality, k, in Eqn (1) determines the 758 relative flow rates of Classic and L4S flows when the AQM concerned 759 is the bottleneck (all other factors being equal). 761 [I-D.ietf-tsvwg-ecn-l4s-id] says, "The constant of proportionality 762 (k) does not have to be standardised for interoperability, but a 763 value of 2 is RECOMMENDED." 765 Assuming Scalable congestion controls for the Internet will be as 766 aggressive as DCTCP, this will ensure their congestion window will be 767 roughly the same as that of a standards track TCP Reno congestion 768 control (Reno) [RFC5681] and other Reno-friendly controls, such as 769 TCP Cubic in its Reno-compatibility mode. 771 The choice of k is a matter of operator policy, and operators MAY 772 choose a different value using Table 1 and the guidelines in 773 Appendix C.2. 775 If multiple customers or users share capacity at a bottleneck 776 (e.g. in the Internet access link of a campus network), the 777 operator's choice of k will determine capacity sharing between the 778 flows of different customers. However, on the public Internet, 779 access network operators typically isolate customers from each other 780 with some form of layer-2 multiplexing (OFDM(A) in DOCSIS3.1, CDMA in 781 3G, SC-FDMA in LTE) or L3 scheduling (WRR in DSL), rather than 782 relying on host congestion controls to share capacity between 783 customers [RFC0970]. In such cases, the choice of k will solely 784 affect relative flow rates within each customer's access capacity, 785 not between customers. Also, k will not affect relative flow rates 786 at any times when all flows are Classic or all flows are L4S, and it 787 will not affect the relative throughput of small flows. 789 2.5.1.1. Requirements in Unexpected Cases 791 The flexibility to allow operator-specific classifiers (Section 2.3) 792 leads to the need to specify what the AQM in each queue ought to do 793 with packets that do not carry the ECN field expected for that queue. 794 It is expected that the AQM in each queue will inspect the ECN field 795 to determine what sort of congestion notification to signal, then it 796 will decide whether to apply congestion notification to this 797 particular packet, as follows: 799 o If a packet that does not carry an ECT(1) or CE codepoint is 800 classified into the L queue: 802 * if the packet is ECT(0), the L AQM SHOULD apply CE-marking 803 using a probability appropriate to Classic congestion control 804 and appropriate to the target delay in the L queue 806 * if the packet is Not-ECT, the appropriate action depends on 807 whether some other function is protecting the L queue from 808 misbehaving flows (e.g. per-flow queue 809 protection [I-D.briscoe-docsis-q-protection] or latency 810 policing): 812 + If separate queue protection is provided, the L AQM SHOULD 813 ignore the packet and forward it unchanged, meaning it 814 should not calculate whether to apply congestion 815 notification and it should neither drop nor CE-mark the 816 packet (for instance, the operator might classify EF traffic 817 that is unresponsive to drop into the L queue, alongside 818 responsive L4S-ECN traffic) 820 + if separate queue protection is not provided, the L AQM 821 SHOULD apply drop using a drop probability appropriate to 822 Classic congestion control and appropriate to the target 823 delay in the L queue 825 o If a packet that carries an ECT(1) codepoint is classified into 826 the C queue: 828 * the C AQM SHOULD apply CE-marking using the coupled AQM 829 probability p_CL (= k*p'). 831 The above requirements are worded as "SHOULDs", because operator- 832 specific classifiers are for flexibility, by definition. Therefore, 833 alternative actions might be appropriate in the operator's specific 834 circumstances. An example would be where the operator knows that 835 certain legacy traffic marked with one codepoint actually has a 836 congestion response associated with another codepoint. 838 If the DualQ Coupled AQM has detected overload, it MUST begin using 839 Classic drop, and continue until the overload episode has subsided. 840 Switching to drop if ECN marking is persistently high is required by 841 Section 7 of [RFC3168] and Section 4.2.1 of [RFC7567]. 843 2.5.2. Management Requirements 845 2.5.2.1. Configuration 847 By default, a DualQ Coupled AQM SHOULD NOT need any configuration for 848 use at a bottleneck on the public Internet [RFC7567]. The following 849 parameters MAY be operator-configurable, e.g. to tune for non- 850 Internet settings: 852 o Optional packet classifier(s) to use in addition to the ECN field 853 (see Section 2.3); 855 o Expected typical RTT, which can be used to determine the queuing 856 delay of the Classic AQM at its operating point, in order to 857 prevent typical lone flows from under-utilizing capacity. For 858 example: 860 * for the PI2 algorithm (Appendix A) the queuing delay target is 861 set to the typical RTT; 863 * for the Curvy RED algorithm (Appendix B) the queuing delay at 864 the desired operating point of the curvy ramp is configured to 865 encompass a typical RTT; 867 * if another Classic AQM was used, it would be likely to need an 868 operating point for the queue based on the typical RTT, and if 869 so it SHOULD be expressed in units of time. 871 An operating point that is manually calculated might be directly 872 configurable instead, e.g. for links with large numbers of flows 873 where under-utilization by a single flow would be unlikely. 875 o Expected maximum RTT, which can be used to set the stability 876 parameter(s) of the Classic AQM. For example: 878 * for the PI2 algorithm (Appendix A), the gain parameters of the 879 PI algorithm depend on the maximum RTT. 881 * for the Curvy RED algorithm (Appendix B) the smoothing 882 parameter is chosen to filter out transients in the queue 883 within a maximum RTT. 885 Stability parameter(s) that are manually calculated assuming a 886 maximum RTT might be directly configurable instead. 888 o Coupling factor, k (see Appendix C.2); 890 o A limit to the conditional priority of L4S. This is scheduler- 891 dependent, but it SHOULD be expressed as a relation between the 892 max delay of a C packet and an L packet. For example: 894 * for a WRR scheduler a weight ratio between L and C of w:1 means 895 that the maximum delay to a C packet is w times that of an L 896 packet. 898 * for a time-shifted FIFO (TS-FIFO) scheduler (see Section 4.1.1) 899 a time-shift of tshift means that the maximum delay to a C 900 packet is tshift greater than that of an L packet. tshift could 901 be expressed as a multiple of the typical RTT rather than as an 902 absolute delay. 904 o The maximum Classic ECN marking probability, p_Cmax, before 905 switching over to drop. 907 2.5.2.2. Monitoring 909 An experimental DualQ Coupled AQM SHOULD allow the operator to 910 monitor each of the following operational statistics on demand, per 911 queue and per configurable sample interval, for performance 912 monitoring and perhaps also for accounting in some cases: 914 o Bits forwarded, from which utilization can be calculated; 916 o Total packets in the three categories: arrived, presented to the 917 AQM, and forwarded. The difference between the first two will 918 measure any non-AQM tail discard. The difference between the last 919 two will measure proactive AQM discard; 921 o ECN packets marked, non-ECN packets dropped, ECN packets dropped, 922 which can be combined with the three total packet counts above to 923 calculate marking and dropping probabilities; 925 o Queue delay (not including serialization delay of the head packet 926 or medium acquisition delay) - see further notes below. 928 Unlike the other statistics, queue delay cannot be captured in a 929 simple accumulating counter. Therefore the type of queue delay 930 statistics produced (mean, percentiles, etc.) will depend on 931 implementation constraints. To facilitate comparative evaluation 932 of different implementations and approaches, an implementation 933 SHOULD allow mean and 99th percentile queue delay to be derived 934 (per queue per sample interval). A relatively simple way to do 935 this would be to store a coarse-grained histogram of queue delay. 936 This could be done with a small number of bins with configurable 937 edges that represent contiguous ranges of queue delay. Then, over 938 a sample interval, each bin would accumulate a count of the number 939 of packets that had fallen within each range. The maximum queue 940 delay per queue per interval MAY also be recorded. 942 2.5.2.3. Anomaly Detection 944 An experimental DualQ Coupled AQM SHOULD asynchronously report the 945 following data about anomalous conditions: 947 o Start-time and duration of overload state. 949 A hysteresis mechanism SHOULD be used to prevent flapping in and 950 out of overload causing an event storm. For instance, exit from 951 overload state could trigger one report, but also latch a timer. 953 Then, during that time, if the AQM enters and exits overload state 954 any number of times, the duration in overload state is accumulated 955 but no new report is generated until the first time the AQM is out 956 of overload once the timer has expired. 958 2.5.2.4. Deployment, Coexistence and Scaling 960 [RFC5706] suggests that deployment, coexistence and scaling should 961 also be covered as management requirements. The raison d'etre of the 962 DualQ Coupled AQM is to enable deployment and coexistence of Scalable 963 congestion controls - as incremental replacements for today's Reno- 964 friendly controls that do not scale with bandwidth-delay product. 965 Therefore there is no need to repeat these motivating issues here 966 given they are already explained in the Introduction and detailed in 967 the L4S architecture [I-D.ietf-tsvwg-l4s-arch]. 969 The descriptions of specific DualQ Coupled AQM algorithms in the 970 appendices cover scaling of their configuration parameters, e.g. with 971 respect to RTT and sampling frequency. 973 3. IANA Considerations (to be removed by RFC Editor) 975 This specification contains no IANA considerations. 977 4. Security Considerations 979 4.1. Overload Handling 981 Where the interests of users or flows might conflict, it could be 982 necessary to police traffic to isolate any harm to the performance of 983 individual flows. However it is hard to avoid unintended side- 984 effects with policing, and in a trusted environment policing is not 985 necessary. Therefore per-flow policing 986 (e.g. [I-D.briscoe-docsis-q-protection]) needs to be separable from a 987 basic AQM, as an option under policy control. 989 However, a basic DualQ AQM does at least need to handle overload. A 990 useful objective would be for the overload behaviour of the DualQ AQM 991 to be at least no worse than a single queue AQM. However, a trade- 992 off needs to be made between complexity and the risk of either 993 traffic class harming the other. In each of the following three 994 subsections, an overload issue specific to the DualQ is described, 995 followed by proposed solution(s). 997 Under overload the higher priority L4S service will have to sacrifice 998 some aspect of its performance. Alternative solutions are provided 999 below that each relax a different factor: e.g. throughput, delay, 1000 drop. These choices need to be made either by the developer or by 1001 operator policy, rather than by the IETF. 1003 4.1.1. Avoiding Classic Starvation: Sacrifice L4S Throughput or Delay? 1005 Priority of L4S is required to be conditional to avoid total 1006 starvation of Classic by heavy L4S traffic. This raises the question 1007 of whether to sacrifice L4S throughput or L4S delay (or some other 1008 policy) to mitigate starvation of Classic: 1010 Sacrifice L4S throughput: By using weighted round robin as the 1011 conditional priority scheduler, the L4S service can sacrifice some 1012 throughput during overload. This can either be thought of as 1013 guaranteeing a minimum throughput service for Classic traffic, or 1014 as guaranteeing a maximum delay for a packet at the head of the 1015 Classic queue. 1017 The scheduling weight of the Classic queue should be small 1018 (e.g. 1/16). Then, in most traffic scenarios the scheduler will 1019 not interfere and it will not need to - the coupling mechanism and 1020 the end-systems will share out the capacity across both queues as 1021 if it were a single pool. However, because the congestion 1022 coupling only applies in one direction (from C to L), if L4S 1023 traffic is over-aggressive or unresponsive, the scheduler weight 1024 for Classic traffic will at least be large enough to ensure it 1025 does not starve. 1027 In cases where the ratio of L4S to Classic flows (e.g. 19:1) is 1028 greater than the ratio of their scheduler weights (e.g. 15:1), the 1029 L4S flows will get less than an equal share of the capacity, but 1030 only slightly. For instance, with the example numbers given, each 1031 L4S flow will get (15/16)/19 = 4.9% when ideally each would get 1032 1/20=5%. In the rather specific case of an unresponsive flow 1033 taking up just less than the capacity set aside for L4S 1034 (e.g. 14/16 in the above example), using WRR could significantly 1035 reduce the capacity left for any responsive L4S flows. 1037 The scheduling weight of the Classic queue should not be too 1038 small, otherwise a C packet at the head of the queue could be 1039 excessively delayed by a continually busy L queue. For instance 1040 if the Classic weight is 1/16, the maximum that a Classic packet 1041 at the head of the queue can be delayed by L traffic is the 1042 serialization delay of 15 MTU-sized packets. 1044 Sacrifice L4S Delay: To control milder overload of responsive 1045 traffic, particularly when close to the maximum congestion signal, 1046 the operator could choose to control overload of the Classic queue 1047 by allowing some delay to 'leak' across to the L4S queue. The 1048 scheduler can be made to behave like a single First-In First-Out 1049 (FIFO) queue with different service times by implementing a very 1050 simple conditional priority scheduler that could be called a 1051 "time-shifted FIFO" (see the Modifier Earliest Deadline First 1052 (MEDF) scheduler of [MEDF]). This scheduler adds tshift to the 1053 queue delay of the next L4S packet, before comparing it with the 1054 queue delay of the next Classic packet, then it selects the packet 1055 with the greater adjusted queue delay. Under regular conditions, 1056 this time-shifted FIFO scheduler behaves just like a strict 1057 priority scheduler. But under moderate or high overload it 1058 prevents starvation of the Classic queue, because the time-shift 1059 (tshift) defines the maximum extra queuing delay of Classic 1060 packets relative to L4S. 1062 The example implementations in Appendix A and Appendix B could both 1063 be implemented with either policy. 1065 4.1.2. Congestion Signal Saturation: Introduce L4S Drop or Delay? 1067 To keep the throughput of both L4S and Classic flows roughly equal 1068 over the full load range, a different control strategy needs to be 1069 defined above the point where one AQM first saturates to a 1070 probability of 100% leaving no room to push back the load any harder. 1071 If k>1, L4S will saturate first, even though saturation could be 1072 caused by unresponsive traffic in either queue. 1074 The term 'unresponsive' includes cases where a flow becomes 1075 temporarily unresponsive, for instance, a real-time flow that takes a 1076 while to adapt its rate in response to congestion, or a standard Reno 1077 flow that is normally responsive, but above a certain congestion 1078 level it will not be able to reduce its congestion window below the 1079 allowed minimum of 2 segments [RFC5681], effectively becoming 1080 unresponsive. (Note that L4S traffic ought to remain responsive 1081 below a window of 2 segments (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1083 Saturation raises the question of whether to relieve congestion by 1084 introducing some drop into the L4S queue or by allowing delay to grow 1085 in both queues (which could eventually lead to tail drop too): 1087 Drop on Saturation: Saturation can be avoided by setting a maximum 1088 threshold for L4S ECN marking (assuming k>1) before saturation 1089 starts to make the flow rates of the different traffic types 1090 diverge. Above that the drop probability of Classic traffic is 1091 applied to all packets of all traffic types. Then experiments 1092 have shown that queueing delay can be kept at the target in any 1093 overload situation, including with unresponsive traffic, and no 1094 further measures are required [DualQ-Test]. 1096 Delay on Saturation: When L4S marking saturates, instead of 1097 switching to drop, the drop and marking probabilities could be 1098 capped. Beyond that, delay will grow either solely in the queue 1099 with unresponsive traffic (if WRR is used), or in both queues (if 1100 time-shifted FIFO is used). In either case, the higher delay 1101 ought to control temporary high congestion. If the overload is 1102 more persistent, eventually the combined DualQ will overflow and 1103 tail drop will control congestion. 1105 The example implementation in Appendix A solely applies the "drop on 1106 saturation" policy. The DOCSIS specification of a DualQ Coupled 1107 AQM [DOCSIS3.1] also implements the 'drop on saturation' policy with 1108 a very shallow L buffer. However, the addition of DOCSIS per-flow 1109 Queue Protection [I-D.briscoe-docsis-q-protection] turns this into 1110 'delay on saturation' by redirecting some packets of the flow(s) most 1111 responsible for L queue overload into the C queue, which has a higher 1112 delay target. If overload continues, this again becomes 'drop on 1113 saturation' as the level of drop in the C queue rises to maintain the 1114 target delay of the C queue. 1116 4.1.3. Protecting against Unresponsive ECN-Capable Traffic 1118 Unresponsive traffic has a greater advantage if it is also ECN- 1119 capable. The advantage is undetectable at normal low levels of drop/ 1120 marking, but it becomes significant with the higher levels of drop/ 1121 marking typical during overload. This is an issue whether the ECN- 1122 capable traffic is L4S or Classic. 1124 This raises the question of whether and when to switch off ECN 1125 marking and use solely drop instead, as required by both Section 7 of 1126 [RFC3168] and Section 4.2.1 of [RFC7567]. 1128 Experiments with the DualPI2 AQM (Appendix A) have shown that 1129 introducing 'drop on saturation' at 100% L4S marking addresses this 1130 problem with unresponsive ECN as well as addressing the saturation 1131 problem. It leaves only a small range of congestion levels where 1132 unresponsive traffic gains any advantage from using the ECN 1133 capability, and the advantage is hardly detectable [DualQ-Test]. 1135 5. Acknowledgements 1137 Thanks to Anil Agarwal, Sowmini Varadhan's, Gabi Bracha, Nicolas 1138 Kuhn, Greg Skinner, Tom Henderson and David Pullen for detailed 1139 review comments particularly of the appendices and suggestions on how 1140 to make the explanations clearer. Thanks also to Tom Henderson for 1141 insights on the choice of schedulers and queue delay measurement 1142 techniques. 1144 The early contributions of Koen De Schepper, Bob Briscoe, Olga 1145 Bondarenko and Inton Tsang were part-funded by the European Community 1146 under its Seventh Framework Programme through the Reducing Internet 1147 Transport Latency (RITE) project (ICT-317700). Bob Briscoe's 1148 contribution was also part-funded by the Comcast Innovation Fund and 1149 the Research Council of Norway through the TimeIn project. The views 1150 expressed here are solely those of the authors. 1152 6. Contributors 1154 The following contributed implementations and evaluations that 1155 validated and helped to improve this specification: 1157 Olga Albisser of Simula Research Lab, Norway 1158 (Olga Bondarenko during early drafts) implemented the prototype 1159 DualPI2 AQM for Linux with Koen De Schepper and conducted 1160 extensive evaluations as well as implementing the live performance 1161 visualization GUI [L4Sdemo16]. 1163 Olivier Tilmans of Nokia 1164 Bell Labs, Belgium prepared and maintains the Linux implementation 1165 of DualPI2 for upstreaming. 1167 Shravya K.S. wrote a model for the ns-3 simulator based on the -01 1168 version of this Internet-Draft. Based on this initial work, Tom 1169 Henderson updated that earlier model and created a 1170 model for the DualQ variant specified as part of the Low Latency 1171 DOCSIS specification, as well as conducting extensive evaluations. 1173 Ing Jyh (Inton) Tsang of Nokia, Belgium built the End-to-End Data 1174 Centre to the Home broadband testbed on which DualQ Coupled AQM 1175 implementations were tested. 1177 7. References 1179 7.1. Normative References 1181 [I-D.ietf-tsvwg-ecn-l4s-id] 1182 Schepper, K. D. and B. Briscoe, "Explicit Congestion 1183 Notification (ECN) Protocol for Ultra-Low Queuing Delay 1184 (L4S)", draft-ietf-tsvwg-ecn-l4s-id-14 (work in progress), 1185 March 2021. 1187 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1188 Requirement Levels", BCP 14, RFC 2119, 1189 DOI 10.17487/RFC2119, March 1997, 1190 . 1192 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 1193 of Explicit Congestion Notification (ECN) to IP", 1194 RFC 3168, DOI 10.17487/RFC3168, September 2001, 1195 . 1197 [RFC8311] Black, D., "Relaxing Restrictions on Explicit Congestion 1198 Notification (ECN) Experimentation", RFC 8311, 1199 DOI 10.17487/RFC8311, January 2018, 1200 . 1202 7.2. Informative References 1204 [Alizadeh-stability] 1205 Alizadeh, M., Javanmard, A., and B. Prabhakar, "Analysis 1206 of DCTCP: Stability, Convergence, and Fairness", ACM 1207 SIGMETRICS 2011 , June 2011, 1208 . 1210 [AQMmetrics] 1211 Kwon, M. and S. Fahmy, "A Comparison of Load-based and 1212 Queue- based Active Queue Management Algorithms", Proc. 1213 Int'l Soc. for Optical Engineering (SPIE) 4866:35--46 DOI: 1214 10.1117/12.473021, 2002, 1215 . 1217 [ARED01] Floyd, S., Gummadi, R., and S. Shenker, "Adaptive RED: An 1218 Algorithm for Increasing the Robustness of RED's Active 1219 Queue Management", ACIRI Technical Report , August 2001, 1220 . 1222 [BBRv1] Cardwell, N., Cheng, Y., Hassas Yeganeh, S., and V. 1223 Jacobson, "BBR Congestion Control", Internet Draft draft- 1224 cardwell-iccrg-bbr-congestion-control-00, July 2017, 1225 . 1228 [CoDel] Nichols, K. and V. Jacobson, "Controlling Queue Delay", 1229 ACM Queue 10(5), May 2012, 1230 . 1232 [CRED_Insights] 1233 Briscoe, B., "Insights from Curvy RED (Random Early 1234 Detection)", BT Technical Report TR-TUB8-2015-003 1235 arXiv:1904.07339 [cs.NI], July 2015, 1236 . 1238 [DCttH15] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 1239 Tsang, "`Data Centre to the Home': Ultra-Low Latency for 1240 All", RITE project Technical Report , 2015, 1241 . 1243 [DOCSIS3.1] 1244 CableLabs, "MAC and Upper Layer Protocols Interface 1245 (MULPI) Specification, CM-SP-MULPIv3.1", Data-Over-Cable 1246 Service Interface Specifications DOCSIS(R) 3.1 Version i17 1247 or later, January 2019, . 1250 [DualPI2Linux] 1251 Albisser, O., De Schepper, K., Briscoe, B., Tilmans, O., 1252 and H. Steen, "DUALPI2 - Low Latency, Low Loss and 1253 Scalable (L4S) AQM", Proc. Linux Netdev 0x13 , March 2019, 1254 . 1257 [DualQ-Test] 1258 Steen, H., "Destruction Testing: Ultra-Low Delay using 1259 Dual Queue Coupled Active Queue Management", Masters 1260 Thesis, Dept of Informatics, Uni Oslo , May 2017. 1262 [I-D.briscoe-docsis-q-protection] 1263 Briscoe, B. and G. White, "Queue Protection to Preserve 1264 Low Latency", draft-briscoe-docsis-q-protection-00 (work 1265 in progress), July 2019. 1267 [I-D.briscoe-tsvwg-l4s-diffserv] 1268 Briscoe, B., "Interactions between Low Latency, Low Loss, 1269 Scalable Throughput (L4S) and Differentiated Services", 1270 draft-briscoe-tsvwg-l4s-diffserv-02 (work in progress), 1271 November 2018. 1273 [I-D.cardwell-iccrg-bbr-congestion-control] 1274 Cardwell, N., Cheng, Y., Yeganeh, S. H., and V. Jacobson, 1275 "BBR Congestion Control", draft-cardwell-iccrg-bbr- 1276 congestion-control-00 (work in progress), July 2017. 1278 [I-D.ietf-tsvwg-l4s-arch] 1279 Briscoe, B., Schepper, K. D., Bagnulo, M., and G. White, 1280 "Low Latency, Low Loss, Scalable Throughput (L4S) Internet 1281 Service: Architecture", draft-ietf-tsvwg-l4s-arch-08 (work 1282 in progress), November 2020. 1284 [I-D.ietf-tsvwg-nqb] 1285 White, G. and T. Fossati, "A Non-Queue-Building Per-Hop 1286 Behavior (NQB PHB) for Differentiated Services", draft- 1287 ietf-tsvwg-nqb-05 (work in progress), March 2021. 1289 [L4Sdemo16] 1290 Bondarenko, O., De Schepper, K., Tsang, I., and B. 1291 Briscoe, "Ultra-Low Delay for All: Live Experience, Live 1292 Analysis", Proc. MMSYS'16 pp33:1--33:4, May 2016, 1293 . 1297 [LLD] White, G., Sundaresan, K., and B. Briscoe, "Low Latency 1298 DOCSIS: Technology Overview", CableLabs White Paper , 1299 February 2019, . 1302 [Mathis09] 1303 Mathis, M., "Relentless Congestion Control", PFLDNeT'09 , 1304 May 2009, . 1307 [MEDF] Menth, M., Schmid, M., Heiss, H., and T. Reim, "MEDF - a 1308 simple scheduling algorithm for two real-time transport 1309 service classes with application in the UTRAN", Proc. IEEE 1310 Conference on Computer Communications (INFOCOM'03) Vol.2 1311 pp.1116-1122, March 2003. 1313 [PI2] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 1314 Tsang, "PI2: A Linearized AQM for both Classic and 1315 Scalable TCP", ACM CoNEXT'16 , December 2016, 1316 . 1319 [PragueLinux] 1320 Briscoe, B., De Schepper, K., Albisser, O., Misund, J., 1321 Tilmans, O., Kuehlewind, M., and A. Ahmed, "Implementing 1322 the `TCP Prague' Requirements for Low Latency Low Loss 1323 Scalable Throughput (L4S)", Proc. Linux Netdev 0x13 , 1324 March 2019, . 1327 [RFC0970] Nagle, J., "On Packet Switches With Infinite Storage", 1328 RFC 970, DOI 10.17487/RFC0970, December 1985, 1329 . 1331 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 1332 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 1333 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 1334 S., Wroclawski, J., and L. Zhang, "Recommendations on 1335 Queue Management and Congestion Avoidance in the 1336 Internet", RFC 2309, DOI 10.17487/RFC2309, April 1998, 1337 . 1339 [RFC3246] Davie, B., Charny, A., Bennet, J., Benson, K., Le Boudec, 1340 J., Courtney, W., Davari, S., Firoiu, V., and D. 1341 Stiliadis, "An Expedited Forwarding PHB (Per-Hop 1342 Behavior)", RFC 3246, DOI 10.17487/RFC3246, March 2002, 1343 . 1345 [RFC3649] Floyd, S., "HighSpeed TCP for Large Congestion Windows", 1346 RFC 3649, DOI 10.17487/RFC3649, December 2003, 1347 . 1349 [RFC5033] Floyd, S. and M. Allman, "Specifying New Congestion 1350 Control Algorithms", BCP 133, RFC 5033, 1351 DOI 10.17487/RFC5033, August 2007, 1352 . 1354 [RFC5348] Floyd, S., Handley, M., Padhye, J., and J. Widmer, "TCP 1355 Friendly Rate Control (TFRC): Protocol Specification", 1356 RFC 5348, DOI 10.17487/RFC5348, September 2008, 1357 . 1359 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 1360 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 1361 . 1363 [RFC5706] Harrington, D., "Guidelines for Considering Operations and 1364 Management of New Protocols and Protocol Extensions", 1365 RFC 5706, DOI 10.17487/RFC5706, November 2009, 1366 . 1368 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 1369 Recommendations Regarding Active Queue Management", 1370 BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 1371 . 1373 [RFC8033] Pan, R., Natarajan, P., Baker, F., and G. White, 1374 "Proportional Integral Controller Enhanced (PIE): A 1375 Lightweight Control Scheme to Address the Bufferbloat 1376 Problem", RFC 8033, DOI 10.17487/RFC8033, February 2017, 1377 . 1379 [RFC8034] White, G. and R. Pan, "Active Queue Management (AQM) Based 1380 on Proportional Integral Controller Enhanced PIE) for 1381 Data-Over-Cable Service Interface Specifications (DOCSIS) 1382 Cable Modems", RFC 8034, DOI 10.17487/RFC8034, February 1383 2017, . 1385 [RFC8257] Bensley, S., Thaler, D., Balasubramanian, P., Eggert, L., 1386 and G. Judd, "Data Center TCP (DCTCP): TCP Congestion 1387 Control for Data Centers", RFC 8257, DOI 10.17487/RFC8257, 1388 October 2017, . 1390 [RFC8290] Hoeiland-Joergensen, T., McKenney, P., Taht, D., Gettys, 1391 J., and E. Dumazet, "The Flow Queue CoDel Packet Scheduler 1392 and Active Queue Management Algorithm", RFC 8290, 1393 DOI 10.17487/RFC8290, January 2018, 1394 . 1396 [RFC8298] Johansson, I. and Z. Sarker, "Self-Clocked Rate Adaptation 1397 for Multimedia", RFC 8298, DOI 10.17487/RFC8298, December 1398 2017, . 1400 [RFC8312] Rhee, I., Xu, L., Ha, S., Zimmermann, A., Eggert, L., and 1401 R. Scheffenegger, "CUBIC for Fast Long-Distance Networks", 1402 RFC 8312, DOI 10.17487/RFC8312, February 2018, 1403 . 1405 [SigQ-Dyn] 1406 Briscoe, B., "Rapid Signalling of Queue Dynamics", 1407 Technical Report TR-BB-2017-001 arXiv:1904.07044 [cs.NI], 1408 September 2017, . 1410 Appendix A. Example DualQ Coupled PI2 Algorithm 1412 As a first concrete example, the pseudocode below gives the DualPI2 1413 algorithm. DualPI2 follows the structure of the DualQ Coupled AQM 1414 framework in Figure 1. A simple ramp function (configured in units 1415 of queuing time) with unsmoothed ECN marking is used for the Native 1416 L4S AQM. The ramp can also be configured as a step function. The 1417 PI2 algorithm [PI2] is used for the Classic AQM. PI2 is an improved 1418 variant of the PIE AQM [RFC8033]. 1420 The pseudocode will be introduced in two passes. The first pass 1421 explains the core concepts, deferring handling of overload to the 1422 second pass. To aid comparison, line numbers are kept in step 1423 between the two passes by using letter suffixes where the longer code 1424 needs extra lines. 1426 All variables are assumed to be floating point in their basic units 1427 (size in bytes, time in seconds, rates in bytes/second, alpha and 1428 beta in Hz, and probabilities from 0 to 1. Constants expressed in k 1429 (kilo), M (mega), G (giga), u (micro), m (milli) , %, ... are assumed 1430 to be converted to their appropriate multiple or fraction to 1431 represent the basic units. A real implementation that wants to use 1432 integer values needs to handle appropriate scaling factors and allow 1433 accordingly appropriate resolution of its integer types (including 1434 temporary internal values during calculations). 1436 A full open source implementation for Linux is available at: 1437 https://github.com/L4STeam/sch_dualpi2_upstream and explained in 1438 [DualPI2Linux]. The specification of the DualQ Coupled AQM for 1439 DOCSIS cable modems and CMTSs is available in [DOCSIS3.1] and 1440 explained in [LLD]. 1442 A.1. Pass #1: Core Concepts 1444 The pseudocode manipulates three main structures of variables: the 1445 packet (pkt), the L4S queue (lq) and the Classic queue (cq). The 1446 pseudocode consists of the following six functions: 1448 o The initialization function dualpi2_params_init(...) (Figure 2) 1449 that sets parameter defaults (the API for setting non-default 1450 values is omitted for brevity) 1452 o The enqueue function dualpi2_enqueue(lq, cq, pkt) (Figure 3) 1454 o The dequeue function dualpi2_dequeue(lq, cq, pkt) (Figure 4) 1456 o The recurrence function recur(q, likelihood) for de-randomized ECN 1457 marking (shown at the end of Figure 4). 1459 o The L4S AQM function laqm(qdelay) (Figure 5) used to calculate the 1460 ECN-marking probability for the L4S queue 1462 o The base AQM function that implements the PI algorithm 1463 dualpi2_update(lq, cq) (Figure 6) used to regularly update the 1464 base probability (p'), which is squared for the Classic AQM as 1465 well as being coupled across to the L4S queue. 1467 It also uses the following functions that are not shown in full here: 1469 o scheduler(), which selects between the head packets of the two 1470 queues; the choice of scheduler technology is discussed later; 1472 o cq.len() or lq.len() returns the current length (aka. backlog) of 1473 the relevant queue in bytes; 1475 o cq.time() or lq.time() returns the current queuing delay 1476 (aka. sojourn time or service time) of the relevant queue in units 1477 of time (see Note a); 1479 o mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 1481 In experiments so far (building on experiments with PIE) on broadband 1482 access links ranging from 4 Mb/s to 200 Mb/s with base RTTs from 5 ms 1483 to 100 ms, DualPI2 achieves good results with the default parameters 1484 in Figure 2. The parameters are categorised by whether they relate 1485 to the Base PI2 AQM, the L4S AQM or the framework coupling them 1486 together. Constants and variables derived from these parameters are 1487 also included at the end of each category. Each parameter is 1488 explained as it is encountered in the walk-through of the pseudocode 1489 below. 1491 1: dualpi2_params_init(...) { % Set input parameter defaults 1492 2: % DualQ Coupled framework parameters 1493 5: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 1494 3: k = 2 % Coupling factor 1495 4: % NOT SHOWN % scheduler-dependent weight or equival't parameter 1496 6: 1497 7: % PI2 AQM parameters 1498 8: RTT_max = 100 ms % Worst case RTT expected 1499 9: RTT_typ = 15 ms % Typical RTT 1500 11: % PI2 constants derived from above PI2 parameters 1501 10: p_Cmax = min(1/k^2, 1) % Max Classic drop/mark prob 1502 12: target = RTT_typ % PI AQM Classic queue delay target 1503 13: Tupdate = min(RTT_typ, RTT_max/3) % PI sampling interval 1504 14: alpha = 0.1 * Tupdate / RTT_max^2 % PI integral gain in Hz 1505 15: beta = 0.3 / RTT_max % PI proportional gain in Hz 1506 16: 1507 17: % L4S ramp AQM parameters 1508 18: minTh = 800 us % L4S min marking threshold in time units 1509 19: range = 400 us % Range of L4S ramp in time units 1510 20: Th_len = 2 * MTU % Min L4S marking threshold in bytes 1511 21: % L4S constants incl. those derived from other parameters 1512 22: p_Lmax = 1 % Max L4S marking prob 1513 23: floor = Th_len / MIN_LINK_RATE 1514 24: if (minTh < floor) { 1515 25: % Shift ramp so minTh >= serialization time of 2 MTU 1516 26: minTh = floor 1517 27: } 1518 28: maxTh = minTh+range % L4S max marking threshold in time units 1519 29: } 1521 Figure 2: Example Header Pseudocode for DualQ Coupled PI2 AQM 1523 The overall goal of the code is to maintain the base probability (p', 1524 p-prime as in Section 2.4), which is an internal variable from which 1525 the marking and dropping probabilities for L4S and Classic traffic 1526 (p_L and p_C) are derived, with p_L in turn being derived from p_CL. 1527 The probabilities p_CL and p_C are derived in lines 4 and 5 of the 1528 dualpi2_update() function (Figure 6) then used in the 1529 dualpi2_dequeue() function where p_L is also derived from p_CL at 1530 line 6 (Figure 4). The code walk-through below builds up to 1531 explaining that part of the code eventually, but it starts from 1532 packet arrival. 1534 1: dualpi2_enqueue(lq, cq, pkt) { % Test limit and classify lq or cq 1535 2: if ( lq.len() + cq.len() + MTU > limit) 1536 3: drop(pkt) % drop packet if buffer is full 1537 4: timestamp(pkt) % attach arrival time to packet 1538 5: % Packet classifier 1539 6: if ( ecn(pkt) modulo 2 == 1 ) % ECN bits = ECT(1) or CE 1540 7: lq.enqueue(pkt) 1541 8: else % ECN bits = not-ECT or ECT(0) 1542 9: cq.enqueue(pkt) 1543 10: } 1545 Figure 3: Example Enqueue Pseudocode for DualQ Coupled PI2 AQM 1547 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 1548 2: while ( lq.len() + cq.len() > 0 ) { 1549 3: if ( scheduler() == lq ) { 1550 4: lq.dequeue(pkt) % Scheduler chooses lq 1551 5: p'_L = laqm(lq.time()) % Native L4S AQM 1552 6: p_L = max(p'_L, p_CL) % Combining function 1553 7: if ( recur(lq, p_L) ) % Linear marking 1554 8: mark(pkt) 1555 9: } else { 1556 10: cq.dequeue(pkt) % Scheduler chooses cq 1557 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 1558 12: if ( ecn(pkt) == 0 ) { % if ECN field = not-ECT 1559 13: drop(pkt) % squared drop 1560 14: continue % continue to the top of the while loop 1561 15: } 1562 16: mark(pkt) % squared mark 1563 17: } 1564 18: } 1565 19: return(pkt) % return the packet and stop 1566 20: } 1567 21: return(NULL) % no packet to dequeue 1568 22: } 1570 23: recur(q, likelihood) { % Returns TRUE with a certain likelihood 1571 24: q.count += likelihood 1572 25: if (q.count > 1) { 1573 26: q.count -= 1 1574 27: return TRUE 1575 28: } 1576 29: return FALSE 1577 30: } 1579 Figure 4: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1581 When packets arrive, first a common queue limit is checked as shown 1582 in line 2 of the enqueuing pseudocode in Figure 3. This assumes a 1583 shared buffer for the two queues (Note b discusses the merits of 1584 separate buffers). In order to avoid any bias against larger 1585 packets, 1 MTU of space is always allowed and the limit is 1586 deliberately tested before enqueue. 1588 If limit is not exceeded, the packet is timestamped in line 4. This 1589 assumes that queue delay is measured using the sojourn time technique 1590 (see Note a for alternatives). 1592 At lines 5-9, the packet is classified and enqueued to the Classic or 1593 L4S queue dependent on the least significant bit of the ECN field in 1594 the IP header (line 6). Packets with a codepoint having an LSB of 0 1595 (Not-ECT and ECT(0)) will be enqueued in the Classic queue. 1596 Otherwise, ECT(1) and CE packets will be enqueued in the L4S queue. 1597 Optional additional packet classification flexibility is omitted for 1598 brevity (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1600 The dequeue pseudocode (Figure 4) is repeatedly called whenever the 1601 lower layer is ready to forward a packet. It schedules one packet 1602 for dequeuing (or zero if the queue is empty) then returns control to 1603 the caller, so that it does not block while that packet is being 1604 forwarded. While making this dequeue decision, it also makes the 1605 necessary AQM decisions on dropping or marking. The alternative of 1606 applying the AQMs at enqueue would shift some processing from the 1607 critical time when each packet is dequeued. However, it would also 1608 add a whole queue of delay to the control signals, making the control 1609 loop sloppier (for a typical RTT it would double the Classic queue's 1610 feedback delay). 1612 All the dequeue code is contained within a large while loop so that 1613 if it decides to drop a packet, it will continue until it selects a 1614 packet to schedule. Line 3 of the dequeue pseudocode is where the 1615 scheduler chooses between the L4S queue (lq) and the Classic queue 1616 (cq). Detailed implementation of the scheduler is not shown (see 1617 discussion later). 1619 o If an L4S packet is scheduled, in lines 7 and 8 the packet is ECN- 1620 marked with likelihood p_L. The recur() function at the end of 1621 Figure 4 is used, which is preferred over random marking because 1622 it avoids delay due to randomization when interpreting congestion 1623 signals, but it still desynchronizes the saw-teeth of the flows. 1624 Line 6 calculates p_L as the maximum of the coupled L4S 1625 probability p_CL and the probability from the native L4S AQM p'_L. 1626 This implements the max() function shown in Figure 1 to couple the 1627 outputs of the two AQMs together. Of the two probabilities input 1628 to p_L in line 6: 1630 * p'_L is calculated per packet in line 5 by the laqm() function 1631 (see Figure 5), 1633 * Whereas p_CL is maintained by the dualpi2_update() function 1634 which runs every Tupdate (Tupdate is set in line 13 of 1635 Figure 2. It defaults to 16 ms in the reference Linux 1636 implementation because it has to be rounded to a multiple of 4 1637 ms). 1639 o If a Classic packet is scheduled, lines 10 to 17 drop or mark the 1640 packet with probability p_C. 1642 The Native L4S AQM algorithm (Figure 5) is a ramp function, similar 1643 to the RED algorithm, but simplified as follows: 1645 o The extent of the ramp is defined in units of queuing delay, not 1646 bytes, so that configuration remains invariant as the queue 1647 departure rate varies. 1649 o It uses instantaneous queueing delay, which avoids the complexity 1650 of smoothing, but also avoids embedding a worst-case RTT of 1651 smoothing delay in the network (see Section 2.1). 1653 o The ramp rises linearly directly from 0 to 1, not to an 1654 intermediate value of p'_L as RED would, because there is no need 1655 to keep ECN marking probability low. 1657 o Marking does not have to be randomized. Determinism is used 1658 instead of randomness; to reduce the delay necessary to smooth out 1659 the noise of randomness from the signal. 1661 The ramp function requires two configuration parameters, the minimum 1662 threshold (minTh) and the width of the ramp (range), both in units of 1663 queuing time), as shown in lines 18 & 19 of the initialization 1664 function in Figure 2. The ramp function can be configured as a step 1665 (see Note c). 1667 Although the DCTCP paper [Alizadeh-stability] recommends an ECN 1668 marking threshold of 0.17*RTT_typ, it also shows that the threshold 1669 can be much shallower with hardly any worse under-utilization of the 1670 link (because the amplitude of DCTCP's sawteeth is so small). Based 1671 on extensive experiments, for the public Internet the default minimum 1672 ECN marking threshold in Figure 2 is considered a good compromise, 1673 even though it is significantly smaller fraction of RTT_typ. 1675 A minimum marking threshold parameter (Th_len) in transmission units 1676 (default 2 MTU) is also necessary to ensure that the ramp does not 1677 trigger excessive marking on slow links. The code in lines 24-27 of 1678 the initialization function (Figure 2) converts 2 MTU into time units 1679 and shifts the ramp so that the min threshold is no shallower than 1680 this floor. 1682 1: laqm(qdelay) { % Returns native L4S AQM probability 1683 2: if (qdelay >= maxTh) 1684 3: return 1 1685 4: else if (qdelay > minTh) 1686 5: return (qdelay - minTh)/range % Divide could use a bit-shift 1687 6: else 1688 7: return 0 1689 8: } 1691 Figure 5: Example Pseudocode for the Native L4S AQM 1693 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 1694 2: curq = cq.time() % use queuing time of first-in Classic packet 1695 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 1696 4: p_CL = k * p' % Coupled L4S prob = base prob * coupling factor 1697 5: p_C = p'^2 % Classic prob = (base prob)^2 1698 6: prevq = curq 1699 7: } 1701 (Clamping p' within the range [0,1] omitted for clarity - see text) 1703 Figure 6: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1705 The coupled marking probability, p_CL depends on the base probability 1706 (p'), which is kept up to date by the core PI algorithm in Figure 6 1707 executed every Tupdate. 1709 Note that p' solely depends on the queuing time in the Classic queue. 1710 In line 2, the current queuing delay (curq) is evaluated from how 1711 long the head packet was in the Classic queue (cq). The function 1712 cq.time() (not shown) subtracts the time stamped at enqueue from the 1713 current time (see Note a) and implicitly takes the current queuing 1714 delay as 0 if the queue is empty. 1716 The algorithm centres on line 3, which is a classical Proportional- 1717 Integral (PI) controller that alters p' dependent on: a) the error 1718 between the current queuing delay (curq) and the target queuing delay 1719 ('target' - see [RFC8033]); and b) the change in queuing delay since 1720 the last sample. The name 'PI' represents the fact that the second 1721 factor (how fast the queue is growing) is _P_roportional to load 1722 while the first is the _I_ntegral of the load (so it removes any 1723 standing queue in excess of the target). 1725 The two 'gain factors' in line 3, alpha and beta, respectively weight 1726 how strongly each of these elements ((a) and (b)) alters p'. They 1727 are in units of 'per second of delay' or Hz, because they transform 1728 differences in queueing delay into changes in probability (assuming 1729 probability has a value from 0 to 1). 1731 alpha and beta determine how much p' ought to change after each 1732 update interval (Tupdate). For smaller Tupdate, p' should change by 1733 the same amount per second, but in finer more frequent steps. So 1734 alpha depends on Tupdate (see line 14 of the initialization function 1735 in Figure 2). It is best to update p' as frequently as possible, but 1736 Tupdate will probably be constrained by hardware performance. As 1737 shown in line 13, the update interval should be at least as frequent 1738 as once per the RTT of a typical flow (RTT_typ) as long as it does 1739 not exceed roughly RTT_max/3. For link rates from 4 - 200 Mb/s, a 1740 target RTT of 15ms and a maximum RTT of 100ms, it has been verified 1741 through extensive testing that Tupdate=16ms (as recommended in 1742 [RFC8033]) is sufficient. 1744 The choice of alpha and beta also determines the AQM's stable 1745 operating range. The AQM ought to change p' as fast as possible in 1746 response to changes in load without over-compensating and therefore 1747 causing oscillations in the queue. Therefore, the values of alpha 1748 and beta also depend on the RTT of the expected worst-case flow 1749 (RTT_max). 1751 Recommended derivations of the gain constants alpha and beta can be 1752 approximated for Reno over a PI2 AQM as: alpha = 0.1 * Tupdate / 1753 RTT_max^2; beta = 0.3 / RTT_max, as shown in lines 14 & 15 of 1754 Figure 2. These are derived from the stability analysis in [PI2]. 1755 For the default values of Tupdate=16 ms and RTT_max = 100 ms, they 1756 result in alpha = 0.16; beta = 3.2 (discrepancies are due to 1757 rounding). These defaults have been verified with a wide range of 1758 link rates, target delays and a range of traffic models with mixed 1759 and similar RTTs, short and long flows, etc. 1761 In corner cases, p' can overflow the range [0,1] so the resulting 1762 value of p' has to be bounded (omitted from the pseudocode). Then, 1763 as already explained, the coupled and Classic probabilities are 1764 derived from the new p' in lines 4 and 5 of Figure 6 as p_CL = k*p' 1765 and p_C = p'^2. 1767 Because the coupled L4S marking probability (p_CL) is factored up by 1768 k, the dynamic gain parameters alpha and beta are also inherently 1769 factored up by k for the L4S queue. So, the effective gain factor 1770 for the L4S queue is k*alpha (with defaults alpha = 0.16 Hz and k=2, 1771 effective L4S alpha = 0.32 Hz). 1773 Unlike in PIE [RFC8033], alpha and beta do not need to be tuned every 1774 Tupdate dependent on p'. Instead, in PI2, alpha and beta are 1775 independent of p' because the squaring applied to Classic traffic 1776 tunes them inherently. This is explained in [PI2], which also 1777 explains why this more principled approach removes the need for most 1778 of the heuristics that had to be added to PIE. 1780 Nonetheless, an implementer might wish to add selected heuristics to 1781 either AQM. For instance the Linux reference DualPI2 implementation 1782 includes the following: 1784 o Prior to enqueuing an L4S packet, if the L queue contains <2 1785 packets, the packet is flagged to suppress any native L4S AQM 1786 marking at dequeue (which depends on sojourn time); 1788 o Classic and coupled marking or dropping (i.e. based on p_C and 1789 p_CL from the PI controller) is only applied to a packet if the 1790 respective queue length in bytes is > 2 MTU (prior to enqueuing 1791 the packet or after dequeuing it, depending on whether the AQM is 1792 configured to be applied at enqueue or dequeue); 1794 o In the WRR scheduler, the 'credit' indicating which queue should 1795 transmit is only changed if there are packets in both queues 1796 (i.e. if there is actual resource contention). This means that a 1797 properly paced L flow might never be delayed by the WRR. The WRR 1798 credit is reset in favour of the L queue when the link is idle. 1800 An implementer might also wish to add other heuristics, e.g. burst 1801 protection [RFC8033] or enhanced burst protection [RFC8034]. 1803 Notes: 1805 a. The drain rate of the queue can vary if it is scheduled relative 1806 to other queues, or to cater for fluctuations in a wireless 1807 medium. To auto-adjust to changes in drain rate, the queue needs 1808 to be measured in time, not bytes or packets [AQMmetrics], 1809 [CoDel]. Queuing delay could be measured directly by storing a 1810 per-packet time-stamp as each packet is enqueued, and subtracting 1811 this from the system time when the packet is dequeued. If time- 1812 stamping is not easy to introduce with certain hardware, queuing 1813 delay could be predicted indirectly by dividing the size of the 1814 queue by the predicted departure rate, which might be known 1815 precisely for some link technologies (see for example [RFC8034]). 1817 b. Line 2 of the dualpi2_enqueue() function (Figure 3) assumes an 1818 implementation where lq and cq share common buffer memory. An 1819 alternative implementation could use separate buffers for each 1820 queue, in which case the arriving packet would have to be 1821 classified first to determine which buffer to check for available 1822 space. The choice is a trade off; a shared buffer can use less 1823 memory whereas separate buffers isolate the L4S queue from tail- 1824 drop due to large bursts of Classic traffic (e.g. a Classic Reno 1825 TCP during slow-start over a long RTT). 1827 c. There has been some concern that using the step function of DCTCP 1828 for the Native L4S AQM requires end-systems to smooth the signal 1829 for an unnecessarily large number of round trips to ensure 1830 sufficient fidelity. A ramp is no worse than a step in initial 1831 experiments with existing DCTCP. Therefore, it is recommended 1832 that a ramp is configured in place of a step, which will allow 1833 congestion control algorithms to investigate faster smoothing 1834 algorithms. 1836 A ramp is more general that a step, because an operator can 1837 effectively turn the ramp into a step function, as used by DCTCP, 1838 by setting the range to zero. There will not be a divide by zero 1839 problem at line 5 of Figure 5 because, if minTh is equal to 1840 maxTh, the condition for this ramp calculation cannot arise. 1842 A.2. Pass #2: Overload Details 1844 Figure 7 repeats the dequeue function of Figure 4, but with overload 1845 details added. Similarly Figure 8 repeats the core PI algorithm of 1846 Figure 6 with overload details added. The initialization, enqueue, 1847 L4S AQM and recur functions are unchanged. 1849 In line 10 of the initialization function (Figure 2), the maximum 1850 Classic drop probability p_Cmax = min(1/k^2, 1) or 1/4 for the 1851 default coupling factor k=2. p_Cmax is the point at which it is 1852 deemed that the Classic queue has become persistently overloaded, so 1853 it switches to using drop, even for ECN-capable packets. ECT packets 1854 that are not dropped can still be ECN-marked. 1856 In practice, 25% has been found to be a good threshold to preserve 1857 fairness between ECN capable and non ECN capable traffic. This 1858 protects the queues against both temporary overload from responsive 1859 flows and more persistent overload from any unresponsive traffic that 1860 falsely claims to be responsive to ECN. 1862 When the Classic ECN marking probability reaches the p_Cmax threshold 1863 (1/k^2), the marking probability coupled to the L4S queue, p_CL will 1864 always be 100% for any k (by equation (1) in Section 2). So, for 1865 readability, the constant p_Lmax is defined as 1 in line 22 of the 1866 initialization function (Figure 2). This is intended to ensure that 1867 the L4S queue starts to introduce dropping once ECN-marking saturates 1868 at 100% and can rise no further. The 'Prague L4S' 1869 requirements [I-D.ietf-tsvwg-ecn-l4s-id] state that, when an L4S 1870 congestion control detects a drop, it falls back to a response that 1871 coexists with 'Classic' Reno congestion control. So it is correct 1872 that, when the L4S queue drops packets, it drops them proportional to 1873 p'^2, as if they are Classic packets. 1875 Both these switch-overs are triggered by the tests for overload 1876 introduced in lines 4b and 12b of the dequeue function (Figure 7). 1877 Lines 8c to 8g drop L4S packets with probability p'^2. Lines 8h to 1878 8i mark the remaining packets with probability p_CL. Given p_Lmax = 1879 1, all remaining packets will be marked because, to have reached the 1880 else block at line 8b, p_CL >= 1. 1882 Lines 2c to 2d in the core PI algorithm (Figure 8) deal with overload 1883 of the L4S queue when there is no Classic traffic. This is 1884 necessary, because the core PI algorithm maintains the appropriate 1885 drop probability to regulate overload, but it depends on the length 1886 of the Classic queue. If there is no Classic queue the naive PI 1887 update function in Figure 6 would drop nothing, even if the L4S queue 1888 were overloaded - so tail drop would have to take over (lines 2 and 3 1889 of Figure 3). 1891 Instead, the test at line 2a of the full PI update function in 1892 Figure 8 keeps delay on target using drop. If the test at line 2a of 1893 Figure 8 finds that the Classic queue is empty, line 2d measures the 1894 current queue delay using the L4S queue instead. While the L4S queue 1895 is not overloaded, its delay will always be tiny compared to the 1896 target Classic queue delay. So p_CL will be driven to zero, and the 1897 L4S queue will naturally be governed solely by p'_L from the native 1898 L4S AQM (lines 5 and 6 of the dequeue algorithm in Figure 7). But, 1899 if unresponsive L4S source(s) cause overload, the DualQ transitions 1900 smoothly to L4S marking based on the PI algorithm. If overload 1901 increases further, it naturally transitions from marking to dropping 1902 by the switch-over mechanism already described. 1904 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 1905 2: while ( lq.len() + cq.len() > 0 ) { 1906 3: if ( scheduler() == lq ) { 1907 4a: lq.dequeue(pkt) % L4S scheduled 1908 4b: if ( p_CL < p_Lmax ) { % Check for overload saturation 1909 5: p'_L = laqm(lq.time()) % Native L4S AQM 1910 6: p_L = max(p'_L, p_CL) % Combining function 1911 7: if ( recur(lq, p_L) ) % Linear marking 1912 8a: mark(pkt) 1913 8b: } else { % overload saturation 1914 8c: if ( recur(lq, p_C) ) { % probability p_C = p'^2 1915 8e: drop(pkt) % revert to Classic drop due to overload 1916 8f: continue % continue to the top of the while loop 1917 8g: } 1918 8h: if ( recur(lq, p_CL) ) % probability p_CL = k * p' 1919 8i: mark(pkt) % linear marking of remaining packets 1920 8j: } 1921 9: } else { 1922 10: cq.dequeue(pkt) % Classic scheduled 1923 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 1924 12a: if ( (ecn(pkt) == 0) % ECN field = not-ECT 1925 12b: OR (p_C >= p_Cmax) ) { % Overload disables ECN 1926 13: drop(pkt) % squared drop, redo loop 1927 14: continue % continue to the top of the while loop 1928 15: } 1929 16: mark(pkt) % squared mark 1930 17: } 1931 18: } 1932 19: return(pkt) % return the packet and stop 1933 20: } 1934 21: return(NULL) % no packet to dequeue 1935 22: } 1937 Figure 7: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1938 (Including Overload Code) 1940 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 1941 2a: if ( cq.len() > 0 ) 1942 2b: curq = cq.time() %use queuing time of first-in Classic packet 1943 2c: else % Classic queue empty 1944 2d: curq = lq.time() % use queuing time of first-in L4S packet 1945 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 1946 4: p_CL = p' * k % Coupled L4S prob = base prob * coupling factor 1947 5: p_C = p'^2 % Classic prob = (base prob)^2 1948 6: prevq = curq 1949 7: } 1951 Figure 8: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1952 (Including Overload Code) 1954 The choice of scheduler technology is critical to overload protection 1955 (see Section 4.1). 1957 o A well-understood weighted scheduler such as weighted round robin 1958 (WRR) is recommended. As long as the scheduler weight for Classic 1959 is small (e.g. 1/16), its exact value is unimportant because it 1960 does not normally determine capacity shares. The weight is only 1961 important to prevent unresponsive L4S traffic starving Classic 1962 traffic. This is because capacity sharing between the queues is 1963 normally determined by the coupled congestion signal, which 1964 overrides the scheduler, by making L4S sources leave roughly equal 1965 per-flow capacity available for Classic flows. 1967 o Alternatively, a time-shifted FIFO (TS-FIFO) could be used. It 1968 works by selecting the head packet that has waited the longest, 1969 biased against the Classic traffic by a time-shift of tshift. To 1970 implement time-shifted FIFO, the scheduler() function in line 3 of 1971 the dequeue code would simply be implemented as the scheduler() 1972 function at the bottom of Figure 10 in Appendix B. For the public 1973 Internet a good value for tshift is 50ms. For private networks 1974 with smaller diameter, about 4*target would be reasonable. TS- 1975 FIFO is a very simple scheduler, but complexity might need to be 1976 added to address some deficiencies (which is why it is not 1977 recommended over WRR): 1979 * TS-FIFO does not fully isolate latency in the L4S queue from 1980 uncontrolled bursts in the Classic queue; 1982 * TS-FIFO is only appropriate if time-stamping of packets is 1983 feasible; 1985 * Even if time-stamping is supported, the sojourn time of the 1986 head packet is always stale. For instance, if a burst arrives 1987 at an empty queue, the sojourn time will only measure the delay 1988 of the burst once the burst is over, even though the queue knew 1989 about it from the start. At the cost of more operations and 1990 more storage, a 'scaled sojourn time' metric of queue delay can 1991 be used, which is the sojourn time of a packet scaled by the 1992 ratio of the queue sizes when the packet departed and 1993 arrived [SigQ-Dyn]. 1995 o A strict priority scheduler would be inappropriate, because it 1996 would starve Classic if L4S was overloaded. 1998 Appendix B. Example DualQ Coupled Curvy RED Algorithm 2000 As another example of a DualQ Coupled AQM algorithm, the pseudocode 2001 below gives the Curvy RED based algorithm. Although the AQM was 2002 designed to be efficient in integer arithmetic, to aid understanding 2003 it is first given using floating point arithmetic (Figure 10). Then, 2004 one possible optimization for integer arithmetic is given, also in 2005 pseudocode (Figure 11). To aid comparison, the line numbers are kept 2006 in step between the two by using letter suffixes where the longer 2007 code needs extra lines. 2009 B.1. Curvy RED in Pseudocode 2011 The pseudocode manipulates three main structures of variables: the 2012 packet (pkt), the L4S queue (lq) and the Classic queue (cq) and 2013 consists of the following five functions: 2015 o The initialization function cred_params_init(...) (Figure 2) that 2016 sets parameter defaults (the API for setting non-default values is 2017 omitted for brevity); 2019 o The dequeue function cred_dequeue(lq, cq, pkt) (Figure 4); 2021 o The scheduling function scheduler(), which selects between the 2022 head packets of the two queues. 2024 It also uses the following functions that are either shown elsewhere, 2025 or not shown in full here: 2027 o The enqueue function, which is identical to that used for DualPI2, 2028 dualpi2_enqueue(lq, cq, pkt) in Figure 3; 2030 o mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 2032 o cq.len() or lq.len() returns the current length (aka. backlog) of 2033 the relevant queue in bytes; 2035 o cq.time() or lq.time() returns the current queuing delay 2036 (aka. sojourn time or service time) of the relevant queue in units 2037 of time (see Note a in Appendix A.1). 2039 Because Curvy RED was evaluated before DualPI2, certain improvements 2040 introduced for DualPI2 were not evaluated for Curvy RED. In the 2041 pseudocode below, the straightforward improvements have been added on 2042 the assumption they will provide similar benefits, but that has not 2043 been proven experimentally. They are: i) a conditional priority 2044 scheduler instead of strict priority ii) a time-based threshold for 2045 the native L4S AQM; iii) ECN support for the Classic AQM. A recent 2046 evaluation has proved that a minimum ECN-marking threshold (minTh) 2047 greatly improves performance, so this is also included in the 2048 pseudocode. 2050 Overload protection has not been added to the Curvy RED pseudocode 2051 below so as not to detract from the main features. It would be added 2052 in exactly the same way as in Appendix A.2 for the DualPI2 2053 pseudocode. The native L4S AQM uses a step threshold, but a ramp 2054 like that described for DualPI2 could be used instead. The scheduler 2055 uses the simple TS-FIFO algorithm, but it could be replaced with WRR. 2057 The Curvy RED algorithm has not been maintained or evaluated to the 2058 same degree as the DualPI2 algorithm. In initial experiments on 2059 broadband access links ranging from 4 Mb/s to 200 Mb/s with base RTTs 2060 from 5 ms to 100 ms, Curvy RED achieved good results with the default 2061 parameters in Figure 9. 2063 The parameters are categorised by whether they relate to the Classic 2064 AQM, the L4S AQM or the framework coupling them together. Constants 2065 and variables derived from these parameters are also included at the 2066 end of each category. These are the raw input parameters for the 2067 algorithm. A configuration front-end could accept more meaningful 2068 parameters (e.g. RTT_max and RTT_typ) and convert them into these raw 2069 parameters, as has been done for DualPI2 in Appendix A. Where 2070 necessary, parameters are explained further in the walk-through of 2071 the pseudocode below. 2073 1: cred_params_init(...) { % Set input parameter defaults 2074 2: % DualQ Coupled framework parameters 2075 3: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 2076 4: k' = 1 % Coupling factor as a power of 2 2077 5: tshift = 50 ms % Time shift of TS-FIFO scheduler 2078 6: % Constants derived from Classic AQM parameters 2079 7: k = 2^k' % Coupling factor from Equation (1) 2080 6: 2081 7: % Classic AQM parameters 2082 8: g_C = 5 % EWMA smoothing parameter as a power of 1/2 2083 9: S_C = -1 % Classic ramp scaling factor as a power of 2 2084 10: minTh = 500 ms % No Classic drop/mark below this queue delay 2085 11: % Constants derived from Classic AQM parameters 2086 12: gamma = 2^(-g_C) % EWMA smoothing parameter 2087 13: range_C = 2^S_C % Range of Classic ramp 2088 14: 2089 15: % L4S AQM parameters 2090 16: T = 1 ms % Queue delay threshold for native L4S AQM 2091 17: % Constants derived from above parameters 2092 18: S_L = S_C - k' % L4S ramp scaling factor as a power of 2 2093 19: range_L = 2^S_L % Range of L4S ramp 2094 20: } 2096 Figure 9: Example Header Pseudocode for DualQ Coupled Curvy RED AQM 2098 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2099 2: while ( lq.len() + cq.len() > 0 ) { 2100 3: if ( scheduler() == lq ) { 2101 4: lq.dequeue(pkt) % L4S scheduled 2102 5a: p_CL = (Q_C - minTh) / range_L 2103 5b: if ( ( lq.time() > T ) 2104 5c: OR ( p_CL > maxrand(U) ) ) 2105 6: mark(pkt) 2106 7: } else { 2107 8: cq.dequeue(pkt) % Classic scheduled 2108 9a: Q_C = gamma * cq.time() + (1-gamma) * Q_C % Classic Q EWMA 2109 10a: sqrt_p_C = (Q_C - minTh) / range_C 2110 10b: if ( sqrt_p_C > maxrand(2*U) ) { 2111 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2112 12: drop(pkt) % Squared drop, redo loop 2113 13: continue % continue to the top of the while loop 2114 14: } 2115 15: mark(pkt) 2116 16: } 2117 17: } 2118 18: return(pkt) % return the packet and stop here 2119 19: } 2120 20: return(NULL) % no packet to dequeue 2121 21: } 2123 22: maxrand(u) { % return the max of u random numbers 2124 23: maxr=0 2125 24: while (u-- > 0) 2126 25: maxr = max(maxr, rand()) % 0 <= rand() < 1 2127 26: return(maxr) 2128 27: } 2130 28: scheduler() { 2131 29: if ( lq.time() + tshift >= cq.time() ) 2132 30: return lq; 2133 31: else 2134 32: return cq; 2135 33: } 2137 Figure 10: Example Dequeue Pseudocode for DualQ Coupled Curvy RED AQM 2139 The dequeue pseudocode (Figure 10) is repeatedly called whenever the 2140 lower layer is ready to forward a packet. It schedules one packet 2141 for dequeuing (or zero if the queue is empty) then returns control to 2142 the caller, so that it does not block while that packet is being 2143 forwarded. While making this dequeue decision, it also makes the 2144 necessary AQM decisions on dropping or marking. The alternative of 2145 applying the AQMs at enqueue would shift some processing from the 2146 critical time when each packet is dequeued. However, it would also 2147 add a whole queue of delay to the control signals, making the control 2148 loop very sloppy. 2150 The code is written assuming the AQMs are applied on dequeue (Note 2151 1). All the dequeue code is contained within a large while loop so 2152 that if it decides to drop a packet, it will continue until it 2153 selects a packet to schedule. If both queues are empty, the routine 2154 returns NULL at line 20. Line 3 of the dequeue pseudocode is where 2155 the conditional priority scheduler chooses between the L4S queue (lq) 2156 and the Classic queue (cq). The time-shifted FIFO scheduler is shown 2157 at lines 28-33, which would be suitable if simplicity is paramount 2158 (see Note 2). 2160 Within each queue, the decision whether to forward, drop or mark is 2161 taken as follows (to simplify the explanation, it is assumed that 2162 U=1): 2164 L4S: If the test at line 3 determines there is an L4S packet to 2165 dequeue, the tests at lines 5b and 5c determine whether to mark 2166 it. The first is a simple test of whether the L4S queue delay 2167 (lq.time()) is greater than a step threshold T (Note 3). The 2168 second test is similar to the random ECN marking in RED, but with 2169 the following differences: i) marking depends on queuing time, not 2170 bytes, in order to scale for any link rate without being 2171 reconfigured; ii) marking of the L4S queue depends on a logical OR 2172 of two tests; one against its own queuing time and one against the 2173 queuing time of the _other_ (Classic) queue; iii) the tests are 2174 against the instantaneous queuing time of the L4S queue, but a 2175 smoothed average of the other (Classic) queue; iv) the queue is 2176 compared with the maximum of U random numbers (but if U=1, this is 2177 the same as the single random number used in RED). 2179 Specifically, in line 5a the coupled marking probability p_CL is 2180 set to the amount by which the averaged Classic queueing delay Q_C 2181 exceeds the minimum queuing delay threshold (minTh) all divided by 2182 the L4S scaling parameter range_L. range_L represents the queuing 2183 delay (in seconds) added to minTh at which marking probability 2184 would hit 100%. Then in line 5c (if U=1) the result is compared 2185 with a uniformly distributed random number between 0 and 1, which 2186 ensures that, over range_L, marking probability will linearly 2187 increase with queueing time. 2189 Classic: If the scheduler at line 3 chooses to dequeue a Classic 2190 packet and jumps to line 7, the test at line 10b determines 2191 whether to drop or mark it. But before that, line 9a updates Q_C, 2192 which is an exponentially weighted moving average (Note 4) of the 2193 queuing time of the Classic queue, where cq.time() is the current 2194 instantaneous queueing time of the packet at the head of the 2195 Classic queue (zero if empty) and gamma is the EWMA constant 2196 (default 1/32, see line 12 of the initialization function). 2198 Lines 10a and 10b implement the Classic AQM. In line 10a the 2199 averaged queuing time Q_C is divided by the Classic scaling 2200 parameter range_C, in the same way that queuing time was scaled 2201 for L4S marking. This scaled queuing time will be squared to 2202 compute Classic drop probability so, before it is squared, it is 2203 effectively the square root of the drop probability, hence it is 2204 given the variable name sqrt_p_C. The squaring is done by 2205 comparing it with the maximum out of two random numbers (assuming 2206 U=1). Comparing it with the maximum out of two is the same as the 2207 logical `AND' of two tests, which ensures drop probability rises 2208 with the square of queuing time. 2210 The AQM functions in each queue (lines 5c & 10b) are two cases of a 2211 new generalization of RED called Curvy RED, motivated as follows. 2212 When the performance of this AQM was compared with FQ-CoDel and PIE, 2213 their goal of holding queuing delay to a fixed target seemed 2214 misguided [CRED_Insights]. As the number of flows increases, if the 2215 AQM does not allow host congestion controllers to increase queuing 2216 delay, it has to introduce abnormally high levels of loss. Then loss 2217 rather than queuing becomes the dominant cause of delay for short 2218 flows, due to timeouts and tail losses. 2220 Curvy RED constrains delay with a softened target that allows some 2221 increase in delay as load increases. This is achieved by increasing 2222 drop probability on a convex curve relative to queue growth (the 2223 square curve in the Classic queue, if U=1). Like RED, the curve hugs 2224 the zero axis while the queue is shallow. Then, as load increases, 2225 it introduces a growing barrier to higher delay. But, unlike RED, it 2226 requires only two parameters, not three. The disadvantage of Curvy 2227 RED (compared to a PI controller for example) is that it is not 2228 adapted to a wide range of RTTs. Curvy RED can be used as is when 2229 the RTT range to be supported is limited, otherwise an adaptation 2230 mechanism is required. 2232 From our limited experiments with Curvy RED so far, recommended 2233 values of these parameters are: S_C = -1; g_C = 5; T = 5 * MTU at the 2234 link rate (about 1ms at 60Mb/s) for the range of base RTTs typical on 2235 the public Internet. [CRED_Insights] explains why these parameters 2236 are applicable whatever rate link this AQM implementation is deployed 2237 on and how the parameters would need to be adjusted for a scenario 2238 with a different range of RTTs (e.g. a data centre). The setting of 2239 k depends on policy (see Section 2.5 and Appendix C.2 respectively 2240 for its recommended setting and guidance on alternatives). 2242 There is also a cUrviness parameter, U, which is a small positive 2243 integer. It is likely to take the same hard-coded value for all 2244 implementations, once experiments have determined a good value. Only 2245 U=1 has been used in experiments so far, but results might be even 2246 better with U=2 or higher. 2248 Notes: 2250 1. The alternative of applying the AQMs at enqueue would shift some 2251 processing from the critical time when each packet is dequeued. 2252 However, it would also add a whole queue of delay to the control 2253 signals, making the control loop sloppier (for a typical RTT it 2254 would double the Classic queue's feedback delay). On a platform 2255 where packet timestamping is feasible, e.g. Linux, it is also 2256 easiest to apply the AQMs at dequeue because that is where 2257 queuing time is also measured. 2259 2. WRR better isolates the L4S queue from large delay bursts in the 2260 Classic queue, but it is slightly less simple than TS-FIFO. If 2261 WRR were used, a low default Classic weight (e.g. 1/16) would 2262 need to be configured in place of the time shift in line 5 of the 2263 initialization function (Figure 9). 2265 3. A step function is shown for simplicity. A ramp function (see 2266 Figure 5 and the discussion around it in Appendix A.1) is 2267 recommended, because it is more general than a step and has the 2268 potential to enable L4S congestion controls to converge more 2269 rapidly. 2271 4. An EWMA is only one possible way to filter bursts; other more 2272 adaptive smoothing methods could be valid and it might be 2273 appropriate to decrease the EWMA faster than it increases, 2274 e.g. by using the minimum of the smoothed and instantaneous queue 2275 delays, min(Q_C, qc.time()). 2277 B.2. Efficient Implementation of Curvy RED 2279 Although code optimization depends on the platform, the following 2280 notes explain where the design of Curvy RED was particularly 2281 motivated by efficient implementation. 2283 The Classic AQM at line 10b calls maxrand(2*U), which gives twice as 2284 much curviness as the call to maxrand(U) in the marking function at 2285 line 5c. This is the trick that implements the square rule in 2286 equation (1) (Section 2.1). This is based on the fact that, given a 2287 number X from 1 to 6, the probability that two dice throws will both 2288 be less than X is the square of the probability that one throw will 2289 be less than X. So, when U=1, the L4S marking function is linear and 2290 the Classic dropping function is squared. If U=2, L4S would be a 2291 square function and Classic would be quartic. And so on. 2293 The maxrand(u) function in lines 16-21 simply generates u random 2294 numbers and returns the maximum. Typically, maxrand(u) could be run 2295 in parallel out of band. For instance, if U=1, the Classic queue 2296 would require the maximum of two random numbers. So, instead of 2297 calling maxrand(2*U) in-band, the maximum of every pair of values 2298 from a pseudorandom number generator could be generated out-of-band, 2299 and held in a buffer ready for the Classic queue to consume. 2301 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2302 2: while ( lq.len() + cq.len() > 0 ) { 2303 3: if ( scheduler() == lq ) { 2304 4: lq.dequeue(pkt) % L4S scheduled 2305 5: if ((lq.time() > T) OR (Q_C >> (S_L-2) > maxrand(U))) 2306 6: mark(pkt) 2307 7: } else { 2308 8: cq.dequeue(pkt) % Classic scheduled 2309 9: Q_C += (qc.ns() - Q_C) >> g_C % Classic Q EWMA 2310 10: if ( (Q_C >> (S_C-2) ) > maxrand(2*U) ) { 2311 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2312 12: drop(pkt) % Squared drop, redo loop 2313 13: continue % continue to the top of the while loop 2314 14: } 2315 15: mark(pkt) 2316 16: } 2317 17: } 2318 18: return(pkt) % return the packet and stop here 2319 19: } 2320 20: return(NULL) % no packet to dequeue 2321 21: } 2323 Figure 11: Optimised Example Dequeue Pseudocode for Coupled DualQ AQM 2324 using Integer Arithmetic 2326 The two ranges, range_L and range_C are expressed as powers of 2 so 2327 that division can be implemented as a right bit-shift (>>) in lines 5 2328 and 10 of the integer variant of the pseudocode (Figure 11). 2330 For the integer variant of the pseudocode, an integer version of the 2331 rand() function used at line 25 of the maxrand(function) in Figure 10 2332 would be arranged to return an integer in the range 0 <= maxrand() < 2333 2^32 (not shown). This would scale up all the floating point 2334 probabilities in the range [0,1] by 2^32. 2336 Queuing delays are also scaled up by 2^32, but in two stages: i) In 2337 line 9 queuing time qc.ns() is returned in integer nanoseconds, 2338 making the value about 2^30 times larger than when the units were 2339 seconds, ii) then in lines 5 and 10 an adjustment of -2 to the right 2340 bit-shift multiplies the result by 2^2, to complete the scaling by 2341 2^32. 2343 In line 8 of the initialization function, the EWMA constant gamma is 2344 represented as an integer power of 2, g_C, so that in line 9 of the 2345 integer code the division needed to weight the moving average can be 2346 implemented by a right bit-shift (>> g_C). 2348 Appendix C. Choice of Coupling Factor, k 2350 C.1. RTT-Dependence 2352 Where Classic flows compete for the same capacity, their relative 2353 flow rates depend not only on the congestion probability, but also on 2354 their end-to-end RTT (= base RTT + queue delay). The rates of 2355 competing Reno [RFC5681] flows are roughly inversely proportional to 2356 their RTTs. Cubic exhibits similar RTT-dependence when in Reno- 2357 compatibility mode, but is less RTT-dependent otherwise. 2359 Until the early experiments with the DualQ Coupled AQM, the 2360 importance of the reasonably large Classic queue in mitigating RTT- 2361 dependence had not been appreciated. Appendix A.1.6 of 2362 [I-D.ietf-tsvwg-ecn-l4s-id] uses numerical examples to explain why 2363 bloated buffers had concealed the RTT-dependence of Classic 2364 congestion controls before that time. Then it explains why, the more 2365 that queuing delays have reduced, the more that RTT-dependence has 2366 surfaced as a potential starvation problem for long RTT flows. 2368 Given that congestion control on end-systems is voluntary, there is 2369 no reason why it has to be voluntarily RTT-dependent. Therefore 2370 [I-D.ietf-tsvwg-ecn-l4s-id] requires L4S congestion controls to be 2371 significantly less RTT-dependent than the standard Reno congestion 2372 control [RFC5681]. Following this approach means there is no need 2373 for network devices to address RTT-dependence, although there would 2374 be no harm if they did, which per-flow queuing inherently does. 2376 At the time of writing, the range of approaches to RTT-dependence in 2377 L4S congestion controls has not settled. Therefore, the guidance on 2378 the choice of the coupling factor in Appendix C.2 is given against 2379 DCTCP [RFC8257], which has well-understood RTT-dependence. The 2380 guidance is given for various RTT ratios, so that it can be adapted 2381 to future circumstances. 2383 C.2. Guidance on Controlling Throughput Equivalence 2385 +---------------+------+-------+ 2386 | RTT_C / RTT_L | Reno | Cubic | 2387 +---------------+------+-------+ 2388 | 1 | k'=1 | k'=0 | 2389 | 2 | k'=2 | k'=1 | 2390 | 3 | k'=2 | k'=2 | 2391 | 4 | k'=3 | k'=2 | 2392 | 5 | k'=3 | k'=3 | 2393 +---------------+------+-------+ 2395 Table 1: Value of k' for which DCTCP throughput is roughly the same 2396 as Reno or Cubic, for some example RTT ratios 2398 In the above appendices that give example DualQ Coupled algorithms, 2399 to aid efficient implementation, a coupling factor that is an integer 2400 power of 2 is always used. k' is always used to denote the power. k' 2401 is related to the coupling factor k in Equation (1) (Section 2.1) by 2402 k=2^k'. 2404 To determine the appropriate coupling factor policy, the operator 2405 first has to judge whether it wants DCTCP flows to have roughly equal 2406 throughput with Reno or with Cubic (because, even in its Reno- 2407 compatibility mode, Cubic is about 1.4 times more aggressive than 2408 Reno). Then the operator needs to decide at what ratio of RTTs it 2409 wants DCTCP and Classic flows to have roughly equal throughput. For 2410 example choosing k'=0 (equivalent to k=1) will make DCTCP throughput 2411 roughly the same as Cubic, _if their RTTs are the same_. 2413 However, even if the base RTTs are the same, the actual RTTs are 2414 unlikely to be the same, because Classic (Cubic or Reno) traffic 2415 needs roughly a typical base round trip of queue to avoid under- 2416 utilization and excess drop. Whereas L4S (DCTCP) does not. The 2417 operator might still choose this policy if it judges that DCTCP 2418 throughput should be rewarded for keeping its own queue short. 2420 On the other hand, the operator will choose one of the higher values 2421 for k', if it wants to slow DCTCP down to roughly the same throughput 2422 as Classic flows, to compensate for Classic flows slowing themselves 2423 down by causing themselves extra queuing delay. 2425 The values for k' in the table are derived from the formulae below, 2426 which were developed in [DCttH15]: 2428 2^k' = 1.64 (RTT_reno / RTT_dc) (5) 2429 2^k' = 1.19 (RTT_cubic / RTT_dc ) (6) 2431 For localized traffic from a particular ISP's data centre, using the 2432 measured RTTs, it was calculated that a value of k'=3 (equivalent to 2433 k=8) would achieve throughput equivalence, and experiments verified 2434 the formula very closely. 2436 For a typical mix of RTTs from local data centres and across the 2437 general Internet, a value of k'=1 (equivalent to k=2) is recommended 2438 as a good workable compromise. 2440 Authors' Addresses 2442 Koen De Schepper 2443 Nokia Bell Labs 2444 Antwerp 2445 Belgium 2447 Email: koen.de_schepper@nokia.com 2448 URI: https://www.bell-labs.com/usr/koen.de_schepper 2450 Bob Briscoe (editor) 2451 Independent 2452 UK 2454 Email: ietf@bobbriscoe.net 2455 URI: http://bobbriscoe.net/ 2457 Greg White 2458 CableLabs 2459 Louisville, CO 2460 US 2462 Email: G.White@CableLabs.com