Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 675563943
  • Loading branch information
QUICHE team authored and copybara-github committed Sep 17, 2024
1 parent 5f0c635 commit 42b2e66
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 0 deletions.
10 changes: 10 additions & 0 deletions quiche/quic/core/congestion_control/bbr2_misc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ void Bbr2NetworkModel::AdaptLowerBounds(
std::max(bandwidth_latest_, bandwidth_lo_ * (1.0 - Params().beta));
QUIC_DVLOG(3) << "bandwidth_lo_ updated to " << bandwidth_lo_
<< ", bandwidth_latest_ is " << bandwidth_latest_;
if (enable_app_driven_pacing_) {
// In this mode, we forcibly cap bandwidth_lo_ at the application driven
// pacing rate when congestion_event.bytes_lost > 0. The idea is to
// avoid going over what the application needs at the earliest signs of
// network congestion.
bandwidth_lo_ = std::min(application_bandwidth_target_, bandwidth_lo_);
QUIC_DVLOG(3) << "bandwidth_lo_ updated to " << bandwidth_lo_
<< "after applying application_driven_pacing at "
<< application_bandwidth_target_;
}

if (Params().ignore_inflight_lo) {
return;
Expand Down
14 changes: 14 additions & 0 deletions quiche/quic/core/congestion_control/bbr2_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,14 @@ class QUICHE_EXPORT Bbr2NetworkModel {

bool MaybeExpireMinRtt(const Bbr2CongestionEvent& congestion_event);

void SetEnableAppDrivenPacing(bool value) {
enable_app_driven_pacing_ = value;
}

void SetApplicationBandwidthTarget(QuicBandwidth bandwidth) {
application_bandwidth_target_ = bandwidth;
}

QuicBandwidth BandwidthEstimate() const {
return std::min(MaxBandwidth(), bandwidth_lo_);
}
Expand Down Expand Up @@ -576,6 +584,9 @@ class QUICHE_EXPORT Bbr2NetworkModel {
QuicBandwidth bandwidth_latest_ = QuicBandwidth::Zero();
// Max bandwidth of recent rounds. Updated once per round.
QuicBandwidth bandwidth_lo_ = bandwidth_lo_default();
// Target bandwidth from applications for app-driven pacing. Only used when
// enable_app_driven_pacing_ is true.
QuicBandwidth application_bandwidth_target_ = QuicBandwidth::Infinite();
// bandwidth_lo_ at the beginning of a round with loss. Only used when the
// bw_lo_mode is non-default.
QuicBandwidth prior_bandwidth_lo_ = QuicBandwidth::Zero();
Expand All @@ -593,6 +604,9 @@ class QUICHE_EXPORT Bbr2NetworkModel {
// epoch.
bool cwnd_limited_before_aggregation_epoch_ = false;

// Enable application-driven pacing.
bool enable_app_driven_pacing_ = false;

// STARTUP-centric fields which experimentally used by PROBE_UP.
bool full_bandwidth_reached_ = false;
QuicBandwidth full_bandwidth_baseline_ = QuicBandwidth::Zero();
Expand Down
8 changes: 8 additions & 0 deletions quiche/quic/core/congestion_control/bbr2_sender.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ void Bbr2Sender::ApplyConnectionOptions(
if (ContainsQuicTag(connection_options, kBBRB)) {
model_.SetLimitMaxAckHeightTrackerBySendRate(true);
}
if (ContainsQuicTag(connection_options, kADP0)) {
model_.SetEnableAppDrivenPacing(true);
}
if (ContainsQuicTag(connection_options, kB206)) {
params_.startup_full_loss_count = params_.probe_bw_full_loss_count;
}
Expand Down Expand Up @@ -273,6 +276,11 @@ void Bbr2Sender::SetInitialCongestionWindowInPackets(
}
}

void Bbr2Sender::SetApplicationDrivenPacingRate(
QuicBandwidth application_bandwidth_target) {
model_.SetApplicationBandwidthTarget(application_bandwidth_target);
}

void Bbr2Sender::OnCongestionEvent(bool /*rtt_updated*/,
QuicByteCount prior_in_flight,
QuicTime event_time,
Expand Down
3 changes: 3 additions & 0 deletions quiche/quic/core/congestion_control/bbr2_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class QUICHE_EXPORT Bbr2Sender final : public SendAlgorithmInterface {
void SetInitialCongestionWindowInPackets(
QuicPacketCount congestion_window) override;

void SetApplicationDrivenPacingRate(
QuicBandwidth application_bandwidth_target) override;

void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
QuicTime event_time,
const AckedPacketVector& acked_packets,
Expand Down
2 changes: 2 additions & 0 deletions quiche/quic/core/congestion_control/bbr_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class QUICHE_EXPORT BbrSender : public SendAlgorithmInterface {
void AdjustNetworkParameters(const NetworkParams& params) override;
void SetInitialCongestionWindowInPackets(
QuicPacketCount congestion_window) override;
void SetApplicationDrivenPacingRate(
QuicBandwidth /*application_bandwidth_target*/) override {}
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
QuicTime event_time,
const AckedPacketVector& acked_packets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class QUICHE_EXPORT SendAlgorithmInterface {
// if called after the initial congestion window is no longer relevant.
virtual void SetInitialCongestionWindowInPackets(QuicPacketCount packets) = 0;

// [Experimental] Sets the application driven pacing rate. This is only used
// by an experimental feature for bbr2_sender.
virtual void SetApplicationDrivenPacingRate(
QuicBandwidth application_bandwidth_target) = 0;

// Indicates an update to the congestion state, caused either by an incoming
// ack or loss event timeout. |rtt_updated| indicates whether a new
// latest_rtt sample has been taken, |prior_in_flight| the bytes in flight
Expand Down
2 changes: 2 additions & 0 deletions quiche/quic/core/congestion_control/tcp_cubic_sender_bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class QUICHE_EXPORT TcpCubicSenderBytes : public SendAlgorithmInterface {
void SetNumEmulatedConnections(int num_connections);
void SetInitialCongestionWindowInPackets(
QuicPacketCount congestion_window) override;
void SetApplicationDrivenPacingRate(
QuicBandwidth /*application_bandwidth_target*/) override {}
void OnConnectionMigration() override;
void OnCongestionEvent(bool rtt_updated, QuicByteCount prior_in_flight,
QuicTime event_time,
Expand Down
3 changes: 3 additions & 0 deletions quiche/quic/core/crypto/crypto_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ const QuicTag kMTUL = TAG('M', 'T', 'U', 'L'); // Low-target MTU discovery.
const QuicTag kNSLC = TAG('N', 'S', 'L', 'C'); // Always send connection close
// for idle timeout.

// Enable application-driven pacing experiment.
const QuicTag kADP0 = TAG('A', 'D', 'P', '0'); // Enable App-Driven Pacing.

// Proof types (i.e. certificate types)
// NOTE: although it would be silly to do so, specifying both kX509 and kX59R
// is allowed and is equivalent to specifying only kX509.
Expand Down
2 changes: 2 additions & 0 deletions quiche/quic/test_tools/quic_test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,8 @@ class MockSendAlgorithm : public SendAlgorithmInterface {
(const QuicTagVector& connection_options), (override));
MOCK_METHOD(void, SetInitialCongestionWindowInPackets,
(QuicPacketCount packets), (override));
MOCK_METHOD(void, SetApplicationDrivenPacingRate,
(QuicBandwidth application_bandwidth_target), (override));
MOCK_METHOD(void, OnCongestionEvent,
(bool rtt_updated, QuicByteCount bytes_in_flight,
QuicTime event_time, const AckedPacketVector& acked_packets,
Expand Down

0 comments on commit 42b2e66

Please sign in to comment.