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