idnits 2.17.1 draft-ietf-tsvwg-aqm-dualq-coupled-18.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: ---------------------------------------------------------------------------- == There are 4 instances of lines with non-ascii characters in the document. 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 (25 October 2021) is 914 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 2521 -- Looks like a reference, but probably isn't: '1' on line 2521 == Outdated reference: A later version (-29) exists of draft-ietf-tsvwg-ecn-l4s-id-19 == Outdated reference: A later version (-02) exists of draft-cardwell-iccrg-bbr-congestion-control-00 == Outdated reference: A later version (-07) exists of draft-briscoe-docsis-q-protection-00 == Outdated reference: A later version (-03) exists of draft-briscoe-iccrg-prague-congestion-control-00 == Outdated reference: A later version (-02) exists of draft-cardwell-iccrg-bbr-congestion-control-00 -- Duplicate reference: draft-cardwell-iccrg-bbr-congestion-control, mentioned in 'I-D.cardwell-iccrg-bbr-congestion-control', was also mentioned in 'BBRv1'. == Outdated reference: A later version (-20) exists of draft-ietf-tsvwg-l4s-arch-10 -- 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 (~~), 8 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Transport Area working group (tsvwg) K. De Schepper 3 Internet-Draft Nokia Bell Labs 4 Intended status: Experimental B. Briscoe, Ed. 5 Expires: 28 April 2022 Independent 6 G. White 7 CableLabs 8 25 October 2021 10 DualQ Coupled AQMs for Low Latency, Low Loss and Scalable Throughput 11 (L4S) 12 draft-ietf-tsvwg-aqm-dualq-coupled-18 14 Abstract 16 This specification defines a framework for coupling the Active Queue 17 Management (AQM) algorithms in two queues intended for flows with 18 different responses to congestion. This provides a way for the 19 Internet to transition from the scaling problems of standard TCP 20 Reno-friendly ('Classic') congestion controls to the family of 21 'Scalable' congestion controls. These achieve consistently very Low 22 queuing Latency, very Low congestion Loss and Scaling of per-flow 23 throughput (L4S) by using Explicit Congestion Notification (ECN) in a 24 modified way. Until the Coupled DualQ, these L4S senders could only 25 be deployed where a clean-slate environment could be arranged, such 26 as in private data centres. The coupling acts like a semi-permeable 27 membrane: isolating the sub-millisecond average queuing delay and 28 zero congestion loss of L4S from Classic latency and loss; but 29 pooling the capacity between any combination of Scalable and Classic 30 flows with roughly equivalent throughput per flow. The DualQ 31 achieves this indirectly, without having to inspect transport layer 32 flow identifiers and without compromising the performance of the 33 Classic traffic. The solution has low complexity and requires no 34 configuration for the public Internet. 36 Status of This Memo 38 This Internet-Draft is submitted in full conformance with the 39 provisions of BCP 78 and BCP 79. 41 Internet-Drafts are working documents of the Internet Engineering 42 Task Force (IETF). Note that other groups may also distribute 43 working documents as Internet-Drafts. The list of current Internet- 44 Drafts is at https://datatracker.ietf.org/drafts/current/. 46 Internet-Drafts are draft documents valid for a maximum of six months 47 and may be updated, replaced, or obsoleted by other documents at any 48 time. It is inappropriate to use Internet-Drafts as reference 49 material or to cite them other than as "work in progress." 51 This Internet-Draft will expire on 28 April 2022. 53 Copyright Notice 55 Copyright (c) 2021 IETF Trust and the persons identified as the 56 document authors. All rights reserved. 58 This document is subject to BCP 78 and the IETF Trust's Legal 59 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 60 license-info) in effect on the date of publication of this document. 61 Please review these documents carefully, as they describe your rights 62 and restrictions with respect to this document. Code Components 63 extracted from this document must include Simplified BSD License text 64 as described in Section 4.e of the Trust Legal Provisions and are 65 provided without warranty as described in the Simplified BSD License. 67 Table of Contents 69 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 70 1.1. Outline of the Problem . . . . . . . . . . . . . . . . . 3 71 1.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . 5 72 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 7 73 1.4. Features . . . . . . . . . . . . . . . . . . . . . . . . 9 74 2. DualQ Coupled AQM . . . . . . . . . . . . . . . . . . . . . . 11 75 2.1. Coupled AQM . . . . . . . . . . . . . . . . . . . . . . . 11 76 2.2. Dual Queue . . . . . . . . . . . . . . . . . . . . . . . 12 77 2.3. Traffic Classification . . . . . . . . . . . . . . . . . 12 78 2.4. Overall DualQ Coupled AQM Structure . . . . . . . . . . . 13 79 2.5. Normative Requirements for a DualQ Coupled AQM . . . . . 17 80 2.5.1. Functional Requirements . . . . . . . . . . . . . . . 17 81 2.5.1.1. Requirements in Unexpected Cases . . . . . . . . 18 82 2.5.2. Management Requirements . . . . . . . . . . . . . . . 19 83 2.5.2.1. Configuration . . . . . . . . . . . . . . . . . . 19 84 2.5.2.2. Monitoring . . . . . . . . . . . . . . . . . . . 21 85 2.5.2.3. Anomaly Detection . . . . . . . . . . . . . . . . 21 86 2.5.2.4. Deployment, Coexistence and Scaling . . . . . . . 22 87 3. IANA Considerations (to be removed by RFC Editor) . . . . . . 22 88 4. Security Considerations . . . . . . . . . . . . . . . . . . . 22 89 4.1. Overload Handling . . . . . . . . . . . . . . . . . . . . 22 90 4.1.1. Avoiding Classic Starvation: Sacrifice L4S Throughput 91 or Delay? . . . . . . . . . . . . . . . . . . . . . . 23 92 4.1.2. Congestion Signal Saturation: Introduce L4S Drop or 93 Delay? . . . . . . . . . . . . . . . . . . . . . . . 24 95 4.1.3. Protecting against Unresponsive ECN-Capable 96 Traffic . . . . . . . . . . . . . . . . . . . . . . . 25 97 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26 98 6. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 26 99 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 100 7.1. Normative References . . . . . . . . . . . . . . . . . . 26 101 7.2. Informative References . . . . . . . . . . . . . . . . . 27 102 Appendix A. Example DualQ Coupled PI2 Algorithm . . . . . . . . 33 103 A.1. Pass #1: Core Concepts . . . . . . . . . . . . . . . . . 33 104 A.2. Pass #2: Overload Details . . . . . . . . . . . . . . . . 44 105 Appendix B. Example DualQ Coupled Curvy RED Algorithm . . . . . 48 106 B.1. Curvy RED in Pseudocode . . . . . . . . . . . . . . . . . 48 107 B.2. Efficient Implementation of Curvy RED . . . . . . . . . . 54 108 Appendix C. Choice of Coupling Factor, k . . . . . . . . . . . . 56 109 C.1. RTT-Dependence . . . . . . . . . . . . . . . . . . . . . 56 110 C.2. Guidance on Controlling Throughput Equivalence . . . . . 57 111 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 60 113 1. Introduction 115 This document specifies a framework for DualQ Coupled AQMs, which is 116 the network part of the L4S architecture [I-D.ietf-tsvwg-l4s-arch]. 117 L4S enables both very low queuing latency (sub-millisecond on 118 average) and high throughput at the same time, for ad hoc numbers of 119 capacity-seeking applications all sharing the same capacity. 121 1.1. Outline of the Problem 123 Latency is becoming the critical performance factor for many (most?) 124 applications on the public Internet, e.g. interactive Web, Web 125 services, voice, conversational video, interactive video, interactive 126 remote presence, instant messaging, online gaming, remote desktop, 127 cloud-based applications, and video-assisted remote control of 128 machinery and industrial processes. In the developed world, further 129 increases in access network bit-rate offer diminishing returns, 130 whereas latency is still a multi-faceted problem. In the last decade 131 or so, much has been done to reduce propagation time by placing 132 caches or servers closer to users. However, queuing remains a major 133 intermittent component of latency. 135 Traditionally very low latency has only been available for a few 136 selected low rate applications, that confine their sending rate 137 within a specially carved-off portion of capacity, which is 138 prioritized over other traffic, e.g. Diffserv EF [RFC3246]. Up to 139 now it has not been possible to allow any number of low latency, high 140 throughput applications to seek to fully utilize available capacity, 141 because the capacity-seeking process itself causes too much queuing 142 delay. 144 To reduce this queuing delay caused by the capacity seeking process, 145 changes either to the network alone or to end-systems alone are in 146 progress. L4S involves a recognition that both approaches are 147 yielding diminishing returns: 149 * Recent state-of-the-art active queue management (AQM) in the 150 network, e.g. FQ-CoDel [RFC8290], PIE [RFC8033], Adaptive 151 RED [ARED01] ) has reduced queuing delay for all traffic, not just 152 a select few applications. However, no matter how good the AQM, 153 the capacity-seeking (sawtoothing) rate of TCP-like congestion 154 controls represents a lower limit that will either cause queuing 155 delay to vary or cause the link to be under-utilized. These AQMs 156 are tuned to allow a typical capacity-seeking Reno-friendly flow 157 to induce an average queue that roughly doubles the base RTT, 158 adding 5-15 ms of queuing on average (cf. 500 microseconds with 159 L4S for the same mix of long-running and web traffic). However, 160 for many applications low delay is not useful unless it is 161 consistently low. With these AQMs, 99th percentile queuing delay 162 is 20-30 ms (cf. 2 ms with the same traffic over L4S). 164 * Similarly, recent research into using e2e congestion control 165 without needing an AQM in the network (e.g.BBR [BBRv1], 166 [I-D.cardwell-iccrg-bbr-congestion-control]) seems to have hit a 167 similar lower limit to queuing delay of about 20ms on average (and 168 any additional BBRv1 flow adds another 20ms of queuing) but there 169 are also regular 25ms delay spikes due to bandwidth probes and 170 60ms spikes due to flow-starts. 172 L4S learns from the experience of Data Center TCP [RFC8257], which 173 shows the power of complementary changes both in the network and on 174 end-systems. DCTCP teaches us that two small but radical changes to 175 congestion control are needed to cut the two major outstanding causes 176 of queuing delay variability: 178 1. Far smaller rate variations (sawteeth) than Reno-friendly 179 congestion controls; 181 2. A shift of smoothing and hence smoothing delay from network to 182 sender. 184 Without the former, a 'Classic' (e.g. Reno-friendly) flow's round 185 trip time (RTT) varies between roughly 1 and 2 times the base RTT 186 between the machines in question. Without the latter a 'Classic' 187 flow's response to changing events is delayed by a worst-case 188 (transcontinental) RTT, which could be hundreds of times the actual 189 smoothing delay needed for the RTT of typical traffic from localized 190 CDNs. 192 These changes are the two main features of the family of so-called 193 'Scalable' congestion controls (which includes DCTCP, TCP Prague and 194 SCReAM). Both these changes only reduce delay in combination with a 195 complementary change in the network and they are both only feasible 196 with ECN, not drop, for the signalling: 198 1. The smaller sawteeth allow an extremely shallow ECN packet- 199 marking threshold in the queue. 201 2. And no smoothing in the network means that every fluctuation of 202 the queue is signalled immediately. 204 Without ECN, either of these would lead to very high loss levels. 205 But, with ECN, the resulting high marking levels are just signals, 206 not impairments. BBRv2 combines the best of both worlds - it works 207 as a scalable congestion control when ECN is available, but also aims 208 to minimize delay when it isn't. 210 However, until now, Scalable congestion controls (like DCTCP) did not 211 co-exist well in a shared ECN-capable queue with existing ECN-capable 212 TCP Reno [RFC5681] or Cubic [RFC8312] congestion controls --- 213 Scalable controls are so aggressive that these 'Classic' algorithms 214 would drive themselves to a small capacity share. Therefore, until 215 now, L4S controls could only be deployed where a clean-slate 216 environment could be arranged, such as in private data centres (hence 217 the name DCTCP). 219 This document specifies a `DualQ Coupled AQM' extension that solves 220 the problem of coexistence between Scalable and Classic flows, 221 without having to inspect flow identifiers. It is not like flow- 222 queuing approaches [RFC8290] that classify packets by flow identifier 223 into separate queues in order to isolate sparse flows from the higher 224 latency in the queues assigned to heavier flows. If a flow needs 225 both low delay and high throughput, having a queue to itself does not 226 isolate it from the harm it causes to itself. In contrast, DualQ 227 Coupled AQMs address the root cause of the latency problem --- they 228 are an enabler for the smooth low latency scalable behaviour of 229 Scalable congestion controls, so that every packet in every flow can 230 potentially enjoy very low latency, then there would be no need to 231 isolate each flow into a separate queue. 233 1.2. Scope 235 L4S involves complementary changes in the network and on end-systems: 237 Network: A DualQ Coupled AQM (defined in the present document) or a 238 modification to flow-queue AQMs (described in section 4.2.b of 239 [I-D.ietf-tsvwg-l4s-arch]); 241 End-system: A Scalable congestion control (defined in section 4 of 242 [I-D.ietf-tsvwg-ecn-l4s-id]). 244 Packet identifier: The network and end-system parts of L4S can be 245 deployed incrementally, because they both identify L4S packets 246 using the experimentally assigned explicit congestion notification 247 (ECN) codepoints in the IP header: ECT(1) and CE [RFC8311] 248 [I-D.ietf-tsvwg-ecn-l4s-id]. 250 Data Center TCP (DCTCP [RFC8257]) is an example of a Scalable 251 congestion control for controlled environments that has been deployed 252 for some time in Linux, Windows and FreeBSD operating systems. 253 During the progress of this document through the IETF a number of 254 other Scalable congestion controls were implemented, e.g. TCP 255 Prague [I-D.briscoe-iccrg-prague-congestion-control] [PragueLinux], 256 BBRv2 [BBRv2], QUIC Prague and the L4S variant of SCREAM for real- 257 time media [RFC8298]. 259 The focus of this specification is to enable deployment of the 260 network part of the L4S service. Then, without any management 261 intervention, applications can exploit this new network capability as 262 their operating systems migrate to Scalable congestion controls, 263 which can then evolve _while_ their benefits are being enjoyed by 264 everyone on the Internet. 266 The DualQ Coupled AQM framework can incorporate any AQM designed for 267 a single queue that generates a statistical or deterministic mark/ 268 drop probability driven by the queue dynamics. Pseudocode examples 269 of two different DualQ Coupled AQMs are given in the appendices. In 270 many cases the framework simplifies the basic control algorithm, and 271 requires little extra processing. Therefore it is believed the 272 Coupled AQM would be applicable and easy to deploy in all types of 273 buffers; buffers in cost-reduced mass-market residential equipment; 274 buffers in end-system stacks; buffers in carrier-scale equipment 275 including remote access servers, routers, firewalls and Ethernet 276 switches; buffers in network interface cards, buffers in virtualized 277 network appliances, hypervisors, and so on. 279 For the public Internet, nearly all the benefit will typically be 280 achieved by deploying the Coupled AQM into either end of the access 281 link between a 'site' and the Internet, which is invariably the 282 bottleneck (see section 6.4 of[I-D.ietf-tsvwg-l4s-arch] about 283 deployment, which also defines the term 'site' to mean a home, an 284 office, a campus or mobile user equipment). 286 Latency is not the only concern of L4S: 288 * The "Low Loss" part of the name denotes that L4S generally 289 achieves zero congestion loss (which would otherwise cause 290 retransmission delays), due to its use of ECN. 292 * The "Scalable throughput" part of the name denotes that the per- 293 flow throughput of Scalable congestion controls should scale 294 indefinitely, avoiding the imminent scaling problems with 'TCP- 295 Friendly' congestion control algorithms [RFC3649]. 297 The former is clearly in scope of this AQM document. However, the 298 latter is an outcome of the end-system behaviour, and therefore 299 outside the scope of this AQM document, even though the AQM is an 300 enabler. 302 The overall L4S architecture [I-D.ietf-tsvwg-l4s-arch] gives more 303 detail, including on wider deployment aspects such as backwards 304 compatibility of Scalable congestion controls in bottlenecks where a 305 DualQ Coupled AQM has not been deployed. The supporting papers 306 [DualPI2Linux], [PI2], [DCttH19] and [PI2param] give the full 307 rationale for the AQM's design, both discursively and in more precise 308 mathematical form, as well as the results of performance evaluations. 310 1.3. Terminology 312 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 313 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 314 document are to be interpreted as described in [RFC2119] when, and 315 only when, they appear in all capitals, as shown here. 317 The DualQ Coupled AQM uses two queues for two services. Each of the 318 following terms identifies both the service and the queue that 319 provides the service: 321 Classic service/queue: The Classic service is intended for all the 322 congestion control behaviours that co-exist with Reno [RFC5681] 323 (e.g. Reno itself, Cubic [RFC8312], TFRC [RFC5348]). 325 Low-Latency, Low-Loss Scalable throughput (L4S) service/queue: The 326 'L4S' service is intended for traffic from scalable congestion 327 control algorithms, such as TCP Prague 328 [I-D.briscoe-iccrg-prague-congestion-control], which was derived 329 from Data Center TCP [RFC8257]. The L4S service is for more 330 general traffic than just TCP Prague--it allows the set of 331 congestion controls with similar scaling properties to Prague to 332 evolve, such as the examples listed earlier (Relentless, SCReAM, 333 etc.). 335 Classic Congestion Control: A congestion control behaviour that can 336 co-exist with standard TCP Reno [RFC5681] without causing 337 significantly negative impact on its flow rate [RFC5033]. With 338 Classic congestion controls, such as Reno or Cubic, because flow 339 rate has scaled since TCP congestion control was first designed in 340 1988, it now takes hundreds of round trips (and growing) to 341 recover after a congestion signal (whether a loss or an ECN mark) 342 as shown in the examples in section 5.1 of 343 [I-D.ietf-tsvwg-l4s-arch] and in [RFC3649]. Therefore control of 344 queuing and utilization becomes very slack, and the slightest 345 disturbances (e.g. from new flows starting) prevent a high rate 346 from being attained. 348 Scalable Congestion Control: A congestion control where the average 349 time from one congestion signal to the next (the recovery time) 350 remains invariant as the flow rate scales, all other factors being 351 equal. This maintains the same degree of control over queueing 352 and utilization whatever the flow rate, as well as ensuring that 353 high throughput is robust to disturbances. For instance, DCTCP 354 averages 2 congestion signals per round-trip whatever the flow 355 rate, as do other recently developed scalable congestion controls, 356 e.g. Relentless TCP [Mathis09], TCP Prague 357 [I-D.briscoe-iccrg-prague-congestion-control], [PragueLinux], 358 BBRv2 [BBRv2] and the L4S variant of SCREAM for real-time 359 media [SCReAM], [RFC8298]). For the public Internet a Scalable 360 transport has to comply with the requirements in Section 4 of 361 [I-D.ietf-tsvwg-ecn-l4s-id] (aka. the 'Prague L4S requirements'). 363 C: Abbreviation for Classic, e.g. when used as a subscript. 365 L: Abbreviation for L4S, e.g. when used as a subscript. 367 The terms Classic or L4S can also qualify other nouns, such as 368 'codepoint', 'identifier', 'classification', 'packet', 'flow'. 369 For example: an L4S packet means a packet with an L4S identifier 370 sent from an L4S congestion control. 372 Both Classic and L4S services can cope with a proportion of 373 unresponsive or less-responsive traffic as well, but in the L4S 374 case its rate has to be smooth enough or low enough not to build a 375 queue (e.g. DNS, VoIP, game sync datagrams, etc). The DualQ 376 Coupled AQM behaviour is defined to be similar to a single FIFO 377 queue with respect to unresponsive and overload traffic. 379 Reno-friendly: The subset of Classic traffic that is friendly to the 380 standard Reno congestion control defined for TCP in [RFC5681]. 381 Reno-friendly is used in place of 'TCP-friendly', given the latter 382 has become imprecise, because the TCP protocol is now used with so 383 many different congestion control behaviours, and Reno is used in 384 non-TCP transports such as QUIC. 386 Classic ECN: The original Explicit Congestion Notification (ECN) 387 protocol [RFC3168], which requires ECN signals to be treated the 388 same as drops, both when generated in the network and when 389 responded to by the sender. 391 For L4S, the names used for the four codepoints of the 2-bit IP- 392 ECN field are unchanged from those defined in [RFC3168]: Not ECT, 393 ECT(0), ECT(1) and CE, where ECT stands for ECN-Capable Transport 394 and CE stands for Congestion Experienced. A packet marked with 395 the CE codepoint is termed 'ECN-marked' or sometimes just 'marked' 396 where the context makes ECN obvious. 398 1.4. Features 400 The AQM couples marking and/or dropping from the Classic queue to the 401 L4S queue in such a way that a flow will get roughly the same 402 throughput whichever it uses. Therefore both queues can feed into 403 the full capacity of a link and no rates need to be configured for 404 the queues. The L4S queue enables Scalable congestion controls like 405 DCTCP or TCP Prague to give very low and predictably low latency, 406 without compromising the performance of competing 'Classic' Internet 407 traffic. 409 Thousands of tests have been conducted in a typical fixed residential 410 broadband setting. Experiments used a range of base round trip 411 delays up to 100ms and link rates up to 200 Mb/s between the data 412 centre and home network, with varying amounts of background traffic 413 in both queues. For every L4S packet, the AQM kept the average 414 queuing delay below 1ms (or 2 packets where serialization delay 415 exceeded 1ms on slower links), with 99th percentile no worse than 416 2ms. No losses at all were introduced by the L4S AQM. Details of 417 the extensive experiments are available [DualPI2Linux], [PI2], 418 [DCttH19]. 420 In all these experiments, the host was connected to the home network 421 by fixed Ethernet, in order to quantify the queuing delay that can be 422 achieved by a user who cares about delay. It should be emphasized 423 that L4S support at the bottleneck link cannot 'undelay' bursts 424 introduced by another link on the path, for instance by legacy WiFi 425 equipment. However, if L4S support is added to the queue feeding the 426 _outgoing_ WAN link of a home gateway, it would be counterproductive 427 not to also reduce the burstiness of the _incoming_ WiFi. Also, 428 trials of WiFi equipment with an L4S DualQ Coupled AQM on the 429 _outgoing_ WiFi interface are in progress, and early results of an 430 L4S DualQ Coupled AQM in a 5G radio access network testbed with 431 emulated outdoor cell edge radio fading are given in [L4S_5G]. 433 Subjective testing has also been conducted by multiple people all 434 simultaneously using very demanding high bandwidth low latency 435 applications over a single shared access link [L4Sdemo16]. In one 436 application, each user could use finger gestures to pan or zoom their 437 own high definition (HD) sub-window of a larger video scene generated 438 on the fly in 'the cloud' from a football match. Another user 439 wearing VR goggles was remotely receiving a feed from a 360-degree 440 camera in a racing car, again with the sub-window in their field of 441 vision generated on the fly in 'the cloud' dependent on their head 442 movements. Even though other users were also downloading large 443 amounts of L4S and Classic data, playing a gaming benchmark and 444 watchings videos over the same 40Mb/s downstream broadband link, 445 latency was so low that the football picture appeared to stick to the 446 user's finger on the touch pad and the experience fed from the remote 447 camera did not noticeably lag head movements. All the L4S data (even 448 including the downloads) achieved the same very low latency. With an 449 alternative AQM, the video noticeably lagged behind the finger 450 gestures and head movements. 452 Unlike Diffserv Expedited Forwarding, the L4S queue does not have to 453 be limited to a small proportion of the link capacity in order to 454 achieve low delay. The L4S queue can be filled with a heavy load of 455 capacity-seeking flows (TCP Prague etc.) and still achieve low delay. 456 The L4S queue does not rely on the presence of other traffic in the 457 Classic queue that can be 'overtaken'. It gives low latency to L4S 458 traffic whether or not there is Classic traffic. The tail latency of 459 traffic served by the Classic AQM is sometimes a little better 460 sometimes a little worse, when a proportion of the traffic is L4S. 462 The two queues are only necessary because: 464 * the large variations (sawteeth) of Classic flows need roughly a 465 base RTT of queuing delay to ensure full utilization 467 * Scalable flows do not need a queue to keep utilization high, but 468 they cannot keep latency predictably low if they are mixed with 469 Classic traffic, 471 The L4S queue has latency priority within sub-round trip timescales, 472 but over longer periods the coupling from the Classic to the L4S AQM 473 (explained below) ensures that it does not have bandwidth priority 474 over the Classic queue. 476 2. DualQ Coupled AQM 478 There are two main aspects to the approach: 480 * The Coupled AQM that addresses throughput equivalence between 481 Classic (e.g. Reno, Cubic) flows and L4S flows (that satisfy the 482 Prague L4S requirements). 484 * The Dual Queue structure that provides latency separation for L4S 485 flows to isolate them from the typically large Classic queue. 487 2.1. Coupled AQM 489 In the 1990s, the `TCP formula' was derived for the relationship 490 between the steady-state congestion window, cwnd, and the drop 491 probability, p of standard Reno congestion control [RFC5681]. To a 492 first order approximation, the steady-state cwnd of Reno is inversely 493 proportional to the square root of p. 495 The design focuses on Reno as the worst case, because if it does no 496 harm to Reno, it will not harm Cubic or any traffic designed to be 497 friendly to Reno. TCP Cubic implements a Reno-compatibility mode, 498 which is relevant for typical RTTs under 20ms as long as the 499 throughput of a single flow is less than about 350Mb/s. In such 500 cases it can be assumed that Cubic traffic behaves similarly to Reno. 501 The term 'Classic' will be used for the collection of Reno-friendly 502 traffic including Cubic and potentially other experimental congestion 503 controls intended not to significantly impact the flow rate of Reno. 505 A supporting paper [PI2] includes the derivation of the equivalent 506 rate equation for DCTCP, for which cwnd is inversely proportional to 507 p (not the square root), where in this case p is the ECN marking 508 probability. DCTCP is not the only congestion control that behaves 509 like this, so the term 'Scalable' will be used for all similar 510 congestion control behaviours (see examples in Section 1.2). The 511 term 'L4S' is used for traffic driven by a Scalable congestion 512 control that also complies with the additional 'Prague L4S' 513 requirements [I-D.ietf-tsvwg-ecn-l4s-id]. 515 For safe co-existence, under stationary conditions, a Scalable flow 516 has to run at roughly the same rate as a Reno TCP flow (all other 517 factors being equal). So the drop or marking probability for Classic 518 traffic, p_C has to be distinct from the marking probability for L4S 519 traffic, p_L. The original ECN specification [RFC3168] required 520 these probabilities to be the same, but [RFC8311] updates RFC 3168 to 521 enable experiments in which these probabilities are different. 523 Also, to remain stable, Classic sources need the network to smooth 524 p_C so it changes relatively slowly. It is hard for a network node 525 to know the RTTs of all the flows, so a Classic AQM adds a _worst- 526 case_ RTT of smoothing delay (about 100-200 ms). In contrast, L4S 527 shifts responsibility for smoothing ECN feedback to the sender, which 528 only delays its response by its _own_ RTT, as well as allowing a more 529 immediate response if necessary. 531 The Coupled AQM achieves safe coexistence by making the Classic drop 532 probability p_C proportional to the square of the coupled L4S 533 probability p_CL. p_CL is an input to the instantaneous L4S marking 534 probability p_L but it changes as slowly as p_C. This makes the Reno 535 flow rate roughly equal the DCTCP flow rate, because the squaring of 536 p_CL counterbalances the square root of p_C in the 'TCP formula' of 537 Classic Reno congestion control. 539 Stating this as a formula, the relation between Classic drop 540 probability, p_C, and the coupled L4S probability p_CL needs to take 541 the form: 543 p_C = ( p_CL / k )^2 (1) 545 where k is the constant of proportionality, which is termed the 546 coupling factor. 548 2.2. Dual Queue 550 Classic traffic needs to build a large queue to prevent under- 551 utilization. Therefore a separate queue is provided for L4S traffic, 552 and it is scheduled with priority over the Classic queue. Priority 553 is conditional to prevent starvation of Classic traffic. 555 Nonetheless, coupled marking ensures that giving priority to L4S 556 traffic still leaves the right amount of spare scheduling time for 557 Classic flows to each get equivalent throughput to DCTCP flows (all 558 other factors such as RTT being equal). 560 2.3. Traffic Classification 562 Both the Coupled AQM and DualQ mechanisms need an identifier to 563 distinguish L4S (L) and Classic (C) packets. Then the coupling 564 algorithm can achieve coexistence without having to inspect flow 565 identifiers, because it can apply the appropriate marking or dropping 566 probability to all flows of each type. A separate 567 specification [I-D.ietf-tsvwg-ecn-l4s-id] requires the network to 568 treat the ECT(1) and CE codepoints of the ECN field as this 569 identifier. An additional process document has proved necessary to 570 make the ECT(1) codepoint available for experimentation [RFC8311]. 572 For policy reasons, an operator might choose to steer certain packets 573 (e.g. from certain flows or with certain addresses) out of the L 574 queue, even though they identify themselves as L4S by their ECN 575 codepoints. In such cases, [I-D.ietf-tsvwg-ecn-l4s-id] says that the 576 device "MUST NOT alter the end-to-end L4S ECN identifier", so that it 577 is preserved end-to-end. The aim is that each operator can choose 578 how it treats L4S traffic locally, but an individual operator does 579 not alter the identification of L4S packets, which would prevent 580 other operators downstream from making their own choices on how to 581 treat L4S traffic. 583 In addition, an operator could use other identifiers to classify 584 certain additional packet types into the L queue that it deems will 585 not risk harm to the L4S service. For instance addresses of specific 586 applications or hosts; specific Diffserv codepoints such as EF 587 (Expedited Forwarding), Voice-Admit or the Non-Queue-Building (NQB) 588 per-hop behaviour; or certain protocols (e.g. ARP, DNS) (see 589 Section 5.4.1 of [I-D.ietf-tsvwg-ecn-l4s-id]). Note that the 590 mechanism only reads these identifiers. [I-D.ietf-tsvwg-ecn-l4s-id] 591 says it "MUST NOT alter these non-ECN identifiers". Thus, the L 592 queue is not solely an L4S queue, it can be considered more generally 593 as a low latency queue. 595 2.4. Overall DualQ Coupled AQM Structure 597 Figure 1 shows the overall structure that any DualQ Coupled AQM is 598 likely to have. This schematic is intended to aid understanding of 599 the current designs of DualQ Coupled AQMs. However, it is not 600 intended to preclude other innovative ways of satisfying the 601 normative requirements in Section 2.5 that minimally define a DualQ 602 Coupled AQM. Also, the schematic only illustrates operation under 603 normally expected circumstances; behaviour under overload or with 604 operator-specific classifiers is deferred to Section 2.5.1.1. 606 The classifier on the left separates incoming traffic between the two 607 queues (L and C). Each queue has its own AQM that determines the 608 likelihood of marking or dropping (p_L and p_C). It has been 609 proved [PI2] that it is preferable to control load with a linear 610 controller, then square the output before applying it as a drop 611 probability to Reno-friendly traffic (because Reno congestion control 612 decreases its load proportional to the square-root of the increase in 613 drop). So, the AQM for Classic traffic needs to be implemented in 614 two stages: i) a base stage that outputs an internal probability p' 615 (pronounced p-prime); and ii) a squaring stage that outputs p_C, 616 where 618 p_C = (p')^2. (2) 620 Substituting for p_C in Eqn (1) gives: 622 p' = p_CL / k 624 So the slow-moving input to ECN marking in the L queue (the coupled 625 L4S probability) is: 627 p_CL = k*p'. (3) 629 The actual ECN marking probability p_L that is applied to the L queue 630 needs to track the immediate L queue delay under L-only congestion 631 conditions, as well as track p_CL under coupled congestion 632 conditions. So the L queue uses a native AQM that calculates a 633 probability p'_L as a function of the instantaneous L queue delay. 634 And, given the L queue has conditional priority over the C queue, 635 whenever the L queue grows, the AQM ought to apply marking 636 probability p'_L, but p_L ought not to fall below p_CL. This 637 suggests: 639 p_L = max(p'_L, p_CL), (4) 641 which has also been found to work very well in practice. 643 The two transformations of p' in equations (2) and (3) implement the 644 required coupling given in equation (1) earlier. 646 The constant of proportionality or coupling factor, k, in equation 647 (1) determines the ratio between the congestion probabilities (loss 648 or marking) experienced by L4S and Classic traffic. Thus k 649 indirectly determines the ratio between L4S and Classic flow rates, 650 because flows (assuming they are responsive) adjust their rate in 651 response to congestion probability. Appendix C.2 gives guidance on 652 the choice of k and its effect on relative flow rates. 654 _________ 655 | | ,------. 656 L4S (L) queue | |===>| ECN | 657 ,'| _______|_| |marker|\ 658 <' | | `------'\\ 659 //`' v ^ p_L \\ 660 // ,-------. | \\ 661 // |Native |p'_L | \\,. 662 // | L4S |--->(MAX) < | ___ 663 ,----------.// | AQM | ^ p_CL `\|.'Cond-`. 664 | IP-ECN |/ `-------' | / itional \ 665 ==>|Classifier| ,-------. (k*p') [ priority]==> 666 | |\ | Base | | \scheduler/ 667 `----------'\\ | AQM |---->: ,'|`-.___.-' 668 \\ | |p' | <' | 669 \\ `-------' (p'^2) //`' 670 \\ ^ | // 671 \\,. | v p_C // 672 < | _________ .------.// 673 `\| | | | Drop |/ 674 Classic (C) |queue |===>|/mark | 675 __|______| `------' 677 Figure 1: DualQ Coupled AQM Schematic 679 Legend: ===> traffic flow; ---> control dependency. 681 After the AQMs have applied their dropping or marking, the scheduler 682 forwards their packets to the link. Even though the scheduler gives 683 priority to the L queue, it is not as strong as the coupling from the 684 C queue. This is because, as the C queue grows, the base AQM applies 685 more congestion signals to L traffic (as well as C). As L flows 686 reduce their rate in response, they use less than the scheduling 687 share for L traffic. So, because the scheduler is work preserving, 688 it schedules any C traffic in the gaps. 690 Giving priority to the L queue has the benefit of very low L queue 691 delay, because the L queue is kept empty whenever L traffic is 692 controlled by the coupling. Also there only has to be a coupling in 693 one direction - from Classic to L4S. Priority has to be conditional 694 in some way to prevent the C queue starving under overload conditions 695 (see Section 4.1). With normal responsive traffic simple strict 696 priority would work, but it would make new Classic traffic wait until 697 its queue activated the coupling and L4S flows had in turn reduced 698 their rate enough to drain the L queue so that Classic traffic could 699 be scheduled. Giving a small weight or limited waiting time for C 700 traffic improves response times for short Classic messages, such as 701 DNS requests and improves Classic flow startup because immediate 702 capacity is available. 704 Example DualQ Coupled AQM algorithms called DualPI2 and Curvy RED are 705 given in Appendix A and Appendix B. Either example AQM can be used 706 to couple packet marking and dropping across a dual Q. 708 DualPI2 uses a Proportional-Integral (PI) controller as the Base AQM. 709 Indeed, this Base AQM with just the squared output and no L4S queue 710 can be used as a drop-in replacement for PIE [RFC8033], in which case 711 it is just called PI2 [PI2]. PI2 is a principled simplification of 712 PIE that is both more responsive and more stable in the face of 713 dynamically varying load. 715 Curvy RED is derived from RED [RFC2309], but its configuration 716 parameters are insensitive to link rate and it requires less 717 operations per packet. However, DualPI2 is more responsive and 718 stable over a wider range of RTTs than Curvy RED. As a consequence, 719 at the time of writing, DualPI2 has attracted more development and 720 evaluation attention than Curvy RED, leaving the Curvy RED design 721 incomplete and not so fully evaluated. 723 Both AQMs regulate their queue in units of time rather than bytes. 724 As already explained, this ensures configuration can be invariant for 725 different drain rates. With AQMs in a dualQ structure this is 726 particularly important because the drain rate of each queue can vary 727 rapidly as flows for the two queues arrive and depart, even if the 728 combined link rate is constant. 730 It would be possible to control the queues with other alternative 731 AQMs, as long as the normative requirements (those expressed in 732 capitals) in Section 2.5 are observed. 734 The two queues could optionally be part of a larger queuing 735 hierarchy, such as the initial example ideas 736 in [I-D.briscoe-tsvwg-l4s-diffserv]. 738 2.5. Normative Requirements for a DualQ Coupled AQM 740 The following requirements are intended to capture only the essential 741 aspects of a DualQ Coupled AQM. They are intended to be independent 742 of the particular AQMs used for each queue. 744 2.5.1. Functional Requirements 746 A Dual Queue Coupled AQM implementation MUST comply with the 747 prerequisite L4S behaviours for any L4S network node (not just a 748 DualQ) as specified in section 5 of [I-D.ietf-tsvwg-ecn-l4s-id]. 749 These primarily concern classification and remarking as briefly 750 summarized in Section 2.3 earlier. But there is also a subsection 751 (5.5) giving guidance on reducing the burstiness of the link 752 technology underlying any L4S AQM. 754 A Dual Queue Coupled AQM implementation MUST utilize two queues, each 755 with an AQM algorithm. 757 The AQM algorithm for the low latency (L) queue MUST be able to apply 758 ECN marking to ECN-capable packets. 760 The scheduler draining the two queues MUST give L4S packets priority 761 over Classic, although priority MUST be bounded in order not to 762 starve Classic traffic. The scheduler SHOULD be work-conserving, or 763 otherwise close to work-conserving, given Classic service will often 764 rely on borrowing from the L4S service. 766 [I-D.ietf-tsvwg-ecn-l4s-id] defines the meaning of an ECN marking on 767 L4S traffic, relative to drop of Classic traffic. In order to ensure 768 coexistence of Classic and Scalable L4S traffic, it says, "The 769 likelihood that an AQM drops a Not-ECT Classic packet (p_C) MUST be 770 roughly proportional to the square of the likelihood that it would 771 have marked it if it had been an L4S packet (p_L)." The term 772 'likelihood' is used to allow for marking and dropping to be either 773 probabilistic or deterministic. 775 For the current specification, this translates into the following 776 requirement. A DualQ Coupled AQM MUST apply ECN marking to traffic 777 in the L queue that is no lower than that derived from the likelihood 778 of drop (or ECN marking) in the Classic queue using Eqn. (1). 780 The constant of proportionality, k, in Eqn (1) determines the 781 relative flow rates of Classic and L4S flows when the AQM concerned 782 is the bottleneck (all other factors being equal). 783 [I-D.ietf-tsvwg-ecn-l4s-id] says, "The constant of proportionality 784 (k) does not have to be standardised for interoperability, but a 785 value of 2 is RECOMMENDED." 786 Assuming Scalable congestion controls for the Internet will be as 787 aggressive as DCTCP, this will ensure their congestion window will be 788 roughly the same as that of a standards track TCP Reno congestion 789 control (Reno) [RFC5681] and other Reno-friendly controls, such as 790 TCP Cubic in its Reno-compatibility mode. 792 The choice of k is a matter of operator policy, and operators MAY 793 choose a different value using the guidelines in Appendix C.2. 795 If multiple customers or users share capacity at a bottleneck 796 (e.g. in the Internet access link of a campus network), the 797 operator's choice of k will determine capacity sharing between the 798 flows of different customers. However, on the public Internet, 799 access network operators typically isolate customers from each other 800 with some form of layer-2 multiplexing (OFDM(A) in DOCSIS3.1, CDMA in 801 3G, SC-FDMA in LTE) or L3 scheduling (WRR in DSL), rather than 802 relying on host congestion controls to share capacity between 803 customers [RFC0970]. In such cases, the choice of k will solely 804 affect relative flow rates within each customer's access capacity, 805 not between customers. Also, k will not affect relative flow rates 806 at any times when all flows are Classic or all flows are L4S, and it 807 will not affect the relative throughput of small flows. 809 2.5.1.1. Requirements in Unexpected Cases 811 The flexibility to allow operator-specific classifiers (Section 2.3) 812 leads to the need to specify what the AQM in each queue ought to do 813 with packets that do not carry the ECN field expected for that queue. 814 It is expected that the AQM in each queue will inspect the ECN field 815 to determine what sort of congestion notification to signal, then it 816 will decide whether to apply congestion notification to this 817 particular packet, as follows: 819 * If a packet that does not carry an ECT(1) or CE codepoint is 820 classified into the L queue: 822 - if the packet is ECT(0), the L AQM SHOULD apply CE-marking 823 using a probability appropriate to Classic congestion control 824 and appropriate to the target delay in the L queue 826 - if the packet is Not-ECT, the appropriate action depends on 827 whether some other function is protecting the L queue from 828 misbehaving flows (e.g. per-flow queue 829 protection [I-D.briscoe-docsis-q-protection] or latency 830 policing): 832 o If separate queue protection is provided, the L AQM SHOULD 833 ignore the packet and forward it unchanged, meaning it 834 should not calculate whether to apply congestion 835 notification and it should neither drop nor CE-mark the 836 packet (for instance, the operator might classify EF traffic 837 that is unresponsive to drop into the L queue, alongside 838 responsive L4S-ECN traffic) 840 o if separate queue protection is not provided, the L AQM 841 SHOULD apply drop using a drop probability appropriate to 842 Classic congestion control and appropriate to the target 843 delay in the L queue 845 * If a packet that carries an ECT(1) codepoint is classified into 846 the C queue: 848 - the C AQM SHOULD apply CE-marking using the coupled AQM 849 probability p_CL (= k*p'). 851 The above requirements are worded as "SHOULDs", because operator- 852 specific classifiers are for flexibility, by definition. Therefore, 853 alternative actions might be appropriate in the operator's specific 854 circumstances. An example would be where the operator knows that 855 certain legacy traffic marked with one codepoint actually has a 856 congestion response associated with another codepoint. 858 If the DualQ Coupled AQM has detected overload, it MUST begin using 859 Classic drop, and continue until the overload episode has subsided. 860 Switching to drop if ECN marking is persistently high is required by 861 Section 7 of [RFC3168] and Section 4.2.1 of [RFC7567]. 863 2.5.2. Management Requirements 865 2.5.2.1. Configuration 867 By default, a DualQ Coupled AQM SHOULD NOT need any configuration for 868 use at a bottleneck on the public Internet [RFC7567]. The following 869 parameters MAY be operator-configurable, e.g. to tune for non- 870 Internet settings: 872 * Optional packet classifier(s) to use in addition to the ECN field 873 (see Section 2.3); 875 * Expected typical RTT, which can be used to determine the queuing 876 delay of the Classic AQM at its operating point, in order to 877 prevent typical lone flows from under-utilizing capacity. For 878 example: 880 - for the PI2 algorithm (Appendix A) the queuing delay target is 881 dependent on the typical RTT; 883 - for the Curvy RED algorithm (Appendix B) the queuing delay at 884 the desired operating point of the curvy ramp is configured to 885 encompass a typical RTT; 887 - if another Classic AQM was used, it would be likely to need an 888 operating point for the queue based on the typical RTT, and if 889 so it SHOULD be expressed in units of time. 891 An operating point that is manually calculated might be directly 892 configurable instead, e.g. for links with large numbers of flows 893 where under-utilization by a single flow would be unlikely. 895 * Expected maximum RTT, which can be used to set the stability 896 parameter(s) of the Classic AQM. For example: 898 - for the PI2 algorithm (Appendix A), the gain parameters of the 899 PI algorithm depend on the maximum RTT. 901 - for the Curvy RED algorithm (Appendix B) the smoothing 902 parameter is chosen to filter out transients in the queue 903 within a maximum RTT. 905 Stability parameter(s) that are manually calculated assuming a 906 maximum RTT might be directly configurable instead. 908 * Coupling factor, k (see Appendix C.2); 910 * A limit to the conditional priority of L4S. This is scheduler- 911 dependent, but it SHOULD be expressed as a relation between the 912 max delay of a C packet and an L packet. For example: 914 - for a WRR scheduler a weight ratio between L and C of w:1 means 915 that the maximum delay to a C packet is w times that of an L 916 packet. 918 - for a time-shifted FIFO (TS-FIFO) scheduler (see Section 4.1.1) 919 a time-shift of tshift means that the maximum delay to a C 920 packet is tshift greater than that of an L packet. tshift could 921 be expressed as a multiple of the typical RTT rather than as an 922 absolute delay. 924 * The maximum Classic ECN marking probability, p_Cmax, before 925 switching over to drop. 927 2.5.2.2. Monitoring 929 An experimental DualQ Coupled AQM SHOULD allow the operator to 930 monitor each of the following operational statistics on demand, per 931 queue and per configurable sample interval, for performance 932 monitoring and perhaps also for accounting in some cases: 934 * Bits forwarded, from which utilization can be calculated; 936 * Total packets in the three categories: arrived, presented to the 937 AQM, and forwarded. The difference between the first two will 938 measure any non-AQM tail discard. The difference between the last 939 two will measure proactive AQM discard; 941 * ECN packets marked, non-ECN packets dropped, ECN packets dropped, 942 which can be combined with the three total packet counts above to 943 calculate marking and dropping probabilities; 945 * Queue delay (not including serialization delay of the head packet 946 or medium acquisition delay) - see further notes below. 948 Unlike the other statistics, queue delay cannot be captured in a 949 simple accumulating counter. Therefore the type of queue delay 950 statistics produced (mean, percentiles, etc.) will depend on 951 implementation constraints. To facilitate comparative evaluation 952 of different implementations and approaches, an implementation 953 SHOULD allow mean and 99th percentile queue delay to be derived 954 (per queue per sample interval). A relatively simple way to do 955 this would be to store a coarse-grained histogram of queue delay. 956 This could be done with a small number of bins with configurable 957 edges that represent contiguous ranges of queue delay. Then, over 958 a sample interval, each bin would accumulate a count of the number 959 of packets that had fallen within each range. The maximum queue 960 delay per queue per interval MAY also be recorded, to aid 961 diagnosis of faults and anomalous events. 963 2.5.2.3. Anomaly Detection 965 An experimental DualQ Coupled AQM SHOULD asynchronously report the 966 following data about anomalous conditions: 968 * Start-time and duration of overload state. 970 A hysteresis mechanism SHOULD be used to prevent flapping in and 971 out of overload causing an event storm. For instance, exit from 972 overload state could trigger one report, but also latch a timer. 973 Then, during that time, if the AQM enters and exits overload state 974 any number of times, the duration in overload state is accumulated 975 but no new report is generated until the first time the AQM is out 976 of overload once the timer has expired. 978 2.5.2.4. Deployment, Coexistence and Scaling 980 [RFC5706] suggests that deployment, coexistence and scaling should 981 also be covered as management requirements. The raison d'etre of the 982 DualQ Coupled AQM is to enable deployment and coexistence of Scalable 983 congestion controls - as incremental replacements for today's Reno- 984 friendly controls that do not scale with bandwidth-delay product. 985 Therefore there is no need to repeat these motivating issues here 986 given they are already explained in the Introduction and detailed in 987 the L4S architecture [I-D.ietf-tsvwg-l4s-arch]. 989 The descriptions of specific DualQ Coupled AQM algorithms in the 990 appendices cover scaling of their configuration parameters, e.g. with 991 respect to RTT and sampling frequency. 993 3. IANA Considerations (to be removed by RFC Editor) 995 This specification contains no IANA considerations. 997 4. Security Considerations 999 4.1. Overload Handling 1001 Where the interests of users or flows might conflict, it could be 1002 necessary to police traffic to isolate any harm to the performance of 1003 individual flows. However it is hard to avoid unintended side- 1004 effects with policing, and in a trusted environment policing is not 1005 necessary. Therefore per-flow policing 1006 (e.g. [I-D.briscoe-docsis-q-protection]) needs to be separable from a 1007 basic AQM, as an option under policy control. 1009 However, a basic DualQ AQM does at least need to handle overload. A 1010 useful objective would be for the overload behaviour of the DualQ AQM 1011 to be at least no worse than a single queue AQM. However, a trade- 1012 off needs to be made between complexity and the risk of either 1013 traffic class harming the other. In each of the following three 1014 subsections, an overload issue specific to the DualQ is described, 1015 followed by proposed solution(s). 1017 Under overload the higher priority L4S service will have to sacrifice 1018 some aspect of its performance. Alternative solutions are provided 1019 below that each relax a different factor: e.g. throughput, delay, 1020 drop. These choices need to be made either by the developer or by 1021 operator policy, rather than by the IETF. 1023 4.1.1. Avoiding Classic Starvation: Sacrifice L4S Throughput or Delay? 1025 Priority of L4S is required to be conditional (see Section 2.5.1) to 1026 avoid total starvation of Classic by heavy L4S traffic. This raises 1027 the question of whether to sacrifice L4S throughput or L4S delay (or 1028 some other policy) to mitigate starvation of Classic: 1030 Sacrifice L4S throughput: By using weighted round robin as the 1031 conditional priority scheduler, the L4S service can sacrifice some 1032 throughput during overload. This can either be thought of as 1033 guaranteeing a minimum throughput service for Classic traffic, or 1034 as guaranteeing a maximum delay for a packet at the head of the 1035 Classic queue. 1037 The scheduling weight of the Classic queue should be small 1038 (e.g. 1/16). Then, in most traffic scenarios the scheduler will 1039 not interfere and it will not need to - the coupling mechanism and 1040 the end-systems will share out the capacity across both queues as 1041 if it were a single pool. However, because the congestion 1042 coupling only applies in one direction (from C to L), if L4S 1043 traffic is over-aggressive or unresponsive, the scheduler weight 1044 for Classic traffic will at least be large enough to ensure it 1045 does not starve. 1047 In cases where the ratio of L4S to Classic flows (e.g. 19:1) is 1048 greater than the ratio of their scheduler weights (e.g. 15:1), the 1049 L4S flows will get less than an equal share of the capacity, but 1050 only slightly. For instance, with the example numbers given, each 1051 L4S flow will get (15/16)/19 = 4.9% when ideally each would get 1052 1/20=5%. In the rather specific case of an unresponsive flow 1053 taking up just less than the capacity set aside for L4S 1054 (e.g. 14/16 in the above example), using WRR could significantly 1055 reduce the capacity left for any responsive L4S flows. 1057 The scheduling weight of the Classic queue should not be too 1058 small, otherwise a C packet at the head of the queue could be 1059 excessively delayed by a continually busy L queue. For instance 1060 if the Classic weight is 1/16, the maximum that a Classic packet 1061 at the head of the queue can be delayed by L traffic is the 1062 serialization delay of 15 MTU-sized packets. 1064 Sacrifice L4S Delay: To control milder overload of responsive 1065 traffic, particularly when close to the maximum congestion signal, 1066 the operator could choose to control overload of the Classic queue 1067 by allowing some delay to 'leak' across to the L4S queue. The 1068 scheduler can be made to behave like a single First-In First-Out 1069 (FIFO) queue with different service times by implementing a very 1070 simple conditional priority scheduler that could be called a 1071 "time-shifted FIFO" (see the Modifier Earliest Deadline First 1072 (MEDF) scheduler of [MEDF]). This scheduler adds tshift to the 1073 queue delay of the next L4S packet, before comparing it with the 1074 queue delay of the next Classic packet, then it selects the packet 1075 with the greater adjusted queue delay. Under regular conditions, 1076 this time-shifted FIFO scheduler behaves just like a strict 1077 priority scheduler. But under moderate or high overload it 1078 prevents starvation of the Classic queue, because the time-shift 1079 (tshift) defines the maximum extra queuing delay of Classic 1080 packets relative to L4S. 1082 The example implementations in Appendix A and Appendix B could both 1083 be implemented with either policy. 1085 4.1.2. Congestion Signal Saturation: Introduce L4S Drop or Delay? 1087 To keep the throughput of both L4S and Classic flows roughly equal 1088 over the full load range, a different control strategy needs to be 1089 defined above the point where one AQM first saturates to a 1090 probability of 100% leaving no room to push back the load any harder. 1091 If k>1, L4S will saturate first, even though saturation could be 1092 caused by unresponsive traffic in either queue. 1094 The term 'unresponsive' includes cases where a flow becomes 1095 temporarily unresponsive, for instance, a real-time flow that takes a 1096 while to adapt its rate in response to congestion, or a standard Reno 1097 flow that is normally responsive, but above a certain congestion 1098 level it will not be able to reduce its congestion window below the 1099 allowed minimum of 2 segments [RFC5681], effectively becoming 1100 unresponsive. (Note that L4S traffic ought to remain responsive 1101 below a window of 2 segments (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1103 Saturation raises the question of whether to relieve congestion by 1104 introducing some drop into the L4S queue or by allowing delay to grow 1105 in both queues (which could eventually lead to tail drop too): 1107 Drop on Saturation: Saturation can be avoided by setting a maximum 1108 threshold for L4S ECN marking (assuming k>1) before saturation 1109 starts to make the flow rates of the different traffic types 1110 diverge. Above that the drop probability of Classic traffic is 1111 applied to all packets of all traffic types. Then experiments 1112 have shown that queueing delay can be kept at the target in any 1113 overload situation, including with unresponsive traffic, and no 1114 further measures are required [DualQ-Test]. 1116 Delay on Saturation: When L4S marking saturates, instead of 1117 switching to drop, the drop and marking probabilities could be 1118 capped. Beyond that, delay will grow either solely in the queue 1119 with unresponsive traffic (if WRR is used), or in both queues (if 1120 time-shifted FIFO is used). In either case, the higher delay 1121 ought to control temporary high congestion. If the overload is 1122 more persistent, eventually the combined DualQ will overflow and 1123 tail drop will control congestion. 1125 The example implementation in Appendix A solely applies the "drop on 1126 saturation" policy. The DOCSIS specification of a DualQ Coupled 1127 AQM [DOCSIS3.1] also implements the 'drop on saturation' policy with 1128 a very shallow L buffer. However, the addition of DOCSIS per-flow 1129 Queue Protection [I-D.briscoe-docsis-q-protection] turns this into 1130 'delay on saturation' by redirecting some packets of the flow(s) most 1131 responsible for L queue overload into the C queue, which has a higher 1132 delay target. If overload continues, this again becomes 'drop on 1133 saturation' as the level of drop in the C queue rises to maintain the 1134 target delay of the C queue. 1136 4.1.3. Protecting against Unresponsive ECN-Capable Traffic 1138 Unresponsive traffic has a greater advantage if it is also ECN- 1139 capable. The advantage is undetectable at normal low levels of drop/ 1140 marking, but it becomes significant with the higher levels of drop/ 1141 marking typical during overload. This is an issue whether the ECN- 1142 capable traffic is L4S or Classic. 1144 This raises the question of whether and when to switch off ECN 1145 marking and use solely drop instead, as required by both Section 7 of 1146 [RFC3168] and Section 4.2.1 of [RFC7567]. 1148 Experiments with the DualPI2 AQM (Appendix A) have shown that 1149 introducing 'drop on saturation' at 100% L4S marking addresses this 1150 problem with unresponsive ECN as well as addressing the saturation 1151 problem. It leaves only a small range of congestion levels where 1152 unresponsive traffic gains any advantage from using the ECN 1153 capability (relative to being unresponsive without ECN), and the 1154 advantage is hardly detectable [DualQ-Test]. 1156 5. Acknowledgements 1158 Thanks to Anil Agarwal, Sowmini Varadhan's, Gabi Bracha, Nicolas 1159 Kuhn, Greg Skinner, Tom Henderson, David Pullen, Mirja Kuehlewind, 1160 Gorry Fairhurst, Pete Heist and Ermin Sakic for detailed review 1161 comments particularly of the appendices and suggestions on how to 1162 make the explanations clearer. Thanks also to Tom Henderson for 1163 insights on the choice of schedulers and queue delay measurement 1164 techniques. 1166 The early contributions of Koen De Schepper, Bob Briscoe, Olga 1167 Bondarenko and Inton Tsang were part-funded by the European Community 1168 under its Seventh Framework Programme through the Reducing Internet 1169 Transport Latency (RITE) project (ICT-317700). Bob Briscoe's 1170 contribution was also part-funded by the Comcast Innovation Fund and 1171 the Research Council of Norway through the TimeIn project. The views 1172 expressed here are solely those of the authors. 1174 6. Contributors 1176 The following contributed implementations and evaluations that 1177 validated and helped to improve this specification: 1179 Olga Albisser of Simula Research Lab, Norway 1180 (Olga Bondarenko during early drafts) implemented the prototype 1181 DualPI2 AQM for Linux with Koen De Schepper and conducted 1182 extensive evaluations as well as implementing the live performance 1183 visualization GUI [L4Sdemo16]. 1185 Olivier Tilmans of Nokia 1186 Bell Labs, Belgium prepared and maintains the Linux implementation 1187 of DualPI2 for upstreaming. 1189 Shravya K.S. wrote a model for the ns-3 simulator based on the -01 1190 version of this Internet-Draft. Based on this initial work, Tom 1191 Henderson updated that earlier model and created a 1192 model for the DualQ variant specified as part of the Low Latency 1193 DOCSIS specification, as well as conducting extensive evaluations. 1195 Ing Jyh (Inton) Tsang of Nokia, Belgium built the End-to-End Data 1196 Centre to the Home broadband testbed on which DualQ Coupled AQM 1197 implementations were tested. 1199 7. References 1201 7.1. Normative References 1203 [I-D.ietf-tsvwg-ecn-l4s-id] 1204 Schepper, K. D. and B. Briscoe, "Explicit Congestion 1205 Notification (ECN) Protocol for Very Low Queuing Delay 1206 (L4S)", Work in Progress, Internet-Draft, draft-ietf- 1207 tsvwg-ecn-l4s-id-19, 26 July 2021, 1208 . 1211 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1212 Requirement Levels", BCP 14, RFC 2119, 1213 DOI 10.17487/RFC2119, March 1997, 1214 . 1216 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 1217 of Explicit Congestion Notification (ECN) to IP", 1218 RFC 3168, DOI 10.17487/RFC3168, September 2001, 1219 . 1221 [RFC8311] Black, D., "Relaxing Restrictions on Explicit Congestion 1222 Notification (ECN) Experimentation", RFC 8311, 1223 DOI 10.17487/RFC8311, January 2018, 1224 . 1226 7.2. Informative References 1228 [Alizadeh-stability] 1229 Alizadeh, M., Javanmard, A., and B. Prabhakar, "Analysis 1230 of DCTCP: Stability, Convergence, and Fairness", ACM 1231 SIGMETRICS 2011 , June 2011, 1232 . 1234 [AQMmetrics] 1235 Kwon, M. and S. Fahmy, "A Comparison of Load-based and 1236 Queue- based Active Queue Management Algorithms", Proc. 1237 Int'l Soc. for Optical Engineering (SPIE) 4866:35--46 DOI: 1238 10.1117/12.473021, 2002, 1239 . 1241 [ARED01] Floyd, S., Gummadi, R., and S. Shenker, "Adaptive RED: An 1242 Algorithm for Increasing the Robustness of RED's Active 1243 Queue Management", ACIRI Technical Report , August 2001, 1244 . 1246 [BBRv1] Cardwell, N., Cheng, Y., Hassas Yeganeh, S., and V. 1247 Jacobson, "BBR Congestion Control", Internet Draft draft- 1248 cardwell-iccrg-bbr-congestion-control-00, July 2017, 1249 . 1252 [BBRv2] Cardwell, N., "BRTCP BBR v2 Alpha/Preview Release", github 1253 repository; Linux congestion control module, 1254 . 1256 [CCcensus19] 1257 Mishra, A., Sun, X., Jain, A., Pande, S., Joshi, R., and 1258 B. Leong, "The Great Internet TCP Congestion Control 1259 Census", Proc. ACM on Measurement and Analysis of 1260 Computing Systems 3(3), December 2019, 1261 . 1263 [CoDel] Nichols, K. and V. Jacobson, "Controlling Queue Delay", 1264 ACM Queue 10(5), May 2012, 1265 . 1267 [CRED_Insights] 1268 Briscoe, B., "Insights from Curvy RED (Random Early 1269 Detection)", BT Technical Report TR-TUB8-2015-003 1270 arXiv:1904.07339 [cs.NI], July 2015, 1271 . 1273 [DCttH19] De Schepper, K., Bondarenko, O., Tilmans, O., and B. 1274 Briscoe, "`Data Centre to the Home': Ultra-Low Latency for 1275 All", Updated RITE project Technical Report , July 2019, 1276 . 1278 [DOCSIS3.1] 1279 CableLabs, "MAC and Upper Layer Protocols Interface 1280 (MULPI) Specification, CM-SP-MULPIv3.1", Data-Over-Cable 1281 Service Interface Specifications DOCSIS® 3.1 Version i17 1282 or later, 21 January 2019, . 1285 [DualPI2Linux] 1286 Albisser, O., De Schepper, K., Briscoe, B., Tilmans, O., 1287 and H. Steen, "DUALPI2 - Low Latency, Low Loss and 1288 Scalable (L4S) AQM", Proc. Linux Netdev 0x13 , March 2019, 1289 . 1292 [DualQ-Test] 1293 Steen, H., "Destruction Testing: Ultra-Low Delay using 1294 Dual Queue Coupled Active Queue Management", Masters 1295 Thesis, Dept of Informatics, Uni Oslo , May 2017, 1296 . 1299 [Heist21] Heist, P. and J. Morton, "L4S Tests", github README, 1300 August 2021, . 1303 [I-D.briscoe-docsis-q-protection] 1304 Briscoe, B. and G. White, "Queue Protection to Preserve 1305 Low Latency", Work in Progress, Internet-Draft, draft- 1306 briscoe-docsis-q-protection-00, 8 July 2019, 1307 . 1310 [I-D.briscoe-iccrg-prague-congestion-control] 1311 Schepper, K. D., Tilmans, O., and B. Briscoe, "Prague 1312 Congestion Control", Work in Progress, Internet-Draft, 1313 draft-briscoe-iccrg-prague-congestion-control-00, 9 March 1314 2021, . 1317 [I-D.briscoe-tsvwg-l4s-diffserv] 1318 Briscoe, B., "Interactions between Low Latency, Low Loss, 1319 Scalable Throughput (L4S) and Differentiated Services", 1320 Work in Progress, Internet-Draft, draft-briscoe-tsvwg-l4s- 1321 diffserv-02, 4 November 2018, 1322 . 1325 [I-D.cardwell-iccrg-bbr-congestion-control] 1326 Cardwell, N., Cheng, Y., Yeganeh, S. H., and V. Jacobson, 1327 "BBR Congestion Control", Work in Progress, Internet- 1328 Draft, draft-cardwell-iccrg-bbr-congestion-control-00, 3 1329 July 2017, . 1332 [I-D.ietf-tsvwg-l4s-arch] 1333 Briscoe, B., Schepper, K. D., Bagnulo, M., and G. White, 1334 "Low Latency, Low Loss, Scalable Throughput (L4S) Internet 1335 Service: Architecture", Work in Progress, Internet-Draft, 1336 draft-ietf-tsvwg-l4s-arch-10, 1 July 2021, 1337 . 1340 [L4Sdemo16] 1341 Bondarenko, O., De Schepper, K., Tsang, I., and B. 1342 Briscoe, "Ultra-Low Delay for All: Live Experience, Live 1343 Analysis", Proc. MMSYS'16 pp33:1--33:4, May 2016, 1344 . 1348 [L4S_5G] Willars, P., Wittenmark, E., Ronkainen, H., Östberg, C., 1349 Johansson, I., Strand, J., Lédl, P., and D. Schnieders, 1350 "Enabling time-critical applications over 5G with rate 1351 adaptation", Ericsson - Deutsche Telekom White Paper BNEW- 1352 21:025455 Uen, May 2021, . 1356 [Labovitz10] 1357 Labovitz, C., Iekel-Johnson, S., McPherson, D., Oberheide, 1358 J., and F. Jahanian, "Internet Inter-Domain Traffic", Proc 1359 ACM SIGCOMM; ACM CCR 40(4):75--86, August 2010, 1360 . 1362 [LLD] White, G., Sundaresan, K., and B. Briscoe, "Low Latency 1363 DOCSIS: Technology Overview", CableLabs White Paper , 1364 February 2019, . 1367 [Mathis09] Mathis, M., "Relentless Congestion Control", PFLDNeT'09 , 1368 May 2009, . 1371 [MEDF] Menth, M., Schmid, M., Heiss, H., and T. Reim, "MEDF - a 1372 simple scheduling algorithm for two real-time transport 1373 service classes with application in the UTRAN", Proc. IEEE 1374 Conference on Computer Communications (INFOCOM'03) Vol.2 1375 pp.1116-1122, March 2003, 1376 . 1378 [PI2] De Schepper, K., Bondarenko, O., Briscoe, B., and I. 1379 Tsang, "PI2: A Linearized AQM for both Classic and 1380 Scalable TCP", ACM CoNEXT'16 , December 2016, 1381 . 1384 [PI2param] Briscoe, B., "PI2 Parameters", Technical Report TR-BB- 1385 2021-001 arXiv:2107.01003 [cs.NI], July 2021, 1386 . 1388 [PragueLinux] 1389 Briscoe, B., De Schepper, K., Albisser, O., Misund, J., 1390 Tilmans, O., Kühlewind, M., and A.S. Ahmed, "Implementing 1391 the `TCP Prague' Requirements for Low Latency Low Loss 1392 Scalable Throughput (L4S)", Proc. Linux Netdev 0x13 , 1393 March 2019, . 1396 [RFC0970] Nagle, J., "On Packet Switches With Infinite Storage", 1397 RFC 970, DOI 10.17487/RFC0970, December 1985, 1398 . 1400 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 1401 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 1402 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 1403 S., Wroclawski, J., and L. Zhang, "Recommendations on 1404 Queue Management and Congestion Avoidance in the 1405 Internet", RFC 2309, DOI 10.17487/RFC2309, April 1998, 1406 . 1408 [RFC2914] Floyd, S., "Congestion Control Principles", BCP 41, 1409 RFC 2914, DOI 10.17487/RFC2914, September 2000, 1410 . 1412 [RFC3246] Davie, B., Charny, A., Bennet, J.C.R., Benson, K., Le 1413 Boudec, J.Y., Courtney, W., Davari, S., Firoiu, V., and D. 1414 Stiliadis, "An Expedited Forwarding PHB (Per-Hop 1415 Behavior)", RFC 3246, DOI 10.17487/RFC3246, March 2002, 1416 . 1418 [RFC3649] Floyd, S., "HighSpeed TCP for Large Congestion Windows", 1419 RFC 3649, DOI 10.17487/RFC3649, December 2003, 1420 . 1422 [RFC5033] Floyd, S. and M. Allman, "Specifying New Congestion 1423 Control Algorithms", BCP 133, RFC 5033, 1424 DOI 10.17487/RFC5033, August 2007, 1425 . 1427 [RFC5348] Floyd, S., Handley, M., Padhye, J., and J. Widmer, "TCP 1428 Friendly Rate Control (TFRC): Protocol Specification", 1429 RFC 5348, DOI 10.17487/RFC5348, September 2008, 1430 . 1432 [RFC5681] Allman, M., Paxson, V., and E. Blanton, "TCP Congestion 1433 Control", RFC 5681, DOI 10.17487/RFC5681, September 2009, 1434 . 1436 [RFC5706] Harrington, D., "Guidelines for Considering Operations and 1437 Management of New Protocols and Protocol Extensions", 1438 RFC 5706, DOI 10.17487/RFC5706, November 2009, 1439 . 1441 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 1442 Recommendations Regarding Active Queue Management", 1443 BCP 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 1444 . 1446 [RFC8033] Pan, R., Natarajan, P., Baker, F., and G. White, 1447 "Proportional Integral Controller Enhanced (PIE): A 1448 Lightweight Control Scheme to Address the Bufferbloat 1449 Problem", RFC 8033, DOI 10.17487/RFC8033, February 2017, 1450 . 1452 [RFC8034] White, G. and R. Pan, "Active Queue Management (AQM) Based 1453 on Proportional Integral Controller Enhanced PIE) for 1454 Data-Over-Cable Service Interface Specifications (DOCSIS) 1455 Cable Modems", RFC 8034, DOI 10.17487/RFC8034, February 1456 2017, . 1458 [RFC8257] Bensley, S., Thaler, D., Balasubramanian, P., Eggert, L., 1459 and G. Judd, "Data Center TCP (DCTCP): TCP Congestion 1460 Control for Data Centers", RFC 8257, DOI 10.17487/RFC8257, 1461 October 2017, . 1463 [RFC8290] Hoeiland-Joergensen, T., McKenney, P., Taht, D., Gettys, 1464 J., and E. Dumazet, "The Flow Queue CoDel Packet Scheduler 1465 and Active Queue Management Algorithm", RFC 8290, 1466 DOI 10.17487/RFC8290, January 2018, 1467 . 1469 [RFC8298] Johansson, I. and Z. Sarker, "Self-Clocked Rate Adaptation 1470 for Multimedia", RFC 8298, DOI 10.17487/RFC8298, December 1471 2017, . 1473 [RFC8312] Rhee, I., Xu, L., Ha, S., Zimmermann, A., Eggert, L., and 1474 R. Scheffenegger, "CUBIC for Fast Long-Distance Networks", 1475 RFC 8312, DOI 10.17487/RFC8312, February 2018, 1476 . 1478 [SCReAM] Johansson, I., "SCReAM", github repository; , 1479 . 1482 [SigQ-Dyn] Briscoe, B., "Rapid Signalling of Queue Dynamics", 1483 Technical Report TR-BB-2017-001 arXiv:1904.07044 [cs.NI], 1484 September 2017, . 1486 Appendix A. Example DualQ Coupled PI2 Algorithm 1488 As a first concrete example, the pseudocode below gives the DualPI2 1489 algorithm. DualPI2 follows the structure of the DualQ Coupled AQM 1490 framework in Figure 1. A simple ramp function (configured in units 1491 of queuing time) with unsmoothed ECN marking is used for the Native 1492 L4S AQM. The ramp can also be configured as a step function. The 1493 PI2 algorithm [PI2] is used for the Classic AQM. PI2 is an improved 1494 variant of the PIE AQM [RFC8033]. 1496 The pseudocode will be introduced in two passes. The first pass 1497 explains the core concepts, deferring handling of overload to the 1498 second pass. To aid comparison, line numbers are kept in step 1499 between the two passes by using letter suffixes where the longer code 1500 needs extra lines. 1502 All variables are assumed to be floating point in their basic units 1503 (size in bytes, time in seconds, rates in bytes/second, alpha and 1504 beta in Hz, and probabilities from 0 to 1. Constants expressed in k 1505 (kilo), M (mega), G (giga), u (micro), m (milli) , %, ... are assumed 1506 to be converted to their appropriate multiple or fraction to 1507 represent the basic units. A real implementation that wants to use 1508 integer values needs to handle appropriate scaling factors and allow 1509 accordingly appropriate resolution of its integer types (including 1510 temporary internal values during calculations). 1512 A full open source implementation for Linux is available at: 1513 https://github.com/L4STeam/sch_dualpi2_upstream and explained in 1514 [DualPI2Linux]. The specification of the DualQ Coupled AQM for 1515 DOCSIS cable modems and CMTSs is available in [DOCSIS3.1] and 1516 explained in [LLD]. 1518 A.1. Pass #1: Core Concepts 1520 The pseudocode manipulates three main structures of variables: the 1521 packet (pkt), the L4S queue (lq) and the Classic queue (cq). The 1522 pseudocode consists of the following six functions: 1524 * The initialization function dualpi2_params_init(...) (Figure 2) 1525 that sets parameter defaults (the API for setting non-default 1526 values is omitted for brevity) 1528 * The enqueue function dualpi2_enqueue(lq, cq, pkt) (Figure 3) 1530 * The dequeue function dualpi2_dequeue(lq, cq, pkt) (Figure 4) 1532 * The recurrence function recur(q, likelihood) for de-randomized ECN 1533 marking (shown at the end of Figure 4). 1535 * The L4S AQM function laqm(qdelay) (Figure 5) used to calculate the 1536 ECN-marking probability for the L4S queue 1538 * The base AQM function that implements the PI algorithm 1539 dualpi2_update(lq, cq) (Figure 6) used to regularly update the 1540 base probability (p'), which is squared for the Classic AQM as 1541 well as being coupled across to the L4S queue. 1543 It also uses the following functions that are not shown in full here: 1545 * scheduler(), which selects between the head packets of the two 1546 queues; the choice of scheduler technology is discussed later; 1548 * cq.byt() or lq.byt() returns the current length (aka. backlog) of 1549 the relevant queue in bytes; 1551 * cq.len() or lq.len() returns the current length of the relevant 1552 queue in packets; 1554 * cq.time() or lq.time() returns the current queuing delay 1555 (aka. sojourn time or service time) of the relevant queue in units 1556 of time (see Note a); 1558 * mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 1560 In experiments so far (building on experiments with PIE) on broadband 1561 access links ranging from 4 Mb/s to 200 Mb/s with base RTTs from 5 ms 1562 to 100 ms, DualPI2 achieves good results with the default parameters 1563 in Figure 2. The parameters are categorised by whether they relate 1564 to the Base PI2 AQM, the L4S AQM or the framework coupling them 1565 together. Constants and variables derived from these parameters are 1566 also included at the end of each category. Each parameter is 1567 explained as it is encountered in the walk-through of the pseudocode 1568 below, and the rationale for the chosen defaults are given so that 1569 sensible values can be used in scenarios other than the regular 1570 public Internet. 1572 1: dualpi2_params_init(...) { % Set input parameter defaults 1573 2: % DualQ Coupled framework parameters 1574 5: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 1575 3: k = 2 % Coupling factor 1576 4: % NOT SHOWN % scheduler-dependent weight or equival't parameter 1577 6: 1578 7: % PI2 Classic AQM parameters 1579 8: target = 15 ms % Queue delay target 1580 9: RTT_max = 100 ms % Worst case RTT expected 1581 10: % PI2 constants derived from above PI2 parameters 1582 11: p_Cmax = min(1/k^2, 1) % Max Classic drop/mark prob 1583 12: Tupdate = min(target, RTT_max/3) % PI sampling interval 1584 13: alpha = 0.1 * Tupdate / RTT_max^2 % PI integral gain in Hz 1585 14: beta = 0.3 / RTT_max % PI proportional gain in Hz 1586 15: 1587 16: % L4S ramp AQM parameters 1588 17: minTh = 800 us % L4S min marking threshold in time units 1589 18: range = 400 us % Range of L4S ramp in time units 1590 19: Th_len = 1 pkt % Min L4S marking threshold in packets 1591 20: % L4S constants 1592 21: p_Lmax = 1 % Max L4S marking prob 1593 22: } 1595 Figure 2: Example Header Pseudocode for DualQ Coupled PI2 AQM 1597 The overall goal of the code is to apply the marking and dropping 1598 probabilities for L4S and Classic traffic (p_L and p_C). These are 1599 derived from the underlying base probabilities p'_L and p' driven 1600 respectively by the traffic in the L and C queues. The marking 1601 probability for the L queue (p_L) depends on both the base 1602 probability in its own queue (p'_L) and a probability called p_CL, 1603 which is coupled across from p' in the C queue (see Section 2.4 for 1604 the derivation of the specific equations and dependencies). 1606 The probabilities p_CL and p_C are derived in lines 4 and 5 of the 1607 dualpi2_update() function (Figure 6) then used in the 1608 dualpi2_dequeue() function where p_L is also derived from p_CL at 1609 line 6 (Figure 4). The code walk-through below builds up to 1610 explaining that part of the code eventually, but it starts from 1611 packet arrival. 1613 1: dualpi2_enqueue(lq, cq, pkt) { % Test limit and classify lq or cq 1614 2: if ( lq.byt() + cq.byt() + MTU > limit) 1615 3: drop(pkt) % drop packet if buffer is full 1616 4: timestamp(pkt) % attach arrival time to packet 1617 5: % Packet classifier 1618 6: if ( ecn(pkt) modulo 2 == 1 ) % ECN bits = ECT(1) or CE 1619 7: lq.enqueue(pkt) 1620 8: else % ECN bits = not-ECT or ECT(0) 1621 9: cq.enqueue(pkt) 1622 10: } 1624 Figure 3: Example Enqueue Pseudocode for DualQ Coupled PI2 AQM 1626 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 1627 2: while ( lq.byt() + cq.byt() > 0 ) { 1628 3: if ( scheduler() == lq ) { 1629 4: lq.dequeue(pkt) % Scheduler chooses lq 1630 5: p'_L = laqm(lq.time()) && (lq.len() > Th_len) % Native LAQM 1631 6: p_L = max(p'_L, p_CL) % Combining function 1632 7: if ( recur(lq, p_L) ) % Linear marking 1633 8: mark(pkt) 1634 9: } else { 1635 10: cq.dequeue(pkt) % Scheduler chooses cq 1636 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 1637 12: if ( ecn(pkt) == 0 ) { % if ECN field = not-ECT 1638 13: drop(pkt) % squared drop 1639 14: continue % continue to the top of the while loop 1640 15: } 1641 16: mark(pkt) % squared mark 1642 17: } 1643 18: } 1644 19: return(pkt) % return the packet and stop 1645 20: } 1646 21: return(NULL) % no packet to dequeue 1647 22: } 1649 23: recur(q, likelihood) { % Returns TRUE with a certain likelihood 1650 24: q.count += likelihood 1651 25: if (q.count > 1) { 1652 26: q.count -= 1 1653 27: return TRUE 1654 28: } 1655 29: return FALSE 1656 30: } 1658 Figure 4: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 1660 When packets arrive, first a common queue limit is checked as shown 1661 in line 2 of the enqueuing pseudocode in Figure 3. This assumes a 1662 shared buffer for the two queues (Note b discusses the merits of 1663 separate buffers). In order to avoid any bias against larger 1664 packets, 1 MTU of space is always allowed and the limit is 1665 deliberately tested before enqueue. 1667 If limit is not exceeded, the packet is timestamped in line 4. This 1668 assumes that queue delay is measured using the sojourn time technique 1669 (see Note a for alternatives). 1671 At lines 5-9, the packet is classified and enqueued to the Classic or 1672 L4S queue dependent on the least significant bit of the ECN field in 1673 the IP header (line 6). Packets with a codepoint having an LSB of 0 1674 (Not-ECT and ECT(0)) will be enqueued in the Classic queue. 1675 Otherwise, ECT(1) and CE packets will be enqueued in the L4S queue. 1676 Optional additional packet classification flexibility is omitted for 1677 brevity (see [I-D.ietf-tsvwg-ecn-l4s-id]). 1679 The dequeue pseudocode (Figure 4) is repeatedly called whenever the 1680 lower layer is ready to forward a packet. It schedules one packet 1681 for dequeuing (or zero if the queue is empty) then returns control to 1682 the caller, so that it does not block while that packet is being 1683 forwarded. While making this dequeue decision, it also makes the 1684 necessary AQM decisions on dropping or marking. The alternative of 1685 applying the AQMs at enqueue would shift some processing from the 1686 critical time when each packet is dequeued. However, it would also 1687 add a whole queue of delay to the control signals, making the control 1688 loop sloppier (for a typical RTT it would double the Classic queue's 1689 feedback delay). 1691 All the dequeue code is contained within a large while loop so that 1692 if it decides to drop a packet, it will continue until it selects a 1693 packet to schedule. Line 3 of the dequeue pseudocode is where the 1694 scheduler chooses between the L4S queue (lq) and the Classic queue 1695 (cq). Detailed implementation of the scheduler is not shown (see 1696 discussion later). 1698 * If an L4S packet is scheduled, in lines 7 and 8 the packet is ECN- 1699 marked with likelihood p_L. The recur() function at the end of 1700 Figure 4 is used, which is preferred over random marking because 1701 it avoids delay due to randomization when interpreting congestion 1702 signals, but it still desynchronizes the saw-teeth of the flows. 1703 Line 6 calculates p_L as the maximum of the coupled L4S 1704 probability p_CL and the probability from the native L4S AQM p'_L. 1705 This implements the max() function shown in Figure 1 to couple the 1706 outputs of the two AQMs together. Of the two probabilities input 1707 to p_L in line 6: 1709 - p'_L is calculated per packet in line 5 by the laqm() function 1710 (see Figure 5), 1712 - Whereas p_CL is maintained by the dualpi2_update() function 1713 which runs every Tupdate (Tupdate is set in line 12 of 1714 Figure 2). 1716 * If a Classic packet is scheduled, lines 10 to 17 drop or mark the 1717 packet with probability p_C. 1719 The Native L4S AQM algorithm (Figure 5) is a ramp function, similar 1720 to the RED algorithm, but simplified as follows: 1722 * The extent of the ramp is defined in units of queuing delay, not 1723 bytes, so that configuration remains invariant as the queue 1724 departure rate varies. 1726 * It uses instantaneous queueing delay, which avoids the complexity 1727 of smoothing, but also avoids embedding a worst-case RTT of 1728 smoothing delay in the network (see Section 2.1). 1730 * The ramp rises linearly directly from 0 to 1, not to an 1731 intermediate value of p'_L as RED would, because there is no need 1732 to keep ECN marking probability low. 1734 * Marking does not have to be randomized. Determinism is used 1735 instead of randomness; to reduce the delay necessary to smooth out 1736 the noise of randomness from the signal. 1738 The ramp function requires two configuration parameters, the minimum 1739 threshold (minTh) and the width of the ramp (range), both in units of 1740 queuing time, as shown in lines 17 & 18 of the initialization 1741 function in Figure 2. The ramp function can be configured as a step 1742 (see Note c). 1744 Although the DCTCP paper [Alizadeh-stability] recommends an ECN 1745 marking threshold of 0.17*RTT_typ, it also shows that the threshold 1746 can be much shallower with hardly any worse under-utilization of the 1747 link (because the amplitude of DCTCP's sawteeth is so small). Based 1748 on extensive experiments, for the public Internet the default minimum 1749 ECN marking threshold (target) in Figure 2 is considered a good 1750 compromise, even though it is significantly smaller fraction of 1751 RTT_typ. 1753 A minimum marking threshold parameter (Th_len, default 1 packet) is 1754 also necessary to ensure that the ramp does not trigger excessive 1755 marking on slow links. Where an implementation knows the link rate, 1756 it can set up this minimum at the time it is configured. For 1757 instance, it would divide 1 MTU by the link rate to convert it into a 1758 serialization time, then if the lower threshold of the Native L AQM 1759 ramp was lower than this serialization time, it could increase the 1760 thresholds to shift the bottom of the ramp to 2 MTU. This is the 1761 approach used in DOCSIS [DOCSIS3.1], because the configured link rate 1762 is dedicated to the DualQ. 1764 In software implementations, as shown in the pseudocode, the link 1765 rate might be shared with other queues. The second part of the 1766 logical AND condition in Line 5 of Figure 4 caters for such cases. 1767 Even if the outcome of the Native L4S AQM function, laqm(), is true, 1768 it does not mark a packet unless the queue also exceeds 1 packet (but 1769 see note later about the Linux implementation). 1771 1: laqm(qdelay) { % Returns native L4S AQM probability 1772 2: if (qdelay >= maxTh) 1773 3: return 1 1774 4: else if (qdelay > minTh) 1775 5: return (qdelay - minTh)/range % Divide could use a bit-shift 1776 6: else 1777 7: return 0 1778 8: } 1780 Figure 5: Example Pseudocode for the Native L4S AQM 1782 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 1783 2: curq = cq.time() % use queuing time of first-in Classic packet 1784 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 1785 4: p_CL = k * p' % Coupled L4S prob = base prob * coupling factor 1786 5: p_C = p'^2 % Classic prob = (base prob)^2 1787 6: prevq = curq 1788 7: } 1790 Figure 6: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 1792 (Clamping p' within the range [0,1] omitted for clarity - see text) 1794 The coupled marking probability, p_CL depends on the base probability 1795 (p'), which is kept up to date by the core PI algorithm in Figure 6 1796 executed every Tupdate. 1798 Note that p' solely depends on the queuing time in the Classic queue. 1799 In line 2, the current queuing delay (curq) is evaluated from how 1800 long the head packet was in the Classic queue (cq). The function 1801 cq.time() (not shown) subtracts the time stamped at enqueue from the 1802 current time (see Note a) and implicitly takes the current queuing 1803 delay as 0 if the queue is empty. 1805 The algorithm centres on line 3, which is a classical Proportional- 1806 Integral (PI) controller that alters p' dependent on: a) the error 1807 between the current queuing delay (curq) and the target queuing 1808 delay, 'target'; and b) the change in queuing delay since the last 1809 sample. The name 'PI' represents the fact that the second factor 1810 (how fast the queue is growing) is _P_roportional to load while the 1811 first is the _I_ntegral of the load (so it removes any standing queue 1812 in excess of the target). 1814 The target parameter can be set based on local knowledge, but the aim 1815 is for the default to be a good compromise for anywhere in the 1816 intended deployment environment---the public Internet. According to 1817 [PI2param], the target queuing delay on line 9 of Figure 2 is related 1818 to the typical base RTT worldwide, RTT_typ, by two factors: target = 1819 RTT_typ * g * f. Below we summarize the rationale behind these 1820 factors and introduce a further adjustment. The two factors ensure 1821 that, in a large proportion of cases (say 90%), the sawtooth 1822 variations in RTT of a single flow will fit within the buffer without 1823 underutilizing the link. Frankly, these factors are educated 1824 guesses, but with the emphasis closer to 'educated' than to 'guess' 1825 (see [PI2param] for full background): 1827 * RTT_typ is taken as 25 ms. This is based on an average CDN 1828 latency measured in each country weighted by the number of 1829 Internet users in that country to produce an overall weighted 1830 average for the Internet [PI2param]. Countries were ranked by 1831 number of Internet users, and once 90% of Internet users were 1832 covered, smaller countries were excluded to avoid 1833 unrepresentatively small sample sizes. Also, importantly, the 1834 data for the average CDN latency in China (with the largest number 1835 of Internet users) has been removed, because the CDN latency was a 1836 significant outlier and, on reflection, the experimental technique 1837 seemed inappropriate to the CDN market in China. 1839 * g is taken as 0.38. The factor g is a geometry factor that 1840 characterizes the shape of the sawteeth of prevalent Classic 1841 congestion controllers. The geometry factor is the fraction of 1842 the amplitude of the sawtooth variability in queue delay that lies 1843 below the AQM's target. For instance, at low bit rate, the 1844 geometry factor of standard Reno is 0.5, but at higher rates it 1845 tends to just under 1. According to the census of congestion 1846 controllers conducted by Mishra _et al_ in Jul-Oct 2019 1847 [CCcensus19], most Classic TCP traffic uses Cubic. And, according 1848 to the analysis in [PI2param], if running over a PI2 AQM, a large 1849 proportion of this Cubic traffic would be in its Reno-Friendly 1850 mode, which has a geometry factor of ~0.39 (all known 1851 implementations). The rest of the Cubic traffic would be in true 1852 Cubic mode, which has a geometry factor of ~0.36. Without 1853 modelling the sawtooth profiles from all the other less prevalent 1854 congestion controllers, we estimate a 7:3 weighted average of 1855 these two, resulting in an average geometry factor of 0.38. 1857 * f is taken as 2. The factor f is a safety factor that increases 1858 the target queue to allow for the distribution of RTT_typ around 1859 its mean. Otherwise the target queue would only avoid 1860 underutilization for those users below the mean. It also provides 1861 a safety margin for the proportion of paths in use that span 1862 beyond the distance between a user and their local CDN. Currently 1863 no data is available on the variance of queue delay around the 1864 mean in each region, so there is plenty of room for this guess to 1865 become more educated. 1867 * [PI2param] recommends target = RTT_typ * g * f = 25ms * 0.38 * 2 = 1868 19 ms. However a further adjustment is warranted, because target 1869 is moving year on year. The paper is based on data collected in 1870 2019, and it mentions evidence from speedtest.net that suggests 1871 RTT_typ reduced by 17% (fixed) or 12% (mobile) between 2020 and 1872 2021. Therefore we recommend a default of target = 15 ms at the 1873 time of writing (2021). 1875 Operators can always use the data and discussion in [PI2param] to 1876 configure a more appropriate target for their environment. For 1877 instance, an operator might wish to question the assumptions called 1878 out in that paper, such as the goal of no underutilization for a 1879 large majority of single flow transfers (given many large transfers 1880 use multiple flows to avoid the scaling limitations of Classic 1881 flows). 1883 The two 'gain factors' in line 3 of Figure 6, alpha and beta, 1884 respectively weight how strongly each of the two elements (Integral 1885 and Proportional) alters p'. They are in units of 'per second of 1886 delay' or Hz, because they transform differences in queueing delay 1887 into changes in probability (assuming probability has a value from 0 1888 to 1). 1890 Alpha and beta determine how much p' ought to change after each 1891 update interval (Tupdate). For smaller Tupdate, p' should change by 1892 the same amount per second, but in finer more frequent steps. So 1893 alpha depends on Tupdate (see line 13 of the initialization function 1894 in Figure 2). It is best to update p' as frequently as possible, but 1895 Tupdate will probably be constrained by hardware performance. As 1896 shown in line 13, the update interval should be frequent enough to 1897 update at least once in the time taken for the target queue to drain 1898 ('target') as long as it updates at least three times per maximum 1899 RTT. Tupdate defaults to 16 ms in the reference Linux implementation 1900 because it has to be rounded to a multiple of 4 ms. For link rates 1901 from 4 to 200 Mb/s and a maximum RTT of 100ms, it has been verified 1902 through extensive testing that Tupdate=16ms (as also recommended in 1903 [RFC8033]) is sufficient. 1905 The choice of alpha and beta also determines the AQM's stable 1906 operating range. The AQM ought to change p' as fast as possible in 1907 response to changes in load without over-compensating and therefore 1908 causing oscillations in the queue. Therefore, the values of alpha 1909 and beta also depend on the RTT of the expected worst-case flow 1910 (RTT_max). 1912 The maximum RTT of a PI controller (RTT_max in line 10 of Figure 2) 1913 is not an absolute maximum, but more instability (more queue 1914 variability) sets in for long-running flows with an RTT above this 1915 value. The propagation delay half way round the planet and back in 1916 glass fibre is 200 ms. However, hardly any traffic traverses such 1917 extreme paths and, since the significant consolidation of Internet 1918 traffic between 2007 and 2009 [Labovitz10], a high and growing 1919 proportion of all Internet traffic (roughly two-thirds at the time of 1920 writing) has been served from content distribution networks (CDNs) or 1921 'cloud' services distributed close to end-users. The Internet might 1922 change again, but for now, designing for a maximum RTT of 100ms is a 1923 good compromise between faster queue control at low RTT and some 1924 instability on the occasions when a longer path is necessary. 1926 Recommended derivations of the gain constants alpha and beta can be 1927 approximated for Reno over a PI2 AQM as: alpha = 0.1 * Tupdate / 1928 RTT_max^2; beta = 0.3 / RTT_max, as shown in lines 14 & 15 of 1929 Figure 2. These are derived from the stability analysis in [PI2]. 1930 For the default values of Tupdate=16 ms and RTT_max = 100 ms, they 1931 result in alpha = 0.16; beta = 3.2 (discrepancies are due to 1932 rounding). These defaults have been verified with a wide range of 1933 link rates, target delays and a range of traffic models with mixed 1934 and similar RTTs, short and long flows, etc. 1936 In corner cases, p' can overflow the range [0,1] so the resulting 1937 value of p' has to be bounded (omitted from the pseudocode). Then, 1938 as already explained, the coupled and Classic probabilities are 1939 derived from the new p' in lines 4 and 5 of Figure 6 as p_CL = k*p' 1940 and p_C = p'^2. 1942 Because the coupled L4S marking probability (p_CL) is factored up by 1943 k, the dynamic gain parameters alpha and beta are also inherently 1944 factored up by k for the L4S queue. So, the effective gain factor 1945 for the L4S queue is k*alpha (with defaults alpha = 0.16 Hz and k=2, 1946 effective L4S alpha = 0.32 Hz). 1948 Unlike in PIE [RFC8033], alpha and beta do not need to be tuned every 1949 Tupdate dependent on p'. Instead, in PI2, alpha and beta are 1950 independent of p' because the squaring applied to Classic traffic 1951 tunes them inherently. This is explained in [PI2], which also 1952 explains why this more principled approach removes the need for most 1953 of the heuristics that had to be added to PIE. 1955 Nonetheless, an implementer might wish to add selected details to 1956 either AQM. For instance the Linux reference DualPI2 implementation 1957 includes the following (not shown in the pseudocode above): 1959 * The check that the queue exceeds Th_len before marking with the 1960 native L4S AQM is actually at enqueue, not dequeue, otherwise it 1961 would exempt the last packet of a burst from being marked. The 1962 result of the check is conveyed from enqueue to the dequeue 1963 function via a boolean in the packet metadata. 1965 * Classic and coupled marking or dropping (i.e. based on p_C and 1966 p_CL from the PI controller) is not applied to a packet if the 1967 respective queue length in bytes is < 2 MTU (prior to enqueuing 1968 the packet or dequeuing it, depending on whether the AQM is 1969 configured to be applied at enqueue or dequeue); 1971 * In the WRR scheduler, the 'credit' indicating which queue should 1972 transmit is only changed if there are packets in both queues 1973 (i.e. if there is actual resource contention). This means that a 1974 properly paced L flow might never be delayed by the WRR. The WRR 1975 credit is reset in favour of the L queue when the link is idle. 1977 An implementer might also wish to add other heuristics, e.g. burst 1978 protection [RFC8033] or enhanced burst protection [RFC8034]. 1980 Notes: 1982 a. The drain rate of the queue can vary if it is scheduled relative 1983 to other queues, or to cater for fluctuations in a wireless 1984 medium. To auto-adjust to changes in drain rate, the queue needs 1985 to be measured in time, not bytes or packets [AQMmetrics], 1986 [CoDel]. Queuing delay could be measured directly by storing a 1987 per-packet time-stamp as each packet is enqueued, and subtracting 1988 this from the system time when the packet is dequeued. If time- 1989 stamping is not easy to introduce with certain hardware, queuing 1990 delay could be predicted indirectly by dividing the size of the 1991 queue by the predicted departure rate, which might be known 1992 precisely for some link technologies (see for example [RFC8034]). 1994 b. Line 2 of the dualpi2_enqueue() function (Figure 3) assumes an 1995 implementation where lq and cq share common buffer memory. An 1996 alternative implementation could use separate buffers for each 1997 queue, in which case the arriving packet would have to be 1998 classified first to determine which buffer to check for available 1999 space. The choice is a trade off; a shared buffer can use less 2000 memory whereas separate buffers isolate the L4S queue from tail- 2001 drop due to large bursts of Classic traffic (e.g. a Classic Reno 2002 TCP during slow-start over a long RTT). 2004 c. There has been some concern that using the step function of DCTCP 2005 for the Native L4S AQM requires end-systems to smooth the signal 2006 for an unnecessarily large number of round trips to ensure 2007 sufficient fidelity. A ramp is no worse than a step in initial 2008 experiments with existing DCTCP. Therefore, it is recommended 2009 that a ramp is configured in place of a step, which will allow 2010 congestion control algorithms to investigate faster smoothing 2011 algorithms. 2013 A ramp is more general that a step, because an operator can 2014 effectively turn the ramp into a step function, as used by DCTCP, 2015 by setting the range to zero. There will not be a divide by zero 2016 problem at line 5 of Figure 5 because, if minTh is equal to 2017 maxTh, the condition for this ramp calculation cannot arise. 2019 A.2. Pass #2: Overload Details 2021 Figure 7 repeats the dequeue function of Figure 4, but with overload 2022 details added. Similarly Figure 8 repeats the core PI algorithm of 2023 Figure 6 with overload details added. The initialization, enqueue, 2024 L4S AQM and recur functions are unchanged. 2026 In line 10 of the initialization function (Figure 2), the maximum 2027 Classic drop probability p_Cmax = min(1/k^2, 1) or 1/4 for the 2028 default coupling factor k=2. p_Cmax is the point at which it is 2029 deemed that the Classic queue has become persistently overloaded, so 2030 it switches to using drop, even for ECN-capable packets. ECT packets 2031 that are not dropped can still be ECN-marked. 2033 In practice, 25% has been found to be a good threshold to preserve 2034 fairness between ECN capable and non ECN capable traffic. This 2035 protects the queues against both temporary overload from responsive 2036 flows and more persistent overload from any unresponsive traffic that 2037 falsely claims to be responsive to ECN. 2039 When the Classic ECN marking probability reaches the p_Cmax threshold 2040 (1/k^2), the marking probability coupled to the L4S queue, p_CL will 2041 always be 100% for any k (by equation (1) in Section 2). So, for 2042 readability, the constant p_Lmax is defined as 1 in line 22 of the 2043 initialization function (Figure 2). This is intended to ensure that 2044 the L4S queue starts to introduce dropping once ECN-marking saturates 2045 at 100% and can rise no further. The 'Prague L4S' 2046 requirements [I-D.ietf-tsvwg-ecn-l4s-id] state that, when an L4S 2047 congestion control detects a drop, it falls back to a response that 2048 coexists with 'Classic' Reno congestion control. So it is correct 2049 that, when the L4S queue drops packets, it drops them proportional to 2050 p'^2, as if they are Classic packets. 2052 Both these switch-overs are triggered by the tests for overload 2053 introduced in lines 4b and 12b of the dequeue function (Figure 7). 2054 Lines 8c to 8g drop L4S packets with probability p'^2. Lines 8h to 2055 8i mark the remaining packets with probability p_CL. Given p_Lmax = 2056 1, all remaining packets will be marked because, to have reached the 2057 else block at line 8b, p_CL >= 1. 2059 Lines 2c to 2d in the core PI algorithm (Figure 8) deal with overload 2060 of the L4S queue when there is no Classic traffic. This is 2061 necessary, because the core PI algorithm maintains the appropriate 2062 drop probability to regulate overload, but it depends on the length 2063 of the Classic queue. If there is no Classic queue the naive PI 2064 update function in Figure 6 would drop nothing, even if the L4S queue 2065 were overloaded - so tail drop would have to take over (lines 2 and 3 2066 of Figure 3). 2068 Instead, the test at line 2a of the full PI update function in 2069 Figure 8 keeps delay on target using drop. If the test at line 2a of 2070 Figure 8 finds that the Classic queue is empty, line 2d measures the 2071 current queue delay using the L4S queue instead. While the L4S queue 2072 is not overloaded, its delay will always be tiny compared to the 2073 target Classic queue delay. So p_CL will be driven to zero, and the 2074 L4S queue will naturally be governed solely by p'_L from the native 2075 L4S AQM (lines 5 and 6 of the dequeue algorithm in Figure 7). But, 2076 if unresponsive L4S source(s) cause overload, the DualQ transitions 2077 smoothly to L4S marking based on the PI algorithm. If overload 2078 increases further, it naturally transitions from marking to dropping 2079 by the switch-over mechanism already described. 2081 1: dualpi2_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2082 2: while ( lq.byt() + cq.byt() > 0 ) { 2083 3: if ( scheduler() == lq ) { 2084 4a: lq.dequeue(pkt) % L4S scheduled 2085 4b: if ( p_CL < p_Lmax ) { % Check for overload saturation 2086 5: p'_L = laqm(lq.time()) && (lq.len()>Th_len) % Native LAQM 2087 6: p_L = max(p'_L, p_CL) % Combining function 2088 7: if ( recur(lq, p_L) %Linear marking 2089 8a: mark(pkt) 2090 8b: } else { % overload saturation 2091 8c: if ( recur(lq, p_C) ) { % probability p_C = p'^2 2092 8e: drop(pkt) % revert to Classic drop due to overload 2093 8f: continue % continue to the top of the while loop 2094 8g: } 2095 8h: if ( recur(lq, p_CL) ) % probability p_CL = k * p' 2096 8i: mark(pkt) % linear marking of remaining packets 2097 8j: } 2098 9: } else { 2099 10: cq.dequeue(pkt) % Classic scheduled 2100 11: if ( recur(cq, p_C) ) { % probability p_C = p'^2 2101 12a: if ( (ecn(pkt) == 0) % ECN field = not-ECT 2102 12b: OR (p_C >= p_Cmax) ) { % Overload disables ECN 2103 13: drop(pkt) % squared drop, redo loop 2104 14: continue % continue to the top of the while loop 2105 15: } 2106 16: mark(pkt) % squared mark 2107 17: } 2108 18: } 2109 19: return(pkt) % return the packet and stop 2110 20: } 2111 21: return(NULL) % no packet to dequeue 2112 22: } 2114 Figure 7: Example Dequeue Pseudocode for DualQ Coupled PI2 AQM 2115 (Including Overload Code) 2117 1: dualpi2_update(lq, cq) { % Update p' every Tupdate 2118 2a: if ( cq.byt() > 0 ) 2119 2b: curq = cq.time() %use queuing time of first-in Classic packet 2120 2c: else % Classic queue empty 2121 2d: curq = lq.time() % use queuing time of first-in L4S packet 2122 3: p' = p' + alpha * (curq - target) + beta * (curq - prevq) 2123 4: p_CL = p' * k % Coupled L4S prob = base prob * coupling factor 2124 5: p_C = p'^2 % Classic prob = (base prob)^2 2125 6: prevq = curq 2126 7: } 2127 Figure 8: Example PI-Update Pseudocode for DualQ Coupled PI2 AQM 2128 (Including Overload Code) 2130 The choice of scheduler technology is critical to overload protection 2131 (see Section 4.1). 2133 * A well-understood weighted scheduler such as weighted round robin 2134 (WRR) is recommended. As long as the scheduler weight for Classic 2135 is small (e.g. 1/16), its exact value is unimportant because it 2136 does not normally determine capacity shares. The weight is only 2137 important to prevent unresponsive L4S traffic starving Classic 2138 traffic. This is because capacity sharing between the queues is 2139 normally determined by the coupled congestion signal, which 2140 overrides the scheduler, by making L4S sources leave roughly equal 2141 per-flow capacity available for Classic flows. 2143 * Alternatively, a time-shifted FIFO (TS-FIFO) could be used. It 2144 works by selecting the head packet that has waited the longest, 2145 biased against the Classic traffic by a time-shift of tshift. To 2146 implement time-shifted FIFO, the scheduler() function in line 3 of 2147 the dequeue code would simply be implemented as the scheduler() 2148 function at the bottom of Figure 10 in Appendix B. For the public 2149 Internet a good value for tshift is 50ms. For private networks 2150 with smaller diameter, about 4*target would be reasonable. TS- 2151 FIFO is a very simple scheduler, but complexity might need to be 2152 added to address some deficiencies (which is why it is not 2153 recommended over WRR): 2155 - TS-FIFO does not fully isolate latency in the L4S queue from 2156 uncontrolled bursts in the Classic queue; 2158 - TS-FIFO is only appropriate if time-stamping of packets is 2159 feasible; 2161 - Even if time-stamping is supported, the sojourn time of the 2162 head packet is always stale. For instance, if a burst arrives 2163 at an empty queue, the sojourn time will only measure the delay 2164 of the burst once the burst is over, even though the queue knew 2165 about it from the start. To remedy this, each head packet can 2166 be marked based on the delay it causes to packets backlogged 2167 behind it, rather than based on its own delay due to the 2168 packets in front of it. [Heist21] identifies a specific 2169 scenario where bursty traffic significantly hits utilization of 2170 the L queue. If this effect proves to be more widely 2171 applicable, it is believed that using the delay behind the head 2172 would improve performance. It can be implemented by 2173 multiplying the backlog at dequeue by the serialization delay 2174 per unit of backlog. The implementation details will depend on 2175 whether the link rate is known; if it is not, a moving average 2176 of the serialization delay can be maintained. This approach 2177 should cost less in operations and memory than the proposed 2178 'scaled sojourn time' metric, which is the sojourn time of a 2179 packet scaled by the ratio of the queue sizes when the packet 2180 departed and arrived [SigQ-Dyn]. 2182 * A strict priority scheduler would be inappropriate, because it 2183 would starve Classic if L4S was overloaded. 2185 Appendix B. Example DualQ Coupled Curvy RED Algorithm 2187 As another example of a DualQ Coupled AQM algorithm, the pseudocode 2188 below gives the Curvy RED based algorithm. Although the AQM was 2189 designed to be efficient in integer arithmetic, to aid understanding 2190 it is first given using floating point arithmetic (Figure 10). Then, 2191 one possible optimization for integer arithmetic is given, also in 2192 pseudocode (Figure 11). To aid comparison, the line numbers are kept 2193 in step between the two by using letter suffixes where the longer 2194 code needs extra lines. 2196 B.1. Curvy RED in Pseudocode 2198 The pseudocode manipulates three main structures of variables: the 2199 packet (pkt), the L4S queue (lq) and the Classic queue (cq) and 2200 consists of the following five functions: 2202 * The initialization function cred_params_init(...) (Figure 2) that 2203 sets parameter defaults (the API for setting non-default values is 2204 omitted for brevity); 2206 * The dequeue function cred_dequeue(lq, cq, pkt) (Figure 4); 2208 * The scheduling function scheduler(), which selects between the 2209 head packets of the two queues. 2211 It also uses the following functions that are either shown elsewhere, 2212 or not shown in full here: 2214 * The enqueue function, which is identical to that used for DualPI2, 2215 dualpi2_enqueue(lq, cq, pkt) in Figure 3; 2217 * mark(pkt) and drop(pkt) for ECN-marking and dropping a packet; 2219 * cq.byt() or lq.byt() returns the current length (aka. backlog) of 2220 the relevant queue in bytes; 2222 * cq.time() or lq.time() returns the current queuing delay 2223 (aka. sojourn time or service time) of the relevant queue in units 2224 of time (see Note a in Appendix A.1). 2226 Because Curvy RED was evaluated before DualPI2, certain improvements 2227 introduced for DualPI2 were not evaluated for Curvy RED. In the 2228 pseudocode below, the straightforward improvements have been added on 2229 the assumption they will provide similar benefits, but that has not 2230 been proven experimentally. They are: i) a conditional priority 2231 scheduler instead of strict priority ii) a time-based threshold for 2232 the native L4S AQM; iii) ECN support for the Classic AQM. A recent 2233 evaluation has proved that a minimum ECN-marking threshold (minTh) 2234 greatly improves performance, so this is also included in the 2235 pseudocode. 2237 Overload protection has not been added to the Curvy RED pseudocode 2238 below so as not to detract from the main features. It would be added 2239 in exactly the same way as in Appendix A.2 for the DualPI2 2240 pseudocode. The native L4S AQM uses a step threshold, but a ramp 2241 like that described for DualPI2 could be used instead. The scheduler 2242 uses the simple TS-FIFO algorithm, but it could be replaced with WRR. 2244 The Curvy RED algorithm has not been maintained or evaluated to the 2245 same degree as the DualPI2 algorithm. In initial experiments on 2246 broadband access links ranging from 4 Mb/s to 200 Mb/s with base RTTs 2247 from 5 ms to 100 ms, Curvy RED achieved good results with the default 2248 parameters in Figure 9. 2250 The parameters are categorised by whether they relate to the Classic 2251 AQM, the L4S AQM or the framework coupling them together. Constants 2252 and variables derived from these parameters are also included at the 2253 end of each category. These are the raw input parameters for the 2254 algorithm. A configuration front-end could accept more meaningful 2255 parameters (e.g. RTT_max and RTT_typ) and convert them into these raw 2256 parameters, as has been done for DualPI2 in Appendix A. Where 2257 necessary, parameters are explained further in the walk-through of 2258 the pseudocode below. 2260 1: cred_params_init(...) { % Set input parameter defaults 2261 2: % DualQ Coupled framework parameters 2262 3: limit = MAX_LINK_RATE * 250 ms % Dual buffer size 2263 4: k' = 1 % Coupling factor as a power of 2 2264 5: tshift = 50 ms % Time shift of TS-FIFO scheduler 2265 6: % Constants derived from Classic AQM parameters 2266 7: k = 2^k' % Coupling factor from Equation (1) 2267 6: 2268 7: % Classic AQM parameters 2269 8: g_C = 5 % EWMA smoothing parameter as a power of 1/2 2270 9: S_C = -1 % Classic ramp scaling factor as a power of 2 2271 10: minTh = 500 ms % No Classic drop/mark below this queue delay 2272 11: % Constants derived from Classic AQM parameters 2273 12: gamma = 2^(-g_C) % EWMA smoothing parameter 2274 13: range_C = 2^S_C % Range of Classic ramp 2275 14: 2276 15: % L4S AQM parameters 2277 16: T = 1 ms % Queue delay threshold for native L4S AQM 2278 17: % Constants derived from above parameters 2279 18: S_L = S_C - k' % L4S ramp scaling factor as a power of 2 2280 19: range_L = 2^S_L % Range of L4S ramp 2281 20: } 2283 Figure 9: Example Header Pseudocode for DualQ Coupled Curvy RED AQM 2285 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2286 2: while ( lq.byt() + cq.byt() > 0 ) { 2287 3: if ( scheduler() == lq ) { 2288 4: lq.dequeue(pkt) % L4S scheduled 2289 5a: p_CL = (Q_C - minTh) / range_L 2290 5b: if ( ( lq.time() > T ) 2291 5c: OR ( p_CL > maxrand(U) ) ) 2292 6: mark(pkt) 2293 7: } else { 2294 8: cq.dequeue(pkt) % Classic scheduled 2295 9a: Q_C = gamma * cq.time() + (1-gamma) * Q_C % Classic Q EWMA 2296 10a: sqrt_p_C = (Q_C - minTh) / range_C 2297 10b: if ( sqrt_p_C > maxrand(2*U) ) { 2298 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2299 12: drop(pkt) % Squared drop, redo loop 2300 13: continue % continue to the top of the while loop 2301 14: } 2302 15: mark(pkt) 2303 16: } 2304 17: } 2305 18: return(pkt) % return the packet and stop here 2306 19: } 2307 20: return(NULL) % no packet to dequeue 2308 21: } 2310 22: maxrand(u) { % return the max of u random numbers 2311 23: maxr=0 2312 24: while (u-- > 0) 2313 25: maxr = max(maxr, rand()) % 0 <= rand() < 1 2314 26: return(maxr) 2315 27: } 2317 28: scheduler() { 2318 29: if ( lq.time() + tshift >= cq.time() ) 2319 30: return lq; 2320 31: else 2321 32: return cq; 2322 33: } 2324 Figure 10: Example Dequeue Pseudocode for DualQ Coupled Curvy RED AQM 2326 The dequeue pseudocode (Figure 10) is repeatedly called whenever the 2327 lower layer is ready to forward a packet. It schedules one packet 2328 for dequeuing (or zero if the queue is empty) then returns control to 2329 the caller, so that it does not block while that packet is being 2330 forwarded. While making this dequeue decision, it also makes the 2331 necessary AQM decisions on dropping or marking. The alternative of 2332 applying the AQMs at enqueue would shift some processing from the 2333 critical time when each packet is dequeued. However, it would also 2334 add a whole queue of delay to the control signals, making the control 2335 loop very sloppy. 2337 The code is written assuming the AQMs are applied on dequeue (Note 2338 1). All the dequeue code is contained within a large while loop so 2339 that if it decides to drop a packet, it will continue until it 2340 selects a packet to schedule. If both queues are empty, the routine 2341 returns NULL at line 20. Line 3 of the dequeue pseudocode is where 2342 the conditional priority scheduler chooses between the L4S queue (lq) 2343 and the Classic queue (cq). The time-shifted FIFO scheduler is shown 2344 at lines 28-33, which would be suitable if simplicity is paramount 2345 (see Note 2). 2347 Within each queue, the decision whether to forward, drop or mark is 2348 taken as follows (to simplify the explanation, it is assumed that 2349 U=1): 2351 L4S: If the test at line 3 determines there is an L4S packet to 2352 dequeue, the tests at lines 5b and 5c determine whether to mark 2353 it. The first is a simple test of whether the L4S queue delay 2354 (lq.time()) is greater than a step threshold T (Note 3). The 2355 second test is similar to the random ECN marking in RED, but with 2356 the following differences: i) marking depends on queuing time, not 2357 bytes, in order to scale for any link rate without being 2358 reconfigured; ii) marking of the L4S queue depends on a logical OR 2359 of two tests; one against its own queuing time and one against the 2360 queuing time of the _other_ (Classic) queue; iii) the tests are 2361 against the instantaneous queuing time of the L4S queue, but a 2362 smoothed average of the other (Classic) queue; iv) the queue is 2363 compared with the maximum of U random numbers (but if U=1, this is 2364 the same as the single random number used in RED). 2366 Specifically, in line 5a the coupled marking probability p_CL is 2367 set to the amount by which the averaged Classic queueing delay Q_C 2368 exceeds the minimum queuing delay threshold (minTh) all divided by 2369 the L4S scaling parameter range_L. range_L represents the queuing 2370 delay (in seconds) added to minTh at which marking probability 2371 would hit 100%. Then in line 5c (if U=1) the result is compared 2372 with a uniformly distributed random number between 0 and 1, which 2373 ensures that, over range_L, marking probability will linearly 2374 increase with queueing time. 2376 Classic: If the scheduler at line 3 chooses to dequeue a Classic 2377 packet and jumps to line 7, the test at line 10b determines 2378 whether to drop or mark it. But before that, line 9a updates Q_C, 2379 which is an exponentially weighted moving average (Note 4) of the 2380 queuing time of the Classic queue, where cq.time() is the current 2381 instantaneous queueing time of the packet at the head of the 2382 Classic queue (zero if empty) and gamma is the EWMA constant 2383 (default 1/32, see line 12 of the initialization function). 2385 Lines 10a and 10b implement the Classic AQM. In line 10a the 2386 averaged queuing time Q_C is divided by the Classic scaling 2387 parameter range_C, in the same way that queuing time was scaled 2388 for L4S marking. This scaled queuing time will be squared to 2389 compute Classic drop probability so, before it is squared, it is 2390 effectively the square root of the drop probability, hence it is 2391 given the variable name sqrt_p_C. The squaring is done by 2392 comparing it with the maximum out of two random numbers (assuming 2393 U=1). Comparing it with the maximum out of two is the same as the 2394 logical `AND' of two tests, which ensures drop probability rises 2395 with the square of queuing time. 2397 The AQM functions in each queue (lines 5c & 10b) are two cases of a 2398 new generalization of RED called Curvy RED, motivated as follows. 2399 When the performance of this AQM was compared with FQ-CoDel and PIE, 2400 their goal of holding queuing delay to a fixed target seemed 2401 misguided [CRED_Insights]. As the number of flows increases, if the 2402 AQM does not allow host congestion controllers to increase queuing 2403 delay, it has to introduce abnormally high levels of loss. Then loss 2404 rather than queuing becomes the dominant cause of delay for short 2405 flows, due to timeouts and tail losses. 2407 Curvy RED constrains delay with a softened target that allows some 2408 increase in delay as load increases. This is achieved by increasing 2409 drop probability on a convex curve relative to queue growth (the 2410 square curve in the Classic queue, if U=1). Like RED, the curve hugs 2411 the zero axis while the queue is shallow. Then, as load increases, 2412 it introduces a growing barrier to higher delay. But, unlike RED, it 2413 requires only two parameters, not three. The disadvantage of Curvy 2414 RED (compared to a PI controller for example) is that it is not 2415 adapted to a wide range of RTTs. Curvy RED can be used as is when 2416 the RTT range to be supported is limited, otherwise an adaptation 2417 mechanism is needed. 2419 From our limited experiments with Curvy RED so far, recommended 2420 values of these parameters are: S_C = -1; g_C = 5; T = 5 * MTU at the 2421 link rate (about 1ms at 60Mb/s) for the range of base RTTs typical on 2422 the public Internet. [CRED_Insights] explains why these parameters 2423 are applicable whatever rate link this AQM implementation is deployed 2424 on and how the parameters would need to be adjusted for a scenario 2425 with a different range of RTTs (e.g. a data centre). The setting of 2426 k depends on policy (see Section 2.5 and Appendix C.2 respectively 2427 for its recommended setting and guidance on alternatives). 2429 There is also a cUrviness parameter, U, which is a small positive 2430 integer. It is likely to take the same hard-coded value for all 2431 implementations, once experiments have determined a good value. Only 2432 U=1 has been used in experiments so far, but results might be even 2433 better with U=2 or higher. 2435 Notes: 2437 1. The alternative of applying the AQMs at enqueue would shift some 2438 processing from the critical time when each packet is dequeued. 2439 However, it would also add a whole queue of delay to the control 2440 signals, making the control loop sloppier (for a typical RTT it 2441 would double the Classic queue's feedback delay). On a platform 2442 where packet timestamping is feasible, e.g. Linux, it is also 2443 easiest to apply the AQMs at dequeue because that is where 2444 queuing time is also measured. 2446 2. WRR better isolates the L4S queue from large delay bursts in the 2447 Classic queue, but it is slightly less simple than TS-FIFO. If 2448 WRR were used, a low default Classic weight (e.g. 1/16) would 2449 need to be configured in place of the time shift in line 5 of the 2450 initialization function (Figure 9). 2452 3. A step function is shown for simplicity. A ramp function (see 2453 Figure 5 and the discussion around it in Appendix A.1) is 2454 recommended, because it is more general than a step and has the 2455 potential to enable L4S congestion controls to converge more 2456 rapidly. 2458 4. An EWMA is only one possible way to filter bursts; other more 2459 adaptive smoothing methods could be valid and it might be 2460 appropriate to decrease the EWMA faster than it increases, 2461 e.g. by using the minimum of the smoothed and instantaneous queue 2462 delays, min(Q_C, qc.time()). 2464 B.2. Efficient Implementation of Curvy RED 2466 Although code optimization depends on the platform, the following 2467 notes explain where the design of Curvy RED was particularly 2468 motivated by efficient implementation. 2470 The Classic AQM at line 10b calls maxrand(2*U), which gives twice as 2471 much curviness as the call to maxrand(U) in the marking function at 2472 line 5c. This is the trick that implements the square rule in 2473 equation (1) (Section 2.1). This is based on the fact that, given a 2474 number X from 1 to 6, the probability that two dice throws will both 2475 be less than X is the square of the probability that one throw will 2476 be less than X. So, when U=1, the L4S marking function is linear and 2477 the Classic dropping function is squared. If U=2, L4S would be a 2478 square function and Classic would be quartic. And so on. 2480 The maxrand(u) function in lines 16-21 simply generates u random 2481 numbers and returns the maximum. Typically, maxrand(u) could be run 2482 in parallel out of band. For instance, if U=1, the Classic queue 2483 would require the maximum of two random numbers. So, instead of 2484 calling maxrand(2*U) in-band, the maximum of every pair of values 2485 from a pseudorandom number generator could be generated out-of-band, 2486 and held in a buffer ready for the Classic queue to consume. 2488 1: cred_dequeue(lq, cq, pkt) { % Couples L4S & Classic queues 2489 2: while ( lq.byt() + cq.byt() > 0 ) { 2490 3: if ( scheduler() == lq ) { 2491 4: lq.dequeue(pkt) % L4S scheduled 2492 5: if ((lq.time() > T) OR (Q_C >> (S_L-2) > maxrand(U))) 2493 6: mark(pkt) 2494 7: } else { 2495 8: cq.dequeue(pkt) % Classic scheduled 2496 9: Q_C += (qc.ns() - Q_C) >> g_C % Classic Q EWMA 2497 10: if ( (Q_C >> (S_C-2) ) > maxrand(2*U) ) { 2498 11: if ( (ecn(pkt) == 0) { % ECN field = not-ECT 2499 12: drop(pkt) % Squared drop, redo loop 2500 13: continue % continue to the top of the while loop 2501 14: } 2502 15: mark(pkt) 2503 16: } 2504 17: } 2505 18: return(pkt) % return the packet and stop here 2506 19: } 2507 20: return(NULL) % no packet to dequeue 2508 21: } 2510 Figure 11: Optimised Example Dequeue Pseudocode for Coupled DualQ 2511 AQM using Integer Arithmetic 2513 The two ranges, range_L and range_C are expressed as powers of 2 so 2514 that division can be implemented as a right bit-shift (>>) in lines 5 2515 and 10 of the integer variant of the pseudocode (Figure 11). 2517 For the integer variant of the pseudocode, an integer version of the 2518 rand() function used at line 25 of the maxrand(function) in Figure 10 2519 would be arranged to return an integer in the range 0 <= maxrand() < 2520 2^32 (not shown). This would scale up all the floating point 2521 probabilities in the range [0,1] by 2^32. 2523 Queuing delays are also scaled up by 2^32, but in two stages: i) In 2524 line 9 queuing time qc.ns() is returned in integer nanoseconds, 2525 making the value about 2^30 times larger than when the units were 2526 seconds, ii) then in lines 5 and 10 an adjustment of -2 to the right 2527 bit-shift multiplies the result by 2^2, to complete the scaling by 2528 2^32. 2530 In line 8 of the initialization function, the EWMA constant gamma is 2531 represented as an integer power of 2, g_C, so that in line 9 of the 2532 integer code the division needed to weight the moving average can be 2533 implemented by a right bit-shift (>> g_C). 2535 Appendix C. Choice of Coupling Factor, k 2537 C.1. RTT-Dependence 2539 Where Classic flows compete for the same capacity, their relative 2540 flow rates depend not only on the congestion probability, but also on 2541 their end-to-end RTT (= base RTT + queue delay). The rates of 2542 Reno [RFC5681] flows competing over an AQM are roughly inversely 2543 proportional to their RTTs. Cubic exhibits similar RTT-dependence 2544 when in Reno-compatibility mode, but it is less RTT-dependent 2545 otherwise. 2547 Until the early experiments with the DualQ Coupled AQM, the 2548 importance of the reasonably large Classic queue in mitigating RTT- 2549 dependence when the base RTT is low had not been appreciated. 2550 Appendix A.1.6 of [I-D.ietf-tsvwg-ecn-l4s-id] uses numerical examples 2551 to explain why bloated buffers had concealed the RTT-dependence of 2552 Classic congestion controls before that time. Then it explains why, 2553 the more that queuing delays have reduced, the more that RTT- 2554 dependence has surfaced as a potential starvation problem for long 2555 RTT flows, when competing against very short RTT flows. 2557 Given that congestion control on end-systems is voluntary, there is 2558 no reason why it has to be voluntarily RTT-dependent. The RTT- 2559 dependence of existing Classic traffic cannot be 'undeployed'. 2560 Therefore, [I-D.ietf-tsvwg-ecn-l4s-id] requires L4S congestion 2561 controls to be significantly less RTT-dependent than the standard 2562 Reno congestion control [RFC5681], at least at low RTT. Then RTT- 2563 dependence ought to be no worse than it is with appropriately sized 2564 Classic buffers. Following this approach means there is no need for 2565 network devices to address RTT-dependence, although there would be no 2566 harm if they did, which per-flow queuing inherently does. 2568 C.2. Guidance on Controlling Throughput Equivalence 2570 The coupling factor, k, determines the balance between L4S and 2571 Classic flow rates (see Section 2.5.2.1 and equation (1)). 2573 For the public Internet, a coupling factor of k=2 is recommended, and 2574 justified below. For scenarios other than the public Internet, a 2575 good coupling factor can be derived by plugging the appropriate 2576 numbers into the same working. 2578 To summarize the maths below, from equation (5) it can be seen that 2579 choosing k=1.64 will make L4S throughput roughly the same as Classic, 2580 _if their actual end-to-end RTTs are the same_. However, even if the 2581 base RTTs are the same, the actual RTTs are unlikely to be the same, 2582 because Classic traffic needs a fairly large queue to avoid under- 2583 utilization and excess drop. Whereas L4S does not. 2585 Therefore, to determine the appropriate coupling factor policy, the 2586 operator needs to decide at what base RTT it wants L4S and Classic 2587 flows to have roughly equal throughput, once the effect of the 2588 additional Classic queue on Classic throughput has been taken into 2589 account. With this approach, a network operator can determine a good 2590 coupling factor without knowing the precise L4S algorithm for 2591 reducing RTT-dependence - or even in the absence of any algorithm. 2593 The following additional terminology will be used, with appropriate 2594 subscripts: 2596 r: Packet rate [pkt/s] 2598 R: RTT [s/round] 2600 p: ECN marking probability [] 2602 On the Classic side, we consider Reno as the most sensitive and 2603 therefore worst case Classic congestion control, and we will also 2604 consider Cubic in its Reno-friendly mode ('CReno'), as the most 2605 prevalent congestion control, according to the references and 2606 analysis in [PI2param]. In either case, the Classic packet rate in 2607 steady state is given by the well-known square root formula: 2609 r_C = 1.22 / (R_C * p_C^0.5) 2611 On the L4S side, we consider the Prague congestion control 2612 [I-D.briscoe-iccrg-prague-congestion-control] as the reference for 2613 steady-state dependence on congestion. Prague conforms to the same 2614 equation as DCTCP, but we do not use the equation derived in the 2615 DCTCP paper, which is only appropriate for step marking. The coupled 2616 marking, p_CL, is the appropriate one when considering throughput 2617 equivalence with Classic flows. Unlike step marking, coupled 2618 markings are inherently spaced out, so we use the formula for DCTCP 2619 packet rate with probabilistic marking derived in Appendix A of 2620 [PI2]. We use the equation without RTT-independence enabled, which 2621 will be explained later. 2623 r_L = 2/ (R_L * p_CL) 2625 For packet rate equivalence, we equate the two packet rates and 2626 rearrange into the same form as Equation (1), so the two can be 2627 equated and simplified to produce a formula for k: 2629 r_c = r_L 2630 => p_C = (p_CL/1.64 * R_L/R_C)^2 2632 p_C = ( p_CL / k )^2 (1) 2634 k = 1.64 * (R_C / R_L) (5) 2636 We now have the coupling factor in terms of two RTTs. Traditionally, 2637 throughput equivalence is defined for flows under comparable 2638 conditions, including with the same base RTT [RFC2914]. So if we 2639 assume the same base RTT, R_b, for comparable flows, we can put both 2640 R_C and R_L in terms of R_b. 2642 We can approximate the L4S RTT to be hardly greater than the base 2643 RTT, i.e. R_L ~= R_b. And next we replace R_C with (R_b + q_C), 2644 where the Classic queue, q_C, depends on the target queue delay that 2645 the operator has configured for the Classic AQM. 2647 Taking PI2 as an example Classic AQM, it seems that we could just 2648 take R_C = R_b + target (recommended 15 ms by default in 2649 Appendix A.1). However, target is roughly the queue depth reached by 2650 the tips of the sawteeth of a congestion control, not the average 2651 [PI2param]. That is R_max = R_b + target. 2653 The position of the average in relation to the max depends on the 2654 amplitude of the sawteeth, so we will consider Reno [RFC5681] as the 2655 most sensitive worst-case as well as Cubic [RFC8312] in its Reno- 2656 friendly mode ('CReno') as the most prevalent congestion control 2657 algorithm on the Internet according to [PI2param]. 2659 Both are AIMD, so we will generalize using b as the multiplicative 2660 decrease factor (b_r = 0.5 for Reno, b_c = 0.7 for CReno). Then: 2662 R_C = (R_max + b*R_max) / 2 2663 = R_max * (1+b)/2 2665 R_reno = 0.75 * (R_b + target); R_creno = 0.85 * (R_b + target). 2667 Plugging all this into equation (5) we get coupling factor, 2669 k_reno = 1.64*0.75*(R_b+target)/R_b 2670 = 1.23*(1 + target/R_b); k_creno = 1.39 * (1 + target/R_b) 2672 For instance, it is recommended that the operator chooses R_b = 25 2673 ms, as a typical base RTT between Internet users and CDNs [PI2param]. 2674 Then: 2676 k_reno = 1.23 * (1 + 15/25) k_creno = 1.39 * (1 + 15/25) 2677 = 1.97 = 2.22 2678 ~= 2 ~= 2 2680 The approximation is relevant to any of the above example DualQ 2681 Coupled algorithms, which use a coupling factor that is an integer 2682 power of 2 to aid efficient implementation. 2684 An operator can make a policy choice to decide on a different base 2685 RTT at which it wants throughput equivalence. Nonetheless, it makes 2686 sense to choose what is believed to be the typical RTT most users 2687 experience, because a Classic AQM's target queuing delay is also 2688 derived from a typical RTT for the Internet. Therefore, below this 2689 typical RTT, Classic AQMs become fairly RTT-independent. And L4S 2690 flows are also required to become RTT-independent below a typical RTT 2691 [I-D.ietf-tsvwg-ecn-l4s-id]. Therefore, throughput equivalence ought 2692 to be no worse than with Classic AQMs and Classic congestion 2693 controls. 2695 As remarked earlier, the throughput equation used for Prague was with 2696 RTT-independence disabled. This is because we only need the point on 2697 this equation at the typical base RTT - where the operator chooses to 2698 calculate the coupling factor. We do not need to know the full range 2699 of the equation used for RTT-independence as long as it is roughly 2700 the same at this one point. Then, there will at least be throughput 2701 equivalence at that base RTT. And assuming Prague senders implement 2702 RTT-independence over a range of RTTs, the throughput equivalence 2703 will then extend over that range. 2705 As a non-Internet example, for localized traffic from a particular 2706 ISP's data centre, using the measured RTTs, it was calculated that a 2707 value of k = 8 would achieve throughput equivalence, and experiments 2708 verified the formula very closely. 2710 But, for a typical mix of RTTs across the general Internet, a value 2711 of k=2 is recommended as a good workable compromise. 2713 Authors' Addresses 2715 Koen De Schepper 2716 Nokia Bell Labs 2717 Antwerp 2718 Belgium 2720 Email: koen.de_schepper@nokia.com 2721 URI: https://www.bell-labs.com/usr/koen.de_schepper 2723 Bob Briscoe (editor) 2724 Independent 2725 United Kingdom 2727 Email: ietf@bobbriscoe.net 2728 URI: http://bobbriscoe.net/ 2730 Greg White 2731 CableLabs 2732 Louisville, CO, 2733 United States of America 2735 Email: G.White@CableLabs.com