OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 private: | 61 private: |
62 std::vector<PacketSender*> senders_; | 62 std::vector<PacketSender*> senders_; |
63 std::vector<PacketReceiver*> receivers_; | 63 std::vector<PacketReceiver*> receivers_; |
64 std::vector<PacketProcessorRunner> processors_; | 64 std::vector<PacketProcessorRunner> processors_; |
65 }; | 65 }; |
66 | 66 |
67 class BweTest { | 67 class BweTest { |
68 public: | 68 public: |
69 BweTest(); | 69 BweTest(); |
| 70 explicit BweTest(bool plot_capacity); |
70 ~BweTest(); | 71 ~BweTest(); |
71 | 72 |
| 73 void RunChoke(BandwidthEstimatorType bwe_type, |
| 74 std::vector<int> capacities_kbps); |
| 75 |
| 76 void RunVariableCapacity1SingleFlow(BandwidthEstimatorType bwe_type); |
| 77 void RunVariableCapacity2MultipleFlows(BandwidthEstimatorType bwe_type, |
| 78 size_t num_flows); |
| 79 void RunBidirectionalFlow(BandwidthEstimatorType bwe_type); |
| 80 void RunSelfFairness(BandwidthEstimatorType bwe_type); |
| 81 void RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type); |
| 82 void RunLongTcpFairness(BandwidthEstimatorType bwe_type); |
| 83 void RunMultipleShortTcpFairness(BandwidthEstimatorType bwe_type, |
| 84 std::vector<int> tcp_file_sizes_bytes, |
| 85 std::vector<int64_t> tcp_starting_times_ms); |
| 86 void RunPauseResumeFlows(BandwidthEstimatorType bwe_type); |
| 87 |
| 88 void RunFairnessTest(BandwidthEstimatorType bwe_type, |
| 89 size_t num_media_flows, |
| 90 size_t num_tcp_flows, |
| 91 int64_t run_time_seconds, |
| 92 uint32_t capacity_kbps, |
| 93 int64_t max_delay_ms, |
| 94 int64_t rtt_ms, |
| 95 int64_t max_jitter_ms, |
| 96 const int64_t* offsets_ms); |
| 97 |
| 98 void RunFairnessTest(BandwidthEstimatorType bwe_type, |
| 99 size_t num_media_flows, |
| 100 size_t num_tcp_flows, |
| 101 int64_t run_time_seconds, |
| 102 uint32_t capacity_kbps, |
| 103 int64_t max_delay_ms, |
| 104 int64_t rtt_ms, |
| 105 int64_t max_jitter_ms, |
| 106 const int64_t* offsets_ms, |
| 107 const std::string& title, |
| 108 const std::string& flow_name); |
| 109 |
| 110 static std::vector<int> GetFileSizesBytes(int num_files); |
| 111 static std::vector<int64_t> GetStartingTimesMs(int num_files); |
| 112 |
72 protected: | 113 protected: |
73 void SetUp(); | 114 void SetUp(); |
74 | 115 |
75 void VerboseLogging(bool enable); | 116 void VerboseLogging(bool enable); |
76 void RunFor(int64_t time_ms); | 117 void RunFor(int64_t time_ms); |
77 std::string GetTestName() const; | 118 std::string GetTestName() const; |
78 | 119 |
79 void PrintResults(double max_throughput_kbps, | 120 void PrintResults(double max_throughput_kbps, |
80 Stats<double> throughput_kbps, | 121 Stats<double> throughput_kbps, |
81 int flow_id, | 122 int flow_id, |
82 Stats<double> flow_delay_ms, | 123 Stats<double> flow_delay_ms, |
83 Stats<double> flow_throughput_kbps); | 124 Stats<double> flow_throughput_kbps); |
84 | 125 |
85 void PrintResults(double max_throughput_kbps, | 126 void PrintResults(double max_throughput_kbps, |
86 Stats<double> throughput_kbps, | 127 Stats<double> throughput_kbps, |
87 std::map<int, Stats<double>> flow_delay_ms, | 128 std::map<int, Stats<double>> flow_delay_ms, |
88 std::map<int, Stats<double>> flow_throughput_kbps); | 129 std::map<int, Stats<double>> flow_throughput_kbps); |
89 | 130 |
90 void RunFairnessTest(BandwidthEstimatorType bwe_type, | |
91 size_t num_media_flows, | |
92 size_t num_tcp_flows, | |
93 int64_t run_time_seconds, | |
94 int capacity_kbps, | |
95 int max_delay_ms); | |
96 | |
97 Link downlink_; | 131 Link downlink_; |
98 Link uplink_; | 132 Link uplink_; |
99 | 133 |
100 private: | 134 private: |
101 void FindPacketsToProcess(const FlowIds& flow_ids, Packets* in, | 135 void FindPacketsToProcess(const FlowIds& flow_ids, Packets* in, |
102 Packets* out); | 136 Packets* out); |
103 void GiveFeedbackToAffectedSenders(PacketReceiver* receiver); | 137 void GiveFeedbackToAffectedSenders(PacketReceiver* receiver); |
104 | 138 |
105 int64_t run_time_ms_; | 139 int64_t run_time_ms_; |
106 int64_t time_now_ms_; | 140 int64_t time_now_ms_; |
107 int64_t simulation_interval_ms_; | 141 int64_t simulation_interval_ms_; |
108 std::vector<Link*> links_; | 142 std::vector<Link*> links_; |
109 Packets packets_; | 143 Packets packets_; |
| 144 bool plot_total_available_capacity_; |
110 | 145 |
111 DISALLOW_COPY_AND_ASSIGN(BweTest); | 146 DISALLOW_COPY_AND_ASSIGN(BweTest); |
112 }; | 147 }; |
| 148 |
| 149 // Default Evaluation parameters: |
| 150 // Link capacity: 4000ms; |
| 151 // Queueing delay capacity: 300ms. |
| 152 // One-Way propagation delay: 50ms. |
| 153 // Jitter model: Truncated gaussian. |
| 154 // Maximum end-to-end jitter: 30ms = 2*standard_deviation. |
| 155 // Bottleneck queue type: Drop tail. |
| 156 // Path loss ratio: 0%. |
| 157 |
| 158 const int kOneWayDelayMs = 50; |
| 159 const int kMaxQueueingDelayMs = 300; |
| 160 const int kMaxCapacityKbps = 4000; |
| 161 const int kMaxJitterMs = 15; |
| 162 |
| 163 struct DefaultEvaluationFilter { |
| 164 DefaultEvaluationFilter(PacketProcessorListener* listener, int flow_id) |
| 165 : choke(listener, flow_id), |
| 166 delay(listener, flow_id), |
| 167 jitter(listener, flow_id) { |
| 168 SetDefaultParameters(); |
| 169 } |
| 170 |
| 171 DefaultEvaluationFilter(PacketProcessorListener* listener, |
| 172 const FlowIds& flow_ids) |
| 173 : choke(listener, flow_ids), |
| 174 delay(listener, flow_ids), |
| 175 jitter(listener, flow_ids) { |
| 176 SetDefaultParameters(); |
| 177 } |
| 178 |
| 179 void SetDefaultParameters() { |
| 180 delay.SetOneWayDelayMs(kOneWayDelayMs); |
| 181 choke.set_max_delay_ms(kMaxQueueingDelayMs); |
| 182 choke.set_capacity_kbps(kMaxCapacityKbps); |
| 183 jitter.SetMaxJitter(kMaxJitterMs); |
| 184 } |
| 185 |
| 186 ChokeFilter choke; |
| 187 DelayFilter delay; |
| 188 JitterFilter jitter; |
| 189 }; |
| 190 |
113 } // namespace bwe | 191 } // namespace bwe |
114 } // namespace testing | 192 } // namespace testing |
115 } // namespace webrtc | 193 } // namespace webrtc |
116 | 194 |
117 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_H_ | 195 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_H_ |
OLD | NEW |