Adds initial data window field trial to GoogCC.
Bug: webrtc:9718 Change-Id: Ia5a77a09d7ba82b545e9ab12036f717765fdf3b4 Reviewed-on: https://webrtc-review.googlesource.com/97740 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24659}
This commit is contained in:

committed by
Commit Bot

parent
9be7745509
commit
57606328f6
@ -38,6 +38,7 @@ rtc_static_library("goog_cc") {
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:rtc_base_approved",
|
||||
"../../../rtc_base/experiments:alr_experiment",
|
||||
"../../../rtc_base/experiments:field_trial_parser",
|
||||
"../../../system_wrappers",
|
||||
"../../../system_wrappers:field_trial_api",
|
||||
"../../../system_wrappers:metrics_api",
|
||||
|
@ -54,7 +54,6 @@ bool CwndExperimentEnabled() {
|
||||
// The experiment is enabled iff the field trial string begins with "Enabled".
|
||||
return experiment_string.find("Enabled") == 0;
|
||||
}
|
||||
|
||||
bool ReadCwndExperimentParameter(int64_t* accepted_queue_ms) {
|
||||
RTC_DCHECK(accepted_queue_ms);
|
||||
std::string experiment_string =
|
||||
@ -115,6 +114,16 @@ int64_t GetBpsOrDefault(const absl::optional<DataRate>& rate,
|
||||
|
||||
} // namespace
|
||||
|
||||
InitialDataWindowConfig::InitialDataWindowConfig()
|
||||
: size("size", DataSize::Infinity()), exit_rate_factor("rate", 1.0) {
|
||||
std::string trial_string =
|
||||
field_trial::FindFullName("WebRTC-Bwe-InitialDataWindow");
|
||||
ParseFieldTrial({&size, &exit_rate_factor}, trial_string);
|
||||
}
|
||||
InitialDataWindowConfig::InitialDataWindowConfig(
|
||||
const InitialDataWindowConfig&) = default;
|
||||
InitialDataWindowConfig::~InitialDataWindowConfig() = default;
|
||||
|
||||
GoogCcNetworkController::GoogCcNetworkController(RtcEventLog* event_log,
|
||||
NetworkControllerConfig config,
|
||||
bool feedback_only)
|
||||
@ -128,6 +137,7 @@ GoogCcNetworkController::GoogCcNetworkController(RtcEventLog* event_log,
|
||||
acknowledged_bitrate_estimator_(
|
||||
absl::make_unique<AcknowledgedBitrateEstimator>()),
|
||||
initial_config_(config),
|
||||
initial_data_window_(InitialDataWindowConfig()),
|
||||
last_bandwidth_(*config.constraints.starting_rate),
|
||||
pacing_factor_(config.stream_based_config.pacing_factor.value_or(
|
||||
kDefaultPaceMultiplier)),
|
||||
@ -249,7 +259,15 @@ NetworkControlUpdate GoogCcNetworkController::OnSentPacket(
|
||||
SentPacket sent_packet) {
|
||||
alr_detector_->OnBytesSent(sent_packet.size.bytes(),
|
||||
sent_packet.send_time.ms());
|
||||
return NetworkControlUpdate();
|
||||
if (initial_state_ == InitialState::kWaitingForEstimate &&
|
||||
sent_packet.data_in_flight > initial_data_window_.size) {
|
||||
initial_state_ = InitialState::kWindowFullWaitingForEstimate;
|
||||
NetworkControlUpdate update;
|
||||
MaybeTriggerOnNetworkChanged(&update, sent_packet.send_time);
|
||||
return update;
|
||||
} else {
|
||||
return NetworkControlUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
NetworkControlUpdate GoogCcNetworkController::OnStreamsConfig(
|
||||
@ -395,10 +413,19 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
|
||||
previously_in_alr = alr_start_time.has_value();
|
||||
acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(
|
||||
received_feedback_vector);
|
||||
auto acknowledged_bitrate = acknowledged_bitrate_estimator_->bitrate_bps();
|
||||
DelayBasedBwe::Result result;
|
||||
result = delay_based_bwe_->IncomingPacketFeedbackVector(
|
||||
received_feedback_vector, acknowledged_bitrate_estimator_->bitrate_bps(),
|
||||
received_feedback_vector, acknowledged_bitrate,
|
||||
report.feedback_time.ms());
|
||||
|
||||
if (acknowledged_bitrate || result.probe) {
|
||||
if (initial_state_ == InitialState::kWindowFullWaitingForEstimate)
|
||||
delay_based_bwe_->SetStartBitrate(result.target_bitrate_bps *
|
||||
initial_data_window_.exit_rate_factor);
|
||||
initial_state_ = InitialState::kReceivedEstimate;
|
||||
}
|
||||
|
||||
NetworkControlUpdate update;
|
||||
if (result.updated) {
|
||||
if (result.probe) {
|
||||
@ -473,6 +500,9 @@ void GoogCcNetworkController::MaybeTriggerOnNetworkChanged(
|
||||
estimated_bitrate_bps = std::max<int32_t>(
|
||||
estimated_bitrate_bps, bandwidth_estimation_->GetMinBitrate());
|
||||
|
||||
if (initial_state_ == InitialState::kWindowFullWaitingForEstimate)
|
||||
estimated_bitrate_bps = bandwidth_estimation_->GetMinBitrate();
|
||||
|
||||
BWE_TEST_LOGGING_PLOT(1, "fraction_loss_%", at_time.ms(),
|
||||
(fraction_loss * 100) / 256);
|
||||
BWE_TEST_LOGGING_PLOT(1, "rtt_ms", at_time.ms(), rtt_ms);
|
||||
@ -526,4 +556,5 @@ PacerConfig GoogCcNetworkController::GetPacingRates(Timestamp at_time) const {
|
||||
msg.pad_window = padding_rate * msg.time_window;
|
||||
return msg;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -25,9 +25,19 @@
|
||||
#include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
|
||||
#include "modules/congestion_controller/goog_cc/probe_controller.h"
|
||||
#include "rtc_base/constructormagic.h"
|
||||
#include "rtc_base/experiments/field_trial_parser.h"
|
||||
#include "rtc_base/experiments/field_trial_units.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
struct InitialDataWindowConfig {
|
||||
InitialDataWindowConfig();
|
||||
InitialDataWindowConfig(const InitialDataWindowConfig&);
|
||||
~InitialDataWindowConfig();
|
||||
FieldTrialParameter<DataSize> size;
|
||||
FieldTrialParameter<double> exit_rate_factor;
|
||||
};
|
||||
|
||||
class GoogCcNetworkController : public NetworkControllerInterface {
|
||||
public:
|
||||
GoogCcNetworkController(RtcEventLog* event_log,
|
||||
@ -53,6 +63,11 @@ class GoogCcNetworkController : public NetworkControllerInterface {
|
||||
|
||||
private:
|
||||
friend class GoogCcStatePrinter;
|
||||
enum class InitialState {
|
||||
kWaitingForEstimate,
|
||||
kWindowFullWaitingForEstimate,
|
||||
kReceivedEstimate
|
||||
};
|
||||
std::vector<ProbeClusterConfig> UpdateBitrateConstraints(
|
||||
TargetRateConstraints constraints,
|
||||
absl::optional<DataRate> starting_rate);
|
||||
@ -72,6 +87,9 @@ class GoogCcNetworkController : public NetworkControllerInterface {
|
||||
|
||||
absl::optional<NetworkControllerConfig> initial_config_;
|
||||
|
||||
const InitialDataWindowConfig initial_data_window_;
|
||||
InitialState initial_state_ = InitialState::kWaitingForEstimate;
|
||||
|
||||
Timestamp next_loss_update_ = Timestamp::MinusInfinity();
|
||||
int lost_packets_since_last_loss_update_ = 0;
|
||||
int expected_packets_since_last_loss_update_ = 0;
|
||||
|
Reference in New Issue
Block a user