idnits 2.17.1 draft-ietf-tsvwg-byte-pkt-congest-11.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 == Line 1604 has weird spacing: '...ability p ...' == Line 1609 has weird spacing: '...ss-rate p*u ...' == Line 1610 has weird spacing: '...ss-rate p*u*s...' == Line 1617 has weird spacing: '...ss-rate p*u ...' == Line 1618 has weird spacing: '...ss-rate p*u*s...' (Using the creation date from RFC2309, updated by this document, for RFC5378 checks: 1997-03-25) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 1, 2013) is 3921 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-02) exists of draft-nichols-tsvwg-codel-01 -- Obsolete informational reference (is this intentional?): RFC 2309 (Obsoleted by RFC 7567) Summary: 0 errors (**), 0 flaws (~~), 7 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Transport Area Working Group B. Briscoe 3 Internet-Draft BT 4 Updates: 2309 (if approved) J. Manner 5 Intended status: BCP Aalto University 6 Expires: February 2, 2014 August 1, 2013 8 Byte and Packet Congestion Notification 9 draft-ietf-tsvwg-byte-pkt-congest-11 11 Abstract 13 This document provides recommendations of best current practice for 14 dropping or marking packets using any active queue management (AQM) 15 algorithm, including random early detection (RED), BLUE, pre- 16 congestion notification (PCN) and newer schemes such as CoDel and 17 PIE. We give three strong recommendations: (1) packet size should be 18 taken into account when transports detect and respond to congestion 19 indications, (2) packet size should not be taken into account when 20 network equipment creates congestion signals (marking, dropping), and 21 therefore (3) in the specific case of RED, the byte-mode packet drop 22 variant that drops fewer small packets should not be used. This memo 23 updates RFC 2309 to deprecate deliberate preferential treatment of 24 small packets in AQM algorithms. 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on February 2, 2014. 43 Copyright Notice 45 Copyright (c) 2013 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 1.1. Terminology and Scoping . . . . . . . . . . . . . . . . . 6 62 1.2. Example Comparing Packet-Mode Drop and Byte-Mode Drop . . 7 63 2. Recommendations . . . . . . . . . . . . . . . . . . . . . . . 9 64 2.1. Recommendation on Queue Measurement . . . . . . . . . . . 9 65 2.2. Recommendation on Encoding Congestion Notification . . . . 10 66 2.3. Recommendation on Responding to Congestion . . . . . . . . 11 67 2.4. Recommendation on Handling Congestion Indications when 68 Splitting or Merging Packets . . . . . . . . . . . . . . . 12 69 3. Motivating Arguments . . . . . . . . . . . . . . . . . . . . . 12 70 3.1. Avoiding Perverse Incentives to (Ab)use Smaller Packets . 12 71 3.2. Small != Control . . . . . . . . . . . . . . . . . . . . . 14 72 3.3. Transport-Independent Network . . . . . . . . . . . . . . 14 73 3.4. Partial Deployment of AQM . . . . . . . . . . . . . . . . 15 74 3.5. Implementation Efficiency . . . . . . . . . . . . . . . . 17 75 4. A Survey and Critique of Past Advice . . . . . . . . . . . . . 17 76 4.1. Congestion Measurement Advice . . . . . . . . . . . . . . 17 77 4.1.1. Fixed Size Packet Buffers . . . . . . . . . . . . . . 18 78 4.1.2. Congestion Measurement without a Queue . . . . . . . . 19 79 4.2. Congestion Notification Advice . . . . . . . . . . . . . . 20 80 4.2.1. Network Bias when Encoding . . . . . . . . . . . . . . 20 81 4.2.2. Transport Bias when Decoding . . . . . . . . . . . . . 21 82 4.2.3. Making Transports Robust against Control Packet 83 Losses . . . . . . . . . . . . . . . . . . . . . . . . 23 84 4.2.4. Congestion Notification: Summary of Conflicting 85 Advice . . . . . . . . . . . . . . . . . . . . . . . . 23 86 5. Outstanding Issues and Next Steps . . . . . . . . . . . . . . 24 87 5.1. Bit-congestible Network . . . . . . . . . . . . . . . . . 24 88 5.2. Bit- & Packet-congestible Network . . . . . . . . . . . . 25 89 6. Security Considerations . . . . . . . . . . . . . . . . . . . 25 90 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 91 8. Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . 26 92 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 27 93 10. Comments Solicited . . . . . . . . . . . . . . . . . . . . . . 28 94 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 28 95 11.1. Normative References . . . . . . . . . . . . . . . . . . . 28 96 11.2. Informative References . . . . . . . . . . . . . . . . . . 28 97 Appendix A. Survey of RED Implementation Status . . . . . . . . . 32 98 Appendix B. Sufficiency of Packet-Mode Drop . . . . . . . . . . . 33 99 B.1. Packet-Size (In)Dependence in Transports . . . . . . . . . 34 100 B.2. Bit-Congestible and Packet-Congestible Indications . . . . 37 101 Appendix C. Byte-mode Drop Complicates Policing Congestion 102 Response . . . . . . . . . . . . . . . . . . . . . . 38 103 Appendix D. Changes from Previous Versions . . . . . . . . . . . 39 105 1. Introduction 107 This document provides recommendations of best current practice for 108 how we should correctly scale congestion control functions with 109 respect to packet size for the long term. It also recognises that 110 expediency may be necessary to deal with existing widely deployed 111 protocols that don't live up to the long term goal. 113 When signalling congestion, the problem of how (and whether) to take 114 packet sizes into account has exercised the minds of researchers and 115 practitioners for as long as active queue management (AQM) has been 116 discussed. Indeed, one reason AQM was originally introduced was to 117 reduce the lock-out effects that small packets can have on large 118 packets in drop-tail queues. This memo aims to state the principles 119 we should be using and to outline how these principles will affect 120 future protocol design, taking into account the existing deployments 121 we have already. 123 The question of whether to take into account packet size arises at 124 three stages in the congestion notification process: 126 Measuring congestion: When a congested resource measures locally how 127 congested it is, should it measure its queue length in time, bytes 128 or packets? 130 Encoding congestion notification into the wire protocol: When a 131 congested network resource signals its level of congestion, should 132 it drop / mark each packet dependent on the size of the particular 133 packet in question? 135 Decoding congestion notification from the wire protocol: When a 136 transport interprets the notification in order to decide how much 137 to respond to congestion, should it take into account the size of 138 each missing or marked packet? 140 Consensus has emerged over the years concerning the first stage, 141 which Section 2.1 records in the RFC Series. In summary: If possible 142 it is best to measure congestion by time in the queue, but otherwise 143 the choice between bytes and packets solely depends on whether the 144 resource is congested by bytes or packets. 146 The controversy is mainly around the last two stages: whether to 147 allow for the size of the specific packet notifying congestion i) 148 when the network encodes or ii) when the transport decodes the 149 congestion notification. 151 Currently, the RFC series is silent on this matter other than a paper 152 trail of advice referenced from [RFC2309], which conditionally 153 recommends byte-mode (packet-size dependent) drop [pktByteEmail]. 154 Reducing drop of small packets certainly has some tempting 155 advantages: i) it drops less control packets, which tend to be small 156 and ii) it makes TCP's bit-rate less dependent on packet size. 157 However, there are ways of addressing these issues at the transport 158 layer, rather than reverse engineering network forwarding to fix the 159 problems. 161 This memo updates [RFC2309] to deprecate deliberate preferential 162 treatment of packets in AQM algorithms solely because of their size. 163 It recommends that (1) packet size should be taken into account when 164 transports detect and respond to congestion indications, (2) not when 165 network equipment creates them. This memo also adds to the 166 congestion control principles enumerated in BCP 41 [RFC2914]. 168 In the particular case of Random early Detection (RED), this means 169 that the byte-mode packet drop variant should not be used to drop 170 fewer small packets, because that creates a perverse incentive for 171 transports to use tiny segments, consequently also opening up a DoS 172 vulnerability. Fortunately all the RED implementers who responded to 173 our admittedly limited survey (Section 4.2.4) have not followed the 174 earlier advice to use byte-mode drop, so the position this memo 175 argues for seems to already exist in implementations. 177 However, at the transport layer, TCP congestion control is a widely 178 deployed protocol that doesn't scale with packet size. To date this 179 hasn't been a significant problem because most TCP implementations 180 have been used with similar packet sizes. But, as we design new 181 congestion control mechanisms, this memo recommends that we should 182 build in scaling with packet size rather than assuming we should 183 follow TCP's example. 185 This memo continues as follows. First it discusses terminology and 186 scoping. Section 2 gives the concrete formal recommendations, 187 followed by motivating arguments in Section 3. We then critically 188 survey the advice given previously in the RFC series and the research 189 literature (Section 4), referring to an assessment of whether or not 190 this advice has been followed in production networks (Appendix A). 191 To wrap up, outstanding issues are discussed that will need 192 resolution both to inform future protocol designs and to handle 193 legacy (Section 5). Then security issues are collected together in 194 Section 6 before conclusions are drawn in Section 8. The interested 195 reader can find discussion of more detailed issues on the theme of 196 byte vs. packet in the appendices. 198 This memo intentionally includes a non-negligible amount of material 199 on the subject. For the busy reader Section 2 summarises the 200 recommendations for the Internet community. 202 1.1. Terminology and Scoping 204 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 205 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 206 document are to be interpreted as described in [RFC2119]. 208 This memo applies to the design of all AQM algorithms, for example, 209 Random Early Detection (RED) [RFC2309], BLUE [BLUE02], Pre-Congestion 210 Notification (PCN) [RFC5670], Controlled Delay (CoDel) 211 [I-D.nichols-tsvwg-codel] and the Proportional Integral controller 212 Enhanced (PIE) [I-D.pan-tsvwg-pie]. Throughout, RED is used as a 213 concrete example because it is a widely known and deployed AQM 214 algorithm. There is no intention to imply that the advice is any 215 less applicable to the other algorithms, nor that RED is preferred. 217 Congestion Notification: Congestion notification is a changing 218 signal that aims to communicate the probability that the network 219 resource(s) will not be able to forward the level of traffic load 220 offered (or that there is an impending risk that they will not be 221 able to). 223 The `impending risk' qualifier is added, because AQM systems set a 224 virtual limit smaller than the actual limit to the resource, then 225 notify when this virtual limit is exceeded in order to avoid 226 uncontrolled congestion of the actual capacity. 228 Congestion notification communicates a real number bounded by the 229 range [ 0 , 1 ]. This ties in with the most well-understood 230 measure of congestion notification: drop probability. 232 Explicit and Implicit Notification: The byte vs. packet dilemma 233 concerns congestion notification irrespective of whether it is 234 signalled implicitly by drop or using explicit congestion 235 notification (ECN [RFC3168] or PCN [RFC5670]). Throughout this 236 document, unless clear from the context, the term marking will be 237 used to mean notifying congestion explicitly, while congestion 238 notification will be used to mean notifying congestion either 239 implicitly by drop or explicitly by marking. 241 Bit-congestible vs. Packet-congestible: If the load on a resource 242 depends on the rate at which packets arrive, it is called packet- 243 congestible. If the load depends on the rate at which bits arrive 244 it is called bit-congestible. 246 Examples of packet-congestible resources are route look-up engines 247 and firewalls, because load depends on how many packet headers 248 they have to process. Examples of bit-congestible resources are 249 transmission links, radio power and most buffer memory, because 250 the load depends on how many bits they have to transmit or store. 251 Some machine architectures use fixed size packet buffers, so 252 buffer memory in these cases is packet-congestible (see 253 Section 4.1.1). 255 The path through a machine will typically encounter both packet- 256 congestible and bit-congestible resources. However, currently, a 257 design goal of network processing equipment such as routers and 258 firewalls is to size the packet-processing engine(s) relative to 259 the lines in order to keep packet processing uncongested even 260 under worst case packet rates with runs of minimum size packets. 261 Therefore, packet-congestion is currently rare [RFC6077; S.3.3], 262 but there is no guarantee that it will not become more common in 263 future. 265 Note that information is generally processed or transmitted with a 266 minimum granularity greater than a bit (e.g. octets). The 267 appropriate granularity for the resource in question should be 268 used, but for the sake of brevity we will talk in terms of bytes 269 in this memo. 271 Coarser Granularity: Resources may be congestible at higher levels 272 of granularity than bits or packets, for instance stateful 273 firewalls are flow-congestible and call-servers are session- 274 congestible. This memo focuses on congestion of connectionless 275 resources, but the same principles may be applicable for 276 congestion notification protocols controlling per-flow and per- 277 session processing or state. 279 RED Terminology: In RED whether to use packets or bytes when 280 measuring queues is called respectively "packet-mode queue 281 measurement" or "byte-mode queue measurement". And whether the 282 probability of dropping a particular packet is independent or 283 dependent on its size is called respectively "packet-mode drop" or 284 "byte-mode drop". The terms byte-mode and packet-mode should not 285 be used without specifying whether they apply to queue measurement 286 or to drop. 288 1.2. Example Comparing Packet-Mode Drop and Byte-Mode Drop 290 Taking RED as a well-known example algorithm, a central question 291 addressed by this document is whether to recommend RED's packet-mode 292 drop variant and to deprecate byte-mode drop. Table 1 compares how 293 packet-mode and byte-mode drop affect two flows of different size 294 packets. For each it gives the expected number of packets and of 295 bits dropped in one second. Each example flow runs at the same bit- 296 rate of 48Mb/s, but one is broken up into small 60 byte packets and 297 the other into large 1500 byte packets. 299 To keep up the same bit-rate, in one second there are about 25 times 300 more small packets because they are 25 times smaller. As can be seen 301 from the table, the packet rate is 100,000 small packets versus 4,000 302 large packets per second (pps). 304 Parameter Formula Small packets Large packets 305 -------------------- -------------- ------------- ------------- 306 Packet size s/8 60B 1,500B 307 Packet size s 480b 12,000b 308 Bit-rate x 48Mbps 48Mbps 309 Packet-rate u = x/s 100kpps 4kpps 311 Packet-mode Drop 312 Pkt loss probability p 0.1% 0.1% 313 Pkt loss-rate p*u 100pps 4pps 314 Bit loss-rate p*u*s 48kbps 48kbps 316 Byte-mode Drop MTU, M=12,000b 317 Pkt loss probability b = p*s/M 0.004% 0.1% 318 Pkt loss-rate b*u 4pps 4pps 319 Bit loss-rate b*u*s 1.92kbps 48kbps 321 Table 1: Example Comparing Packet-mode and Byte-mode Drop 323 For packet-mode drop, we illustrate the effect of a drop probability 324 of 0.1%, which the algorithm applies to all packets irrespective of 325 size. Because there are 25 times more small packets in one second, 326 it naturally drops 25 times more small packets, that is 100 small 327 packets but only 4 large packets. But if we count how many bits it 328 drops, there are 48,000 bits in 100 small packets and 48,000 bits in 329 4 large packets--the same number of bits of small packets as large. 331 The packet-mode drop algorithm drops any bit with the same 332 probability whether the bit is in a small or a large packet. 334 For byte-mode drop, again we use an example drop probability of 0.1%, 335 but only for maximum size packets (assuming the link MTU is 1,500B or 336 12,000b). The byte-mode algorithm reduces the drop probability of 337 smaller packets proportional to their size, making the probability 338 that it drops a small packet 25 times smaller at 0.004%. But there 339 are 25 times more small packets, so dropping them with 25 times lower 340 probability results in dropping the same number of packets: 4 drops 341 in both cases. The 4 small dropped packets contain 25 times less 342 bits than the 4 large dropped packets: 1,920 compared to 48,000. 344 The byte-mode drop algorithm drops any bit with a probability 345 proportionate to the size of the packet it is in. 347 2. Recommendations 349 This section gives recommendations related to network equipment in 350 Sections 2.1 and 2.2, and in Sections 2.3 and 2.4 we discuss the 351 implications on the transport protocols. 353 2.1. Recommendation on Queue Measurement 355 Ideally, an AQM would measure the service time of the queue to 356 measure congestion of a resource. However service time can only be 357 measured as packets leave the queue, where it is not always feasible 358 to implement a full AQM algorithm. To predict the service time as 359 packets join the queue, an AQM algorithm needs to measure the length 360 of the queue. 362 In this case, if the resource is bit-congestible, the AQM 363 implementation SHOULD measure the length of the queue in bytes and, 364 if the resource is packet-congestible, the implementation SHOULD 365 measure the length of the queue in packets. No other choice makes 366 sense, because the number of packets waiting in the queue isn't 367 relevant if the resource gets congested by bytes and vice versa. For 368 example, the length of the queue into a transmission line would be 369 measured in bytes, while the length of the queue into a firewall 370 would be measured in packets. 372 To avoid the pathological effects of drop tail, the AQM can then 373 transform this service time or queue length into the probability of 374 dropping or marking a packet (e.g. RED's piecewise linear function 375 between thresholds). 377 What this advice means for RED as a specific example: 379 1. A RED implementation SHOULD use byte mode queue measurement for 380 measuring the congestion of bit-congestible resources and packet 381 mode queue measurement for packet-congestible resources. 383 2. An implementation SHOULD NOT make it possible to configure the 384 way a queue measures itself, because whether a queue is bit- 385 congestible or packet-congestible is an inherent property of the 386 queue. 388 Exceptions to these recommendations MAY be necessary, for instance 389 where a packet-congestible resource has to be configured as a proxy 390 bottleneck for a bit-congestible resource in an adjacent box that 391 does not support AQM. 393 The recommended approach in less straightforward scenarios, such as 394 fixed size packet buffers, resources without a queue and buffers 395 comprising a mix of packet and bit-congestible resources, is 396 discussed in Section 4.1. For instance, Section 4.1.1 explains that 397 the queue into a line should be measured in bytes even if the queue 398 consists of fixed-size packet-buffers, because the root-cause of any 399 congestion is bytes arriving too fast for the line--packets filling 400 buffers are merely a symptom of the underlying congestion of the 401 line. 403 2.2. Recommendation on Encoding Congestion Notification 405 When encoding congestion notification (e.g. by drop, ECN or PCN), the 406 probability that network equipment drops or marks a particular packet 407 to notify congestion SHOULD NOT depend on the size of the packet in 408 question. As the example in Section 1.2 illustrates, to drop any bit 409 with probability 0.1% it is only necessary to drop every packet with 410 probability 0.1% without regard to the size of each packet. 412 This approach ensures the network layer offers sufficient congestion 413 information for all known and future transport protocols and also 414 ensures no perverse incentives are created that would encourage 415 transports to use inappropriately small packet sizes. 417 What this advice means for RED as a specific example: 419 1. The RED AQM algorithm SHOULD NOT use byte-mode drop, i.e. it 420 ought to use packet-mode drop. Byte-mode drop is more complex, 421 it creates the perverse incentive to fragment segments into tiny 422 pieces and it is vulnerable to floods of small packets. 424 2. If a vendor has implemented byte-mode drop, and an operator has 425 turned it on, it is RECOMMENDED to switch it to packet-mode drop, 426 after establishing if there are any implications on the relative 427 performance of applications using different packet sizes. The 428 unlikely possibility of some application-specific legacy use of 429 byte-mode drop is the only reason that all the above 430 recommendations on encoding congestion notification are not 431 phrased more strongly. 433 RED as a whole SHOULD NOT be switched off. Without RED, a drop 434 tail queue biases against large packets and is vulnerable to 435 floods of small packets. 437 Note well that RED's byte-mode queue drop is completely orthogonal to 438 byte-mode queue measurement and should not be confused with it. If a 439 RED implementation has a byte-mode but does not specify what sort of 440 byte-mode, it is most probably byte-mode queue measurement, which is 441 fine. However, if in doubt, the vendor should be consulted. 443 A survey (Appendix A) showed that there appears to be little, if any, 444 installed base of the byte-mode drop variant of RED. This suggests 445 that deprecating byte-mode drop will have little, if any, incremental 446 deployment impact. 448 2.3. Recommendation on Responding to Congestion 450 When a transport detects that a packet has been lost or congestion 451 marked, it SHOULD consider the strength of the congestion indication 452 as proportionate to the size in octets (bytes) of the missing or 453 marked packet. 455 In other words, when a packet indicates congestion (by being lost or 456 marked) it can be considered conceptually as if there is a congestion 457 indication on every octet of the packet, not just one indication per 458 packet. 460 To be clear, the above recommendation solely describes how a 461 transport should interpret the meaning of a congestion indication. 462 It makes no recommendation on whether a transport should act 463 differently based on this interpretation. It merely aids 464 interoperablity between transports, if they choose to make their 465 actions depend on the strength of congestion indications. 467 This definition will be useful as the IETF transport area continues 468 its programme of; 470 o updating host-based congestion control protocols to take account 471 of packet size 473 o making transports less sensitive to losing control packets like 474 SYNs and pure ACKs. 476 What this advice means for the case of TCP: 478 1. If two TCP flows with different packet sizes are required to run 479 at equal bit rates under the same path conditions, this SHOULD be 480 done by altering TCP (Section 4.2.2), not network equipment (the 481 latter affects other transports besides TCP). 483 2. If it is desired to improve TCP performance by reducing the 484 chance that a SYN or a pure ACK will be dropped, this SHOULD be 485 done by modifying TCP (Section 4.2.3), not network equipment. 487 To be clear, we are not recommending at all that TCPs under 488 equivalent conditions should aim for equal bit-rates. We are merely 489 saying that anyone trying to do such a thing should modify their TCP 490 algorithm, not the network. 492 These recommendations are phrased as 'SHOULD' rather than 'MUST', 493 because there may be cases where compatibility with pre-existing 494 versions of a transport protocol make the recommendations 495 impractical. 497 2.4. Recommendation on Handling Congestion Indications when Splitting 498 or Merging Packets 500 Packets carrying congestion indications may be split or merged in 501 some circumstances (e.g. at a RTP/RTCP transcoder or during IP 502 fragment reassembly). Splitting and merging only make sense in the 503 context of ECN, not loss. 505 The general rule to follow is that the number of octets in packets 506 with congestion indications SHOULD be equivalent before and after 507 merging or splitting. This is based on the principle used above; 508 that an indication of congestion on a packet can be considered as an 509 indication of congestion on each octet of the packet. 511 The above rule is not phrased with the word "MUST" to allow the 512 following exception. There are cases where pre-existing protocols 513 were not designed to conserve congestion marked octets (e.g. IP 514 fragment reassembly [RFC3168] or loss statistics in RTCP receiver 515 reports [RFC3550] before ECN was added [RFC6679]). When any such 516 protocol is updated, it SHOULD comply with the above rule to conserve 517 marked octets. However, the rule may be relaxed if it would 518 otherwise become too complex to interoperate with pre-existing 519 implementations of the protocol. 521 One can think of a splitting or merging process as if all the 522 incoming congestion-marked octets increment a counter and all the 523 outgoing marked octets decrement the same counter. In order to 524 ensure that congestion indications remain timely, even the smallest 525 positive remainder in the conceptual counter should trigger the next 526 outgoing packet to be marked (causing the counter to go negative). 528 3. Motivating Arguments 530 This section is informative. It justifies the recommendations given 531 in the previous section. 533 3.1. Avoiding Perverse Incentives to (Ab)use Smaller Packets 535 Increasingly, it is being recognised that a protocol design must take 536 care not to cause unintended consequences by giving the parties in 537 the protocol exchange perverse incentives [Evol_cc][RFC3426]. Given 538 there are many good reasons why larger path maximum transmission 539 units (PMTUs) would help solve a number of scaling issues, we do not 540 want to create any bias against large packets that is greater than 541 their true cost. 543 Imagine a scenario where the same bit rate of packets will contribute 544 the same to bit-congestion of a link irrespective of whether it is 545 sent as fewer larger packets or more smaller packets. A protocol 546 design that caused larger packets to be more likely to be dropped 547 than smaller ones would be dangerous in both the following cases: 549 Malicious transports: A queue that gives an advantage to small 550 packets can be used to amplify the force of a flooding attack. By 551 sending a flood of small packets, the attacker can get the queue 552 to discard more traffic in large packets, allowing more attack 553 traffic to get through to cause further damage. Such a queue 554 allows attack traffic to have a disproportionately large effect on 555 regular traffic without the attacker having to do much work. 557 Non-malicious transports: Even if an application designer is not 558 actually malicious, if over time it is noticed that small packets 559 tend to go faster, designers will act in their own interest and 560 use smaller packets. Queues that give advantage to small packets 561 create an evolutionary pressure for applications or transports to 562 send at the same bit-rate but break their data stream down into 563 tiny segments to reduce their drop rate. Encouraging a high 564 volume of tiny packets might in turn unnecessarily overload a 565 completely unrelated part of the system, perhaps more limited by 566 header-processing than bandwidth. 568 Imagine two unresponsive flows arrive at a bit-congestible 569 transmission link each with the same bit rate, say 1Mbps, but one 570 consists of 1500B and the other 60B packets, which are 25x smaller. 571 Consider a scenario where gentle RED [gentle_RED] is used, along with 572 the variant of RED we advise against, i.e. where the RED algorithm is 573 configured to adjust the drop probability of packets in proportion to 574 each packet's size (byte mode packet drop). In this case, RED aims 575 to drop 25x more of the larger packets than the smaller ones. Thus, 576 for example if RED drops 25% of the larger packets, it will aim to 577 drop 1% of the smaller packets (but in practice it may drop more as 578 congestion increases [RFC4828; Appx B.4]). Even though both flows 579 arrive with the same bit rate, the bit rate the RED queue aims to 580 pass to the line will be 750kbps for the flow of larger packets but 581 990kbps for the smaller packets (because of rate variations it will 582 actually be a little less than this target). 584 Note that, although the byte-mode drop variant of RED amplifies small 585 packet attacks, drop-tail queues amplify small packet attacks even 586 more (see Security Considerations in Section 6). Wherever possible 587 neither should be used. 589 3.2. Small != Control 591 Dropping fewer control packets considerably improves performance. It 592 is tempting to drop small packets with lower probability in order to 593 improve performance, because many control packets tend to be smaller 594 (TCP SYNs & ACKs, DNS queries & responses, SIP messages, HTTP GETs, 595 etc). However, we must not give control packets preference purely by 596 virtue of their smallness, otherwise it is too easy for any data 597 source to get the same preferential treatment simply by sending data 598 in smaller packets. Again we should not create perverse incentives 599 to favour small packets rather than to favour control packets, which 600 is what we intend. 602 Just because many control packets are small does not mean all small 603 packets are control packets. 605 So, rather than fix these problems in the network, we argue that the 606 transport should be made more robust against losses of control 607 packets (see 'Making Transports Robust against Control Packet Losses' 608 in Section 4.2.3). 610 3.3. Transport-Independent Network 612 TCP congestion control ensures that flows competing for the same 613 resource each maintain the same number of segments in flight, 614 irrespective of segment size. So under similar conditions, flows 615 with different segment sizes will get different bit-rates. 617 To counter this effect it seems tempting not to follow our 618 recommendation, and instead for the network to bias congestion 619 notification by packet size in order to equalise the bit-rates of 620 flows with different packet sizes. However, in order to do this, the 621 queuing algorithm has to make assumptions about the transport, which 622 become embedded in the network. Specifically: 624 o The queuing algorithm has to assume how aggressively the transport 625 will respond to congestion (see Section 4.2.4). If the network 626 assumes the transport responds as aggressively as TCP NewReno, it 627 will be wrong for Compound TCP and differently wrong for Cubic 628 TCP, etc. To achieve equal bit-rates, each transport then has to 629 guess what assumption the network made, and work out how to 630 replace this assumed aggressiveness with its own aggressiveness. 632 o Also, if the network biases congestion notification by packet size 633 it has to assume a baseline packet size--all proposed algorithms 634 use the local MTU (for example see the byte-mode loss probability 635 formula in Table 1). Then if the non-Reno transports mentioned 636 above are trying to reverse engineer what the network assumed, 637 they also have to guess the MTU of the congested link. 639 Even though reducing the drop probability of small packets (e.g. 640 RED's byte-mode drop) helps ensure TCP flows with different packet 641 sizes will achieve similar bit rates, we argue this correction should 642 be made to any future transport protocols based on TCP, not to the 643 network in order to fix one transport, no matter how predominant it 644 is. Effectively, favouring small packets is reverse engineering of 645 network equipment around one particular transport protocol (TCP), 646 contrary to the excellent advice in [RFC3426], which asks designers 647 to question "Why are you proposing a solution at this layer of the 648 protocol stack, rather than at another layer?" 650 In contrast, if the network never takes account of packet size, the 651 transport can be certain it will never need to guess any assumptions 652 the network has made. And the network passes two pieces of 653 information to the transport that are sufficient in all cases: i) 654 congestion notification on the packet and ii) the size of the packet. 655 Both are available for the transport to combine (by taking account of 656 packet size when responding to congestion) or not. Appendix B checks 657 that these two pieces of information are sufficient for all relevant 658 scenarios. 660 When the network does not take account of packet size, it allows 661 transport protocols to choose whether to take account of packet size 662 or not. However, if the network were to bias congestion notification 663 by packet size, transport protocols would have no choice; those that 664 did not take account of packet size themselves would unwittingly 665 become dependent on packet size, and those that already took account 666 of packet size would end up taking account of it twice. 668 3.4. Partial Deployment of AQM 670 In overview, the argument in this section runs as follows: 672 o Because the network does not and cannot always drop packets in 673 proportion to their size, it shouldn't be given the task of making 674 drop signals depend on packet size at all. 676 o Transports on the other hand don't always want to make their rate 677 response proportional to the size of dropped packets, but if they 678 want to, they always can. 680 The argument is similar to the end-to-end argument that says "Don't 681 do X in the network if end-systems can do X by themselves, and they 682 want to be able to choose whether to do X anyway." Actually the 683 following argument is stronger; in addition it says "Don't give the 684 network task X that could be done by the end-systems, if X is not 685 deployed on all network nodes, and end-systems won't be able to tell 686 whether their network is doing X, or whether they need to do X 687 themselves." In this case, the X in question is "making the response 688 to congestion depend on packet size". 690 We will now re-run this argument taking each step in more depth. The 691 argument applies solely to drop, not to ECN marking. 693 A queue drops packets for either of two reasons: a) to signal to host 694 congestion controls that they should reduce the load and b) because 695 there is no buffer left to store the packets. Active queue 696 management tries to use drops as a signal for hosts to slow down 697 (case a) so that drop due to buffer exhaustion (case b) should not be 698 necessary. 700 AQM is not universally deployed in every queue in the Internet; many 701 cheap Ethernet bridges, software firewalls, NATs on consumer devices, 702 etc implement simple tail-drop buffers. Even if AQM were universal, 703 it has to be able to cope with buffer exhaustion (by switching to a 704 behaviour like tail-drop), in order to cope with unresponsive or 705 excessive transports. For these reasons networks will sometimes be 706 dropping packets as a last resort (case b) rather than under AQM 707 control (case a). 709 When buffers are exhausted (case b), they don't naturally drop 710 packets in proportion to their size. The network can only reduce the 711 probability of dropping smaller packets if it has enough space to 712 store them somewhere while it waits for a larger packet that it can 713 drop. If the buffer is exhausted, it does not have this choice. 714 Admittedly tail-drop does naturally drop somewhat fewer small 715 packets, but exactly how few depends more on the mix of sizes than 716 the size of the packet in question. Nonetheless, in general, if we 717 wanted networks to do size-dependent drop, we would need universal 718 deployment of (packet-size dependent) AQM code, which is currently 719 unrealistic. 721 A host transport cannot know whether any particular drop was a 722 deliberate signal from an AQM or a sign of a queue shedding packets 723 due to buffer exhaustion. Therefore, because the network cannot 724 universally do size-dependent drop, it should not do it all. 726 Whereas universality is desirable in the network, diversity is 727 desirable between different transport layer protocols - some, like 728 NewReno TCP [RFC5681], may not choose to make their rate response 729 proportionate to the size of each dropped packet, while others will 730 (e.g. TFRC-SP [RFC4828]). 732 3.5. Implementation Efficiency 734 Biasing against large packets typically requires an extra multiply 735 and divide in the network (see the example byte-mode drop formula in 736 Table 1). Allowing for packet size at the transport rather than in 737 the network ensures that neither the network nor the transport needs 738 to do a multiply operation--multiplication by packet size is 739 effectively achieved as a repeated add when the transport adds to its 740 count of marked bytes as each congestion event is fed to it. Also 741 the work to do the biasing is spread over many hosts, rather than 742 concentrated in just the congested network element. These aren't 743 principled reasons in themselves, but they are a happy consequence of 744 the other principled reasons. 746 4. A Survey and Critique of Past Advice 748 This section is informative, not normative. 750 The original 1993 paper on RED [RED93] proposed two options for the 751 RED active queue management algorithm: packet mode and byte mode. 752 Packet mode measured the queue length in packets and dropped (or 753 marked) individual packets with a probability independent of their 754 size. Byte mode measured the queue length in bytes and marked an 755 individual packet with probability in proportion to its size 756 (relative to the maximum packet size). In the paper's outline of 757 further work, it was stated that no recommendation had been made on 758 whether the queue size should be measured in bytes or packets, but 759 noted that the difference could be significant. 761 When RED was recommended for general deployment in 1998 [RFC2309], 762 the two modes were mentioned implying the choice between them was a 763 question of performance, referring to a 1997 email [pktByteEmail] for 764 advice on tuning. A later addendum to this email introduced the 765 insight that there are in fact two orthogonal choices: 767 o whether to measure queue length in bytes or packets (Section 4.1) 769 o whether the drop probability of an individual packet should depend 770 on its own size (Section 4.2). 772 The rest of this section is structured accordingly. 774 4.1. Congestion Measurement Advice 776 The choice of which metric to use to measure queue length was left 777 open in RFC2309. It is now well understood that queues for bit- 778 congestible resources should be measured in bytes, and queues for 779 packet-congestible resources should be measured in packets 781 [pktByteEmail]. 783 Congestion in some legacy bit-congestible buffers is only measured in 784 packets not bytes. In such cases, the operator has to set the 785 thresholds mindful of a typical mix of packets sizes. Any AQM 786 algorithm on such a buffer will be oversensitive to high proportions 787 of small packets, e.g. a DoS attack, and under-sensitive to high 788 proportions of large packets. However, there is no need to make 789 allowances for the possibility of such legacy in future protocol 790 design. This is safe because any under-sensitivity during unusual 791 traffic mixes cannot lead to congestion collapse given the buffer 792 will eventually revert to tail drop, discarding proportionately more 793 large packets. 795 4.1.1. Fixed Size Packet Buffers 797 The question of whether to measure queues in bytes or packets seems 798 to be well understood. However, measuring congestion is confusing 799 when the resource is bit congestible but the queue into the resource 800 is packet congestible. This section outlines the approach to take. 802 Some, mostly older, queuing hardware allocates fixed sized buffers in 803 which to store each packet in the queue. This hardware forwards to 804 the line in one of two ways: 806 o With some hardware, any fixed sized buffers not completely filled 807 by a packet are padded when transmitted to the wire. This case, 808 should clearly be treated as packet-congestible, because both 809 queuing and transmission are in fixed MTU-sized units. Therefore 810 the queue length in packets is a good model of congestion of the 811 link. 813 o More commonly, hardware with fixed size packet buffers transmits 814 packets to line without padding. This implies a hybrid forwarding 815 system with transmission congestion dependent on the size of 816 packets but queue congestion dependent on the number of packets, 817 irrespective of their size. 819 Nonetheless, there would be no queue at all unless the line had 820 become congested--the root-cause of any congestion is too many 821 bytes arriving for the line. Therefore, the AQM should measure 822 the queue length as the sum of all the packet sizes in bytes that 823 are queued up waiting to be serviced by the line, irrespective of 824 whether each packet is held in a fixed size buffer. 826 In the (unlikely) first case where use of padding means the queue 827 should be measured in packets, further confusion is likely because 828 the fixed buffers are rarely all one size. Typically pools of 829 different sized buffers are provided (Cisco uses the term 'buffer 830 carving' for the process of dividing up memory into these pools 831 [IOSArch]). Usually, if the pool of small buffers is exhausted, 832 arriving small packets can borrow space in the pool of large buffers, 833 but not vice versa. However, there is no need to consider all this 834 complexity, because the root-cause of any congestion is still line 835 overload--buffer consumption is only the symptom. Therefore, the 836 length of the queue should be measured as the sum of the bytes in the 837 queue that will be transmitted to line, including any padding. In 838 the (unusual) case of transmission with padding this means the sum of 839 the sizes of the small buffers queued plus the sum of the sizes of 840 the large buffers queued. 842 We will return to borrowing of fixed sized buffers when we discuss 843 biasing the drop/marking probability of a specific packet because of 844 its size in Section 4.2.1. But here we can repeat the simple rule 845 for how to measure the length of queues of fixed buffers: no matter 846 how complicated the buffering scheme is, ultimately a transmission 847 line is nearly always bit-congestible so the number of bytes queued 848 up waiting for the line measures how congested the line is, and it is 849 rarely important to measure how congested the buffering system is. 851 4.1.2. Congestion Measurement without a Queue 853 AQM algorithms are nearly always described assuming there is a queue 854 for a congested resource and the algorithm can use the queue length 855 to determine the probability that it will drop or mark each packet. 856 But not all congested resources lead to queues. For instance, power 857 limited resources are usually bit-congestible if energy is primarily 858 required for transmission rather than header processing, but it is 859 rare for a link protocol to build a queue as it approaches maximum 860 power. 862 Nonetheless, AQM algorithms do not require a queue in order to work. 863 For instance spectrum congestion can be modelled by signal quality 864 using target bit-energy-to-noise-density ratio. And, to model radio 865 power exhaustion, transmission power levels can be measured and 866 compared to the maximum power available. [ECNFixedWireless] proposes 867 a practical and theoretically sound way to combine congestion 868 notification for different bit-congestible resources at different 869 layers along an end to end path, whether wireless or wired, and 870 whether with or without queues. 872 In wireless protocols that use request to send / clear to send (RTS / 873 CTS) control, such as some variants of IEEE802.11, it is reasonable 874 to base an AQM on the time spent waiting for transmission 875 opportunities (TXOPs) even though wireless spectrum is usually 876 regarded as congested by bits (for a given coding scheme). This is 877 because requests for TXOPs queue up as the spectrum gets congested by 878 all the bits being transferred. So the time that TXOPs are queued 879 directly reflects bit congestion of the spectrum. 881 4.2. Congestion Notification Advice 883 4.2.1. Network Bias when Encoding 885 4.2.1.1. Advice on Packet Size Bias in RED 887 The previously mentioned email [pktByteEmail] referred to by 888 [RFC2309] advised that most scarce resources in the Internet were 889 bit-congestible, which is still believed to be true (Section 1.1). 890 But it went on to offer advice that is updated by this memo. It said 891 that drop probability should depend on the size of the packet being 892 considered for drop if the resource is bit-congestible, but not if it 893 is packet-congestible. The argument continued that if packet drops 894 were inflated by packet size (byte-mode dropping), "a flow's fraction 895 of the packet drops is then a good indication of that flow's fraction 896 of the link bandwidth in bits per second". This was consistent with 897 a referenced policing mechanism being worked on at the time for 898 detecting unusually high bandwidth flows, eventually published in 899 1999 [pBox]. However, the problem could and should have been solved 900 by making the policing mechanism count the volume of bytes randomly 901 dropped, not the number of packets. 903 A few months before RFC2309 was published, an addendum was added to 904 the above archived email referenced from the RFC, in which the final 905 paragraph seemed to partially retract what had previously been said. 906 It clarified that the question of whether the probability of 907 dropping/marking a packet should depend on its size was not related 908 to whether the resource itself was bit congestible, but a completely 909 orthogonal question. However the only example given had the queue 910 measured in packets but packet drop depended on the size of the 911 packet in question. No example was given the other way round. 913 In 2000, Cnodder et al [REDbyte] pointed out that there was an error 914 in the part of the original 1993 RED algorithm that aimed to 915 distribute drops uniformly, because it didn't correctly take into 916 account the adjustment for packet size. They recommended an 917 algorithm called RED_4 to fix this. But they also recommended a 918 further change, RED_5, to adjust drop rate dependent on the square of 919 relative packet size. This was indeed consistent with one implied 920 motivation behind RED's byte mode drop--that we should reverse 921 engineer the network to improve the performance of dominant end-to- 922 end congestion control mechanisms. This memo makes a different 923 recommendations in Section 2. 925 By 2003, a further change had been made to the adjustment for packet 926 size, this time in the RED algorithm of the ns2 simulator. Instead 927 of taking each packet's size relative to a `maximum packet size' it 928 was taken relative to a `mean packet size', intended to be a static 929 value representative of the `typical' packet size on the link. We 930 have not been able to find a justification in the literature for this 931 change, however Eddy and Allman conducted experiments [REDbias] that 932 assessed how sensitive RED was to this parameter, amongst other 933 things. However, this changed algorithm can often lead to drop 934 probabilities of greater than 1 (which gives a hint that there is 935 probably a mistake in the theory somewhere). 937 On 10-Nov-2004, this variant of byte-mode packet drop was made the 938 default in the ns2 simulator. It seems unlikely that byte-mode drop 939 has ever been implemented in production networks (Appendix A), 940 therefore any conclusions based on ns2 simulations that use RED 941 without disabling byte-mode drop are likely to behave very 942 differently from RED in production networks. 944 4.2.1.2. Packet Size Bias Regardless of AQM 946 The byte-mode drop variant of RED (or a similar variant of other AQM 947 algorithms) is not the only possible bias towards small packets in 948 queueing systems. We have already mentioned that tail-drop queues 949 naturally tend to lock-out large packets once they are full. 951 But also queues with fixed sized buffers reduce the probability that 952 small packets will be dropped if (and only if) they allow small 953 packets to borrow buffers from the pools for larger packets (see 954 Section 4.1.1). Borrowing effectively makes the maximum queue size 955 for small packets greater than that for large packets, because more 956 buffers can be used by small packets while less will fit large 957 packets. Incidentally, the bias towards small packets from buffer 958 borrowing is nothing like as large as that of RED's byte-mode drop. 960 Nonetheless, fixed-buffer memory with tail drop is still prone to 961 lock-out large packets, purely because of the tail-drop aspect. So, 962 fixed size packet-buffers should be augmented with a good AQM 963 algorithm and packet-mode drop. If an AQM is too complicated to 964 implement with multiple fixed buffer pools, the minimum necessary to 965 prevent large packet lock-out is to ensure smaller packets never use 966 the last available buffer in any of the pools for larger packets. 968 4.2.2. Transport Bias when Decoding 970 The above proposals to alter the network equipment to bias towards 971 smaller packets have largely carried on outside the IETF process. 972 Whereas, within the IETF, there are many different proposals to alter 973 transport protocols to achieve the same goals, i.e. either to make 974 the flow bit-rate take account of packet size, or to protect control 975 packets from loss. This memo argues that altering transport 976 protocols is the more principled approach. 978 A recently approved experimental RFC adapts its transport layer 979 protocol to take account of packet sizes relative to typical TCP 980 packet sizes. This proposes a new small-packet variant of TCP- 981 friendly rate control [RFC5348] called TFRC-SP [RFC4828]. 982 Essentially, it proposes a rate equation that inflates the flow rate 983 by the ratio of a typical TCP segment size (1500B including TCP 984 header) over the actual segment size [PktSizeEquCC]. (There are also 985 other important differences of detail relative to TFRC, such as using 986 virtual packets [CCvarPktSize] to avoid responding to multiple losses 987 per round trip and using a minimum inter-packet interval.) 989 Section 4.5.1 of this TFRC-SP spec discusses the implications of 990 operating in an environment where queues have been configured to drop 991 smaller packets with proportionately lower probability than larger 992 ones. But it only discusses TCP operating in such an environment, 993 only mentioning TFRC-SP briefly when discussing how to define 994 fairness with TCP. And it only discusses the byte-mode dropping 995 version of RED as it was before Cnodder et al pointed out it didn't 996 sufficiently bias towards small packets to make TCP independent of 997 packet size. 999 So the TFRC-SP spec doesn't address the issue of which of the network 1000 or the transport _should_ handle fairness between different packet 1001 sizes. In its Appendix B.4 it discusses the possibility of both 1002 TFRC-SP and some network buffers duplicating each other's attempts to 1003 deliberately bias towards small packets. But the discussion is not 1004 conclusive, instead reporting simulations of many of the 1005 possibilities in order to assess performance but not recommending any 1006 particular course of action. 1008 The paper originally proposing TFRC with virtual packets (VP-TFRC) 1009 [CCvarPktSize] proposed that there should perhaps be two variants to 1010 cater for the different variants of RED. However, as the TFRC-SP 1011 authors point out, there is no way for a transport to know whether 1012 some queues on its path have deployed RED with byte-mode packet drop 1013 (except if an exhaustive survey found that no-one has deployed it!-- 1014 see Appendix A). Incidentally, VP-TFRC also proposed that byte-mode 1015 RED dropping should really square the packet-size compensation-factor 1016 (like that of Cnodder's RED_5, but apparently unaware of it). 1018 Pre-congestion notification [RFC5670] is an IETF technology to use a 1019 virtual queue for AQM marking for packets within one Diffserv class 1020 in order to give early warning prior to any real queuing. The PCN 1021 marking algorithms have been designed not to take account of packet 1022 size when forwarding through queues. Instead the general principle 1023 has been to take account of the sizes of marked packets when 1024 monitoring the fraction of marking at the edge of the network, as 1025 recommended here. 1027 4.2.3. Making Transports Robust against Control Packet Losses 1029 Recently, two RFCs have defined changes to TCP that make it more 1030 robust against losing small control packets [RFC5562] [RFC5690]. In 1031 both cases they note that the case for these two TCP changes would be 1032 weaker if RED were biased against dropping small packets. We argue 1033 here that these two proposals are a safer and more principled way to 1034 achieve TCP performance improvements than reverse engineering RED to 1035 benefit TCP. 1037 Although there are no known proposals, it would also be possible and 1038 perfectly valid to make control packets robust against drop by 1039 explicitly requesting a lower drop probability using their Diffserv 1040 code point [RFC2474] to request a scheduling class with lower drop. 1042 Although not brought to the IETF, a simple proposal from Wischik 1043 [DupTCP] suggests that the first three packets of every TCP flow 1044 should be routinely duplicated after a short delay. It shows that 1045 this would greatly improve the chances of short flows completing 1046 quickly, but it would hardly increase traffic levels on the Internet, 1047 because Internet bytes have always been concentrated in the large 1048 flows. It further shows that the performance of many typical 1049 applications depends on completion of long serial chains of short 1050 messages. It argues that, given most of the value people get from 1051 the Internet is concentrated within short flows, this simple 1052 expedient would greatly increase the value of the best efforts 1053 Internet at minimal cost. 1055 4.2.4. Congestion Notification: Summary of Conflicting Advice 1057 +-----------+----------------+-----------------+--------------------+ 1058 | transport | RED_1 (packet | RED_4 (linear | RED_5 (square byte | 1059 | cc | mode drop) | byte mode drop) | mode drop) | 1060 +-----------+----------------+-----------------+--------------------+ 1061 | TCP or | s/sqrt(p) | sqrt(s/p) | 1/sqrt(p) | 1062 | TFRC | | | | 1063 | TFRC-SP | 1/sqrt(p) | 1/sqrt(sp) | 1/(s.sqrt(p)) | 1064 +-----------+----------------+-----------------+--------------------+ 1066 Table 2: Dependence of flow bit-rate per RTT on packet size, s, and 1067 drop probability, p, when network and/or transport bias towards small 1068 packets to varying degrees 1070 Table 2 aims to summarise the potential effects of all the advice 1071 from different sources. Each column shows a different possible AQM 1072 behaviour in different queues in the network, using the terminology 1073 of Cnodder et al outlined earlier (RED_1 is basic RED with packet- 1074 mode drop). Each row shows a different transport behaviour: TCP 1075 [RFC5681] and TFRC [RFC5348] on the top row with TFRC-SP [RFC4828] 1076 below. Each cell shows how the bits per round trip of a flow depends 1077 on packet size, s, and drop probability, p. In order to declutter 1078 the formulae to focus on packet-size dependence they are all given 1079 per round trip, which removes any RTT term. 1081 Let us assume that the goal is for the bit-rate of a flow to be 1082 independent of packet size. Suppressing all inessential details, the 1083 table shows that this should either be achievable by not altering the 1084 TCP transport in a RED_5 network, or using the small packet TFRC-SP 1085 transport (or similar) in a network without any byte-mode dropping 1086 RED (top right and bottom left). Top left is the `do nothing' 1087 scenario, while bottom right is the `do-both' scenario in which bit- 1088 rate would become far too biased towards small packets. Of course, 1089 if any form of byte-mode dropping RED has been deployed on a subset 1090 of queues that congest, each path through the network will present a 1091 different hybrid scenario to its transport. 1093 Whatever, we can see that the linear byte-mode drop column in the 1094 middle would considerably complicate the Internet. It's a half-way 1095 house that doesn't bias enough towards small packets even if one 1096 believes the network should be doing the biasing. Section 2 1097 recommends that _all_ bias in network equipment towards small packets 1098 should be turned off--if indeed any equipment vendors have 1099 implemented it--leaving packet-size bias solely as the preserve of 1100 the transport layer (solely the leftmost, packet-mode drop column). 1102 In practice it seems that no deliberate bias towards small packets 1103 has been implemented for production networks. Of the 19% of vendors 1104 who responded to a survey of 84 equipment vendors, none had 1105 implemented byte-mode drop in RED (see Appendix A for details). 1107 5. Outstanding Issues and Next Steps 1109 5.1. Bit-congestible Network 1111 For a connectionless network with nearly all resources being bit- 1112 congestible the recommended position is clear--that the network 1113 should not make allowance for packet sizes and the transport should. 1114 This leaves two outstanding issues: 1116 o How to handle any legacy of AQM with byte-mode drop already 1117 deployed; 1119 o The need to start a programme to update transport congestion 1120 control protocol standards to take account of packet size. 1122 A survey of equipment vendors (Section 4.2.4) found no evidence that 1123 byte-mode packet drop had been implemented, so deployment will be 1124 sparse at best. A migration strategy is not really needed to remove 1125 an algorithm that may not even be deployed. 1127 A programme of experimental updates to take account of packet size in 1128 transport congestion control protocols has already started with 1129 TFRC-SP [RFC4828]. 1131 5.2. Bit- & Packet-congestible Network 1133 The position is much less clear-cut if the Internet becomes populated 1134 by a more even mix of both packet-congestible and bit-congestible 1135 resources (see Appendix B.2). This problem is not pressing, because 1136 most Internet resources are designed to be bit-congestible before 1137 packet processing starts to congest (see Section 1.1). 1139 The IRTF Internet congestion control research group (ICCRG) has set 1140 itself the task of reaching consensus on generic forwarding 1141 mechanisms that are necessary and sufficient to support the 1142 Internet's future congestion control requirements (the first 1143 challenge in [RFC6077]). The research question of whether packet 1144 congestion might become common and what to do if it does may in the 1145 future be explored in the IRTF (the "Challenge 3: Packet Size" in 1146 [RFC6077]). 1148 Note that sometimes it seems that resources might be congested by 1149 neither bits nor packets, e.g. where the queue for access to a 1150 wireless medium is in units of transmission opportunities. However, 1151 the root cause of congestion of the underlying spectrum is overload 1152 of bits (see Section 4.1.2). 1154 6. Security Considerations 1156 This memo recommends that queues do not bias drop probability due to 1157 packets size. For instance dropping small packets less often than 1158 large creates a perverse incentive for transports to break down their 1159 flows into tiny segments. One of the benefits of implementing AQM 1160 was meant to be to remove this perverse incentive that drop-tail 1161 queues gave to small packets. 1163 In practice, transports cannot all be trusted to respond to 1164 congestion. So another reason for recommending that queues do not 1165 bias drop probability towards small packets is to avoid the 1166 vulnerability to small packet DDoS attacks that would otherwise 1167 result. One of the benefits of implementing AQM was meant to be to 1168 remove drop-tail's DoS vulnerability to small packets, so we 1169 shouldn't add it back again. 1171 If most queues implemented AQM with byte-mode drop, the resulting 1172 network would amplify the potency of a small packet DDoS attack. At 1173 the first queue the stream of packets would push aside a greater 1174 proportion of large packets, so more of the small packets would 1175 survive to attack the next queue. Thus a flood of small packets 1176 would continue on towards the destination, pushing regular traffic 1177 with large packets out of the way in one queue after the next, but 1178 suffering much less drop itself. 1180 Appendix C explains why the ability of networks to police the 1181 response of _any_ transport to congestion depends on bit-congestible 1182 network resources only doing packet-mode not byte-mode drop. In 1183 summary, it says that making drop probability depend on the size of 1184 the packets that bits happen to be divided into simply encourages the 1185 bits to be divided into smaller packets. Byte-mode drop would 1186 therefore irreversibly complicate any attempt to fix the Internet's 1187 incentive structures. 1189 7. IANA Considerations 1191 This document has no actions for IANA. 1193 8. Conclusions 1195 This memo identifies the three distinct stages of the congestion 1196 notification process where implementations need to decide whether to 1197 take packet size into account. The recommendations provided in 1198 Section 2 of this memo are different in each case: 1200 o When network equipment measures the length of a queue, if it is 1201 not feasible to use time it is recommended to count in bytes if 1202 the network resource is congested by bytes, or to count in packets 1203 if is congested by packets. 1205 o When network equipment decides whether to drop (or mark) a packet, 1206 it is recommended that the size of the particular packet should 1207 not be taken into account 1209 o However, when a transport algorithm responds to a dropped or 1210 marked packet, the size of the rate reduction should be 1211 proportionate to the size of the packet. 1213 In summary, the answers are 'it depends', 'no' and 'yes' respectively 1214 For the specific case of RED, this means that byte-mode queue 1215 measurement will often be appropriate although byte-mode drop is 1216 strongly deprecated. 1218 At the transport layer the IETF should continue updating congestion 1219 control protocols to take account of the size of each packet that 1220 indicates congestion. Also the IETF should continue to make 1221 protocols less sensitive to losing control packets like SYNs, pure 1222 ACKs and DNS exchanges. Although many control packets happen to be 1223 small, the alternative of network equipment favouring all small 1224 packets would be dangerous. That would create perverse incentives to 1225 split data transfers into smaller packets. 1227 The memo develops these recommendations from principled arguments 1228 concerning scaling, layering, incentives, inherent efficiency, 1229 security and policeability. But it also addresses practical issues 1230 such as specific buffer architectures and incremental deployment. 1231 Indeed a limited survey of RED implementations is discussed, which 1232 shows there appears to be little, if any, installed base of RED's 1233 byte-mode drop. Therefore it can be deprecated with little, if any, 1234 incremental deployment complications. 1236 The recommendations have been developed on the well-founded basis 1237 that most Internet resources are bit-congestible not packet- 1238 congestible. We need to know the likelihood that this assumption 1239 will prevail longer term and, if it might not, what protocol changes 1240 will be needed to cater for a mix of the two. The IRTF Internet 1241 Congestion Control Research Group (ICCRG) is currently working on 1242 these problems [RFC6077]. 1244 9. Acknowledgements 1246 Thank you to Sally Floyd, who gave extensive and useful review 1247 comments. Also thanks for the reviews from Philip Eardley, David 1248 Black, Fred Baker, David Taht, Toby Moncaster, Arnaud Jacquet and 1249 Mirja Kuehlewind as well as helpful explanations of different 1250 hardware approaches from Larry Dunn and Fred Baker. We are grateful 1251 to Bruce Davie and his colleagues for providing a timely and 1252 efficient survey of RED implementation in Cisco's product range. 1253 Also grateful thanks to Toby Moncaster, Will Dormann, John Regnault, 1254 Simon Carter and Stefaan De Cnodder who further helped survey the 1255 current status of RED implementation and deployment and, finally, 1256 thanks to the anonymous individuals who responded. 1258 Bob Briscoe and Jukka Manner were partly funded by Trilogy, a 1259 research project (ICT- 216372) supported by the European Community 1260 under its Seventh Framework Programme. The views expressed here are 1261 those of the authors only. 1263 10. Comments Solicited 1265 Comments and questions are encouraged and very welcome. They can be 1266 addressed to the IETF Transport Area working group mailing list 1267 , and/or to the authors. 1269 11. References 1271 11.1. Normative References 1273 [RFC2119] Bradner, S., "Key words for use in RFCs to 1274 Indicate Requirement Levels", BCP 14, 1275 RFC 2119, March 1997. 1277 [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, 1278 "The Addition of Explicit Congestion 1279 Notification (ECN) to IP", RFC 3168, 1280 September 2001. 1282 11.2. Informative References 1284 [BLUE02] Feng, W-c., Shin, K., Kandlur, D., and D. 1285 Saha, "The BLUE active queue management 1286 algorithms", IEEE/ACM Transactions on 1287 Networking 10(4) 513--528, August 2002, . 1291 [CCvarPktSize] Widmer, J., Boutremans, C., and J-Y. Le 1292 Boudec, "Congestion Control for Flows with 1293 Variable Packet Size", ACM CCR 34(2) 137-- 1294 151, 2004, 1295 . 1298 [CHOKe_Var_Pkt] Psounis, K., Pan, R., and B. Prabhaker, 1299 "Approximate Fair Dropping for Variable 1300 Length Packets", IEEE Micro 21(1):48--56, 1301 January-February 2001, . 1305 [DRQ] Shin, M., Chong, S., and I. Rhee, "Dual- 1306 Resource TCP/AQM for Processing- 1307 Constrained Networks", IEEE/ACM 1308 Transactions on Networking Vol 16, issue 1309 2, April 2008, . 1312 [DupTCP] Wischik, D., "Short messages", Royal 1313 Society workshop on networks: modelling 1314 and control , September 2007, . 1318 [ECNFixedWireless] Siris, V., "Resource Control for Elastic 1319 Traffic in CDMA Networks", Proc. ACM 1320 MOBICOM'02 , September 2002, . 1324 [Evol_cc] Gibbens, R. and F. Kelly, "Resource 1325 pricing and the evolution of congestion 1326 control", Automatica 35(12)1969--1985, 1327 December 1999, . 1330 [I-D.nichols-tsvwg-codel] Nichols, K. and V. Jacobson, "Controlled 1331 Delay Active Queue Management", 1332 draft-nichols-tsvwg-codel-01 (work in 1333 progress), February 2013. 1335 [I-D.pan-tsvwg-pie] Pan, R., Natarajan, P., Piglione, C., and 1336 M. Prabhu, "PIE: A Lightweight Control 1337 Scheme To Address the Bufferbloat 1338 Problem", draft-pan-tsvwg-pie-00 (work in 1339 progress), December 2012. 1341 [IOSArch] Bollapragada, V., White, R., and C. 1342 Murphy, "Inside Cisco IOS Software 1343 Architecture", Cisco Press: CCIE 1344 Professional Development ISBN13: 978-1- 1345 57870-181-0, July 2000. 1347 [PktSizeEquCC] Vasallo, P., "Variable Packet Size 1348 Equation-Based Congestion Control", ICSI 1349 Technical Report tr-00-008, 2000, . 1353 [RED93] Floyd, S. and V. Jacobson, "Random Early 1354 Detection (RED) gateways for Congestion 1355 Avoidance", IEEE/ACM Transactions on 1356 Networking 1(4) 397--413, August 1993, . 1360 [REDbias] Eddy, W. and M. Allman, "A Comparison of 1361 RED's Byte and Packet Modes", Computer 1362 Networks 42(3) 261--280, June 2003, . 1366 [REDbyte] De Cnodder, S., Elloumi, O., and K. 1367 Pauwels, "RED behavior with different 1368 packet sizes", Proc. 5th IEEE Symposium on 1369 Computers and Communications (ISCC) 793-- 1370 799, July 2000, . 1373 [RFC2309] Braden, B., Clark, D., Crowcroft, J., 1374 Davie, B., Deering, S., Estrin, D., Floyd, 1375 S., Jacobson, V., Minshall, G., Partridge, 1376 C., Peterson, L., Ramakrishnan, K., 1377 Shenker, S., Wroclawski, J., and L. Zhang, 1378 "Recommendations on Queue Management and 1379 Congestion Avoidance in the Internet", 1380 RFC 2309, April 1998. 1382 [RFC2474] Nichols, K., Blake, S., Baker, F., and D. 1383 Black, "Definition of the Differentiated 1384 Services Field (DS Field) in the IPv4 and 1385 IPv6 Headers", RFC 2474, December 1998. 1387 [RFC2914] Floyd, S., "Congestion Control 1388 Principles", BCP 41, RFC 2914, 1389 September 2000. 1391 [RFC3426] Floyd, S., "General Architectural and 1392 Policy Considerations", RFC 3426, 1393 November 2002. 1395 [RFC3550] Schulzrinne, H., Casner, S., Frederick, 1396 R., and V. Jacobson, "RTP: A Transport 1397 Protocol for Real-Time Applications", 1398 STD 64, RFC 3550, July 2003. 1400 [RFC3714] Floyd, S. and J. Kempf, "IAB Concerns 1401 Regarding Congestion Control for Voice 1402 Traffic in the Internet", RFC 3714, 1403 March 2004. 1405 [RFC4828] Floyd, S. and E. Kohler, "TCP Friendly 1406 Rate Control (TFRC): The Small-Packet (SP) 1407 Variant", RFC 4828, April 2007. 1409 [RFC5348] Floyd, S., Handley, M., Padhye, J., and J. 1410 Widmer, "TCP Friendly Rate Control (TFRC): 1411 Protocol Specification", RFC 5348, 1412 September 2008. 1414 [RFC5562] Kuzmanovic, A., Mondal, A., Floyd, S., and 1415 K. Ramakrishnan, "Adding Explicit 1416 Congestion Notification (ECN) Capability 1417 to TCP's SYN/ACK Packets", RFC 5562, 1418 June 2009. 1420 [RFC5670] Eardley, P., "Metering and Marking 1421 Behaviour of PCN-Nodes", RFC 5670, 1422 November 2009. 1424 [RFC5681] Allman, M., Paxson, V., and E. Blanton, 1425 "TCP Congestion Control", RFC 5681, 1426 September 2009. 1428 [RFC5690] Floyd, S., Arcia, A., Ros, D., and J. 1429 Iyengar, "Adding Acknowledgement 1430 Congestion Control to TCP", RFC 5690, 1431 February 2010. 1433 [RFC6077] Papadimitriou, D., Welzl, M., Scharf, M., 1434 and B. Briscoe, "Open Research Issues in 1435 Internet Congestion Control", RFC 6077, 1436 February 2011. 1438 [RFC6679] Westerlund, M., Johansson, I., Perkins, 1439 C., O'Hanlon, P., and K. Carlberg, 1440 "Explicit Congestion Notification (ECN) 1441 for RTP over UDP", RFC 6679, August 2012. 1443 [RFC6789] Briscoe, B., Woundy, R., and A. Cooper, 1444 "Congestion Exposure (ConEx) Concepts and 1445 Use Cases", RFC 6789, December 2012. 1447 [Rate_fair_Dis] Briscoe, B., "Flow Rate Fairness: 1448 Dismantling a Religion", ACM 1449 CCR 37(2)63--74, April 2007, . 1452 [gentle_RED] Floyd, S., "Recommendation on using the 1453 "gentle_" variant of RED", Web page , 1454 March 2000, . 1457 [pBox] Floyd, S. and K. Fall, "Promoting the Use 1458 of End-to-End Congestion Control in the 1459 Internet", IEEE/ACM Transactions on 1460 Networking 7(4) 458--472, August 1999, . 1464 [pktByteEmail] Floyd, S., "RED: Discussions of Byte and 1465 Packet Modes", email , March 1997, . 1469 Appendix A. Survey of RED Implementation Status 1471 This Appendix is informative, not normative. 1473 In May 2007 a survey was conducted of 84 vendors to assess how widely 1474 drop probability based on packet size has been implemented in RED 1475 Table 3. About 19% of those surveyed replied, giving a sample size 1476 of 16. Although in most cases we do not have permission to identify 1477 the respondents, we can say that those that have responded include 1478 most of the larger equipment vendors, covering a large fraction of 1479 the market. The two who gave permission to be identified were Cisco 1480 and Alcatel-Lucent. The others range across the large network 1481 equipment vendors at L3 & L2, firewall vendors, wireless equipment 1482 vendors, as well as large software businesses with a small selection 1483 of networking products. All those who responded confirmed that they 1484 have not implemented the variant of RED with drop dependent on packet 1485 size (2 were fairly sure they had not but needed to check more 1486 thoroughly). At the time the survey was conducted, Linux did not 1487 implement RED with packet-size bias of drop, although we have not 1488 investigated a wider range of open source code. 1490 +-------------------------------+----------------+-----------------+ 1491 | Response | No. of vendors | %age of vendors | 1492 +-------------------------------+----------------+-----------------+ 1493 | Not implemented | 14 | 17% | 1494 | Not implemented (probably) | 2 | 2% | 1495 | Implemented | 0 | 0% | 1496 | No response | 68 | 81% | 1497 | Total companies/orgs surveyed | 84 | 100% | 1498 +-------------------------------+----------------+-----------------+ 1500 Table 3: Vendor Survey on byte-mode drop variant of RED (lower drop 1501 probability for small packets) 1503 Where reasons have been given, the extra complexity of packet bias 1504 code has been most prevalent, though one vendor had a more principled 1505 reason for avoiding it--similar to the argument of this document. 1507 Our survey was of vendor implementations, so we cannot be certain 1508 about operator deployment. But we believe many queues in the 1509 Internet are still tail-drop. The company of one of the co-authors 1510 (BT) has widely deployed RED, but many tail-drop queues are bound to 1511 still exist, particularly in access network equipment and on 1512 middleboxes like firewalls, where RED is not always available. 1514 Routers using a memory architecture based on fixed size buffers with 1515 borrowing may also still be prevalent in the Internet. As explained 1516 in Section 4.2.1, these also provide a marginal (but legitimate) bias 1517 towards small packets. So even though RED byte-mode drop is not 1518 prevalent, it is likely there is still some bias towards small 1519 packets in the Internet due to tail drop and fixed buffer borrowing. 1521 Appendix B. Sufficiency of Packet-Mode Drop 1523 This Appendix is informative, not normative. 1525 Here we check that packet-mode drop (or marking) in the network gives 1526 sufficiently generic information for the transport layer to use. We 1527 check against a 2x2 matrix of four scenarios that may occur now or in 1528 the future (Table 4). The horizontal and vertical dimensions have 1529 been chosen because each tests extremes of sensitivity to packet size 1530 in the transport and in the network respectively. 1532 Note that this section does not consider byte-mode drop at all. 1533 Having deprecated byte-mode drop, the goal here is to check that 1534 packet-mode drop will be sufficient in all cases. 1536 +-------------------------------+-----------------+-----------------+ 1537 | Transport | a) Independent | b) Dependent on | 1538 | | of packet size | packet size of | 1539 | Network | of congestion | congestion | 1540 | | notifications | notifications | 1541 +-------------------------------+-----------------+-----------------+ 1542 | 1) Predominantly | Scenario a1) | Scenario b1) | 1543 | bit-congestible network | | | 1544 | 2) Mix of bit-congestible and | Scenario a2) | Scenario b2) | 1545 | pkt-congestible network | | | 1546 +-------------------------------+-----------------+-----------------+ 1548 Table 4: Four Possible Congestion Scenarios 1550 Appendix B.1 focuses on the horizontal dimension of Table 4 checking 1551 that packet-mode drop (or marking) gives sufficient information, 1552 whether or not the transport uses it--scenarios b) and a) 1553 respectively. 1555 Appendix B.2 focuses on the vertical dimension of Table 4, checking 1556 that packet-mode drop gives sufficient information to the transport 1557 whether resources in the network are bit-congestible or packet- 1558 congestible (these terms are defined in Section 1.1). 1560 Notation: To be concrete, we will compare two flows with different 1561 packet sizes, s_1 and s_2. As an example, we will take s_1 = 60B 1562 = 480b and s_2 = 1500B = 12,000b. 1564 A flow's bit rate, x [bps], is related to its packet rate, u 1565 [pps], by 1567 x(t) = s.u(t). 1569 In the bit-congestible case, path congestion will be denoted by 1570 p_b, and in the packet-congestible case by p_p. When either case 1571 is implied, the letter p alone will denote path congestion. 1573 B.1. Packet-Size (In)Dependence in Transports 1575 In all cases we consider a packet-mode drop queue that indicates 1576 congestion by dropping (or marking) packets with probability p 1577 irrespective of packet size. We use an example value of loss 1578 (marking) probability, p=0.1%. 1580 A transport like RFC5681 TCP treats a congestion notification on any 1581 packet whatever its size as one event. However, a network with just 1582 the packet-mode drop algorithm does give more information if the 1583 transport chooses to use it. We will use Table 5 to illustrate this. 1585 We will set aside the last column until later. The columns labelled 1586 "Flow 1" and "Flow 2" compare two flows consisting of 60B and 1500B 1587 packets respectively. The body of the table considers two separate 1588 cases, one where the flows have equal bit-rate and the other with 1589 equal packet-rates. In both cases, the two flows fill a 96Mbps link. 1590 Therefore, in the equal bit-rate case they each have half the bit- 1591 rate (48Mbps). Whereas, with equal packet-rates, flow 1 uses 25 1592 times smaller packets so it gets 25 times less bit-rate--it only gets 1593 1/(1+25) of the link capacity (96Mbps/26 = 4Mbps after rounding). In 1594 contrast flow 2 gets 25 times more bit-rate (92Mbps) in the equal 1595 packet rate case because its packets are 25 times larger. The packet 1596 rate shown for each flow could easily be derived once the bit-rate 1597 was known by dividing bit-rate by packet size, as shown in the column 1598 labelled "Formula". 1600 Parameter Formula Flow 1 Flow 2 Combined 1601 ----------------------- ----------- ------- ------- -------- 1602 Packet size s/8 60B 1,500B (Mix) 1603 Packet size s 480b 12,000b (Mix) 1604 Pkt loss probability p 0.1% 0.1% 0.1% 1606 EQUAL BIT-RATE CASE 1607 Bit-rate x 48Mbps 48Mbps 96Mbps 1608 Packet-rate u = x/s 100kpps 4kpps 104kpps 1609 Absolute pkt-loss-rate p*u 100pps 4pps 104pps 1610 Absolute bit-loss-rate p*u*s 48kbps 48kbps 96kbps 1611 Ratio of lost/sent pkts p*u/u 0.1% 0.1% 0.1% 1612 Ratio of lost/sent bits p*u*s/(u*s) 0.1% 0.1% 0.1% 1614 EQUAL PACKET-RATE CASE 1615 Bit-rate x 4Mbps 92Mbps 96Mbps 1616 Packet-rate u = x/s 8kpps 8kpps 15kpps 1617 Absolute pkt-loss-rate p*u 8pps 8pps 15pps 1618 Absolute bit-loss-rate p*u*s 4kbps 92kbps 96kbps 1619 Ratio of lost/sent pkts p*u/u 0.1% 0.1% 0.1% 1620 Ratio of lost/sent bits p*u*s/(u*s) 0.1% 0.1% 0.1% 1622 Table 5: Absolute Loss Rates and Loss Ratios for Flows of Small and 1623 Large Packets and Both Combined 1625 So far we have merely set up the scenarios. We now consider 1626 congestion notification in the scenario. Two TCP flows with the same 1627 round trip time aim to equalise their packet-loss-rates over time. 1628 That is the number of packets lost in a second, which is the packets 1629 per second (u) multiplied by the probability that each one is dropped 1630 (p). Thus TCP converges on the "Equal packet-rate" case, where both 1631 flows aim for the same "Absolute packet-loss-rate" (both 8pps in the 1632 table). 1634 Packet-mode drop actually gives flows sufficient information to 1635 measure their loss-rate in bits per second, if they choose, not just 1636 packets per second. Each flow can count the size of a lost or marked 1637 packet and scale its rate-response in proportion (as TFRC-SP does). 1638 The result is shown in the row entitled "Absolute bit-loss-rate", 1639 where the bits lost in a second is the packets per second (u) 1640 multiplied by the probability of losing a packet (p) multiplied by 1641 the packet size (s). Such an algorithm would try to remove any 1642 imbalance in bit-loss-rate such as the wide disparity in the "Equal 1643 packet-rate" case (4kbps vs. 92kbps). Instead, a packet-size- 1644 dependent algorithm would aim for equal bit-loss-rates, which would 1645 drive both flows towards the "Equal bit-rate" case, by driving them 1646 to equal bit-loss-rates (both 48kbps in this example). 1648 The explanation so far has assumed that each flow consists of packets 1649 of only one constant size. Nonetheless, it extends naturally to 1650 flows with mixed packet sizes. In the right-most column of Table 5 a 1651 flow of mixed size packets is created simply by considering flow 1 1652 and flow 2 as a single aggregated flow. There is no need for a flow 1653 to maintain an average packet size. It is only necessary for the 1654 transport to scale its response to each congestion indication by the 1655 size of each individual lost (or marked) packet. Taking for example 1656 the "Equal packet-rate" case, in one second about 8 small packets and 1657 8 large packets are lost (making closer to 15 than 16 losses per 1658 second due to rounding). If the transport multiplies each loss by 1659 its size, in one second it responds to 8*480b and 8*12,000b lost 1660 bits, adding up to 96,000 lost bits in a second. This double checks 1661 correctly, being the same as 0.1% of the total bit-rate of 96Mbps. 1662 For completeness, the formula for absolute bit-loss-rate is p(u1*s1+ 1663 u2*s2). 1665 Incidentally, a transport will always measure the loss probability 1666 the same irrespective of whether it measures in packets or in bytes. 1667 In other words, the ratio of lost to sent packets will be the same as 1668 the ratio of lost to sent bytes. (This is why TCP's bit rate is 1669 still proportional to packet size even when byte-counting is used, as 1670 recommended for TCP in [RFC5681], mainly for orthogonal security 1671 reasons.) This is intuitively obvious by comparing two example 1672 flows; one with 60B packets, the other with 1500B packets. If both 1673 flows pass through a queue with drop probability 0.1%, each flow will 1674 lose 1 in 1,000 packets. In the stream of 60B packets the ratio of 1675 bytes lost to sent will be 60B in every 60,000B; and in the stream of 1676 1500B packets, the loss ratio will be 1,500B out of 1,500,000B. When 1677 the transport responds to the ratio of lost to sent packets, it will 1678 measure the same ratio whether it measures in packets or bytes: 0.1% 1679 in both cases. The fact that this ratio is the same whether measured 1680 in packets or bytes can be seen in Table 5, where the ratio of lost 1681 to sent packets and the ratio of lost to sent bytes is always 0.1% in 1682 all cases (recall that the scenario was set up with p=0.1%). 1684 This discussion of how the ratio can be measured in packets or bytes 1685 is only raised here to highlight that it is irrelevant to this memo! 1686 Whether a transport depends on packet size or not depends on how this 1687 ratio is used within the congestion control algorithm. 1689 So far we have shown that packet-mode drop passes sufficient 1690 information to the transport layer so that the transport can take 1691 account of bit-congestion, by using the sizes of the packets that 1692 indicate congestion. We have also shown that the transport can 1693 choose not to take packet size into account if it wishes. We will 1694 now consider whether the transport can know which to do. 1696 B.2. Bit-Congestible and Packet-Congestible Indications 1698 As a thought-experiment, imagine an idealised congestion notification 1699 protocol that supports both bit-congestible and packet-congestible 1700 resources. It would require at least two ECN flags, one for each of 1701 bit-congestible and packet-congestible resources. 1703 1. A packet-congestible resource trying to code congestion level p_p 1704 into a packet stream should mark the idealised `packet 1705 congestion' field in each packet with probability p_p 1706 irrespective of the packet's size. The transport should then 1707 take a packet with the packet congestion field marked to mean 1708 just one mark, irrespective of the packet size. 1710 2. A bit-congestible resource trying to code time-varying byte- 1711 congestion level p_b into a packet stream should mark the `byte 1712 congestion' field in each packet with probability p_b, again 1713 irrespective of the packet's size. Unlike before, the transport 1714 should take a packet with the byte congestion field marked to 1715 count as a mark on each byte in the packet. 1717 This hides a fundamental problem--much more fundamental than whether 1718 we can magically create header space for yet another ECN flag, or 1719 whether it would work while being deployed incrementally. 1720 Distinguishing drop from delivery naturally provides just one 1721 implicit bit of congestion indication information--the packet is 1722 either dropped or not. It is hard to drop a packet in two ways that 1723 are distinguishable remotely. This is a similar problem to that of 1724 distinguishing wireless transmission losses from congestive losses. 1726 This problem would not be solved even if ECN were universally 1727 deployed. A congestion notification protocol must survive a 1728 transition from low levels of congestion to high. Marking two states 1729 is feasible with explicit marking, but much harder if packets are 1730 dropped. Also, it will not always be cost-effective to implement AQM 1731 at every low level resource, so drop will often have to suffice. 1733 We are not saying two ECN fields will be needed (and we are not 1734 saying that somehow a resource should be able to drop a packet in one 1735 of two different ways so that the transport can distinguish which 1736 sort of drop it was!). These two congestion notification channels 1737 are a conceptual device to illustrate a dilemma we could face in the 1738 future. Section 3 gives four good reasons why it would be a bad idea 1739 to allow for packet size by biasing drop probability in favour of 1740 small packets within the network. The impracticality of our thought 1741 experiment shows that it will be hard to give transports a practical 1742 way to know whether to take account of the size of congestion 1743 indication packets or not. 1745 Fortunately, this dilemma is not pressing because by design most 1746 equipment becomes bit-congested before its packet-processing becomes 1747 congested (as already outlined in Section 1.1). Therefore transports 1748 can be designed on the relatively sound assumption that a congestion 1749 indication will usually imply bit-congestion. 1751 Nonetheless, although the above idealised protocol isn't intended for 1752 implementation, we do want to emphasise that research is needed to 1753 predict whether there are good reasons to believe that packet 1754 congestion might become more common, and if so, to find a way to 1755 somehow distinguish between bit and packet congestion [RFC3714]. 1757 Recently, the dual resource queue (DRQ) proposal [DRQ] has been made 1758 on the premise that, as network processors become more cost 1759 effective, per packet operations will become more complex 1760 (irrespective of whether more function in the network is desirable). 1761 Consequently the premise is that CPU congestion will become more 1762 common. DRQ is a proposed modification to the RED algorithm that 1763 folds both bit congestion and packet congestion into one signal 1764 (either loss or ECN). 1766 Finally, we note one further complication. Strictly, packet- 1767 congestible resources are often cycle-congestible. For instance, for 1768 routing look-ups load depends on the complexity of each look-up and 1769 whether the pattern of arrivals is amenable to caching or not. This 1770 also reminds us that any solution must not require a forwarding 1771 engine to use excessive processor cycles in order to decide how to 1772 say it has no spare processor cycles. 1774 Appendix C. Byte-mode Drop Complicates Policing Congestion Response 1776 This section is informative, not normative. 1778 There are two main classes of approach to policing congestion 1779 response: i) policing at each bottleneck link or ii) policing at the 1780 edges of networks. Packet-mode drop in RED is compatible with 1781 either, while byte-mode drop precludes edge policing. 1783 The simplicity of an edge policer relies on one dropped or marked 1784 packet being equivalent to another of the same size without having to 1785 know which link the drop or mark occurred at. However, the byte-mode 1786 drop algorithm has to depend on the local MTU of the line--it needs 1787 to use some concept of a 'normal' packet size. Therefore, one 1788 dropped or marked packet from a byte-mode drop algorithm is not 1789 necessarily equivalent to another from a different link. A policing 1790 function local to the link can know the local MTU where the 1791 congestion occurred. However, a policer at the edge of the network 1792 cannot, at least not without a lot of complexity. 1794 The early research proposals for type (i) policing at a bottleneck 1795 link [pBox] used byte-mode drop, then detected flows that contributed 1796 disproportionately to the number of packets dropped. However, with 1797 no extra complexity, later proposals used packet mode drop and looked 1798 for flows that contributed a disproportionate amount of dropped bytes 1799 [CHOKe_Var_Pkt]. 1801 Work is progressing on the congestion exposure protocol (ConEx 1802 [RFC6789]), which enables a type (ii) edge policer located at a 1803 user's attachment point. The idea is to be able to take an 1804 integrated view of the effect of all a user's traffic on any link in 1805 the internetwork. However, byte-mode drop would effectively preclude 1806 such edge policing because of the MTU issue above. 1808 Indeed, making drop probability depend on the size of the packets 1809 that bits happen to be divided into would simply encourage the bits 1810 to be divided into smaller packets in order to confuse policing. In 1811 contrast, as long as a dropped/marked packet is taken to mean that 1812 all the bytes in the packet are dropped/marked, a policer can remain 1813 robust against bits being re-divided into different size packets or 1814 across different size flows [Rate_fair_Dis]. 1816 Appendix D. Changes from Previous Versions 1818 To be removed by the RFC Editor on publication. 1820 Full incremental diffs between each version are available at 1821 1822 (courtesy of the rfcdiff tool): 1824 From -10 to -11: Following a further WGLC: 1826 * Abstract: clarified that advice applies to all AQMs including 1827 newer ones 1829 * Abstract & Intro: changed 'read' to 'detect', because you don't 1830 read losses, you detect them. 1832 * S.1. Introduction: Disambiguated summary of advice on queue 1833 measurement. 1835 * Clarified that the doc deprecates any preference based solely 1836 on packet size, it's not only against preferring smaller 1837 packets. 1839 * S.4.1.2. Congestion Measurement without a Queue: Explained 1840 that a queue of TXOPs represents a queue into spectrum 1841 congested by too many bits. 1843 * S.5.2: Bit- & Packet-congestible Network: Referred to 1844 explanation in S.4.1.2 to make the point that TXOPs are not a 1845 primary unit of workload like bits and packets are, even though 1846 you get queues of TXOPs. 1848 * 6. Security: Disambiguated 'bias towards'. 1850 * 8. Conclusions: Made consistent with recommendation to use 1851 time if possible for queue measurement. 1853 From -09 to -10: Following IESG review: 1855 * Updates 2309: Left header unchanged reflecting eventual IESG 1856 consensus [Sean Turner, Pete Resnick]. 1858 * S.1 Intro: This memo adds to the congestion control principles 1859 enumerated in BCP 41 [Pete Resnick] 1861 * Abstract, S.1, S.1.1, s.1.2 Intro, Scoping and Example: Made 1862 applicability to all AQMs clearer listing some more example 1863 AQMs and explained that we always use RED for examples, but 1864 this doesn't mean it's not applicable to other AQMs. [A number 1865 of reviewers have described the draft as "about RED"] 1867 * S.1 & S.2.1 Queue measurement: Explained that the choice 1868 between measuring the queue in packets or bytes is only 1869 relevant if measuring it in time units is infeasible [So as not 1870 to imply that we haven't noticed the advances made by PDPC & 1871 CoDel] 1873 * S.1.1. Terminology: Better explained why hybrid systems 1874 congested by both packets and bytes are often designed to be 1875 treated as bit-congestible [Richard Barnes]. 1877 * S.2.1. Queue measurement advice: Added examples. Added a 1878 counter-example to justify SHOULDs rather than MUSTs. Pointed 1879 to S.4.1 for a list of more complicated scenarios. [Benson 1880 Schliesser, OpsDir] 1882 * S2.2. Recommendation on Encoding Congestion Notification: 1883 Removed SHOULD treat packets equally, leaving only SHOULD NOT 1884 drop dependent on packet size, to avoid it sounding like we're 1885 saying QoS is not allowed. Pointed to possible app-specific 1886 legacy use of byte-mode as a counter-example that prevents us 1887 saying MUST NOT. [Pete Resnick] 1889 * S.2.3. Recommendation on Responding to Congestion: capitalised 1890 the two SHOULDs in recommendations for TCP, and gave possible 1891 counter-examples. [noticed while dealing with Pete Resnick's 1892 point] 1894 * S2.4. Splitting & Merging: RTCP -> RTP/RTCP [Pete McCann, Gen- 1895 ART] 1897 * S.3.2 Small != Control: many control packets are small -> 1898 ...tend to be small [Stephen Farrell] 1900 * S.3.1 Perverse incentives: Changed transport designers to app 1901 developers [Stephen Farrell] 1903 * S.4.1.1. Fixed Size Packet Buffers: Nearly completely re- 1904 written to simplify and to reverse the advice when the 1905 underlying resource is bit-congestible, irrespective of whether 1906 the buffer consists of fixed-size packet buffers. [Richard 1907 Barnes & Benson Schliesser] 1909 * S.4.2.1.2. Packet Size Bias Regardless of AQM: Largely re- 1910 written to reflect the earlier change in advice about fixed- 1911 size packet buffers, and to primarily focus on getting rid of 1912 tail-drop, not various nuances of tail-drop. [Richard Barnes & 1913 Benson Schliesser] 1915 * Editorial corrections [Tim Bray, AppsDir, Pete McCann, Gen-ART 1916 and others] 1918 * Updated refs (two I-Ds have become RFCs). [Pete McCann] 1920 From -08 to -09: Following WG last call: 1922 * S.2.1: Made RED-related queue measurement recommendations 1923 clearer 1925 * S.2.3: Added to "Recommendation on Responding to Congestion" to 1926 make it clear that we are definitely not saying transports have 1927 to equalise bit-rates, just how to do it and not do it, if you 1928 want to. 1930 * S.3: Clarified motivation sections S.3.3 "Transport-Independent 1931 Network" and S.3.5 "Implementation Efficiency" 1933 * S.3.4: Completely changed motivating argument from "Scaling 1934 Congestion Control with Packet Size" to "Partial Deployment of 1935 AQM". 1937 From -07 to -08: 1939 * Altered abstract to say it provides best current practice and 1940 highlight that it updates RFC2309 1942 * Added null IANA section 1944 * Updated refs 1946 From -06 to -07: 1948 * A mix-up with the corollaries and their naming in 2.1 to 2.3 1949 fixed. 1951 From -05 to -06: 1953 * Primarily editorial fixes. 1955 From -04 to -05: 1957 * Changed from Informational to BCP and highlighted non-normative 1958 sections and appendices 1960 * Removed language about consensus 1962 * Added "Example Comparing Packet-Mode Drop and Byte-Mode Drop" 1964 * Arranged "Motivating Arguments" into a more logical order and 1965 completely rewrote "Transport-Independent Network" & "Scaling 1966 Congestion Control with Packet Size" arguments. Removed "Why 1967 Now?" 1969 * Clarified applicability of certain recommendations 1971 * Shifted vendor survey to an Appendix 1973 * Cut down "Outstanding Issues and Next Steps" 1975 * Re-drafted the start of the conclusions to highlight the three 1976 distinct areas of concern 1978 * Completely re-wrote appendices 1980 * Editorial corrections throughout. 1982 From -03 to -04: 1984 * Reordered Sections 2 and 3, and some clarifications here and 1985 there based on feedback from Colin Perkins and Mirja 1986 Kuehlewind. 1988 From -02 to -03 (this version) 1990 * Structural changes: 1992 + Split off text at end of "Scaling Congestion Control with 1993 Packet Size" into new section "Transport-Independent 1994 Network" 1996 + Shifted "Recommendations" straight after "Motivating 1997 Arguments" and added "Conclusions" at end to reinforce 1998 Recommendations 2000 + Added more internal structure to Recommendations, so that 2001 recommendations specific to RED or to TCP are just 2002 corollaries of a more general recommendation, rather than 2003 being listed as a separate recommendation. 2005 + Renamed "State of the Art" as "Critical Survey of Existing 2006 Advice" and retitled a number of subsections with more 2007 descriptive titles. 2009 + Split end of "Congestion Coding: Summary of Status" into a 2010 new subsection called "RED Implementation Status". 2012 + Removed text that had been in the Appendix "Congestion 2013 Notification Definition: Further Justification". 2015 * Reordered the intro text a little. 2017 * Made it clearer when advice being reported is deprecated and 2018 when it is not. 2020 * Described AQM as in network equipment, rather than saying "at 2021 the network layer" (to side-step controversy over whether 2022 functions like AQM are in the transport layer but in network 2023 equipment). 2025 * Minor improvements to clarity throughout 2027 From -01 to -02: 2029 * Restructured the whole document for (hopefully) easier reading 2030 and clarity. The concrete recommendation, in RFC2119 language, 2031 is now in Section 8. 2033 From -00 to -01: 2035 * Minor clarifications throughout and updated references 2037 From briscoe-byte-pkt-mark-02 to ietf-byte-pkt-congest-00: 2039 * Added note on relationship to existing RFCs 2041 * Posed the question of whether packet-congestion could become 2042 common and deferred it to the IRTF ICCRG. Added ref to the 2043 dual-resource queue (DRQ) proposal. 2045 * Changed PCN references from the PCN charter & architecture to 2046 the PCN marking behaviour draft most likely to imminently 2047 become the standards track WG item. 2049 From -01 to -02: 2051 * Abstract reorganised to align with clearer separation of issue 2052 in the memo. 2054 * Introduction reorganised with motivating arguments removed to 2055 new Section 3. 2057 * Clarified avoiding lock-out of large packets is not the main or 2058 only motivation for RED. 2060 * Mentioned choice of drop or marking explicitly throughout, 2061 rather than trying to coin a word to mean either. 2063 * Generalised the discussion throughout to any packet forwarding 2064 function on any network equipment, not just routers. 2066 * Clarified the last point about why this is a good time to sort 2067 out this issue: because it will be hard / impossible to design 2068 new transports unless we decide whether the network or the 2069 transport is allowing for packet size. 2071 * Added statement explaining the horizon of the memo is long 2072 term, but with short term expediency in mind. 2074 * Added material on scaling congestion control with packet size 2075 (Section 3.4). 2077 * Separated out issue of normalising TCP's bit rate from issue of 2078 preference to control packets (Section 3.2). 2080 * Divided up Congestion Measurement section for clarity, 2081 including new material on fixed size packet buffers and buffer 2082 carving (Section 4.1.1 & Section 4.2.1) and on congestion 2083 measurement in wireless link technologies without queues 2084 (Section 4.1.2). 2086 * Added section on 'Making Transports Robust against Control 2087 Packet Losses' (Section 4.2.3) with existing & new material 2088 included. 2090 * Added tabulated results of vendor survey on byte-mode drop 2091 variant of RED (Table 3). 2093 From -00 to -01: 2095 * Clarified applicability to drop as well as ECN. 2097 * Highlighted DoS vulnerability. 2099 * Emphasised that drop-tail suffers from similar problems to 2100 byte-mode drop, so only byte-mode drop should be turned off, 2101 not RED itself. 2103 * Clarified the original apparent motivations for recommending 2104 byte-mode drop included protecting SYNs and pure ACKs more than 2105 equalising the bit rates of TCPs with different segment sizes. 2106 Removed some conjectured motivations. 2108 * Added support for updates to TCP in progress (ackcc & ecn-syn- 2109 ack). 2111 * Updated survey results with newly arrived data. 2113 * Pulled all recommendations together into the conclusions. 2115 * Moved some detailed points into two additional appendices and a 2116 note. 2118 * Considerable clarifications throughout. 2120 * Updated references 2122 Authors' Addresses 2124 Bob Briscoe 2125 BT 2126 B54/77, Adastral Park 2127 Martlesham Heath 2128 Ipswich IP5 3RE 2129 UK 2131 Phone: +44 1473 645196 2132 EMail: bob.briscoe@bt.com 2133 URI: http://bobbriscoe.net/ 2135 Jukka Manner 2136 Aalto University 2137 Department of Communications and Networking (Comnet) 2138 P.O. Box 13000 2139 FIN-00076 Aalto 2140 Finland 2142 Phone: +358 9 470 22481 2143 EMail: jukka.manner@aalto.fi 2144 URI: http://www.netlab.tkk.fi/~jmanner/