idnits 2.17.1 draft-ietf-aqm-docsis-pie-01.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 : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 29, 2015) is 3133 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-10) exists of draft-ietf-aqm-pie-01 Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Active Queue Management and Packet Scheduling (aqm) G. White 3 Internet-Draft CableLabs 4 Intended status: Informational R. Pan 5 Expires: April 1, 2016 Cisco Systems 6 September 29, 2015 8 A PIE-Based AQM for DOCSIS Cable Modems 9 draft-ietf-aqm-docsis-pie-01 11 Abstract 13 Cable modems based on the DOCSIS(R) specification provide broadband 14 Internet access to over one hundred million users worldwide. In some 15 cases, the cable modem connection is the bottleneck (lowest speed) 16 link between the customer and the Internet. As a result, the impact 17 of buffering and bufferbloat in the cable modem can have a 18 significant effect on user experience. The CableLabs DOCSIS 3.1 19 specification introduces requirements for cable modems to support an 20 Active Queue Management (AQM) algorithm that is intended to alleviate 21 the impact that buffering has on latency sensitive traffic, while 22 preserving bulk throughput performance. In addition, the CableLabs 23 DOCSIS 3.0 specifications have also been amended to contain similar 24 requirements. This document describes the requirements on Active 25 Queue Management that apply to DOCSIS equipment, including a 26 description of the "DOCSIS-PIE" algorithm that is required on DOCSIS 27 3.1 cable modems. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on April 1, 2016. 46 Copyright Notice 48 Copyright (c) 2015 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 2. Overview of DOCSIS AQM Requirements . . . . . . . . . . . . . 3 65 3. The DOCSIS MAC Layer and Service Flows . . . . . . . . . . . 3 66 4. DOCSIS-PIE vs. PIE . . . . . . . . . . . . . . . . . . . . . 5 67 4.1. Latency Target . . . . . . . . . . . . . . . . . . . . . 5 68 4.2. Departure rate estimation . . . . . . . . . . . . . . . . 5 69 4.3. Enhanced burst protection . . . . . . . . . . . . . . . . 6 70 4.4. Expanded auto-tuning range . . . . . . . . . . . . . . . 7 71 4.5. Trigger for exponential decay . . . . . . . . . . . . . . 7 72 4.6. Drop probability scaling . . . . . . . . . . . . . . . . 7 73 4.7. Support for explicit congestion notification . . . . . . 8 74 5. Implementation Guidance . . . . . . . . . . . . . . . . . . . 8 75 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 76 Appendix A. DOCSIS-PIE Algorithm definition . . . . . . . . . . 9 77 A.1. DOCSIS-PIE AQM Constants and Variables . . . . . . . . . 9 78 A.1.1. Configuration parameters . . . . . . . . . . . . . . 10 79 A.1.2. Constant values . . . . . . . . . . . . . . . . . . . 10 80 A.1.3. Variables . . . . . . . . . . . . . . . . . . . . . . 10 81 A.1.4. Public/system functions: . . . . . . . . . . . . . . 11 82 A.2. DOCSIS-PIE AQM Control Path . . . . . . . . . . . . . . . 11 83 A.3. DOCSIS-PIE AQM Data Path . . . . . . . . . . . . . . . . 13 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 86 1. Introduction 88 A recent resurgence of interest in Active Queue Management, arising 89 from a recognition of the inadequacies of drop tail queuing in the 90 presence of loss-based congestion control algorithms, has resulted in 91 the development of new algorithms that appear to provide very good 92 congestion feedback to current TCP algorithms, while also having 93 operational simplicity and low complexity. One of these algorithms 94 has been selected as a requirement for cable modems built according 95 to the DOCSIS 3.1 specification [DOCSIS_3.1]. The Data Over Cable 96 Service Interface Specifications (DOCSIS) define the broadband 97 technology deployed worldwide for Ethernet and IP service over hybrid 98 fiber-coaxial cable systems. The most recent revision of the DOCSIS 99 technology, version 3.1, was published in October 2013 and provides 100 support for up to 10 Gbps downstream (toward the customer) and 1 Gbps 101 upstream (from the customer) capacity over existing cable networks. 102 Previous versions of the DOCSIS technology did not contain 103 requirements for AQM. This document outlines the high-level AQM 104 requirements for DOCSIS systems, discusses some of the salient 105 features of the DOCSIS MAC layer, and describes the DOCSIS-PIE 106 algorithm - largely by comparing it to its progenitor, the 107 [I-D.ietf-aqm-pie] algorithm. 109 2. Overview of DOCSIS AQM Requirements 111 CableLabs' DOCSIS 3.1 specification [DOCSIS_3.1] mandates that cable 112 modems implement a specific variant of the Proportional Integral 113 controller Enhanced (PIE) [I-D.ietf-aqm-pie] active queue management 114 algorithm. This specific variant is provided for reference in 115 Appendix A, and simulation results comparing it to drop tail queuing 116 and other AQM options are given in [CommMag] and [DOCSIS-AQM]. In 117 addition, CableLabs' DOCSIS 3.0 specification [DOCSIS_3.0] has been 118 amended to recommend that cable modems implement the same algorithm. 119 Both specifications allow that cable modems can optionally implement 120 additional algorithms, that can then be selected for use by the 121 operator via the modem's configuration file. 123 These requirements on the cable modem apply to upstream transmissions 124 (i.e. from the customer to the Internet). 126 Both specifications also include requirements (mandatory in DOCSIS 127 3.1 and recommended in DOCSIS 3.0) that the Cable Modem Termination 128 System (CMTS) implement active queue management for downstream 129 traffic, however no specific algorithm is defined for downstream use. 131 3. The DOCSIS MAC Layer and Service Flows 133 The DOCSIS Media Access Control (sub-)layer provides tools for 134 configuring differentiated Quality of Service for different 135 applications by the use of Packet Classifiers and Service Flows. 137 Each Service Flow has an associated Quality of Service (QoS) 138 parameter set that defines the treatment of the packets that traverse 139 the Service Flow. These parameters include (for example) Minimum 140 Reserved Traffic Rate, Maximum Sustained Traffic Rate, Peak Traffic 141 Rate, Maximum Traffic Burst, and Traffic Priority. Each upstream 142 Service Flow corresponds to a queue in the cable modem, and each 143 downstream Service Flow corresponds to a queue in the CMTS. The 144 DOCSIS AQM requirements mandate that the CM and CMTS implement the 145 AQM algorithm (and allow it to be disabled if need be) on each 146 Service Flow queue independently. 148 Packet Classifiers can match packets based upon several fields in the 149 packet/frame headers including the Ethernet header, IP header, and 150 TCP/UDP header. Matched packets are then queued in the associated 151 Service Flow queue. 153 Each cable modem can be configured with multiple Packet Classifiers 154 and Service Flows. The maximum number of such entities that a cable 155 modem supports is an implementation decision for the manufacturer, 156 but modems typically support 16 or 32 upstream Service Flows and at 157 least that many Packet Classifiers. Similarly the CMTS supports 158 multiple downstream Service Flows and multiple Packet Classifiers per 159 cable modem. 161 It is typical that upstream and downstream Service Flows used for 162 broadband Internet access are configured with a Maximum Sustained 163 Traffic Rate. This QoS parameter rate-shapes the traffic onto the 164 DOCSIS link, and is the main parameter that defines the service 165 offering. Additionally, it is common that upstream and downstream 166 Service Flows are configured with a Maximum Traffic Burst and a Peak 167 Traffic Rate. These parameters allow the service to burst at a 168 higher (sometimes significantly higher) rate than is defined in the 169 Maximum Sustained Traffic Rate for the amount of bytes configured in 170 Maximum Traffic Burst, as long as the long-term average data rate 171 remains at or below the Maximum Sustained Traffic Rate. 173 Mathematically, what is enforced is that the traffic placed on the 174 DOCSIS link in the time interval (t1,t2) complies with the following 175 rate shaping equations: 177 TxBytes(t1,t2) <= (t2-t1)*R/8 + B 179 TxBytes(t1,t2) <= (t2-t1)*P/8 + 1522 181 for all values t2>t1, where: 183 R = Maximum Sustained Traffic Rate (bps) 185 P = Peak Traffic Rate (bps) 187 B = Maximum Traffic Burst (bytes) 189 The result of this configuration is that the link rate available to 190 the Service Flow varies based on the pattern of load. If the load 191 that the Service Flow places on the link is less than the Maximum 192 Sustained Traffic Rate, the Service Flow "earns" credit that it can 193 then use (should the load increase) to burst at the Peak Traffic 194 Rate. This dynamic is important since these rate changes 195 (particularly the decrease in data rate once the traffic burst credit 196 is exhausted) can induce a step increase in buffering latency. 198 4. DOCSIS-PIE vs. PIE 200 There are a number of differences between the version of the PIE 201 algorithm that is mandated for cable modems in the DOCSIS 202 specifications and the version described in [I-D.ietf-aqm-pie]. 203 These differences are described in the following subsections. 205 4.1. Latency Target 207 The latency target (aka delay reference) is a key parameter that 208 affects, among other things, the tradeoff in performance between 209 latency-sensitive applications and bulk TCP applications. Via 210 simulation studies, a value of 10ms was identified as providing a 211 good balance of performance. However, it is recognized that there 212 may be service offerings for which this value doesn't provide the 213 best performance balance. As a result, this is provided as a 214 configuration parameter that the operator can set independently on 215 each upstream service flow. If not explicitly set by the operator, 216 the modem will use 10 ms as the default value. 218 4.2. Departure rate estimation 220 The PIE algorithm utilizes a departure rate estimator to track 221 fluctuations in the egress rate for the queue and to generate a 222 smoothed estimate of this rate for use in the drop probability 223 calculation. This estimator may be well suited to many link 224 technologies, but is not ideal for DOCSIS upstream links for a number 225 of reasons. 227 First, the bursty nature of the upstream transmissions, in which the 228 queue drains at line rate (up to ~100 Mbps for DOCSIS 3.0 and ~1 Gbps 229 for DOCSIS 3.1) and then is blocked until the next transmit 230 opportunity, results in the potential for inaccuracy in measurement, 231 given that the PIE departure rate estimator starts each measurement 232 during a transmission burst and ends each measurement during a 233 (possibly different) transmission burst. For example, in the case 234 where the start and end of measurement occur within a single burst, 235 the PIE estimator will calculate the egress rate to be equal to the 236 line rate, rather than the average rate available to the modem. 238 Second, the latency introduced by the DOCSIS request-grant mechanism 239 can result in some further inaccuracy. In typical conditions, the 240 request-grant mechanism can add between ~4 ms and ~8 ms of latency to 241 the forwarding of upstream traffic. Within that range, the amount of 242 additional latency that affects any individual data burst is 243 effectively random, being influenced by the arrival time of the burst 244 relative to the next request transmit opportunity, among other 245 factors. 247 Third, in the significant majority of cases, the departure rate, 248 while variable, is controlled by the modem itself via the pair of 249 token bucket rate shaping equations described in Section 3. 250 Together, these two equations enforce a maximum sustained traffic 251 rate, a peak traffic rate, and a maximum traffic burst size for the 252 modem's requested bandwidth. The implication of this is that the 253 modem, in the significant majority of cases, will know precisely what 254 the departure rate will be, and can predict exactly when transitions 255 between peak rate and maximum sustained traffic rate will occur. 256 Compare this to the PIE estimator, which would be simply reacting to 257 (and smoothing its estimate of) those rate transitions after the 258 fact. 260 Finally, since the modem is already implementing the dual token 261 bucket traffic shaper, it contains enough internal state to calculate 262 predicted queuing delay with a minimum of computations. Furthermore, 263 these computations only need to be run every drop probability update 264 interval, as opposed to the PIE estimator, which runs a similar 265 number of computations on each packet dequeue event. 267 For these reasons, the DOCSIS-PIE algorithm utilizes the 268 configuration and state of the dual token bucket traffic shaper to 269 translate queue depth into predicted queuing delay, rather than 270 implementing the departure rate estimator defined in PIE. 272 4.3. Enhanced burst protection 274 The PIE [I-D.ietf-aqm-pie] algorithm has two states, INACTIVE and 275 ACTIVE. During the INACTIVE state, AQM packet drops are suppressed. 276 The algorithm transitions to the ACTIVE state when the queue exceeds 277 1/3 of the buffer size. Upon transition to the ACTIVE state, PIE 278 includes a burst protection feature in which the AQM packet drops are 279 suppressed for the first 150ms. Since DOCSIS-PIE is predominantly 280 deployed on consumer broadband connections, a more sophisticated 281 burst protection was developed in order to provide better performance 282 in the presence of a single TCP session. 284 Where the PIE algorithm has two states, DOCSIS-PIE has three. The 285 INACTIVE and ACTIVE states in DOCSIS-PIE are identical to those 286 states in PIE. The QUIESCENT state is a transitional state between 287 INACTIVE and ACTIVE. The DOCSIS-PIE algorithm transitions from 288 INACTIVE to QUIESCENT when the queue exceeds 1/3 of the buffer size. 289 In the QUIESCENT state, packet drops are immediately enabled, and 290 upon the first packet drop, the algorithm transitions to the ACTIVE 291 state (where drop probability is reset to zero for the 150ms duration 292 of the burst protection as in PIE). From the ACTIVE state, the 293 algorithm transitions to QUIESCENT if the drop_probability has 294 decayed to zero and the queuing latency has been less than half of 295 the LATENCY_TARGET for two update intervals. The algorithm then 296 fully resets to the INACTIVE state if this "quiet" condition exists 297 for the duration of the BURST_RESET_TIMEOUT (1 second). One end 298 result of the addition of the QUIESCENT state is that a single packet 299 drop can occur relatively early on during an initial burst, whereas 300 all drops would be suppressed for at least 150ms of the burst 301 duration in PIE. The other end result is that if traffic stops and 302 then resumes within 1 second, DOCSIS_PIE can directly drop a single 303 packet and then re-enter burst protection, whereas PIE would require 304 that the buffer exceed 1/3 full. 306 4.4. Expanded auto-tuning range 308 The PIE algorithm scales the PI coefficients based on the current 309 drop probability. The DOCSIS-PIE algorithm extends this scaling to 310 drop probabilities below 1e-4. 312 4.5. Trigger for exponential decay 314 The PIE algorithm includes a mechanism by which the drop probability 315 is allowed to decay exponentially (rather than linearly) when it is 316 detected that the buffer is empty. In the DOCSIS case, recently 317 arrived packets may reside in buffer due to the request-grant latency 318 even if the link is effectively idle. As a result, the buffer may 319 not be identically empty in the situations for which the exponential 320 decay is intended. To compensate for this, we trigger exponential 321 decay when the buffer occupancy is less than 5ms * Peak Traffic Rate. 323 4.6. Drop probability scaling 325 The DOCSIS-PIE algorithm scales the calculated drop probability based 326 on the ratio of the packet size to a constant value of 1024 bytes 327 (representing approximate average packet size). While [RFC7567] in 328 general recommends against this type of scaling, we note that DOCSIS- 329 PIE is expected to predominantly be used to manage upstream queues in 330 residential broadband deployments, where we believe the benefits 331 outweigh the disadvantages. As a safeguard to prevent a flood of 332 small packets from starving flows that use larger packets, DOCSIS-PIE 333 limits the scaled probability to a defined maximum value of 0.85. 335 4.7. Support for explicit congestion notification 337 DOCSIS-PIE does not include support for explicit congestion 338 notification. Cable modems are essentially IEEE 802.1d Ethernet 339 bridges and so are not designed to modify IP header fields. 340 Additionally, the packet processing pipeline in a cable modem is 341 commonly implemented in hardware. As a result, introducing support 342 for ECN would have engendered a more significant redesign of cable 343 modem data paths, and implementations would have been difficult or 344 impossible to modify in the future. At the time of the development 345 of DOCSIS-PIE, which coincided with the development of modem chip 346 designs, the benefits of ECN marking relative to packet drop were 347 considered to be relatively minor, there was considerable discussion 348 about differential treatment of ECN capable packets in the AQM drop/ 349 mark decision, and there were some initial suggestions that a new ECN 350 approach was needed. Due to this uncertainty, we chose to not 351 include support for ECN. 353 5. Implementation Guidance 355 The AQM space is an evolving one, and it is expected that continued 356 research in this field may in the future result in improved 357 algorithms. 359 As part of defining the DOCSIS-PIE algorithm, we split the pseudocode 360 definition into two components, a "data path" component and a 361 "control path" component. The control path component contains the 362 packet drop probability update functionality, whereas the data path 363 component contains the per-packet operations, including the drop 364 decision logic. 366 It is understood that some aspects of the cable modem implementation 367 may be done in hardware, particularly functions that handle packet- 368 processing. 370 While the DOCSIS specifications don't mandate the internal 371 implementation details of the cable modem, modem implementers are 372 strongly advised against implementing the control path functionality 373 in hardware. The intent of this advice is to retain the possibility 374 that future improvements in AQM algorithms can be accommodated via 375 software updates to deployed devices. 377 6. References 379 [CommMag] White, G., "Active queue management in DOCSIS 3.1 380 networks", IEEE Communications Magazine vol.53, no.3, 381 pp.126-132, March 2015. 383 [DOCSIS-AQM] 384 White, G., "Active Queue Management in DOCSIS 3.x Cable 385 Modems", May 2014, . 388 [DOCSIS_3.0] 389 CableLabs, "DOCSIS 3.0 MAC and Upper Layer Protocols 390 Specification", November 2013, . 394 [DOCSIS_3.1] 395 CableLabs, "DOCSIS 3.1 MAC and Upper Layer Protocols 396 Specification", October 2013, . 400 [I-D.ietf-aqm-pie] 401 Pan, R., Natarajan, P., Baker, F., and G. White, "PIE: A 402 Lightweight Control Scheme To Address the Bufferbloat 403 Problem", draft-ietf-aqm-pie-01 (work in progress), March 404 2015. 406 [RFC7567] Baker, F., Ed. and G. Fairhurst, Ed., "IETF 407 Recommendations Regarding Active Queue Management", BCP 408 197, RFC 7567, DOI 10.17487/RFC7567, July 2015, 409 . 411 Appendix A. DOCSIS-PIE Algorithm definition 413 PIE defines two functions organized here into two design blocks: 415 1. Control path block, a periodically running algorithm that 416 calculates a drop probability based on the estimated queuing 417 latency and queuing latency trend. 419 2. Data path block, a function that occurs on each packet enqueue: 420 per-packet drop decision based on the drop probability. 422 It is desired to have the ability to update the Control path block 423 based on operational experience with PIE deployments. 425 A.1. DOCSIS-PIE AQM Constants and Variables 426 A.1.1. Configuration parameters 428 o LATENCY_TARGET. AQM Latency Target for this Service Flow 430 o PEAK_RATE. Service Flow configured Peak Traffic Rate, expressed 431 in Bytes/sec. 433 o MSR. Service Flow configured Max. Sustained Traffic Rate, 434 expressed in Bytes/sec. 436 o BUFFER_SIZE. The size (in bytes) of the buffer for this Service 437 Flow. 439 A.1.2. Constant values 441 o A=0.25, B=2.5. Weights in the drop probability calculation 443 o INTERVAL=16 ms. Update interval for drop probability. 445 o BURST_RESET_TIMEOUT = 1 s. 447 o MAX_BURST = 142 ms (150 ms-8 ms(update error)) 449 o MEAN_PKTSIZE = 1024 bytes 451 o MIN_PKTSIZE = 64 bytes 453 o PROB_LOW = 0.85 455 o PROB_HIGH = 8.5 457 o LATENCY_LOW = 5 ms 459 o LATENCY_HIGH=200 ms. 461 A.1.3. Variables 463 o drop_prob_. The current packet drop probability. 465 o accu_prob_. accumulated drop prob. since last drop 467 o qdelay_old_. The previous queue delay estimate. 469 o burst_allowance_. Countdown for burst protection, initialize to 0 471 o burst_reset_. counter to reset burst 473 o aqm_state_. AQM activity state encoding 3 states: 475 INACTIVE - queue staying below 1/3 full, suppress AQM drops 477 QUIESCENT - transition state 479 ACTIVE - normal AQM drops (after burst protection period) 481 o queue_. Holds the pending packets. 483 A.1.4. Public/system functions: 485 o drop(packet). Drops/discards a packet 487 o random(). Returns a uniform r.v. in the range 0 ~ 1 489 o queue_.is_full(). Returns true if queue_ is full 491 o queue_.byte_length(). Returns current queue_ length in bytes, 492 including all MAC PDU bytes without DOCSIS MAC overhead 494 o queue_.enque(packet). Adds packet to tail of queue_ 496 o msrtokens(). Returns current token credits (in bytes) from the 497 Max Sust. Traffic Rate token bucket 499 o packet.size(). Returns size of packet 501 A.2. DOCSIS-PIE AQM Control Path 503 The DOCSIS-PIE control path performs the following: 505 o Calls control_path_init() at service flow creation 507 o Calls calculate_drop_prob() at a regular INTERVAL (16ms) 509 ================ 510 // Initialization function 511 control_path_init() { 512 drop_prob_ = 0; 513 qdelay_old_ = 0; 514 burst_reset_ = 0; 515 aqm_state_ = INACTIVE; 516 } 518 // Background update, occurs every INTERVAL 519 calculate_drop_prob() { 521 if (queue_.byte_length() <= msrtokens()) { 522 qdelay = queue_.byte_length() / PEAK_RATE; 524 } else { 525 qdelay = ((queue_.byte_length() - msrtokens()) / MSR \ 526 + msrtokens() / PEAK_RATE); 527 } 529 if (burst_allowance_ > 0) { 530 drop_prob_ = 0; 531 burst_allowance_ = max(0, burst_allowance_ - INTERVAL); 532 } else { 533 p = A * (qdelay - LATENCY_TARGET) + \ 534 B * (qdelay - qdelay_old_); 535 // Since A=0.25 & B=2.5, can be implemented 536 // with shift and add 538 if (drop_prob_ < 0.000001) { 539 p /= 2048; 540 } else if (drop_prob_ < 0.00001) { 541 p /= 512; 542 } else if (drop_prob_ < 0.0001) { 543 p /= 128; 544 } else if (drop_prob_ < 0.001) { 545 p /= 32; 546 } else if (drop_prob_ < 0.01) { 547 p /= 8; 548 } else if (drop_prob_ < 0.1) { 549 p /= 2; 550 } else if (drop_prob_ < 1) { 551 p /= 0.5; 552 } else if (drop_prob_ < 10) { 553 p /= 0.125; 554 } else { 555 p /= 0.03125; 556 } 558 if ((drop_prob_ >= 0.1) && (p > 0.02)) { 559 p = 0.02; 560 } 561 drop_prob_ += p; 563 /* some special cases */ 564 if (qdelay < LATENCY_LOW && qdelay_old_ < LATENCY_LOW) { 565 drop_prob_ *= 0.98; // exponential decay 566 } else if (qdelay > LATENCY_HIGH) { 567 drop_prob_ += 0.02; // ramp up quickly 568 } 570 drop_prob_ = max(0, drop_prob_); 571 drop_prob_ = min(drop_prob_, \ 572 PROB_LOW * MEAN_PKTSIZE/MIN_PKTSIZE); 573 } 575 // check if all is quiet 576 quiet = (qdelay < 0.5 * LATENCY_TARGET) 577 && (qdelay_old_ < 0.5 * LATENCY_TARGET) 578 && (drop_prob_ == 0) 579 && (burst_allowance_ == 0); 581 // Update AQM state based on quiet or !quiet 582 if ((aqm_state_ == ACTIVE) && quiet) { 583 aqm_state_ = QUIESCENT; 584 burst_reset_ = 0; 585 } else if (aqm_state_ == QUIESCENT) { 586 if (quiet) { 587 burst_reset_ += INTERVAL ; 588 if (burst_reset_ > BURST_RESET_TIMEOUT) { 589 burst_reset_ = 0; 590 aqm_state_ = INACTIVE; 591 } 592 } else { 593 burst_reset_ = 0; 594 } 595 } 597 qdelay_old_ = qdelay; 599 } 601 A.3. DOCSIS-PIE AQM Data Path 603 The DOCSIS-PIE data path performs the following: 605 o Calls enque() in response to an incoming packet from the CMCI 607 ================ 608 enque(packet) { 609 if (queue_.is_full()) { 610 drop(packet); 611 accu_prob_ = 0; 612 } else if (drop_early(packet, queue_.byte_length())) { 613 drop(packet); 614 } else { 615 queue_.enque(packet); 616 } 617 } 619 //////////////// 620 drop_early(packet, queue_length) { 622 // if still in burst protection, suppress AQM drops 623 if (burst_allowance_ > 0) { 624 return FALSE; 625 } 627 // if drop_prob_ goes to zero, clear accu_prob_ 628 if (drop_prob_ == 0) { 629 accu_prob_ = 0; 630 } 632 if (aqm_state_ == INACTIVE) { 633 if (queue_.byte_length() < BUFFER_SIZE/3) { 634 // if queue is still small, stay in 635 // INACTIVE state and suppress AQM drops 636 return FALSE; 637 } else { 638 // otherwise transition to QUIESCENT state 639 aqm_state_ = QUIESCENT; 640 } 641 } 643 //The CM can quantize packet.size to 64, 128, 256, 512, 768, 644 // 1024, 1280, 1536, 2048 in the calculation below 645 p1 = drop_prob_ * packet.size() / MEAN_PKTSIZE; 646 p1 = min(p1, PROB_LOW); 648 accu_prob_ += p1; 650 // Suppress AQM drops in certain situations 651 if ( (qdelay_old_ < 0.5 * LATENCY_TARGET && drop_prob_ < 0.2) 652 || (queue_.byte_length() <= 2 * MEAN_PKTSIZE) ) { 653 return FALSE; 654 } 656 if (accu_prob_ < PROB_LOW) { // avoid dropping too fast due 657 return FALSE; // to bad luck of coin tosses... 658 } else if (accu_prob_ >= PROB_HIGH) { // ...and avoid droppping 659 drop = TRUE; // too slowly 660 } else { //Random drop 661 double u = random(); // 0 ~ 1 662 if (u > p1) 663 return FALSE; 664 else 665 drop = TRUE; 666 } 667 // at this point, drop == TRUE, so packet will be dropped. 669 // reset accu_prob_ 670 accu_prob_ = 0; 672 // If in QUIESCENT state, packet drop triggers 673 // ACTIVE state and start of burst protection 674 if (aqm_state_ == QUIESCENT) { 675 aqm_state_ = ACTIVE; 676 burst_allowance_ = MAX_BURST; 677 } 678 return TRUE; 679 } 681 Authors' Addresses 683 Greg White 684 CableLabs 685 858 Coal Creek Circle 686 Louisville, CO 80027-9750 687 USA 689 Email: g.white@cablelabs.com 691 Rong Pan 692 Cisco Systems 693 510 McCarthy Blvd 694 Milpitas, CA 95134 695 USA 697 Email: ropan@cisco.com