OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 for (size_t i = 0; i < kNumFlows; ++i) { | 263 for (size_t i = 0; i < kNumFlows; ++i) { |
264 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], GetParam(), | 264 receivers[i].reset(new PacketReceiver(&uplink_, kAllFlowIds[i], GetParam(), |
265 i == 0, false)); | 265 i == 0, false)); |
266 } | 266 } |
267 | 267 |
268 RunFor(30 * 60 * 1000); | 268 RunFor(30 * 60 * 1000); |
269 } | 269 } |
270 | 270 |
271 TEST_P(BweSimulation, PacedSelfFairness50msTest) { | 271 TEST_P(BweSimulation, PacedSelfFairness50msTest) { |
272 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 272 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
273 RunFairnessTest(GetParam(), 4, 0, 1000, 3000, 50); | 273 Random random(0x12345678); |
stefan-webrtc
2015/07/21 12:12:32
I'd prefer if these (PacedSelfFairness*) by defaul
magalhaesc
2015/07/21 14:46:53
Done.
stefan-webrtc
2015/07/22 09:30:29
I think you misunderstood. I wanted you to not hav
magalhaesc
2015/07/22 11:22:54
Yes, I had misunderstood. Since we're using the me
| |
274 const int64_t kAverageOffsetMs = 20 * 1000; | |
275 const int kNumRmcatFlows = 4; | |
276 int64_t offsets_ms[kNumRmcatFlows]; | |
277 offsets_ms[0] = static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
278 for (int i = 1; i < kNumRmcatFlows; ++i) { | |
279 offsets_ms[i] = offsets_ms[i - 1] + | |
280 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
281 } | |
282 RunFairnessTest(GetParam(), kNumRmcatFlows, 0, 1000, 3000, 50, 50, 0, | |
283 offsets_ms); | |
274 } | 284 } |
275 | 285 |
276 TEST_P(BweSimulation, PacedSelfFairness500msTest) { | 286 TEST_P(BweSimulation, PacedSelfFairness500msTest) { |
277 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 287 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
278 RunFairnessTest(GetParam(), 4, 0, 1000, 3000, 500); | 288 Random random(0x12345678); |
289 const int64_t kAverageOffsetMs = 20 * 1000; | |
290 const int kNumRmcatFlows = 4; | |
291 int64_t offsets_ms[kNumRmcatFlows]; | |
292 offsets_ms[0] = static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
293 for (int i = 1; i < kNumRmcatFlows; ++i) { | |
294 offsets_ms[i] = offsets_ms[i - 1] + | |
295 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
296 } | |
297 RunFairnessTest(GetParam(), kNumRmcatFlows, 0, 1000, 3000, 500, 50, 0, | |
298 offsets_ms); | |
279 } | 299 } |
280 | 300 |
281 TEST_P(BweSimulation, PacedSelfFairness1000msTest) { | 301 TEST_P(BweSimulation, PacedSelfFairness1000msTest) { |
282 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 302 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
283 RunFairnessTest(GetParam(), 4, 0, 1000, 3000, 1000); | 303 Random random(0x12345678); |
304 const int64_t kAverageOffsetMs = 20 * 1000; | |
305 const int kNumRmcatFlows = 4; | |
306 int64_t offsets_ms[kNumRmcatFlows]; | |
307 offsets_ms[0] = static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
308 for (int i = 1; i < kNumRmcatFlows; ++i) { | |
309 offsets_ms[i] = offsets_ms[i - 1] + | |
310 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
311 } | |
312 RunFairnessTest(GetParam(), 4, 0, 1000, 3000, 1000, 50, 0, offsets_ms); | |
284 } | 313 } |
285 | 314 |
286 TEST_P(BweSimulation, TcpFairness50msTest) { | 315 TEST_P(BweSimulation, TcpFairness50msTest) { |
287 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 316 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
288 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 50); | 317 Random random(0x12345678); |
stefan-webrtc
2015/07/21 12:12:31
Same for TcpFairness*Test
magalhaesc
2015/07/21 14:46:53
Done.
| |
318 const int64_t kAverageOffsetMs = 20 * 1000; | |
319 int64_t offset_ms = | |
320 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
321 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 50, 50, 0, &offset_ms); | |
289 } | 322 } |
290 | 323 |
291 TEST_P(BweSimulation, TcpFairness500msTest) { | 324 TEST_P(BweSimulation, TcpFairness500msTest) { |
292 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 325 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
293 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 500); | 326 Random random(0x12345678); |
327 const int64_t kAverageOffsetMs = 20 * 1000; | |
328 int64_t offset_ms = | |
329 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
330 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 500, 50, 0, &offset_ms); | |
294 } | 331 } |
295 | 332 |
296 TEST_P(BweSimulation, TcpFairness1000msTest) { | 333 TEST_P(BweSimulation, TcpFairness1000msTest) { |
297 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); | 334 srand(Clock::GetRealTimeClock()->TimeInMicroseconds()); |
298 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 1000); | 335 Random random(0x12345678); |
336 const int kAverageOffsetMs = 20 * 1000; | |
337 int64_t offset_ms = | |
338 static_cast<int64_t>(random.Rand(0, 2 * kAverageOffsetMs)); | |
339 RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 1000, 50, 0, &offset_ms); | |
340 } | |
341 | |
342 // Following test cases begin with "Evaluation" as a referrence to the | |
stefan-webrtc
2015/07/21 12:12:31
The following...
magalhaesc
2015/07/21 14:46:53
Done.
| |
343 // Internet draft https://tools.ietf.org/html/draft-ietf-rmcat-eval-test-01. | |
344 | |
345 TEST_P(BweSimulation, Evaluation1) { | |
346 this->RunVariableCapacitySingleFlow(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->.
magalhaesc
2015/07/21 14:46:53
Done.
| |
347 } | |
348 | |
349 TEST_P(BweSimulation, Evaluation2) { | |
350 this->RunVariableCapacityTwoFlows(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->.
Can we generalize RunVariableCapac
magalhaesc
2015/07/21 14:46:53
They test different variations in capacity. Names
stefan-webrtc
2015/07/22 09:30:29
Thanks! Maybe also make it possible to pass in the
magalhaesc
2015/07/22 11:22:54
Yes, it will be better. Done.
| |
351 } | |
352 | |
353 TEST_P(BweSimulation, Evaluation3) { | |
354 this->RunBidirectionalFlow(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->.
magalhaesc
2015/07/21 14:46:53
Done.
| |
355 } | |
356 | |
357 // 5.4. Three forward direction competing flows, constant capacity. | |
358 TEST_P(BweSimulation, Evaluation4) { | |
359 const int kNumRmcatFlows = 3; | |
360 const int kNumTcpFlows = 0; | |
361 const int64_t kRunTimeS = 120; | |
362 const int kLinkCapacity = 3500; | |
363 | |
364 const int64_t kStartingApartMs = 20 * 1000; | |
365 int64_t offsets_ms[kNumRmcatFlows]; | |
366 for (int i = 0; i < kNumRmcatFlows; ++i) { | |
367 offsets_ms[i] = kStartingApartMs * i; | |
368 } | |
369 | |
370 // Test also with one way propagation delay = 100ms. | |
371 RunFairnessTest(GetParam(), kNumRmcatFlows, kNumTcpFlows, kRunTimeS, | |
372 kLinkCapacity, kMaxQueueingDelayMs, 2 * kOneWayDelayMs, | |
373 kMaxJitterMs, offsets_ms); | |
374 } | |
375 | |
376 TEST_P(BweSimulation, Evaluation5) { | |
377 this->RunRoundTripTimeFairness(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->
magalhaesc
2015/07/21 14:46:53
Done.
| |
378 } | |
379 | |
380 TEST_P(BweSimulation, Evaluation6) { | |
381 this->RunLongTcpFairness(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->
Btw, can this be implemented with R
magalhaesc
2015/07/21 14:46:53
Yes, with a few modifications
magalhaesc
2015/07/21 14:46:53
Done.
| |
382 } | |
383 | |
384 // Different calls to the Evaluation7 will create the same FileSizes | |
385 // and StartingTimes as long as the seeds remain unchanged. This is essential | |
386 // when calling it with multiple estimators for comparison purposes. | |
387 TEST_P(BweSimulation, Evaluation7) { | |
388 const int kNumTcpFiles = 10; | |
389 this->RunMultipleShortTcpFairness(GetParam(), | |
stefan-webrtc
2015/07/21 12:12:31
Remove this->
magalhaesc
2015/07/21 14:46:53
Done.
| |
390 BweTest::GetFileSizesBytes(kNumTcpFiles), | |
391 BweTest::GetStartingTimesMs(kNumTcpFiles)); | |
392 } | |
393 | |
394 TEST_P(BweSimulation, Evaluation8) { | |
395 this->RunPauseResumeFlows(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:32
Remove this->
magalhaesc
2015/07/21 14:46:53
Done.
| |
396 } | |
397 | |
398 // Following test cases begin with "GccComparison" run the | |
399 // evaluation test cases for both GCC and other calling RMCAT. | |
400 | |
401 TEST_P(BweSimulation, GccComparison1) { | |
402 this->RunVariableCapacitySingleFlow(GetParam()); | |
stefan-webrtc
2015/07/21 12:12:31
Remove this-> here and all below.
magalhaesc
2015/07/21 14:46:53
Done.
| |
403 BweTest gcc_test; | |
404 gcc_test.set_plot_available_capacity(false); | |
stefan-webrtc
2015/07/21 12:12:31
Maybe make this part of a second constructor of Bw
magalhaesc
2015/07/21 14:46:53
Done.
| |
405 gcc_test.RunVariableCapacitySingleFlow(kFullSendSideEstimator); | |
406 } | |
407 | |
408 TEST_P(BweSimulation, GccComparison2) { | |
409 this->RunVariableCapacityTwoFlows(GetParam()); | |
410 BweTest gcc_test; | |
411 gcc_test.set_plot_available_capacity(false); | |
412 gcc_test.RunVariableCapacityTwoFlows(kFullSendSideEstimator); | |
413 } | |
414 | |
415 TEST_P(BweSimulation, GccComparison3) { | |
416 this->RunBidirectionalFlow(GetParam()); | |
417 BweTest gcc_test; | |
418 gcc_test.set_plot_available_capacity(false); | |
419 gcc_test.RunBidirectionalFlow(kFullSendSideEstimator); | |
420 } | |
421 | |
422 // 5.4. Three forward direction competing flows, constant capacity. | |
423 TEST_P(BweSimulation, GccComparison4) { | |
424 const int kNumRmcatFlows = 3; | |
425 const int kNumTcpFlows = 0; | |
426 const int64_t kRunTimeS = 120; | |
427 const int kLinkCapacity = 3500; | |
428 | |
429 const int64_t kStartingApartMs = 20 * 1000; | |
430 int64_t offsets_ms[kNumRmcatFlows]; | |
431 for (int i = 0; i < kNumRmcatFlows; ++i) { | |
432 offsets_ms[i] = kStartingApartMs * i; | |
433 } | |
434 | |
435 // Test also with one way propagation delay = 100ms. | |
436 this->RunFairnessTest(GetParam(), kNumRmcatFlows, kNumTcpFlows, kRunTimeS, | |
437 kLinkCapacity, kMaxQueueingDelayMs, 2 * kOneWayDelayMs, | |
438 kMaxJitterMs, offsets_ms); | |
439 | |
440 BweTest gcc_test; | |
441 gcc_test.set_plot_available_capacity(false); | |
442 gcc_test.RunFairnessTest(kFullSendSideEstimator, kNumRmcatFlows, kNumTcpFlows, | |
443 kRunTimeS, kLinkCapacity, kMaxQueueingDelayMs, | |
444 2 * kOneWayDelayMs, kMaxJitterMs, offsets_ms); | |
445 } | |
446 | |
447 TEST_P(BweSimulation, GccComparison5) { | |
448 this->RunRoundTripTimeFairness(GetParam()); | |
449 BweTest gcc_test; | |
450 gcc_test.set_plot_available_capacity(false); | |
451 gcc_test.RunRoundTripTimeFairness(kFullSendSideEstimator); | |
452 } | |
453 | |
454 TEST_P(BweSimulation, GccComparison6) { | |
455 this->RunLongTcpFairness(GetParam()); | |
456 BweTest gcc_test; | |
457 gcc_test.set_plot_available_capacity(false); | |
458 gcc_test.RunLongTcpFairness(kFullSendSideEstimator); | |
459 } | |
460 | |
461 TEST_P(BweSimulation, GccComparison7) { | |
462 const int kNumTcpFiles = 10; | |
463 | |
464 std::vector<int> tcp_file_sizes_bytes = | |
465 BweTest::GetFileSizesBytes(kNumTcpFiles); | |
466 std::vector<int64_t> tcp_starting_times_ms = | |
467 BweTest::GetStartingTimesMs(kNumTcpFiles); | |
468 | |
469 this->RunMultipleShortTcpFairness(GetParam(), tcp_file_sizes_bytes, | |
470 tcp_starting_times_ms); | |
471 | |
472 BweTest gcc_test; | |
473 gcc_test.set_plot_available_capacity(false); | |
474 gcc_test.RunMultipleShortTcpFairness( | |
475 kFullSendSideEstimator, tcp_file_sizes_bytes, tcp_starting_times_ms); | |
476 } | |
477 | |
478 TEST_P(BweSimulation, GccComparison8) { | |
479 this->RunPauseResumeFlows(GetParam()); | |
480 BweTest gcc_test; | |
481 gcc_test.set_plot_available_capacity(false); | |
482 gcc_test.RunPauseResumeFlows(kFullSendSideEstimator); | |
483 } | |
484 | |
485 TEST_P(BweSimulation, GccComparisonChoke) { | |
486 int array[] = {1000, 500, 1000}; | |
487 std::vector<int> capacities_kbps(array, array + 3); | |
488 this->RunChoke(GetParam(), capacities_kbps); | |
489 | |
490 BweTest gcc_test; | |
491 gcc_test.set_plot_available_capacity(false); | |
492 gcc_test.RunChoke(kFullSendSideEstimator, capacities_kbps); | |
299 } | 493 } |
300 | 494 |
301 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE | 495 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE |
302 } // namespace bwe | 496 } // namespace bwe |
303 } // namespace testing | 497 } // namespace testing |
304 } // namespace webrtc | 498 } // namespace webrtc |
499 | |
OLD | NEW |