Reinstate killswitch for WebRTC-Bwe-ReceiverLimitCapsOnly.

Bug: webrtc:12306
Change-Id: Idd643c3152252732562553f207d0a6335773e98a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221043
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34211}
This commit is contained in:
Christoffer Rodbro
2021-06-02 13:27:36 +02:00
committed by WebRTC LUCI CQ
parent ab229b0706
commit f3ff3c5b77
3 changed files with 50 additions and 27 deletions

View File

@ -124,6 +124,35 @@ void UpdatesTargetRateBasedOnLinkCapacity(std::string test_name = "") {
truth->PrintRow();
EXPECT_NEAR(client->target_rate().kbps(), 90, 25);
}
DataRate RunRembDipScenario(std::string test_name) {
Scenario s(test_name);
NetworkSimulationConfig net_conf;
net_conf.bandwidth = DataRate::KilobitsPerSec(2000);
net_conf.delay = TimeDelta::Millis(50);
auto* client = s.CreateClient("send", [&](CallClientConfig* c) {
c->transport.rates.start_rate = DataRate::KilobitsPerSec(1000);
});
auto send_net = {s.CreateSimulationNode(net_conf)};
auto ret_net = {s.CreateSimulationNode(net_conf)};
auto* route = s.CreateRoutes(
client, send_net, s.CreateClient("return", CallClientConfig()), ret_net);
s.CreateVideoStream(route->forward(), VideoStreamConfig());
s.RunFor(TimeDelta::Seconds(10));
EXPECT_GT(client->send_bandwidth().kbps(), 1500);
DataRate RembLimit = DataRate::KilobitsPerSec(250);
client->SetRemoteBitrate(RembLimit);
s.RunFor(TimeDelta::Seconds(1));
EXPECT_EQ(client->send_bandwidth(), RembLimit);
DataRate RembLimitLifted = DataRate::KilobitsPerSec(10000);
client->SetRemoteBitrate(RembLimitLifted);
s.RunFor(TimeDelta::Seconds(10));
return client->send_bandwidth();
}
} // namespace
class GoogCcNetworkControllerTest : public ::testing::Test {
@ -851,31 +880,16 @@ TEST_F(GoogCcNetworkControllerTest, IsFairToTCP) {
}
TEST(GoogCcScenario, RampupOnRembCapLifted) {
Scenario s("googcc_unit/rampup_ramb_cap_lifted");
NetworkSimulationConfig net_conf;
net_conf.bandwidth = DataRate::KilobitsPerSec(2000);
net_conf.delay = TimeDelta::Millis(50);
auto* client = s.CreateClient("send", [&](CallClientConfig* c) {
c->transport.rates.start_rate = DataRate::KilobitsPerSec(1000);
});
auto send_net = {s.CreateSimulationNode(net_conf)};
auto ret_net = {s.CreateSimulationNode(net_conf)};
auto* route = s.CreateRoutes(
client, send_net, s.CreateClient("return", CallClientConfig()), ret_net);
s.CreateVideoStream(route->forward(), VideoStreamConfig());
DataRate final_estimate =
RunRembDipScenario("googcc_unit/rampup_ramb_cap_lifted");
EXPECT_GT(final_estimate.kbps(), 1500);
}
s.RunFor(TimeDelta::Seconds(10));
EXPECT_GT(client->send_bandwidth().kbps(), 1500);
DataRate RembLimit = DataRate::KilobitsPerSec(250);
client->SetRemoteBitrate(RembLimit);
s.RunFor(TimeDelta::Seconds(1));
EXPECT_EQ(client->send_bandwidth(), RembLimit);
DataRate RembLimitLifted = DataRate::KilobitsPerSec(10000);
client->SetRemoteBitrate(RembLimitLifted);
s.RunFor(TimeDelta::Seconds(10));
EXPECT_GT(client->send_bandwidth().kbps(), 1500);
TEST(GoogCcScenario, SlowRampupOnRembCapLiftedWithKillSwitch) {
ScopedFieldTrials trial("WebRTC-Bwe-ReceiverLimitCapsOnly/Disabled/");
DataRate final_estimate =
RunRembDipScenario("googcc_unit/slow_rampup_remb_cap_lifted_killswitch");
EXPECT_LT(final_estimate.kbps(), 1000);
}
} // namespace test

View File

@ -226,7 +226,8 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation(
low_loss_threshold_(kDefaultLowLossThreshold),
high_loss_threshold_(kDefaultHighLossThreshold),
bitrate_threshold_(kDefaultBitrateThreshold),
loss_based_bandwidth_estimation_(key_value_config) {
loss_based_bandwidth_estimation_(key_value_config),
disable_receiver_limit_caps_only_("Disabled") {
RTC_DCHECK(event_log);
if (BweLossExperimentIsEnabled()) {
uint32_t bitrate_threshold_kbps;
@ -239,6 +240,8 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation(
bitrate_threshold_ = DataRate::KilobitsPerSec(bitrate_threshold_kbps);
}
}
ParseFieldTrial({&disable_receiver_limit_caps_only_},
key_value_config->Lookup("WebRTC-Bwe-ReceiverLimitCapsOnly"));
}
SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {}
@ -307,7 +310,9 @@ int SendSideBandwidthEstimation::GetMinBitrate() const {
}
DataRate SendSideBandwidthEstimation::target_rate() const {
DataRate target = std::min(current_target_, receiver_limit_);
DataRate target = current_target_;
if (!disable_receiver_limit_caps_only_)
target = std::min(target, receiver_limit_);
return std::max(min_bitrate_configured_, target);
}
@ -579,7 +584,10 @@ void SendSideBandwidthEstimation::UpdateMinHistory(Timestamp at_time) {
}
DataRate SendSideBandwidthEstimation::GetUpperLimit() const {
return std::min(delay_based_limit_, max_bitrate_configured_);
DataRate upper_limit = delay_based_limit_;
if (disable_receiver_limit_caps_only_)
upper_limit = std::min(upper_limit, receiver_limit_);
return std::min(upper_limit, max_bitrate_configured_);
}
void SendSideBandwidthEstimation::MaybeLogLowBitrateWarning(DataRate bitrate,

View File

@ -190,6 +190,7 @@ class SendSideBandwidthEstimation {
float high_loss_threshold_;
DataRate bitrate_threshold_;
LossBasedBandwidthEstimation loss_based_bandwidth_estimation_;
FieldTrialFlag disable_receiver_limit_caps_only_;
};
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_SEND_SIDE_BANDWIDTH_ESTIMATION_H_