Removes overuse predictor.

It's not currently used and it complicates receive side estimation.

Bug: webrtc:10742
Change-Id: Iaa3c86807c7b637aea3ff393e728dc91eac23db6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/145724
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28623}
This commit is contained in:
Sebastian Jansson
2019-07-16 11:52:56 +02:00
committed by Commit Bot
parent 71c52a8002
commit 22ff9fc6bc
5 changed files with 1 additions and 136 deletions

View File

@ -21,8 +21,6 @@ rtc_static_library("goog_cc") {
sources = [
"goog_cc_network_control.cc",
"goog_cc_network_control.h",
"overuse_predictor.cc",
"overuse_predictor.h",
]
deps = [

View File

@ -98,7 +98,6 @@ GoogCcNetworkController::GoogCcNetworkController(NetworkControllerConfig config,
network_state_predictor_.get())),
acknowledged_bitrate_estimator_(
absl::make_unique<AcknowledgedBitrateEstimator>(key_value_config_)),
overuse_predictor_(key_value_config_),
initial_config_(config),
last_raw_target_rate_(*config.constraints.starting_rate),
last_pushback_target_rate_(last_raw_target_rate_),
@ -254,16 +253,7 @@ NetworkControlUpdate GoogCcNetworkController::OnSentPacket(
}
bandwidth_estimation_->OnSentPacket(sent_packet);
bool network_changed = false;
if (overuse_predictor_.Enabled()) {
overuse_predictor_.OnSentPacket(sent_packet);
if (estimate_ && overuse_predictor_.PredictOveruse(*estimate_)) {
DataRate new_target = delay_based_bwe_->TriggerOveruse(
sent_packet.send_time, acknowledged_bitrate_estimator_->bitrate());
bandwidth_estimation_->UpdateDelayBasedEstimate(sent_packet.send_time,
new_target);
network_changed = true;
}
}
if (congestion_window_pushback_controller_) {
congestion_window_pushback_controller_->UpdateOutstandingData(
sent_packet.data_in_flight.bytes());

View File

@ -32,7 +32,6 @@
#include "modules/congestion_controller/goog_cc/alr_detector.h"
#include "modules/congestion_controller/goog_cc/congestion_window_pushback_controller.h"
#include "modules/congestion_controller/goog_cc/delay_based_bwe.h"
#include "modules/congestion_controller/goog_cc/overuse_predictor.h"
#include "modules/congestion_controller/goog_cc/probe_controller.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
@ -103,7 +102,6 @@ class GoogCcNetworkController : public NetworkControllerInterface {
std::unique_ptr<NetworkStatePredictor> network_state_predictor_;
std::unique_ptr<DelayBasedBwe> delay_based_bwe_;
std::unique_ptr<AcknowledgedBitrateEstimator> acknowledged_bitrate_estimator_;
OverusePredictor overuse_predictor_;
absl::optional<NetworkControllerConfig> initial_config_;

View File

@ -1,72 +0,0 @@
/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/congestion_controller/goog_cc/overuse_predictor.h"
#include <algorithm>
namespace webrtc {
namespace {
constexpr int kMaxPendingPackets = 100;
DataRate GetAvailableCapacity(const NetworkStateEstimate& est,
double deviation) {
double capacity_bps = est.link_capacity.bps();
double min_capacity_bps = est.link_capacity_min.bps();
double deviation_bps = est.link_capacity_std_dev.bps();
return DataRate::bps(
std::max(capacity_bps + deviation_bps * deviation, min_capacity_bps));
}
} // namespace
OverusePredictorConfig::OverusePredictorConfig(const std::string& config) {
ParseFieldTrial({&enabled, &capacity_dev_ratio_threshold, &capacity_deviation,
&delay_threshold},
config);
}
OverusePredictor::OverusePredictor(const WebRtcKeyValueConfig* config)
: conf_(config->Lookup("WebRTC-Bwe-OverusePredictor")) {}
bool OverusePredictor::Enabled() const {
return conf_.enabled;
}
void OverusePredictor::OnSentPacket(SentPacket sent_packet) {
pending_.push_back(SentPacketInfo{sent_packet.send_time, sent_packet.size});
if (pending_.size() > kMaxPendingPackets)
pending_.pop_front();
}
bool OverusePredictor::PredictOveruse(const NetworkStateEstimate& est) {
while (!pending_.empty() && pending_.front().send_time < est.last_send_time) {
pending_.pop_front();
}
double deviation_ratio = est.link_capacity_std_dev / est.link_capacity;
if (deviation_ratio > conf_.capacity_dev_ratio_threshold)
return false;
TimeDelta buffer_delay = PredictDelay(est) - est.propagation_delay;
return buffer_delay > conf_.delay_threshold;
}
TimeDelta OverusePredictor::PredictDelay(const NetworkStateEstimate& est) {
auto safe_capacity = GetAvailableCapacity(est, conf_.capacity_deviation);
Timestamp last_send_time = est.last_send_time;
TimeDelta link_delay = est.pre_link_buffer_delay;
for (const auto& packet : pending_) {
auto delta = packet.send_time - last_send_time;
last_send_time = packet.send_time;
link_delay = std::max(link_delay - delta, est.propagation_delay);
link_delay += packet.size / safe_capacity;
}
return link_delay;
}
} // namespace webrtc

View File

@ -1,49 +0,0 @@
/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_CONGESTION_CONTROLLER_GOOG_CC_OVERUSE_PREDICTOR_H_
#define MODULES_CONGESTION_CONTROLLER_GOOG_CC_OVERUSE_PREDICTOR_H_
#include <deque>
#include <string>
#include "api/transport/network_types.h"
#include "api/transport/webrtc_key_value_config.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/experiments/field_trial_units.h"
namespace webrtc {
struct OverusePredictorConfig {
FieldTrialFlag enabled{"Enabled"};
FieldTrialParameter<double> capacity_dev_ratio_threshold{"dev_thr", 0.2};
FieldTrialParameter<double> capacity_deviation{"cap_dev", -1};
FieldTrialParameter<TimeDelta> delay_threshold{"del_thr", TimeDelta::ms(100)};
explicit OverusePredictorConfig(const std::string& config);
};
class OverusePredictor {
public:
explicit OverusePredictor(const WebRtcKeyValueConfig* config);
void OnSentPacket(SentPacket sent_packet);
bool Enabled() const;
bool PredictOveruse(const NetworkStateEstimate& est);
private:
struct SentPacketInfo {
Timestamp send_time;
DataSize size;
};
TimeDelta PredictDelay(const NetworkStateEstimate& est);
const OverusePredictorConfig conf_;
std::deque<SentPacketInfo> pending_;
};
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_GOOG_CC_OVERUSE_PREDICTOR_H_