Skip to content

Commit 42b2e66

Browse files
QUICHE teamcopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 675563943
1 parent 5f0c635 commit 42b2e66

File tree

9 files changed

+49
-0
lines changed

9 files changed

+49
-0
lines changed

quiche/quic/core/congestion_control/bbr2_misc.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ void Bbr2NetworkModel::AdaptLowerBounds(
226226
std::max(bandwidth_latest_, bandwidth_lo_ * (1.0 - Params().beta));
227227
QUIC_DVLOG(3) << "bandwidth_lo_ updated to " << bandwidth_lo_
228228
<< ", bandwidth_latest_ is " << bandwidth_latest_;
229+
if (enable_app_driven_pacing_) {
230+
// In this mode, we forcibly cap bandwidth_lo_ at the application driven
231+
// pacing rate when congestion_event.bytes_lost > 0. The idea is to
232+
// avoid going over what the application needs at the earliest signs of
233+
// network congestion.
234+
bandwidth_lo_ = std::min(application_bandwidth_target_, bandwidth_lo_);
235+
QUIC_DVLOG(3) << "bandwidth_lo_ updated to " << bandwidth_lo_
236+
<< "after applying application_driven_pacing at "
237+
<< application_bandwidth_target_;
238+
}
229239

230240
if (Params().ignore_inflight_lo) {
231241
return;

quiche/quic/core/congestion_control/bbr2_misc.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ class QUICHE_EXPORT Bbr2NetworkModel {
438438

439439
bool MaybeExpireMinRtt(const Bbr2CongestionEvent& congestion_event);
440440

441+
void SetEnableAppDrivenPacing(bool value) {
442+
enable_app_driven_pacing_ = value;
443+
}
444+
445+
void SetApplicationBandwidthTarget(QuicBandwidth bandwidth) {
446+
application_bandwidth_target_ = bandwidth;
447+
}
448+
441449
QuicBandwidth BandwidthEstimate() const {
442450
return std::min(MaxBandwidth(), bandwidth_lo_);
443451
}
@@ -576,6 +584,9 @@ class QUICHE_EXPORT Bbr2NetworkModel {
576584
QuicBandwidth bandwidth_latest_ = QuicBandwidth::Zero();
577585
// Max bandwidth of recent rounds. Updated once per round.
578586
QuicBandwidth bandwidth_lo_ = bandwidth_lo_default();
587+
// Target bandwidth from applications for app-driven pacing. Only used when
588+
// enable_app_driven_pacing_ is true.
589+
QuicBandwidth application_bandwidth_target_ = QuicBandwidth::Infinite();
579590
// bandwidth_lo_ at the beginning of a round with loss. Only used when the
580591
// bw_lo_mode is non-default.
581592
QuicBandwidth prior_bandwidth_lo_ = QuicBandwidth::Zero();
@@ -593,6 +604,9 @@ class QUICHE_EXPORT Bbr2NetworkModel {
593604
// epoch.
594605
bool cwnd_limited_before_aggregation_epoch_ = false;
595606

607+
// Enable application-driven pacing.
608+
bool enable_app_driven_pacing_ = false;
609+
596610
// STARTUP-centric fields which experimentally used by PROBE_UP.
597611
bool full_bandwidth_reached_ = false;
598612
QuicBandwidth full_bandwidth_baseline_ = QuicBandwidth::Zero();

quiche/quic/core/congestion_control/bbr2_sender.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ void Bbr2Sender::ApplyConnectionOptions(
194194
if (ContainsQuicTag(connection_options, kBBRB)) {
195195
model_.SetLimitMaxAckHeightTrackerBySendRate(true);
196196
}
197+
if (ContainsQuicTag(connection_options, kADP0)) {
198+
model_.SetEnableAppDrivenPacing(true);
199+
}
197200
if (ContainsQuicTag(connection_options, kB206)) {
198201
params_.startup_full_loss_count = params_.probe_bw_full_loss_count;
199202
}
@@ -273,6 +276,11 @@ void Bbr2Sender::SetInitialCongestionWindowInPackets(
273276
}
274277
}
275278

279+
void Bbr2Sender::SetApplicationDrivenPacingRate(
280+
QuicBandwidth application_bandwidth_target) {
281+
model_.SetApplicationBandwidthTarget(application_bandwidth_target);
282+
}
283+
276284
void Bbr2Sender::OnCongestionEvent(bool /*rtt_updated*/,
277285
QuicByteCount prior_in_flight,
278286
QuicTime event_time,

quiche/quic/core/congestion_control/bbr2_sender.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class QUICHE_EXPORT Bbr2Sender final : public SendAlgorithmInterface {
5252
void SetInitialCongestionWindowInPackets(
5353
QuicPacketCount congestion_window) override;
5454

55+
void SetApplicationDrivenPacingRate(
56+
QuicBandwidth application_bandwidth_target) override;
57+
5558
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
5659
QuicTime event_time,
5760
const AckedPacketVector& acked_packets,

quiche/quic/core/congestion_control/bbr_sender.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ class QUICHE_EXPORT BbrSender : public SendAlgorithmInterface {
108108
void AdjustNetworkParameters(const NetworkParams& params) override;
109109
void SetInitialCongestionWindowInPackets(
110110
QuicPacketCount congestion_window) override;
111+
void SetApplicationDrivenPacingRate(
112+
QuicBandwidth /*application_bandwidth_target*/) override {}
111113
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
112114
QuicTime event_time,
113115
const AckedPacketVector& acked_packets,

quiche/quic/core/congestion_control/send_algorithm_interface.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ class QUICHE_EXPORT SendAlgorithmInterface {
7474
// if called after the initial congestion window is no longer relevant.
7575
virtual void SetInitialCongestionWindowInPackets(QuicPacketCount packets) = 0;
7676

77+
// [Experimental] Sets the application driven pacing rate. This is only used
78+
// by an experimental feature for bbr2_sender.
79+
virtual void SetApplicationDrivenPacingRate(
80+
QuicBandwidth application_bandwidth_target) = 0;
81+
7782
// Indicates an update to the congestion state, caused either by an incoming
7883
// ack or loss event timeout. |rtt_updated| indicates whether a new
7984
// latest_rtt sample has been taken, |prior_in_flight| the bytes in flight

quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class QUICHE_EXPORT TcpCubicSenderBytes : public SendAlgorithmInterface {
5050
void SetNumEmulatedConnections(int num_connections);
5151
void SetInitialCongestionWindowInPackets(
5252
QuicPacketCount congestion_window) override;
53+
void SetApplicationDrivenPacingRate(
54+
QuicBandwidth /*application_bandwidth_target*/) override {}
5355
void OnConnectionMigration() override;
5456
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
5557
QuicTime event_time,

quiche/quic/core/crypto/crypto_protocol.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ const QuicTag kMTUL = TAG('M', 'T', 'U', 'L'); // Low-target MTU discovery.
364364
const QuicTag kNSLC = TAG('N', 'S', 'L', 'C'); // Always send connection close
365365
// for idle timeout.
366366

367+
// Enable application-driven pacing experiment.
368+
const QuicTag kADP0 = TAG('A', 'D', 'P', '0'); // Enable App-Driven Pacing.
369+
367370
// Proof types (i.e. certificate types)
368371
// NOTE: although it would be silly to do so, specifying both kX509 and kX59R
369372
// is allowed and is equivalent to specifying only kX509.

quiche/quic/test_tools/quic_test_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,8 @@ class MockSendAlgorithm : public SendAlgorithmInterface {
12161216
(const QuicTagVector& connection_options), (override));
12171217
MOCK_METHOD(void, SetInitialCongestionWindowInPackets,
12181218
(QuicPacketCount packets), (override));
1219+
MOCK_METHOD(void, SetApplicationDrivenPacingRate,
1220+
(QuicBandwidth application_bandwidth_target), (override));
12191221
MOCK_METHOD(void, OnCongestionEvent,
12201222
(bool rtt_updated, QuicByteCount bytes_in_flight,
12211223
QuicTime event_time, const AckedPacketVector& acked_packets,

0 commit comments

Comments
 (0)