|
73 | 73 | /* Taken from send_algorithm_interface.h */ |
74 | 74 | #define kDefaultMaxCongestionWindowPackets 2000 |
75 | 75 |
|
| 76 | +/* Multiplier for maximum cwnd relative to BDP. This allows BBR to probe |
| 77 | + * bandwidth (1.25x during PROBE_BW) and handle ACK aggregation without |
| 78 | + * hitting a hard limit at high RTT. |
| 79 | + */ |
| 80 | +#define kMaxCwndBdpMultiplier 3.0f |
| 81 | + |
76 | 82 | // The time after which the current min_rtt value expires. |
77 | 83 | #define kMinRttExpiry sec(10) |
78 | 84 |
|
@@ -146,8 +152,9 @@ set_mode (struct lsquic_bbr *bbr, enum bbr_mode mode) |
146 | 152 | { |
147 | 153 | if (bbr->bbr_mode != mode) |
148 | 154 | { |
149 | | - LSQ_DEBUG("mode change %s -> %s", mode2str[bbr->bbr_mode], |
150 | | - mode2str[mode]); |
| 155 | + LSQ_INFO("mode change %s -> %s (BW: %"PRIu64" bps, cwnd: %"PRIu64")", |
| 156 | + mode2str[bbr->bbr_mode], mode2str[mode], |
| 157 | + minmax_get(&bbr->bbr_max_bandwidth), bbr->bbr_cwnd); |
151 | 158 | bbr->bbr_mode = mode; |
152 | 159 | } |
153 | 160 | else |
@@ -941,6 +948,11 @@ calculate_cwnd (struct lsquic_bbr *bbr, uint64_t bytes_acked, |
941 | 948 | LSQ_DEBUG("exceed max cwnd"); |
942 | 949 | bbr->bbr_cwnd = bbr->bbr_max_cwnd; |
943 | 950 | } |
| 951 | + |
| 952 | + /* Update max_cwnd based on current BDP to scale with network conditions. */ |
| 953 | + uint64_t bdp_based_max = get_target_cwnd(bbr, kMaxCwndBdpMultiplier); |
| 954 | + uint64_t static_min = kDefaultMaxCongestionWindowPackets * kDefaultTCPMSS; |
| 955 | + bbr->bbr_max_cwnd = MAX(bdp_based_max, static_min); |
944 | 956 | } |
945 | 957 |
|
946 | 958 |
|
|
0 commit comments