blob: b196156cefc7121e9e2cda7be61403be4331b9c3 [file] [log] [blame]
Anastasia Koloskovaddbbf462018-08-21 16:12:31 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_
12#define MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_
13
14#include "api/transport/network_control.h"
15#include "modules/congestion_controller/pcc/monitor_interval.h"
16
17namespace webrtc {
18namespace pcc {
19
20// Utility function is used by PCC to transform the performance statistics
21// (sending rate, loss rate, packets latency) gathered at one monitor interval
22// into a numerical value.
23// https://www.usenix.org/conference/nsdi18/presentation/dong
24class PccUtilityFunctionInterface {
25 public:
26 virtual double Compute(const PccMonitorInterval& monitor_interval) const = 0;
27 virtual ~PccUtilityFunctionInterface() = default;
28};
29
30// Vivace utility function were suggested in the paper "PCC Vivace:
31// Online-Learning Congestion Control", Mo Dong et all.
32class VivaceUtilityFunction : public PccUtilityFunctionInterface {
33 public:
34 VivaceUtilityFunction(double delay_gradient_coefficient,
35 double loss_coefficient,
36 double throughput_coefficient,
37 double throughput_power,
38 double delay_gradient_threshold,
39 double delay_gradient_negative_bound);
40 double Compute(const PccMonitorInterval& monitor_interval) const override;
41 ~VivaceUtilityFunction() override;
42
43 private:
44 const double delay_gradient_coefficient_;
45 const double loss_coefficient_;
46 const double throughput_power_;
47 const double throughput_coefficient_;
48 const double delay_gradient_threshold_;
49 const double delay_gradient_negative_bound_;
50};
51
52// This utility function were obtained by tuning Vivace utility function.
53// The main difference is that gradient of modified utilify funtion (as well as
54// rate updates) scales proportionally to the sending rate which leads to
55// better performance in case of single sender.
56class ModifiedVivaceUtilityFunction : public PccUtilityFunctionInterface {
57 public:
58 ModifiedVivaceUtilityFunction(double delay_gradient_coefficient,
59 double loss_coefficient,
60 double throughput_coefficient,
61 double throughput_power,
62 double delay_gradient_threshold,
63 double delay_gradient_negative_bound);
64 double Compute(const PccMonitorInterval& monitor_interval) const override;
65 ~ModifiedVivaceUtilityFunction() override;
66
67 private:
68 const double delay_gradient_coefficient_;
69 const double loss_coefficient_;
70 const double throughput_power_;
71 const double throughput_coefficient_;
72 const double delay_gradient_threshold_;
73 const double delay_gradient_negative_bound_;
74};
75
76} // namespace pcc
77} // namespace webrtc
78
79#endif // MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_