idnits 2.17.1 draft-ietf-aqm-fq-codel-00.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 : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 8 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 470 has weird spacing: '...st_head flowc...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (December 9, 2014) is 3425 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 699 == Unused Reference: 'RFC2119' is defined on line 651, but no explicit reference was found in the text == Unused Reference: 'RFC0896' is defined on line 654, but no explicit reference was found in the text == Unused Reference: 'RFC0970' is defined on line 657, but no explicit reference was found in the text == Unused Reference: 'RFC2309' is defined on line 660, but no explicit reference was found in the text == Unused Reference: 'SFQ' is defined on line 674, but no explicit reference was found in the text ** Obsolete normative reference: RFC 896 (Obsoleted by RFC 7805) ** Obsolete normative reference: RFC 2309 (Obsoleted by RFC 7567) Summary: 3 errors (**), 0 flaws (~~), 8 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 AQM working group T. Hoeiland-Joergensen 3 Internet-Draft Karlstad University 4 Intended status: Informational P. McKenney 5 Expires: June 12, 2015 IBM Linux Technology Center 6 D. Taht 7 Teklibre 8 J. Gettys 9 E. Dumazet 10 Google, Inc. 11 December 9, 2014 13 FlowQueue-Codel 14 draft-ietf-aqm-fq-codel-00 16 Abstract 18 This memo presents the FQ-CoDel hybrid packet scheduler/AQM 19 algorithm, a critical tool for fighting bufferbloat and reducing 20 latency across the Internet. 22 FQ-CoDel mixes packets from multiple flows and reduces the impact of 23 head of line blocking from bursty traffic. It provides isolation for 24 low-rate traffic such as DNS, web, and videoconferencing traffic. It 25 improves utilisation across the networking fabric, especially for 26 bidirectional traffic, by keeping queue lengths short; and it can be 27 implemented in a memory- and CPU-efficient fashion across a wide 28 range of hardware. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at http://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on June 12, 2015. 47 Copyright Notice 49 Copyright (c) 2014 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (http://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 1. Introduction 64 The FQ-CoDel algorithm is a combined packet scheduler and AQM 65 developed as part of the bufferbloat-fighting community effort. It 66 is based on a modified Deficit Round Robin (DRR) queue scheduler, 67 with the CoDel AQM algorithm operating on each sub-queue. This 68 document describes the combined algorithm; reference implementations 69 are available for ns2 and ns3 and it is included in the mainline 70 Linux kernel as the FQ-CoDel queueing discipline. 72 The rest of this document is structured as follows: This section 73 gives some concepts and terminology used in the rest of the document, 74 and gives a short informal summary of the FQ-CoDel algorithm. 75 Section 2 gives an overview of the CoDel algorithm. Section 3 covers 76 the DRR portion. Section 4 defines the parameters and data 77 structures employed by FQ-CoDel. Section 5 describes the working of 78 the algorithm in detail. Section 6 describes implementation 79 considerations, and section 7 lists some of the limitations of using 80 flow queueing. Finally section 11 concludes. 82 1.1. Terminology and concepts 84 Flow: A flow is typically identified by a 5-tuple of source IP, 85 destination IP, source port, destination port, and protocol. It can 86 also be identified by a superset or subset of those parameters, or by 87 mac address, or other means. 89 Queue: A queue of packets represented internally in FQ-CoDel. In 90 most instances each flow gets its own queue; however because of the 91 possibility of hash collisions, this is not always the case. In an 92 attempt to avoid confusion, the word 'queue' is used to refer to the 93 internal data structure, and 'flow' to refer to the actual stream of 94 packets being delivered to the FQ-CoDel algorithm. 96 Scheduler: A mechanism to select which queue a packet is dequeued 97 from. 99 CoDel AQM: The Active Queue Management algorithm employed by FQ- 100 CoDel. 102 DRR: Deficit round-robin scheduling. 104 Quantum: The maximum amount of bytes to be dequeued from a queue at 105 once. 107 1.2. Informal summary of FQ-CoDel 109 FQ-CoDel is a _hybrid_ of DRR [DRR] and CoDel [CODELDRAFT], with an 110 optimisation for sparse flows similar to SQF [SQF2012] and DRR++ 111 [DRRPP]. We call this "Flow Queueing" rather than "Fair Queueing" as 112 flows that build a queue are treated differently than flows that do 113 not. 115 FQ-CoDel stochastically classifies incoming packets into different 116 sub-queues by hashing the 5-tuple of IP protocol number and source 117 and destination IP and port numbers, perturbed with a random number 118 selected at initiation time (although other flow classification 119 schemes can optionally be configured instead). Each queue is managed 120 by the CoDel queueing discipline. Packet ordering within a queue is 121 preserved, since queues have FIFO ordering. 123 The FQ-CoDel algorithm consists of two logical parts: the scheduler 124 which selects which queue to dequeue a packet from, and the CoDel AQM 125 which works on each of the queues. The subtleties of FQ-CoDel are 126 mostly in the scheduling part, whereas the interaction between the 127 scheduler and the CoDel algorithm are fairly straight forward: 129 At initialisation, each queue is set up to have a separate set of 130 CoDel state variables. By default, 1024 queues are created. The 131 current implementation supports anywhere from one to 64K separate 132 queues, and each queue maintains the state variables throughout its 133 lifetime, and so acts the same as the non-FQ CoDel variant would. 134 This means that with only one queue, FQ-CoDel behaves essentially the 135 same as CoDel by itself. 137 On dequeue, FQ-CoDel selects a queue from which to dequeue by a two- 138 tier round-robin scheme, in which each queue is allowed to dequeue up 139 to a configurable quantum of bytes for each iteration. Deviations 140 from this quantum is maintained as a deficit for the queue, which 141 serves to make the fairness scheme byte-based rather than a packet- 142 based. The two-tier round-robin mechanism distinguishes between 143 "new" queues (which don't build up a standing queue) and "old" 144 queues, that have queued enough data to be around for more than one 145 iteration of the round-robin scheduler. 147 This new/old queue distinction has a particular consequence for 148 queues that don't build up more than a quantum of bytes before being 149 visited by the scheduler: Such queues are removed from the list, and 150 then re-added as a new queue each time a packet arrives for it, and 151 so will get priority over queues that do not empty out each round 152 (except for a minor modification to protect against starvation, 153 detailed below). Exactly how much data a flow has to send to keep 154 its queue in this state is somewhat difficult to reason about, 155 because it depends on both the egress link speed and the number of 156 concurrent flows. However, in practice many things that are 157 beneficial to have prioritised for typical internet use (ACKs, DNS 158 lookups, interactive SSH, HTTP requests, ARP, ICMP, VoIP) _tend_ to 159 fall in this category, which is why FQ-CoDel performs so well for 160 many practical applications. However, the implicitness of the 161 prioritisation means that for applications that require guaranteed 162 priority (for instance multiplexing the network control plane over 163 the network itself), explicit classification is still needed. 165 This scheduling scheme has some subtlety to it, which is explained in 166 detail in the remainder of this document. 168 2. CoDel 170 CoDel is described in the the ACM Queue paper [CODEL2012], and the 171 AQM working group draft [CODELDRAFT]. The basic idea is to control 172 queue length, maintaining sufficient queueing to keep the outgoing 173 link busy, but avoiding building up the queue beyond that point. 174 This is done by preferentially dropping packets that remain in the 175 queue for "too long". The CoDel algorithm itself will not be 176 described here; instead we refer the reader to the CoDel draft 177 [CODELDRAFT]. 179 3. Flow Queueing 181 FQ-CoDel's DRR scheduler is byte-based, employing a deficit round- 182 robin mechanism between queues. This works by keeping track of the 183 current byte _deficit_ of each queue. This deficit is initialised to 184 the configurable quantum; each time a queue gets a dequeue 185 opportunity, it gets to dequeue packets, decreasing the deficit by 186 the packet size for each packet, until the deficit runs into the 187 negative, at which point it is increased by one quantum, and the 188 dequeue opportunity ends. 190 This means that if one queue contains packets of, for instance, size 191 quantum/3, and another contains quantum-sized packets, the first 192 queue will dequeue three packets each time it gets a turn, whereas 193 the second only dequeues one. This means that flows that send small 194 packets are not penalised by the difference in packet sizes; rather, 195 the DRR scheme approximates a (single-)byte-based fairness queueing. 196 The size of the quantum determines the scheduling granularity, with 197 the tradeoff from too small a quantum being scheduling overhead. For 198 small bandwidths, lowering the quantum from the default MTU size can 199 be advantageous. 201 Unlike DRR there are two sets of flows - a "new" list for flows that 202 have not built a queue recently, and an "old" list for flow-building 203 queues. 205 4. FQ-CoDel Parameters and Data Structures 207 This section goes into the parameters and data structures in FQ- 208 CoDel. 210 4.1. Parameters 212 4.1.1. Interval 214 The _interval_ parameter has the same semantics as CoDel and is used 215 to ensure that the measured minimum delay does not become too stale. 216 The minimum delay MUST be experienced in the last epoch of length 217 interval. It SHOULD be set on the order of the worst-case RTT 218 through the bottleneck to give end-points sufficient time to react. 220 The default interval value is 100 ms. 222 4.1.2. Target 224 The _target_ parameter has the same semantics as CoDel. It is the 225 acceptable minimum standing/persistent queue delay for each FQ-CoDel 226 Queue. This minimum delay is identified by tracking the local 227 minimum queue delay that packets experience. 229 The default target value is 5 ms, but this value SHOULD be tuned to 230 be at least the transmission time of a single MTU-sized packet at the 231 prevalent egress link speed (which for e.g. 1Mbps and MTU 1500 is 232 ~15ms). It should otherwise be set to on the order of 5-10% of the 233 configured interval. 235 4.1.3. Packet limit 237 Routers do not have infinite memory, so some packet limit MUST be 238 enforced. 240 The _limit_ parameter is the hard limit on the real queue size, 241 measured in number of packets. This limit is a global limit on the 242 number of packets in all queues; each individual queue does not have 243 an upper limit. When the limit is reached and a new packet arrives 244 for enqueue, a packet is dropped from the head of the largest queue 245 (measured in bytes) to make room for the new packet. 247 The default packet limit is 10240 packets, which is suitable for up 248 to 10GigE speeds. In practice, the hard limit is rarely, if ever, 249 hit, as drops are performed by the CoDel algorithm long before the 250 limit is hit. For platforms that are severely memory constrained, a 251 lower limit can be used. 253 4.1.4. Quantum 255 The _quantum_ parameter is the number of bytes each queue gets to 256 dequeue on each round of the scheduling algorithm. The default is 257 set to 1514 bytes which corresponds to the Ethernet MTU plus the 258 hardware header length of 14 bytes. 260 In TSO-enabled systems, where a "packet" consists of an offloaded 261 packet train, it can presently be as large as 64K bytes. In GRO- 262 enabled systems, up to 17 times the TCP max segment size (or 25K 263 bytes). 265 4.1.5. Flows 267 The _flows_ parameter sets the number of sub-queues into which the 268 incoming packets are classified. Due to the stochastic nature of 269 hashing, multiple flows may end up being hashed into the same slot. 271 This parameter can be set only at load time since memory has to be 272 allocated for the hash table in the current implementation. 274 The default value is 1024. 276 4.1.6. ECN 278 ECN is _enabled_ by default. Rather than do anything special with 279 misbehaved ECN flows, FQ-CoDel relies on the packet scheduling system 280 to minimise their impact, thus unresponsive packets in a flow being 281 marked with ECN can grow to the overall packet limit, but will not 282 otherwise affect the performance of the system. 284 It can be disabled by specifying the _noecn_ parameter. 286 4.2. Data structures 288 4.2.1. Internal sub-queues 290 The main data structure of FQ-CoDel is the array of sub-queues, which 291 is instantiated to the number of queues specified by the _flows_ 292 parameter at instantiation time. Each sub-queue consists simply of 293 an ordered list of packets with FIFO semantics, two state variables 294 tracking the queue deficit and total number of bytes enqueued, and 295 the set of CoDel state variables. Other state variables to track 296 queue statistics can also be included: for instance, the Linux 297 implementation keeps a count of dropped packets. 299 Queue space is shared: there's a global limit on the number of 300 packets the queues can hold, but not one per queue. 302 4.2.2. New and old queues lists 304 FQ-CoDel maintains two lists of active queues, called "new" and "old" 305 queues. Each list is an ordered list containing references to the 306 array of sub-queues. When a packet is added to a queue that is not 307 currently active, that queue becomes active by being added to the 308 list of new queues. Later on, it is moved to the list of old queues, 309 from which it is removed when it is no longer active. This behaviour 310 is the source of some subtlety in the packet scheduling at dequeue 311 time, explained below. 313 5. The FQ-CoDel scheduler and AQM interactions 315 This section describes the operation of the FQ-CoDel scheduler and 316 AQM. It is split into two parts explaining the enqueue and dequeue 317 operations. 319 5.1. Enqueue 321 The packet enqueue mechanism consists of three stages: classification 322 into a sub-queue, timestamping and bookkeeping, and optionally 323 dropping a packet when the total number of enqueued packets goes over 324 the maximum. 326 When a packet is enqueued, it is first classified into the 327 appropriate sub-queue. By default, this is done by hashing on the 328 5-tuple of IP protocol, and source and destination IP and port 329 numbers, permuted by a random value selected at initialisation time, 330 and taking the hash value modulo the number of sub-queues. However, 331 an implementation MAY also specify a configurable classification 332 scheme along a wide variety of other possible parameters such as mac 333 address, diffserv, firewall and flow specific markings, etc. (the 334 Linux implementation does so in the form of the 'tc filter' command). 336 If a custom filter fails, classification failure results in the 337 packet being dropped and no further action taken. By design the 338 standard filter cannot fail. 340 Additionally, the default hashing algorithm presently deployed does 341 decapsulation of some common packet types (6in4, IPIP, GRE 0), mixes 342 IPv6 IP addresses thoroughly, and uses Jenkins hash on the result. 344 Once the packet has been successfully classified into a sub-queue, it 345 is handed over to the CoDel algorithm for timestamping. It is then 346 added to the tail of the selected queue, and the queue's byte count 347 is updated by the packet size. Then, if the queue is not currently 348 active (i.e. if it is not in either the list of new or the list of 349 old queues), it is added to the end of the list of new queues, and 350 its deficit is initiated to the configured quantum. Otherwise it is 351 added to the old queue list. 353 Finally, the total number of enqueued packets is compared with the 354 configured limit, and if it is _above_ this value (which can happen 355 since a packet was just enqueued), a packet is dropped from the head 356 of the queue with the largest current byte count. Note that this in 357 most cases means that the packet that gets dropped is different from 358 the one that was just enqueued, and may even be from a different 359 queue. 361 5.2. Dequeue 363 Most of FQ-CoDel's work is done at packet dequeue time. It consists 364 of three parts: selecting a queue from which to dequeue a packet, 365 actually dequeuing it (employing the CoDel algorithm in the process), 366 and some final bookkeeping. 368 For the first part, the scheduler first looks at the list of new 369 queues; for each queue in that list, if that queue has a negative 370 deficit (i.e. it has already dequeued at least a quantum of bytes), 371 its deficit is increased by one quantum, and the queue is put onto 372 _the end of_ the list of old queues, and the routine selects the next 373 queue and starts again. 375 Otherwise, that queue is selected for dequeue. If the list of new 376 queues is empty, the scheduler proceeds down the list of old queues 377 in the same fashion (checking the deficit, and either selecting the 378 queue for dequeuing, or increasing the deficit and putting the queue 379 back at the end of the list). 381 After having selected a queue from which to dequeue a packet, the 382 CoDel algorithm is invoked on that queue. This applies the CoDel 383 control law, and may discard one or more packets from the head of 384 that queue, before returning the packet that should be dequeued (or 385 nothing if the queue is or becomes empty while being handled by the 386 CoDel algorithm). 388 Finally, if the CoDel algorithm did not return a packet, the queue is 389 empty, and the scheduler does one of two things: if the queue 390 selected for dequeue came from the list of new queues, it is moved to 391 _the end of_ the list of old queues. If instead it came from the 392 list of old queues, that queue is removed from the list, to be added 393 back (as a new queue) the next time a packet arrives that hashes to 394 that queue. Then (since no packet was available for dequeue), the 395 whole dequeue process is restarted from the beginning. 397 If, instead, the scheduler _did_ get a packet back from the CoDel 398 algorithm, it updates the byte deficit for the selected queue before 399 returning the packet as the result of the dequeue operation. 401 The step that moves an empty queue from the list of new queues to 402 _the end of_ the list of old queues before it is removed is crucial 403 to prevent starvation. Otherwise the queue could reappear (the next 404 time a packet arrives for it) before the list of old queues is 405 visited; this can go on indefinitely even with a small number of 406 active flows, if the flow providing packets to the queue in question 407 transmits at just the right rate. This is prevented by first moving 408 the queue to _the end of_ the list of old queues, forcing a pass 409 through that, and thus preventing starvation. Moving it to the end 410 of the list, rather than the front, is crucial for this to work. 412 The resulting migration of queues between the different states is 413 summarised in the following state diagram: 415 +-----------------+ +--------------------+ 416 | | Empty | | 417 | Empty |<---------------+ Old +-----+ 418 | | | | | 419 +-------+---------+ +--------------------+ | 420 | ^ ^ |Quantum 421 |Arrival | | |Exceeded 422 v | | | 423 +-----------------+ | | | 424 | | Empty or | | | 425 | New +-------------------+ +--------+ 426 | | Quantum exceeded 427 +-----------------+ 429 6. Implementation considerations 431 6.1. Probability of hash collisions 433 Since the Linux FQ-CoDel implementation by default uses 1024 hash 434 buckets, the probability that (say) 100 VoIP sessions will all hash 435 to the same bucket is something like ten to the power of minus 300. 436 Thus, the probability that at least one of the VoIP sessions will 437 hash to some other queue is very high indeed. 439 Conversely, the probability that each of the 100 VoIP sessions will 440 get its own queue is given by (1023!/(924!*1024^99)) or about 0.007; 441 so not all that probable. The probability rises sharply, however, if 442 we are willing to accept a few collisions. For example, there is 443 about an 86% probability that no more than two of the 100 VoIP 444 sessions will be involved in any given collision, and about a 99% 445 probability that no more than three of the VoIP sessions will be 446 involved in any given collision. These last two results were 447 computed using Monte Carlo simulations: Oddly enough, the mathematics 448 for VoIP-session collision exactly matches that of hardware cache 449 overflow. 451 6.2. Memory Overhead 453 FQ-CoDel can be implemented with a very low memory footprint (less 454 than 64 bytes per queue on 64 bit systems). These are the data 455 structures used in the Linux implementation: 457 struct codel_vars { 458 u32 count; 459 u32 lastcount; 460 bool dropping; 461 u16 rec_inv_sqrt; 462 codel_time_t first_above_time; 463 codel_time_t drop_next; 464 codel_time_t ldelay; 465 }; 467 struct fq_codel_flow { 468 struct sk_buff *head; 469 struct sk_buff *tail; 470 struct list_head flowchain; 471 int deficit; 472 u32 dropped; /* number of drops (or ECN marks) on this flow */ 473 struct codel_vars cvars; 474 }; 476 The master table managing all queues looks like this: 478 struct fq_codel_sched_data { 479 struct tcf_proto *filter_list; /* optional external classifier */ 480 struct fq_codel_flow *flows; /* Flows table [flows_cnt] */ 481 u32 *backlogs; /* backlog table [flows_cnt] */ 482 u32 flows_cnt; /* number of flows */ 483 u32 perturbation; /* hash perturbation */ 484 u32 quantum; /* psched_mtu(qdisc_dev(sch)); */ 485 struct codel_params cparams; 486 struct codel_stats cstats; 487 u32 drop_overlimit; 488 u32 new_flow_count; 490 struct list_head new_flows; /* list of new flows */ 491 struct list_head old_flows; /* list of old flows */ 492 }; 494 6.3. Per-Packet Timestamping 496 The CoDel portion of the algorithm requires per-packet timestamps be 497 stored along with the packet. While this approach works well for 498 software-based routers, it may be impossible to retrofit devices that 499 do most of their processing in silicon and lack space or mechanism 500 for timestamping. 502 Also, while perfect resolution is not needed, timestamping functions 503 in the core OS need to be efficient as they are called at least once 504 on each packet enqueue and dequeue. 506 6.4. Other forms of "Fair Queueing" 508 Much of the scheduling portion of FQ-CoDel is derived from DRR and is 509 substantially similar to DRR++. SFQ-based versions have also been 510 produced and tested in ns2. Other forms of Fair Queueing, such as 511 WFQ or QFQ, have not been thoroughly explored. 513 6.5. Differences between CoDel and FQ-CoDel behaviour 515 CoDel can be applied to a single queue system as a straight AQM, 516 where it converges towards an "ideal" drop rate (i.e. one that 517 minimises delay while keeping a high link utilisation), and then 518 optimises around that control point. 520 The scheduling of FQ-CoDel mixes packets of competing flows, which 521 acts to pace bursty flows to better fill the pipe. Additionally, a 522 new flow gets substantial "credit" over other flows until CoDel finds 523 an ideal drop rate for it. However, for a new flow that exceeds the 524 configured quantum, more time passes before all of its data is 525 delivered (as packets from it, too, are mixed across the other 526 existing queue-building flows). Thus, FQ-CoDel takes longer (as 527 measured in time) to converge towards an ideal drop rate for a given 528 new flow, but does so within fewer delivered _packets_ from that 529 flow. 531 Finally, the flow isolation FQ-CoDel provides means that the CoDel 532 drop mechanism operates on the flows actually building queues, which 533 results in packets being dropped more accurately from the largest 534 flows than CoDel alone manages. Additionally, flow isolation 535 radically improves the transient behaviour of the network when 536 traffic or link characteristics change (e.g. when new flows start up 537 or the link bandwidth changes); while CoDel itself can take a while 538 to respond, fq_codel doesn't miss a beat. 540 7. Limitations of flow queueing 542 While FQ-CoDel has been shown in many scenarios to offer significant 543 performance gains, there are some scenarios where the scheduling 544 algorithm in particular is not a good fit. This section documents 545 some of the known cases which either may require tweaking the default 546 behaviour, or where alternatives to flow queueing should be 547 considered. 549 7.1. Fairness between things other than flows 551 In some parts of the network, enforcing flow-level fairness may not 552 be desirable, or some other level of fairness may be more important. 553 An example of this can be an Internet Service Provider that may be 554 more interested in ensuring fairness between customers than between 555 flows. Or a hosting or transit provider that wishes to ensure 556 fairness between connecting Autonomous Systems or networks. Another 557 issue can be that the number of simultaneous flows experienced at a 558 particular link can be too high for flow-based fairness queueing to 559 be effective. 561 Whatever the reason, in a scenario where fairness between flows is 562 not desirable, reconfiguring FQ-CoDel to match on a different 563 characteristic can be a way forward. The implementation in Linux can 564 leverage the powerful packet matching mechanism of the _tc_ subsystem 565 to use any available packet field to partition packets into virtual 566 queues, to for instance match on address or subnet source/destination 567 pairs, application layer characteristics, etc. 569 Furthermore, as commonly deployed today, FQ-CoDel is used with three 570 or more tiers of classification: priority, best effort and 571 background, based on diffserv markings. Some products do more 572 detailed classification, including deep packet inspection and 573 destination-specific filters to achieve their desired result. 575 7.2. Flow bunching by opaque encapsulation 577 Where possible, FQ-CoDel will attempt to decapsulate packets before 578 matching on the header fields for the flow hashing. However, for 579 some encapsulation techniques, most notably encrypted VPNs, this is 580 not possible. If several flows are bunched into one such 581 encapsulated tunnel, they will be seen as one flow by the FQ-CoDel 582 algorithm. This means that they will share a queue, and drop 583 behaviour, and so flows inside the encapsulation will not benefit 584 from the implicit prioritisation of FQ-CoDel, but will continue to 585 benefit from the reduced overall queue length from the CoDel 586 algorithm operating on the queue. In addition, when such an 587 encapsulated bunch competes against other flows, it will count as one 588 flow, and not assigned a share of the bandwidth based on how many 589 flows are inside the encapsulation. 591 Depending on the application, this may or may not be desirable 592 behaviour. In cases where it is not, changing FQ-CoDel's matching to 593 not be flow-based (as detailed in the previous subsection above) can 594 be a way to mitigate this. 596 7.3. Low-priority congestion control algorithms 598 Because of the flow isolation that FQ-CoDel provides, low-priority 599 congestion control algorithms (or, in general, algorithms that try to 600 voluntarily use up less than their fair share of bandwidth) can be 601 re-prioritised. Because a flow experiences very little added latency 602 when the link is congested, such algorithms lack the signal to back 603 off that added latency previously afforded them. As such, existing 604 algorithms tend to revert to loss-based congestion control, and will 605 consume the fair share of bandwidth afforded to them by the FQ-CoDel 606 scheduler. However, low-priority congestion control mechanisms may 607 be able to take steps to continue to be low priority, for instance by 608 taking into account the vastly reduced level of delay afforded by an 609 AQM, or by using a coupled approach to observing the behaviour of 610 multiple flows. 612 8. Security Considerations 614 There are no specific security exposures associated with FQ-CoDel. 615 Some exposures present in current FIFO systems are in fact reduced 616 (e.g. simple minded packet floods). 618 9. IANA Considerations 620 This document has no actions for IANA. 622 10. Acknowledgements 624 Our deepest thanks to Eric Dumazet (author of FQ-CoDel), Kathie 625 Nichols, Van Jacobson, and all the members of the bufferbloat.net 626 effort. 628 11. Conclusions 630 FQ-CoDel is a very general, efficient, nearly parameterless active 631 queue management approach combining flow queueing with CoDel. It is 632 a critical tool in solving bufferbloat. 634 FQ-CoDel's default settings SHOULD be modified for other special- 635 purpose networking applications, such as for exceptionally slow 636 links, for use in data centres, or on links with inherent delay 637 greater than 800ms (e.g. satellite links). 639 On-going projects are: improving FQ-CoDel with more SFQ-like 640 behaviour for lower bandwidth systems, improving the control law, 641 optimising sparse packet drop behaviour, etc.. 643 In addition to the Linux kernel sources, ns2 and ns3 models are 644 available. Refinements (such as NFQCODEL [1]) are being tested in 645 the CeroWrt effort. 647 12. References 649 12.1. Normative References 651 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 652 Requirement Levels", BCP 14, RFC 2119, March 1997. 654 [RFC0896] Nagle, J., "Congestion control in IP/TCP internetworks", 655 RFC 896, January 1984. 657 [RFC0970] Nagle, J., "On packet switches with infinite storage", RFC 658 970, December 1985. 660 [RFC2309] Braden, B., Clark, D., Crowcroft, J., Davie, B., Deering, 661 S., Estrin, D., Floyd, S., Jacobson, V., Minshall, G., 662 Partridge, C., Peterson, L., Ramakrishnan, K., Shenker, 663 S., Wroclawski, J., and L. Zhang, "Recommendations on 664 Queue Management and Congestion Avoidance in the 665 Internet", RFC 2309, April 1998. 667 [CODELDRAFT] 668 Nichols, K., Jacobson, V., McGregor, A., and J. Iyengar, 669 "Controlled Delay Active Queue Management", October 2014, 670 . 672 12.2. Informative References 674 [SFQ] McKenney, P., "Stochastic Fairness Queuing", September 675 1990, . 678 [CODEL2012] 679 Nichols, K. and V. Jacobson, "Controlling Queue Delay", 680 July 2012, . 682 [SQF2012] Bonald, T., Muscariello, L., and N. Ostallo, "On the 683 impact of TCP and per-flow scheduling on Internet 684 Performance - IEEE/ACM transactions on Networking", April 685 2012, . 688 [DRR] Shreedhar, M. and G. Varghese, "Efficient Fair Queueing 689 Using Deficit Round Robin", June 1996, 690 . 693 [DRRPP] MacGregor, and Shi, "Deficits for Bursty Latency-critical 694 Flows: DRR++", 2000, . 697 12.3. URIs 699 [1] http://www.bufferbloat.net/projects/cerowrt/wiki/nfq_codel 701 Authors' Addresses 703 Toke Hoeiland-Joergensen 704 Karlstad University 705 Dept. of Computer Science 706 Karlstad 65188 707 Sweden 709 Email: toke.hoiland-jorgensen@kau.se 710 Paul McKenney 711 IBM Linux Technology Center 712 1385 NW Amberglen Parkway 713 Hillsboro, OR 97006 714 USA 716 Email: paulmck@linux.vnet.ibm.com 717 URI: http://www2.rdrop.com/~paulmck/ 719 Dave Taht 720 Teklibre 721 2104 W First street 722 Apt 2002 723 FT Myers, FL 33901 724 USA 726 Email: d+ietf@teklibre.com 727 URI: http://www.teklibre.com/ 729 Jim Gettys 730 Google, Inc. 731 21 Oak Knoll Road 732 Carlisle, MA 01741 733 USA 735 Email: jg@freedesktop.org 736 URI: https://en.wikipedia.org/wiki/Jim_Gettys 738 Eric Dumazet 739 Google, Inc. 740 1600 Amphitheater Pkwy 741 Mountain View, Ca 94043 742 USA 744 Email: edumazet@gmail.com