@@ -176,12 +176,18 @@ bbr_inflight (udx_stream_t *stream, double bw, double gain) {
176176 return bbr_bdp (stream , bw , gain );
177177}
178178
179- // unneccessary?
179+ // Return the highest recently seen degree of ack aggregation. unit is packets.
180+ // aggregation is the amount acked during an rtt interval greater than
181+ // the amount predicted by the current pacing rate. (acked - expected_acked)
182+ // This is used to set a higher cwnd, allowing us to continue sending
183+ // during interruptions of the ack stream.
184+
180185static uint32_t
181186bbr_ack_aggregation_cwnd (udx_stream_t * stream ) {
182187 uint32_t aggr_cwnd = 0 ;
183188 if (bbr_extra_acked_gain && bbr_full_bw_reached (stream )) {
184- uint32_t max_aggr_cwnd = (bbr_bw (stream ) * bbr_extra_acked_max_ms ) / 1000 ;
189+ // clamps extra aggregation packets to at most extra_acked_max_ms (100ms) of packets at current bw
190+ uint32_t max_aggr_cwnd = bbr_bw (stream ) * bbr_extra_acked_max_ms ;
185191
186192 aggr_cwnd = (bbr_extra_acked_gain * bbr_extra_acked (stream ));
187193 aggr_cwnd = min_uint32 (aggr_cwnd , max_aggr_cwnd );
@@ -356,6 +362,7 @@ bbr_update_ack_aggregation (udx_stream_t *stream, udx_rate_sample_t *rs) {
356362 }
357363
358364 if (stream -> bbr .round_start ) {
365+ // redundant since we clamp to bbr_extra_acked_win_rtts
359366 stream -> bbr .extra_acked_win_rtts = min_uint32 (0xff , stream -> bbr .extra_acked_win_rtts + 1 );
360367 if (stream -> bbr .extra_acked_win_rtts >= bbr_extra_acked_win_rtts ) {
361368 stream -> bbr .extra_acked_win_rtts = 0 ;
@@ -367,7 +374,9 @@ bbr_update_ack_aggregation (udx_stream_t *stream, udx_rate_sample_t *rs) {
367374 uint32_t epoch_ms = time_delta_ms (stream -> delivered_ts , stream -> bbr .ack_epoch_start );
368375 uint32_t expected_acked = bbr_bw (stream ) * epoch_ms ;
369376
370- // reset aggregation epoch if ACK rate is below expected or significanly large no of ack received since epoch
377+ // reset aggregation epoch if
378+ // 1. ACK rate is below expected or
379+ // 2. an (improbably large) # of acks that would overflow ack_epoch_acked arrives
371380 if (stream -> bbr .ack_epoch_acked <= expected_acked || ((uint64_t ) stream -> bbr .ack_epoch_acked + rs -> acked_sacked >= bbr_ack_epoch_acked_reset_thresh )) {
372381 stream -> bbr .ack_epoch_acked = 0 ;
373382 stream -> bbr .ack_epoch_start = stream -> delivered_ts ;
0 commit comments