utility_function.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  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. #ifndef MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_
  11. #define MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_
  12. #include "modules/congestion_controller/pcc/monitor_interval.h"
  13. namespace webrtc {
  14. namespace pcc {
  15. // Utility function is used by PCC to transform the performance statistics
  16. // (sending rate, loss rate, packets latency) gathered at one monitor interval
  17. // into a numerical value.
  18. // https://www.usenix.org/conference/nsdi18/presentation/dong
  19. class PccUtilityFunctionInterface {
  20. public:
  21. virtual double Compute(const PccMonitorInterval& monitor_interval) const = 0;
  22. virtual ~PccUtilityFunctionInterface() = default;
  23. };
  24. // Vivace utility function were suggested in the paper "PCC Vivace:
  25. // Online-Learning Congestion Control", Mo Dong et all.
  26. class VivaceUtilityFunction : public PccUtilityFunctionInterface {
  27. public:
  28. VivaceUtilityFunction(double delay_gradient_coefficient,
  29. double loss_coefficient,
  30. double throughput_coefficient,
  31. double throughput_power,
  32. double delay_gradient_threshold,
  33. double delay_gradient_negative_bound);
  34. double Compute(const PccMonitorInterval& monitor_interval) const override;
  35. ~VivaceUtilityFunction() override;
  36. private:
  37. const double delay_gradient_coefficient_;
  38. const double loss_coefficient_;
  39. const double throughput_power_;
  40. const double throughput_coefficient_;
  41. const double delay_gradient_threshold_;
  42. const double delay_gradient_negative_bound_;
  43. };
  44. // This utility function were obtained by tuning Vivace utility function.
  45. // The main difference is that gradient of modified utilify funtion (as well as
  46. // rate updates) scales proportionally to the sending rate which leads to
  47. // better performance in case of single sender.
  48. class ModifiedVivaceUtilityFunction : public PccUtilityFunctionInterface {
  49. public:
  50. ModifiedVivaceUtilityFunction(double delay_gradient_coefficient,
  51. double loss_coefficient,
  52. double throughput_coefficient,
  53. double throughput_power,
  54. double delay_gradient_threshold,
  55. double delay_gradient_negative_bound);
  56. double Compute(const PccMonitorInterval& monitor_interval) const override;
  57. ~ModifiedVivaceUtilityFunction() override;
  58. private:
  59. const double delay_gradient_coefficient_;
  60. const double loss_coefficient_;
  61. const double throughput_power_;
  62. const double throughput_coefficient_;
  63. const double delay_gradient_threshold_;
  64. const double delay_gradient_negative_bound_;
  65. };
  66. } // namespace pcc
  67. } // namespace webrtc
  68. #endif // MODULES_CONGESTION_CONTROLLER_PCC_UTILITY_FUNCTION_H_