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