idnits 2.17.1 draft-ietf-aqm-codel-07.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 10, 2017) is 2598 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Unused Reference: 'BMPFQ' is defined on line 1000, but no explicit reference was found in the text == Unused Reference: 'SFQ1990' is defined on line 1041, but no explicit reference was found in the text == Outdated reference: A later version (-06) exists of draft-ietf-aqm-fq-codel-03 -- Obsolete informational reference (is this intentional?): RFC 2581 (Obsoleted by RFC 5681) -- Obsolete informational reference (is this intentional?): RFC 896 (Obsoleted by RFC 7805) -- Obsolete informational reference (is this intentional?): RFC 2309 (Obsoleted by RFC 7567) Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 AQM K. Nichols 3 Internet-Draft Pollere, Inc. 4 Intended status: Experimental V. Jacobson 5 Expires: September 11, 2017 A. McGregor, ed. 6 J. Iyengar, ed. 7 Google 8 March 10, 2017 10 Controlled Delay Active Queue Management 11 draft-ietf-aqm-codel-07 13 Abstract 15 This document describes a general framework called CoDel (Controlled 16 Delay) that controls bufferbloat-generated excess delay in modern 17 networking environments. CoDel consists of an estimator, a setpoint, 18 and a control loop. It requires no configuration in normal Internet 19 deployments. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on September 11, 2017. 38 Copyright Notice 40 Copyright (c) 2017 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Conventions used in this document . . . . . . . . . . . . . . 4 57 3. Overview of the Codel AQM . . . . . . . . . . . . . . . . . . 4 58 3.1. Non-starvation . . . . . . . . . . . . . . . . . . . . . 5 59 3.2. Using the interval . . . . . . . . . . . . . . . . . . . 6 60 3.3. The target setpoint . . . . . . . . . . . . . . . . . . . 6 61 3.4. Use with multiple queues . . . . . . . . . . . . . . . . 7 62 3.5. Setting up CoDel . . . . . . . . . . . . . . . . . . . . 7 63 4. Annotated Pseudo-code for CoDel AQM . . . . . . . . . . . . . 8 64 4.1. Data Types . . . . . . . . . . . . . . . . . . . . . . . 8 65 4.2. Per-queue state (codel_queue_t instance variables) . . . 9 66 4.3. Constants . . . . . . . . . . . . . . . . . . . . . . . . 9 67 4.4. Enqueue routine . . . . . . . . . . . . . . . . . . . . . 9 68 4.5. Dequeue routine . . . . . . . . . . . . . . . . . . . . . 9 69 4.6. Helper routines . . . . . . . . . . . . . . . . . . . . . 11 70 4.7. Implementation considerations . . . . . . . . . . . . . . 12 71 5. Understanding the Building Blocks of Queue Management . . . . 13 72 5.1. Estimator . . . . . . . . . . . . . . . . . . . . . . . . 14 73 5.2. Setpoint . . . . . . . . . . . . . . . . . . . . . . . . 16 74 5.3. Control Loop . . . . . . . . . . . . . . . . . . . . . . 18 75 6. Further Experimentation . . . . . . . . . . . . . . . . . . . 20 76 7. Security Considerations . . . . . . . . . . . . . . . . . . . 21 77 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 78 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 21 79 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 80 10.1. Normative References . . . . . . . . . . . . . . . . . . 21 81 10.2. Informative References . . . . . . . . . . . . . . . . . 21 82 Appendix A. Applying CoDel in the datacenter . . . . . . . . . . 23 83 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 85 1. Introduction 87 The "persistently full buffer" problem has been discussed in the IETF 88 community since the early 80's [RFC896]. The IRTF's End-to-End 89 Working Group called for the deployment of active queue management 90 (AQM) to solve the problem in 1998 [RFC2309]. Despite this 91 awareness, the problem has only gotten worse as Moore's Law growth in 92 memory density fueled an exponential increase in buffer pool size. 93 Efforts to deploy AQM have been frustrated by difficult configuration 94 and negative impact on network utilization. This "bufferbloat" 95 problem [TSV2011] [BB2011] has become increasingly important 96 throughout the Internet but particularly at the consumer edge. Queue 97 management has become more critical due to increased consumer use of 98 the Internet, mixing large video transactions with time-critical VoIP 99 and gaming. 101 An effective AQM remediates bufferbloat at a bottleneck while "doing 102 no harm" at hops where buffers are not bloated. The development and 103 deployment of AQM however is commonly subject to common 104 misconceptions about the cause of packet queues in network buffers. 105 Network buffers exist to absorb the packet bursts that occur 106 naturally in statistically multiplexed networks. Buffers helpfully 107 absorb the queues created by such reasonable packet network behavior 108 as short-term mismatches in traffic arrival and departure rates that 109 arise from upstream resource contention, transport conversation 110 startup transients and/or changes in the number of conversations 111 sharing a link. Unfortunately, other less useful network behaviors 112 can cause queues to fill and their effects are not nearly as benign. 113 Discussion of these issues and the reason why the solution is not 114 simply smaller buffers can be found in [RFC2309], [VANQ2006], 115 [REDL1998], and [CODEL2012]. To understand queue management, it is 116 critical to understand the difference between the necessary, useful 117 "good" queue, and the counterproductive "bad" queue. 119 Several approaches to AQM have been developed over the past two 120 decades but none has been widely deployed due to performance 121 problems. When designed with the wrong conceptual model for queues, 122 AQMs have limited operational range, require a lot of configuration 123 tweaking, and frequently impair rather than improve performance. 124 Learning from this past history, the CoDel approach is designed to 125 meet the following goals: 127 o parameterless for normal operation - has no knobs for operators, 128 users, or implementers to adjust 130 o treat "good queue" and "bad queue" differently, that is, keep 131 delay low while permitting necessary bursts of traffic 133 o control delay while insensitive (or nearly so) to round trip 134 delays, link rates and traffic loads; this goal is to "do no harm" 135 to network traffic while controlling delay 137 o adapt to dynamically changing link rates with no negative impact 138 on utilization 140 o simple and efficient implementation (can easily span the spectrum 141 from low-end, linux-based access points and home routers up to 142 high-end commercial router silicon) 144 CoDel has five major differences from prior AQMs: use of local queue 145 minimum to track congestion ("bad queue"), use of an efficient single 146 state variable representation of that tracked statistic, use of 147 packet sojourn time as the observed datum, rather than packets, 148 bytes, or rates, use of mathematically determined setpoint derived 149 from maximizing the network power metric, and a modern state space 150 controller. 152 CoDel configures itself based on a round-trip time metric which can 153 be set to 100ms for the normal, terrestrial Internet. With no 154 changes to parameters, CoDel is expected to work across a wide range 155 of conditions, with varying links and the full range of terrestrial 156 round trip times. 158 CoDel is easily adapted to multiple queue systems as shown by [FQ- 159 CODEL-ID]. Implementers should use the fq_codel multiple-queue 160 approach as it deals with many problems beyond the reach of an AQM on 161 a single queue. 163 CoDel was first published in [CODEL2012] and has been implemented in 164 the Linux kernel. 166 Note that while this document refers to dropping packets when 167 indicated by CoDel, it is reasonable to ECN-mark packets instead as 168 well. 170 2. Conventions used in this document 172 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 173 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 174 document are to be interpreted as described in [RFC2119]. 176 In this document, these words will appear with that interpretation 177 only when in ALL CAPS. Lower case uses of these words are not to be 178 interpreted as carrying [RFC2119] significance. 180 3. Overview of the Codel AQM 182 CoDel was initially designed as a bufferbloat solution for the 183 consumer network edge. The CoDel building blocks are able to adapt 184 to different or time-varying link rates, to be easily used with 185 multiple queues, to have excellent utilization with low delay, and to 186 have a simple and efficient implementation. The only setting CoDel 187 requires is its interval value, and as 100ms satisfies that 188 definition for normal Internet usage, CoDel can be parameter-free for 189 consumer use. 191 To ensure that link utilization is not adversely affected, CoDel's 192 estimator sets its target to the setpoint that optimizes power and 193 CoDel's controller does not drop packets when the drop would leave 194 the queue empty or with fewer than a maximum transmission unit (MTU) 195 worth of bytes in the buffer. Section 5.2 shows that the ideal 196 setpoint is 5-10% of the connection RTT. In the open terrestrial- 197 based Internet, especially at the consumer edge, we expect most 198 unbloated RTTs to have a ceiling of 100ms [CHARB2007]. Using this 199 RTT gives a minimum target of 5ms and the interval for tracking the 200 minimum is 100ms. In practice, uncongested links will see sojourn 201 times below target more often than once per RTT, so the estimator is 202 not overly sensitive to the value of the interval. 204 When the estimator finds a persistent delay above target, the 205 controller enters the drop state where a packet is dropped and the 206 next drop time is set. As discussed in section 5.3, the initial next 207 drop spacing is intended to be long enough to give the endpoints time 208 to react to the single drop so SHOULD be set to a value equal to the 209 interval. If the estimator's output falls below target, the 210 controller cancels the next drop and exits the drop state. (The 211 controller is more sensitive than the estimator to an overly short 212 interval, since an unnecessary drop would occur and lower link 213 utilization.) If next drop time is reached while the controller is 214 still in drop state, the packet being dequeued is dropped and the 215 next drop time is recalculated. 217 Additional logic prevents re-entering the dropping state too soon 218 after exiting it and resumes the dropping state at a recent control 219 level, if one exists. This logic is described more precisely in the 220 pseudo-code below. Additional work is required to determine the 221 frequency and importance of re-entering the dropping state. 223 Note that CoDel AQM only enters its dropping state when the local 224 minimum sojourn delay has exceeded target for a time interval long 225 enough for normal bursts to dissipate, ensuring that a burst of 226 packets that fits in the pipe will not be dropped. 228 3.1. Non-starvation 230 CoDel's goals are to control delay with little or no impact on link 231 utilization and to be deployed on a wide range of link bandwidths, 232 including variable-rate links, without reconfiguration. To keep from 233 making drops when it would starve the output link, CoDel makes 234 another check before dropping to see if at least an MTU worth of 235 bytes remains in the buffer. If not, the packet SHOULD NOT be 236 dropped and, therefore, CoDel exits the drop state. The MTU size can 237 be set adaptively to the largest packet seen so far or can be read 238 from the driver. 240 3.2. Using the interval 242 The interval is chosen to give endpoints time to react to a drop 243 without being so long that response times suffer. CoDel's estimator, 244 setpoint, and control loop all use the interval. Understanding their 245 derivation shows that CoDel is the most sensitive to the value of 246 interval for single long-lived TCPs with a decreased sensitivity for 247 traffic mixes. This is fortunate as RTTs vary across connections and 248 are not known apriori. The best policy seems to be to use an 249 interval slightly larger than the RTT seen by most of the connections 250 using a link, a value that can be determined as the largest RTT seen 251 if the value is not an outlier (use of a 95-99th percentile value 252 should work). In practice, this value is not known or measured 253 (though see Section 6.2 for an application where interval is 254 measured. An interval setting of 100ms works well across a range of 255 RTTs from 10ms to 1 second (excellent performance is achieved in the 256 range from 10 ms to 300ms). For devices intended for the normal 257 terrestrial Internet, interval SHOULD have a value of 100ms. This 258 will only cause overdropping where a long-lived TCP has an RTT longer 259 than 100ms and there is little or no mixing with other connections 260 through the link. 262 A note on the roles of the target setpoint and the minimum-tracking 263 interval. Target should not be increased in response to lower layers 264 that have a bursty nature, where packets are transmitted for short 265 periods interspersed with idle periods where the link is waiting for 266 permission to send. CoDel's estimator will "see" the effective 267 transmission rate over an interval, and increasing target only leads 268 to longer queue delays. On the other hand, where a significant 269 additional delay is added to the intrinsic RTT of most or all packets 270 due to the waiting time for a transmission, it is necessary to 271 increase interval by that extra delay. Target SHOULD NOT be adjusted 272 for such short-term bursts, but interval MAY need to be adjusted if 273 the path's intrinsic RTT changes. 275 3.3. The target setpoint 277 The target is the maximum acceptable persistent queue delay above 278 which CoDel is dropping or preparing to drop and below which CoDel 279 will not drop. Target SHOULD be set to 5ms for normal Internet 280 traffic. 282 The calculations of section 5.2 show that the best setpoint is 5-10% 283 of the RTT, with the low end of 5% preferred. Extensive simulations 284 exploring the impact of different target values when used with mixed 285 traffic flows with different RTTs and different bandwidths show that 286 below a target of 5ms, utilization suffers for some conditions and 287 traffic loads, and above 5ms showed very little or no improvement in 288 utilization. 290 Sojourn times must remain above the target for an entire interval in 291 order to enter the drop state. Any packet with a sojourn time less 292 than the target will reset the time that the queue was last below the 293 target. Since Internet traffic has very dynamic characteristics, the 294 actual sojourn delay experienced by packets varies greatly and is 295 often less than the target unless the overload is excessive. When a 296 link is not overloaded, it is not a bottleneck and packet sojourn 297 times will be small or nonexistent. In the usual case, there are 298 only one or two places along a path where packets will encounter a 299 bottleneck (usually at the edge), so the total amount of queueing 300 delay experienced by a packet should be less than 10ms even under 301 extremely congested conditions. This net delay is substantially 302 lower than common current queueing delays on the Internet that grow 303 to orders of seconds [NETAL2010, CHARB2007]. 305 3.4. Use with multiple queues 307 CoDel is easily adapted to multiple queue systems. With other 308 approaches there is always a question of how to account for the fact 309 that each queue receives less than the full link rate over time and 310 usually sees a varying rate over time. This is what CoDel excels at: 311 using a packet's sojourn time in the buffer completely circumvents 312 this problem. In a multiple-queue setting, a separate CoDel 313 algorithm runs on each queue, but each CoDel instance uses the packet 314 sojourn time the same way a single-queue CoDel does. Just as a 315 single-queue CoDel adapts to changing link bandwidths [CODEL2012], so 316 does a multiple-queue CoDel system. As an optimization to avoid 317 queueing more than necessary, when testing for queue occupancy before 318 dropping, the total occupancy of all queues sharing the same output 319 link should be used. This property of CoDel has been exploited in 320 fq_codel [FQ-CODEL-ID], which hashes on the packet header fields to 321 determine a specific bin, or sub-queue, for each five-tuple flow, and 322 runs CoDel on each bin or sub-queue thus creating a well-mixed output 323 flow and obviating issues of reverse path flows (including "ack 324 compression"). 326 3.5. Setting up CoDel 328 CoDel is set for use in devices in the open Internet. An interval of 329 100ms is used, target is set to 5% of interval, and the initial drop 330 spacing is also set to interval. These settings have been chosen so 331 that a device, such as a small WiFi router, can be sold without the 332 need for any values to be made adjustable, yielding a parameterless 333 implementation. In addition, CoDel is useful in environments with 334 significantly different characteristics from the normal Internet, for 335 example, in switches used as a cluster interconnect within a data 336 center. Since cluster traffic is entirely internal to the data 337 center, round trip latencies are low (typically <100us) but 338 bandwidths are high (1-40Gbps) so it's relatively easy for the 339 aggregation phase of a distributed computation (e.g., the Reduce part 340 of a Map/Reduce) to persistently fill then overflow the modest per- 341 port buffering available in most high speed switches. A CoDel 342 configured for this environment (target and interval in the 343 microsecond rather than millisecond range) can minimize drops or ECN 344 marks while keeping throughput high and latency low. 346 Devices destined for these environments MAY use a different interval, 347 where suitable. If appropriate analysis indicates, the target MAY be 348 set to some other value in the 5-10% of interval and the initial drop 349 spacing MAY be set to a value of 1.0 to 1.2 times the interval. But 350 these settings will cause problems such as overdropping and low 351 throughput if used on the open Internet, so devices that allow CoDel 352 to be configured SHOULD default to Internet-appropriate values given 353 in this document. 355 4. Annotated Pseudo-code for CoDel AQM 357 What follows is the CoDel algorithm in C++-like pseudo-code. Since 358 CoDel adds relatively little new code to a basic tail-drop fifo- 359 queue, we have attempted to highlight just these additions by 360 presenting CoDel as a sub-class of a basic fifo-queue base class. 361 The reference code is included to aid implementers who wish to apply 362 CoDel to queue management as described here or to adapt its 363 principles to other applications. 365 Implementors are strongly encouraged to also look at the Linux kernel 366 version of CoDel - a well-written, well tested, real-world, C-based 367 implementation. As of this writing, it is available at 368 https://github.com/torvalds/linux/blob/master/net/sched/sch_codel.c. 370 4.1. Data Types 372 time_t is an integer time value in units convenient for the system. 373 The code presented here uses 0 as a flag value to indicate "no time 374 set." 376 packet_t* is a pointer to a packet descriptor. We assume it has a 377 tstamp field capable of holding a time_t and that field is available 378 for use by CoDel (it will be set by the enqueue routine and used by 379 the dequeue routine). 381 queue_t is a base class for queue objects (the parent class for 382 codel_queue_t objects). We assume it has enqueue() and dequeue() 383 methods that can be implemented in child classes. We assume it has a 384 bytes() method that returns the current queue size in bytes. This 385 can be an approximate value. The method is invoked in the dequeue() 386 method but shouldn't require a lock with the enqueue() method. 388 flag_t is a Boolean. 390 4.2. Per-queue state (codel_queue_t instance variables) 392 time_t first_above_time_ = 0; // Time to declare sojourn time above 393 // target 394 time_t drop_next_ = 0; // Time to drop next packet 395 uint32_t count_ = 0; // Packets dropped in dropping state 396 uint32_t lastcount_ = 0; // Count from previous iteration 397 flag_t dropping_ = false; // Set to true if in drop state 399 4.3. Constants 401 time_t target = MS2TIME(5); // 5ms target queue delay 402 time_t interval = MS2TIME(100); // 100ms sliding-minimum window 403 u_int maxpacket = 512; // Maximum packet size in bytes 404 // (should use interface MTU) 406 4.4. Enqueue routine 408 All the work of CoDel is done in the dequeue routine. The only CoDel 409 addition to enqueue is putting the current time in the packet's 410 tstamp field so that the dequeue routine can compute the packet's 411 sojourn time. 413 void codel_queue_t::enqueue(packet_t* pkt) 414 { 415 pkt->timestamp() = clock(); 416 queue_t::enqueue(pkt); 417 } 419 4.5. Dequeue routine 421 This is the heart of CoDel. There are two branches based on whether 422 the controller is in dropping state: (i) if the controller is in 423 dropping state (that is, the minimum packet sojourn time is greater 424 than target) then the controller checks if it is time to leave 425 dropping state or schedules the next drop(s); or (ii) if the 426 controller is not in dropping state, it determines if it should enter 427 dropping state and do the initial drop. 429 packet_t* CoDelQueue::dequeue() 430 { 431 time_t now = clock(); 432 dodequeue_result r = dodequeue(now); 433 uint32_t delta; 435 if (dropping_) { 436 if (! r.ok_to_drop) { 437 // sojourn time below target - leave dropping state 438 dropping_ = false; 439 } 440 // Time for the next drop. Drop current packet and dequeue 441 // next. If the dequeue doesn't take us out of dropping 442 // state, schedule the next drop. A large backlog might 443 // result in drop rates so high that the next drop should 444 // happen now, hence the 'while' loop. 445 while (now >= drop_next_ && dropping_) { 446 drop(r.p); 447 ++count_; 448 r = dodequeue(now); 449 if (! r.ok_to_drop) { 450 // leave dropping state 451 dropping_ = false; 452 } else { 453 // schedule the next drop. 454 drop_next_ = control_law(drop_next_, count_); 455 } 456 } 457 // If we get here we're not in dropping state. The 'ok_to_drop' 458 // return from dodequeue means that the sojourn time has been 459 // above 'target' for 'interval' so enter dropping state. 460 } else if (r.ok_to_drop) { 461 drop(r.p); 462 r = dodequeue(now); 463 dropping_ = true; 465 // If min went above target close to when it last went 466 // below, assume that the drop rate that controlled the 467 // queue on the last cycle is a good starting point to 468 // control it now. ('drop_next' will be at most 'interval' 469 // later than the time of the last drop so 'now - drop_next' 470 // is a good approximation of the time from the last drop 471 // until now.) Implementations vary slightly here; this is 472 // the Linux version, which is more widely deployed and 473 // tested. 474 delta = count_ - lastcount_; 475 count_ = (delta > 1 && now - drop_next_ < 16*interval_)? 476 delta : 1; 477 drop_next_ = control_law(now, count_); 478 lastcount_ = count_; 480 } 481 return (r.p); 482 } 484 4.6. Helper routines 486 Since the degree of multiplexing and nature of the traffic sources is 487 unknown, CoDel acts as a closed-loop servo system that gradually 488 increases the frequency of dropping until the queue is controlled 489 (sojourn time goes below target). This is the control law that 490 governs the servo. It has this form because of the sqrt(p) 491 dependence of TCP throughput on drop probability. Note that for 492 embedded systems or kernel implementation, the inverse sqrt can be 493 computed efficiently using only integer multiplication. 495 time_t codel_queue_t::control_law(time_t t, uint32_t count) 496 { 497 return t + interval / sqrt(count); 498 } 500 Next is a helper routine the does the actual packet dequeue and 501 tracks whether the sojourn time is above or below target and, if 502 above, if it has remained above continuously for at least interval. 503 It returns two values: a Boolean indicating if it is OK to drop 504 (sojourn time above target for at least interval), and the packet 505 dequeued. 507 typedef struct { 508 packet_t* p; 509 flag_t ok_to_drop; 510 } dodequeue_result; 512 dodequeue_result codel_queue_t::dodequeue(time_t now) 513 { 514 dodequeue_result r = { queue_t::dequeue(), false }; 515 if (r.p == NULL) { 516 // queue is empty - we can't be above target 517 first_above_time_ = 0; 518 return r; 519 } 521 // To span a large range of bandwidths, CoDel runs two 522 // different AQMs in parallel. One is sojourn-time-based 523 // and takes effect when the time to send an MTU-sized 524 // packet is less than target. The 1st term of the "if" 525 // below does this. The other is backlog-based and takes 526 // effect when the time to send an MTU-sized packet is >= 527 // target. The goal here is to keep the output link 528 // utilization high by never allowing the queue to get 529 // smaller than the amount that arrives in a typical 530 // interarrival time (MTU-sized packets arriving spaced 531 // by the amount of time it takes to send such a packet on 532 // the bottleneck). The 2nd term of the "if" does this. 533 time_t sojourn_time = now - r.p->tstamp; 534 if (sojourn_time_ < target_ || bytes() <= maxpacket_) { 535 // went below - stay below for at least interval 536 first_above_time_ = 0; 537 } else { 538 if (first_above_time_ == 0) { 539 // just went above from below. if still above at 540 // first_above_time, will say it's ok to drop. 541 first_above_time_ = now + interval_; 542 } else if (now >= first_above_time_) { 543 r.ok_to_drop = true; 544 } 545 } 546 return r; 547 } 549 4.7. Implementation considerations 551 time_t is an integer time value in units convenient for the system. 552 Resolution to at least a millisecond is required and better 553 resolution is useful up to the minimum possible packet time on the 554 output link; 64- or 32-bit widths are acceptable but with 32 bits the 555 resolution should be no finer than 2^{-16} to leave enough dynamic 556 range to represent a wide range of queue waiting times. Narrower 557 widths also have implementation issues due to overflow (wrapping) and 558 underflow (limit cycles because of truncation to zero) that are not 559 addressed in this pseudocode. 561 Since CoDel requires relatively little per-queue state and no direct 562 communication or state sharing between the enqueue and dequeue 563 routines, it is relatively simple to add CoDel to almost any packet 564 processing pipeline, including ASIC- or NPU-based forwarding engines. 565 One issue to consider is dodequeue()'s use of a 'bytes()' function to 566 determine the current queue size in bytes. This value does not need 567 to be exact. If the enqueue part of the pipeline keeps a running 568 count of the total number of bytes it has put into the queue and the 569 dequeue routine keeps a running count of the total bytes it has 570 removed from the queue, 'bytes()' is simply the difference between 571 these two counters (32-bit counters should be adequate.) Enqueue has 572 to update its counter once per packet queued but it does not matter 573 when (before, during or after the packet has been added to the 574 queue). The worst that can happen is a slight, transient, 575 underestimate of the queue size which might cause a drop to be 576 briefly deferred. 578 5. Understanding the Building Blocks of Queue Management 580 At the heart of queue management is the notion of "good queue" and 581 "bad queue" and the search for ways to get rid of the bad queue 582 (which only adds delay) while preserving the good queue (which 583 provides for good utilization). This section explains queueing, both 584 good and bad, and covers the CoDel building blocks that can be used 585 to manage packet buffers to keep their queues in the "good" range. 587 Packet queues form in buffers facing bottleneck links, i.e., where 588 the line rate goes from high to low or where many links converge. 589 The well-known bandwidth-delay product (sometimes called "pipe size") 590 is the bottleneck's bandwidth multiplied by the sender-receiver- 591 sender round-trip delay, and is the amount of data that has to be in 592 transit between two hosts in order to run the bottleneck link at 100% 593 utilization. To explore how queues can form, consider a long-lived 594 TCP connection with a 25 packet window sending through a connection 595 with a bandwidth-delay product of 20 packets. After an initial burst 596 of packets the connection will settle into a five packet (+/-1) 597 standing queue; this standing queue size is determined by the 598 mismatch between the window size and the pipe size, and is unrelated 599 to the connection's sending rate. The connection has 25 packets in 600 flight at all times, but only 20 packets arrive at the destination 601 over a round trip time. If the TCP connection has a 30 packet 602 window, the queue will be ten packets with no change in sending rate. 604 Similarly, if the window is 20 packets, there will be no queue but 605 the sending rate is the same. Nothing can be inferred about the 606 sending rate from the queue size, and any queue other than transient 607 bursts only creates delays in the network. The sender needs to 608 reduce the number of packets in flight rather than sending rate. 610 In the above example, the five packet standing queue can be seen to 611 contribute nothing but delay to the connection, and thus is clearly 612 "bad queue". If, in our example, there is a single bottleneck link 613 and it is much slower than the link that feeds it (say, a high-speed 614 ethernet link into a limited DSL uplink) a 20 packet buffer at the 615 bottleneck might be necessary to temporarily hold the 20 packets in 616 flight to keep the bottleneck link's utilization high. The burst of 617 packets should drain completely (to 0 or 1 packets) within a round 618 trip time and this transient queue is "good queue" because it allows 619 the connection to keep the 20 packets in flight and for the 620 bottleneck link to be fully utilized. In terms of the delay 621 experienced, the "good queue" goes away in about a round trip time, 622 while "bad queue" hangs around for longer, causing delays. 624 Effective queue management detects "bad queue" while ignoring "good 625 queue" and takes action to get rid of the bad queue when it is 626 detected. The goal is a queue controller that accomplishes this 627 objective. To control a queue, we need three basic components 629 o Estimator - figure out what we've got 631 o Setpoint - know what what we want 633 o Control loop - if what we've got isn't what we want, we need a way 634 to move it there 636 5.1. Estimator 638 The estimator both observes the queue and detects when good queue 639 turns to bad queue and vice versa. CoDel has two parts to its 640 estimator: what is observed as an indicator of queue and how the 641 observations are used to detect good/bad queue. 643 Queue length has been widely used as an observed indicator of 644 congestion and is frequently conflated with sending rate. Use of 645 queue length as a metric is sensitive to how and when the length is 646 observed. A high speed arrival link to a buffer serviced at a much 647 lower rate can rapidly build up a queue that might disperse 648 completely or down to a single packet before a round trip time has 649 elapsed. If the queue length is monitored at packet arrival (as in 650 original RED) or departure time, every packet will see a queue with 651 one possible exception. If the queue length itself is time sampled 652 (as recommended in [REDL1998], a truer picture of the queue's 653 occupancy can be gained at the expense of considerable implementation 654 complexity. 656 The use of queue length is further complicated in networks that are 657 subject to both short and long term changes in available link rate 658 (as in WiFi). Link rate drops can result in a spike in queue length 659 that should be ignored unless it persists. It is not the queue 660 length that should be controlled but the amount of excess delay 661 packets experience due to a persistent or standing queue, which means 662 that the packet sojourn time in the buffer is exactly what we want to 663 track. Tracking the packet sojourn times in the buffer observes the 664 actual delay experienced by each packet. Sojourn time allows queue 665 management to be independent of link rate, gives superior performance 666 to use of buffer size, and is directly related to user-visible 667 performance. It works regardless of line rate changes or link 668 sharing by multiple queues (which the individual queues may 669 experience as changing rates). 671 Consider a link shared by two queues with different priorities. 672 Packets that arrive at the high priority queue are sent as soon as 673 the link is available while packets in the other queue have to wait 674 until the high priority queue is empty (i.e., a strict priority 675 scheduler). The number of packets in the high priority queue might 676 be large but the queue is emptied quickly and the amount of time each 677 packet spends enqueued (the sojourn time) is not large. The other 678 queue might have a smaller number of packets, but packet sojourn 679 times will include the waiting time for the high priority packets to 680 be sent. This makes the sojourn time a good sample of the congestion 681 that each separate queue is experiencing. This example also shows 682 how the metric of sojourn time is independent of the number of queues 683 or the service discipline used, and is instead indicative of 684 congestion seen by the individual queues. 686 How can observed sojourn time be used to separate good queue from bad 687 queue? Although averages, especially of queue length, have 688 previously been widely used as an indicator of bad queue, their 689 efficacy is questionable. Consider the burst that disperses every 690 round trip time. The average queue will be one-half the burst size, 691 though this might vary depending on when the average is computed and 692 the timing of arrivals. The average queue sojourn time would be one- 693 half the time it takes to clear the burst. The average then would 694 indicate a persistent queue where there is none. Instead of averages 695 we recommend tracking the minimum sojourn time, then, if there is one 696 packet that has a zero sojourn time then there is no persistent 697 queue. The value of the minimum in detecting persistent queue is 698 apparent when looking at graphs of queue delay. 700 A persistent queue can be detected by tracking the (local) minimum 701 queue delay packets experience. To ensure that this minimum value 702 does not become stale, it has to have been experienced recently, i.e. 703 during an appropriate past time interval. This interval is the 704 maximum amount of time a minimum value is considered to be in effect, 705 and is related to the amount of time it takes for the largest 706 expected burst to drain. Conservatively, this interval should be at 707 least a round trip time to avoid falsely detecting a persistent queue 708 and not a lot more than a round trip time to avoid delay in detecting 709 the persistent queue. This suggests that the appropriate interval 710 value is the maximum round-trip time of all the connections sharing 711 the buffer. 713 (The following key insight makes computation of the local minimum 714 efficient: It is sufficient to keep a single state variable of how 715 long the minimum has been above or below a target value rather than 716 retaining all the local values to compute the minimum, leading to 717 both storage and computational savings. We use this insight in the 718 pseudo-code for CoDel later in the draft.) 720 These two parts, use of sojourn time as observed values and the local 721 minimum as the statistic to monitor queue congestion are key to 722 CoDel's estimator building block. The local minimum sojourn time 723 provides an accurate and robust measure of standing queue and has an 724 efficient implementation. In addition, use of the minimum sojourn 725 time has important advantages in implementation. The minimum packet 726 sojourn can only be decreased when a packet is dequeued which means 727 that all the work of CoDel can take place when packets are dequeued 728 for transmission and that no locks are needed in the implementation. 729 The minimum is the only statistic with this property. 731 A more detailed explanation with many pictures can be found in 732 http://www.ietf.org/proceedings/84/slides/slides-84-tsvarea-4.pdf . 734 5.2. Setpoint 736 Now that we have a robust way of detecting standing queue, we need a 737 setpoint that tells us when to act. If the controller is set to take 738 action as soon as the estimator has a non-zero value, the average 739 drop rate will be maximized, which minimizes TCP goodput 740 [MACTCP1997]. Also, this policy results in no backlog over time (no 741 persistent queue), which negates much of the value of having a 742 buffer, since it maximizes the bottleneck link bandwidth lost due to 743 normal stochastic variation in packet interarrival time. We want a 744 setpoint that maximizes utilization while minimizing delay. Early in 745 the history of packet networking, Kleinrock developed the analytic 746 machinery to do this using a quantity he called 'power', which is the 747 ratio of a normalized throughput to a normalized delay [KLEIN81]. 749 It is straightforward to derive an analytic expression for the 750 average goodput of a TCP conversation at a given round-trip time r 751 and setpoint f (where f is expressed as a fraction of r). Reno TCP, 752 for example, yields: 754 goodput = r (3 + 6f - f^2) / (4 (1+f)) 756 Since the peak queue delay is simply the product of f and r, power is 757 solely a function of f since the r's in the numerator and denominator 758 cancel: 760 power is proportional to (1 + 2f - 1/3 f^2) / (1 + f)^2 762 As Kleinrock observed, the best operating point, in terms of 763 bandwidth / delay tradeoff, is the peak power point, since points off 764 the peak represent a higher cost (in delay) per unit of bandwidth. 765 The power vs. f curve for any AIMD TCP is monotone decreasing. But 766 the curve is very flat for f < 0.1 followed by a increasing curvature 767 with a knee around f = 0.2, then a steep, almost linear fall off 768 [TSV84]. Since the previous equation showed that goodput is monotone 769 increasing with f, the best operating point is near the right edge of 770 the flat top since that represents the highest goodput achievable for 771 a negligible increase in delay. However, since the r in the model is 772 a conservative upper bound, a target of 0.1r runs the risk of pushing 773 shorter RTT connections over the knee and giving them higher delay 774 for no significant goodput increase. Generally, a more conservative 775 target of 0.05r offers a good utilization vs. delay tradeoff while 776 giving enough headroom to work well with a large variation in real 777 RTT. 779 As the above analysis shows, a very small standing queue gives close 780 to 100% utilization of the bottleneck link. While this result was 781 for Reno TCP, the derivation uses only properties that must hold for 782 any 'TCP friendly' transport. We have verified by both analysis and 783 simulation that this result holds for Reno, Cubic, and 784 Westwood[TSV84]. This results in a particularly simple form for the 785 setpoint: the ideal range for the permitted standing queue is between 786 5% and 10% of the TCP connection's RTT. Thus target is simply 5% of 787 the interval of section 3.1. 789 We used simulation to explore the impact when TCPs are mixed with 790 other traffic and with connections of different RTTs. Accordingly, 791 we experimented extensively with values in the 5-10% of RTT range 792 and, overall, used target values between 1 and 20 milliseconds for 793 RTTs from 30 to 500ms and link bandwidths of 64Kbps to 100Mbps to 794 experimentally explore the setpoint that gives consistently high 795 utilization while controlling delay across a range of bandwidths, 796 RTTs, and traffic loads. Our results were notably consistent with 797 the mathematics above. 799 A congested (but not overloaded) CoDel link with traffic composed 800 solely or primarily of long-lived TCP flows will have a median delay 801 through the link will tend to the target. For bursty traffic loads 802 and for overloaded conditions (where it is difficult or impossible 803 for all the arriving flows to be accommodated) the median queues will 804 be longer than target. 806 The non-starvation drop inhibit feature dominates where the link rate 807 becomes very small. By inhibiting drops when there is less than an 808 (outbound link) MTU worth of bytes in the buffer, CoDel adapts to 809 very low bandwidth links, as shown in [CODEL2012]. 811 5.3. Control Loop 813 Section 5.1 describes a simple, reliable way to measure bad 814 (persistent) queue. Section 5.2 shows that TCP congestion control 815 dynamics gives rise to a setpoint for this measure that's a provably 816 good balance between enhancing throughput and minimizing delay, and 817 that this setpoint is a constant fraction of the same 'largest 818 average RTT' interval used to distinguish persistent from transient 819 queue. The only remaining building block needed for a basic AQM is a 820 'control loop' algorithm to effectively drive the queueing system 821 from any 'persistent queue above target' state to a state where the 822 persistent queue is below target. 824 Control theory provides a wealth of approaches to the design of 825 control loops. Most of classical control theory deals with the 826 control of linear, time-invariant, single-input-single-output (SISO) 827 systems. Control loops for these systems generally come from a (well 828 understood) class known as Proportional-Integral-Derivative (PID) 829 controllers. Unfortunately, a queue is not a linear system and an 830 AQM operates at the point of maximum non-linearity (where the output 831 link bandwidth saturates so increased demand creates delay rather 832 than higher utilization). Output queues are also not time-invariant 833 since traffic is generally a mix of connections which start and stop 834 at arbitrary times and which can have radically different behaviors 835 ranging from "open loop" UDP audio/video to "closed-loop" congestion- 836 avoiding TCP. Finally, the constantly changing mix of connections 837 (which can't be converted to a single 'lumped parameter' model 838 because of their transfer function differences) makes the system 839 multi-input-multi-output (MIMO), not SISO. 841 Since queueing systems match none of the prerequisites for a 842 classical controller, a modern state-space controller is a better 843 approach with states 'no persistent queue' and 'has persistent 844 queue'. Since Internet traffic mixtures change rapidly and 845 unpredictably, a noise and error tolerant adaptation algorithm like 846 Stochastic Gradient is a good choice. Since there's essentially no 847 information in the amount of persistent queue [TSV84], the adaptation 848 should be driven by how long it has persisted. 850 Consider the two extremes of traffic behavior, a single open-loop UDP 851 video stream and a single, long-lived TCP bulk data transfer. If the 852 average bandwidth of the UDP video stream is greater that the 853 bottleneck link rate, the link's queue will grow and the controller 854 will eventually enter 'has persistent queue' state and start dropping 855 packets. Since the video stream is open loop, its arrival rate is 856 unaffected by drops so the queue will persist until the average drop 857 rate is greater than the output bandwidth deficit (= average arrival 858 rate - average departure rate) so the job of the adaptation algorithm 859 is to discover this rate. For this example, the adaptation could 860 consist of simply estimating the arrival and departure rates then 861 dropping at a rate slightly greater than their difference. But this 862 class of algorithm won't work at all for the bulk data TCP stream. 863 TCP runs in closed-loop flow balance [TSV84] so its arrival rate is 864 almost always exactly equal to the departure rate - the queue isn't 865 the result of a rate imbalance but rather a mismatch between the TCP 866 sender's window and the source-destination-source round-trip path 867 capacity (i.e., the connection's bandwidth-delay product). The 868 sender's TCP congestion avoidance algorithm will slowly increase the 869 send window (one packet per round-trip-time) [RFC2581] which will 870 eventually cause the bottleneck to enter 'has persistent queue' 871 state. But, since the average input rate is the same as the average 872 output rate, the rate deficit estimation that gave the correct drop 873 rate for the video stream would compute a drop rate of zero for the 874 TCP stream. However, if the output link drops one packet as it 875 enters 'has persistent queue' state, when the sender discovers this 876 (via TCP's normal packet loss repair mechanisms) it will reduce its 877 window by a factor of two [RFC2581] so, one round-trip-time after the 878 drop, the persistent queue will go away. 880 If there were N TCP conversations sharing the bottleneck, the 881 controller would have to drop O(N) packets, one from each 882 conversation, to make all the conversations reduce their window to 883 get rid of the persistent queue. If the traffic mix consists of 884 short (<= bandwidth-delay product) conversations, the aggregate 885 behavior becomes more like the open-loop video example since each 886 conversation is likely to have already sent all its packets by the 887 time it learns about a drop so each drop has negligible effect on 888 subsequent traffic. 890 The controller does not know the number, duration, or kind of 891 conversations creating its queue, so it has to learn the appropriate 892 response. Since single drops can have a large effect if the degree 893 of multiplexing (the number of active conversations) is small, 894 dropping at too high a rate is likely to have a catastrophic effect 895 on throughput. Dropping at a low rate (< 1 packet per round-trip- 896 time) then increasing the drop rate slowly until the persistent queue 897 goes below target is unlikely to overdrop and is guaranteed to 898 eventually dissipate the persistent queue. This stochastic gradient 899 learning procedure is the core of CoDel's control loop (the gradient 900 exists because a drop always reduces the (instantaneous) queue so an 901 increasing drop rate always moves the system "down" toward no 902 persistent queue, regardless of traffic mix). 904 The "next drop time" is decreased in inverse proportion to the square 905 root of the number of drops since the dropping state was entered, 906 using the well-known nonlinear relationship of drop rate to 907 throughput to get a linear change in throughput [REDL1998], 908 [MACTCP1997]. 910 Since the best rate to start dropping is at slightly more than one 911 packet per RTT, the controller's initial drop rate can be directly 912 derived from the estimator's interval, defined in section 3.1. When 913 the minimum sojourn time first crosses the target and CoDel drops a 914 packet, the earliest the controller could see the effect of the drop 915 is the round trip time (interval) + the local queue wait time 916 (target). If the next drop happens any earlier than this time 917 (interval + target), CoDel will overdrop. In practice, the local 918 queue waiting time tends to vary, so making the initial drop spacing 919 (i.e., the time to the second drop) be exactly the minimum possible 920 also leads to overdropping. Analysis of simulation and real-world 921 measured data shows that the 75th percentile magnitude of this 922 variation is less than the target, and so the initial drop spacing 923 should be set to the estimator's interval (i.e., initial drop spacing 924 = interval) to ensure that the controller has accounted for 925 acceptable congestion delays. 927 Use of the minimum statistic lets the controller be placed in the 928 dequeue routine with the estimator. This means that the control 929 signal (the drop) can be sent at the first sign of bad queue (as 930 indicated by the sojourn time) and that the controller can stop 931 acting as soon as the sojourn time falls below the setpoint. 932 Dropping at dequeue has both implementation and control advantages. 934 6. Further Experimentation 936 We encourage experimentation with the recommended values of target 937 and interval for Internet settings. CoDel provides general, 938 efficient, parameterless building blocks for queue management that 939 can be applied to single or multiple queues in a variety of data 940 networking scenarios. CoDel's settings may be modified for other 941 special-purpose networking applications. 943 7. Security Considerations 945 This document describes an active queue management algorithm for 946 implementation in networked devices. There are no specific security 947 exposures associated with CoDel. 949 8. IANA Considerations 951 This document does not require actions by IANA. 953 9. Acknowledgments 955 The authors thank Jim Gettys for the constructive nagging that made 956 us get the work "out there" before we thought it was ready. We thank 957 Dave Taht, Eric Dumazet, and the open source community for showing 958 the value of getting it "out there" and for making it real. We thank 959 Nandita Dukkipati for contributions to Section 6 and for comments 960 which helped to substantially improve this draft. We thank the AQM 961 working group and the Transport Area shepherd, Wes Eddy, for 962 patiently prodding this draft all the way to a standard. 964 10. References 966 10.1. Normative References 968 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate 969 Requirement Levels", March 1997. 971 10.2. Informative References 973 [FQ-CODEL-ID] 974 Hoeiland-Joergensen, T., McKenney, P., 975 dave.taht@gmail.com, d., Gettys, J., and E. Dumazet, 976 "FlowQueue-Codel", draft-ietf-aqm-fq-codel-03 (work in 977 progress), November 2015. 979 [RFC2581] Allman, M., Paxson, V., and W. Stevens, "TCP Congestion 980 Control", RFC 2581, April 1999. 982 [RFC896] Nagle, J., "Congestion control in IP/TCP internetworks", 983 RFC 896, January 1984. 985 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 986 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 987 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 988 S., Wroclawski, J., and L. Zhang, "Recommendations on 989 Queue Management and Congestion Avoidance in the 990 Internet", RFC 2309, April 1998. 992 [TSV2011] Gettys, J., "Bufferbloat: Dark Buffers in the Internet", 993 IETF 80 presentation to Transport Area Open Meeting, 994 March, 2011, 995 . 997 [BB2011] Gettys, J. and K. Nichols, "Bufferbloat: Dark Buffers in 998 the Internet", Communications of the ACM 9(11) pp. 57-65. 1000 [BMPFQ] Suter, B., "Buffer Management Schemes for Supporting TCP 1001 in Gigabit Routers with Per-flow Queueing", IEEE Journal 1002 on Selected Areas in Communications Vol. 17 Issue 6, June, 1003 1999, pp. 1159-1169. 1005 [CODEL2012] 1006 Nichols, K. and V. Jacobson, "Controlling Queue Delay", 1007 Communications of the ACM Vol. 55 No. 11, July, 2012, pp. 1008 42-50. 1010 [VANQ2006] 1011 Jacobson, V., "A Rant on Queues", talk at MIT Lincoln 1012 Labs, Lexington, MA July, 2006, 1013 . 1015 [REDL1998] 1016 Nichols, K., Jacobson, V., and K. Poduri, "RED in a 1017 Different Light", Tech report, September, 1999, 1018 . 1021 [NETAL2010] 1022 Kreibich, C., et. al., "Netalyzr: Illuminating the Edge 1023 Network", Proceedings of the Internet Measurement 1024 Conference Melbourne, Australia, 2010. 1026 [TSV84] Jacobson, V., "CoDel talk at TSV meeting IETF 84", 1027 . 1030 [CHARB2007] 1031 Dischinger, M., et. al, "Characterizing Residential 1032 Broadband Networks", Proceedings of the Internet 1033 Measurement Conference San Diego, CA, 2007. 1035 [MACTCP1997] 1036 Mathis, M., Semke, J., and J. Mahdavi, "The Macroscopic 1037 Behavior of the TCP Congestion Avoidance Algorithm", ACM 1038 SIGCOMM Computer Communications Review Vol. 27 no. 1, Jan. 1039 2007. 1041 [SFQ1990] McKenney, P., "Stochastic Fairness Queuing", Proceedings 1042 of IEEE INFOCOMM 90 San Francisco, 1990. 1044 [KLEIN81] Kleinrock, L. and R. Gail, "An Invariant Property of 1045 Computer Network Power", International Conference on 1046 Communications June, 1981, 1047 . 1049 Appendix A. Applying CoDel in the datacenter 1051 Nandita Dukkipati and her group at Google realized that the CoDel 1052 building blocks could be applied to bufferbloat problems in 1053 datacenter servers, not just to Internet routers. The Linux CoDel 1054 queueing discipline (qdisc) was adapted in three ways to tackle this 1055 bufferbloat problem. 1057 1. The default CoDel action was modified to be a direct feedback 1058 from qdisc to the TCP layer at dequeue. The direct feedback 1059 simply reduces TCP's congestion window just as congestion control 1060 would do in the event of drop. The scheme falls back to ECN 1061 marking or packet drop if the TCP socket lock could not be 1062 acquired at dequeue. 1064 2. Being located in the server makes it possible to monitor the 1065 actual RTT to use as CoDel's interval rather than making a "best 1066 guess" of RTT. The CoDel interval is dynamically adjusted by 1067 using the maximum TCP round-trip time (RTT) of those connections 1068 sharing the same Qdisc/bucket. In particular, there is a history 1069 entry of the maximum RTT experienced over the last second. As a 1070 packet is dequeued, the RTT estimate is accessed from its TCP 1071 socket. If the estimate is larger than the current CoDel 1072 interval, the CoDel interval is immediately refreshed to the new 1073 value. If the CoDel interval is not refreshed for over a second, 1074 it is decreased it to the history entry and the process is 1075 repeated. The use of the dynamic TCP RTT estimate lets interval 1076 adapt to the actual maximum value currently seen and thus lets 1077 the controller space its drop intervals appropriately. 1079 3. Since the mathematics of computing the setpoint are invariant, a 1080 target of 5% of the RTT or CoDel interval was used here. 1082 Non-data packets were not dropped as these are typically small and 1083 sometimes critical control packets. Being located on the server, 1084 there is no concern with misbehaving users as there would be on the 1085 public Internet. 1087 In several data center workload benchmarks, which are typically 1088 bursty, CoDel reduced the queueing latencies at the qdisc, and 1089 thereby improved the mean and 99th-percentile latencies from several 1090 tens of milliseconds to less than one millisecond. The minimum 1091 tracking part of the CoDel framework proved useful in disambiguating 1092 "good" queue versus "bad" queue, particularly helpful in controlling 1093 qdisc buffers that are inherently bursty because of TCP Segmentation 1094 Offload (TSO). 1096 Authors' Addresses 1098 Kathleen Nichols 1099 Pollere, Inc. 1100 PO Box 370201 1101 Montara, CA 94037 1102 USA 1104 Email: nichols@pollere.com 1106 Van Jacobson 1107 Google 1109 Email: vanj@google.com 1111 Andrew McGregor 1112 Google 1114 Email: andrewmcgr@google.com 1116 Janardhan Iyengar 1117 Google 1119 Email: jri@google.com