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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 ~BweTest(); | 70 ~BweTest(); |
71 | 71 |
72 void RunChoke(BandwidthEstimatorType bwe_type, | |
73 std::vector<int> capacities_kbps); | |
74 | |
75 void RunVariableCapacitySingleFlow(BandwidthEstimatorType bwe_type); | |
76 void RunVariableCapacityTwoFlows(BandwidthEstimatorType bwe_type); | |
77 void RunBidirectionalFlow(BandwidthEstimatorType bwe_type); | |
78 void RunRoundTripTimeFairness(BandwidthEstimatorType bwe_type); | |
79 void RunLongTcpFairness(BandwidthEstimatorType bwe_type); | |
80 void RunMultipleShortTcpFairness(BandwidthEstimatorType bwe_type, | |
81 std::vector<int> tcp_file_sizes_bytes, | |
82 std::vector<int64_t> tcp_starting_times_ms); | |
83 void RunPauseResumeFlows(BandwidthEstimatorType bwe_type); | |
84 | |
85 void RunFairnessTest(BandwidthEstimatorType bwe_type, | |
86 size_t num_media_flows, | |
87 size_t num_tcp_flows, | |
88 int64_t run_time_seconds, | |
89 int capacity_kbps, | |
90 int64_t max_delay_ms, | |
91 int64_t rtt_ms, | |
92 int64_t max_jitter_ms, | |
93 const int64_t* offsets_ms); | |
94 | |
95 void set_plot_available_capacity(bool plot) { | |
96 plot_total_available_capacity_ = plot; | |
97 } | |
98 | |
99 static std::vector<int> GetFileSizesBytes(int num_files); | |
100 static std::vector<int64_t> GetStartingTimesMs(int num_files); | |
101 | |
72 protected: | 102 protected: |
73 void SetUp(); | 103 void SetUp(); |
74 | 104 |
75 void VerboseLogging(bool enable); | 105 void VerboseLogging(bool enable); |
76 void RunFor(int64_t time_ms); | 106 void RunFor(int64_t time_ms); |
77 std::string GetTestName() const; | 107 std::string GetTestName() const; |
78 | 108 |
79 void PrintResults(double max_throughput_kbps, | 109 void PrintResults(double max_throughput_kbps, |
80 Stats<double> throughput_kbps, | 110 Stats<double> throughput_kbps, |
81 int flow_id, | 111 int flow_id, |
82 Stats<double> flow_delay_ms, | 112 Stats<double> flow_delay_ms, |
83 Stats<double> flow_throughput_kbps); | 113 Stats<double> flow_throughput_kbps); |
84 | 114 |
85 void PrintResults(double max_throughput_kbps, | 115 void PrintResults(double max_throughput_kbps, |
86 Stats<double> throughput_kbps, | 116 Stats<double> throughput_kbps, |
87 std::map<int, Stats<double>> flow_delay_ms, | 117 std::map<int, Stats<double>> flow_delay_ms, |
88 std::map<int, Stats<double>> flow_throughput_kbps); | 118 std::map<int, Stats<double>> flow_throughput_kbps); |
89 | 119 |
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_; | 120 Link downlink_; |
98 Link uplink_; | 121 Link uplink_; |
99 | 122 |
100 private: | 123 private: |
101 void FindPacketsToProcess(const FlowIds& flow_ids, Packets* in, | 124 void FindPacketsToProcess(const FlowIds& flow_ids, Packets* in, |
102 Packets* out); | 125 Packets* out); |
103 void GiveFeedbackToAffectedSenders(PacketReceiver* receiver); | 126 void GiveFeedbackToAffectedSenders(PacketReceiver* receiver); |
104 | 127 |
105 int64_t run_time_ms_; | 128 int64_t run_time_ms_; |
106 int64_t time_now_ms_; | 129 int64_t time_now_ms_; |
107 int64_t simulation_interval_ms_; | 130 int64_t simulation_interval_ms_; |
108 std::vector<Link*> links_; | 131 std::vector<Link*> links_; |
109 Packets packets_; | 132 Packets packets_; |
133 bool plot_total_available_capacity_; | |
110 | 134 |
111 DISALLOW_COPY_AND_ASSIGN(BweTest); | 135 DISALLOW_COPY_AND_ASSIGN(BweTest); |
112 }; | 136 }; |
137 | |
138 // Default Evaluation parameters: | |
139 // Link capacity: 4000ms; | |
140 // Queueing delay capacity: 300ms. | |
141 // One-Way propagation delay: 50ms. | |
142 // Jitter model: Truncated gaussian. | |
143 // Maximum end-to-end jitter: 30ms = 2*standard_deviation. | |
144 // Bottleneck queue type: Drop tail. | |
145 // Path loss ratio: 0%. | |
146 | |
147 const int kOneWayDelayMs = 50; | |
148 const int kMaxQueueingDelayMs = 300; | |
149 const int kMaxCapacityKbps = 4000; | |
150 const int kMaxJitterMs = 15; | |
151 | |
152 struct DefaultEvaluationFilter { | |
153 DefaultEvaluationFilter(PacketProcessorListener* listener, int flow_id) | |
154 : choke(listener, flow_id), | |
155 delay(listener, flow_id), | |
156 jitter(listener, flow_id) { | |
157 SetDefaultParameters(this); | |
158 } | |
159 | |
160 DefaultEvaluationFilter(PacketProcessorListener* listener, | |
161 const FlowIds& flow_ids) | |
162 : choke(listener, flow_ids), | |
163 delay(listener, flow_ids), | |
164 jitter(listener, flow_ids) { | |
165 SetDefaultParameters(this); | |
stefan-webrtc
2015/07/21 12:12:32
This is weird. Why not just SetDefaultParameters()
magalhaesc
2015/07/21 14:46:53
Right.
It was supposed to be static, but actually
| |
166 } | |
167 | |
168 void SetDefaultParameters(DefaultEvaluationFilter* filter) { | |
169 filter->delay.SetOneWayDelayMs(kOneWayDelayMs); | |
170 filter->choke.set_max_delay_ms(kMaxQueueingDelayMs); | |
171 filter->choke.set_capacity_kbps(kMaxCapacityKbps); | |
172 filter->jitter.SetMaxJitter(kMaxJitterMs); | |
173 } | |
174 | |
175 ChokeFilter choke; | |
176 DelayFilter delay; | |
177 JitterFilter jitter; | |
178 }; | |
179 | |
113 } // namespace bwe | 180 } // namespace bwe |
114 } // namespace testing | 181 } // namespace testing |
115 } // namespace webrtc | 182 } // namespace webrtc |
116 | 183 |
117 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_H_ | 184 #endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_BWE_TEST_H_ |
OLD | NEW |