chromium/net/third_party/quiche/src/quiche/quic/core/congestion_control/send_algorithm_test.cc

// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <algorithm>
#include <map>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include <vector>

#include "absl/strings/str_cat.h"
#include "quiche/quic/core/congestion_control/rtt_stats.h"
#include "quiche/quic/core/congestion_control/send_algorithm_interface.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_utils.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/mock_clock.h"
#include "quiche/quic/test_tools/quic_config_peer.h"
#include "quiche/quic/test_tools/quic_connection_peer.h"
#include "quiche/quic/test_tools/quic_sent_packet_manager_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
#include "quiche/quic/test_tools/simulator/quic_endpoint.h"
#include "quiche/quic/test_tools/simulator/simulator.h"
#include "quiche/quic/test_tools/simulator/switch.h"

namespace quic {
namespace test {
namespace {

// Use the initial CWND of 10, as 32 is too much for the test network.
const uint32_t kInitialCongestionWindowPackets =;

// Test network parameters.  Here, the topology of the network is:
//
//           QUIC Sender
//               |
//               |  <-- local link
//               |
//        Network switch
//               *  <-- the bottleneck queue in the direction
//               |          of the receiver
//               |
//               |  <-- test link
//               |
//               |
//           Receiver
//
// When setting the bandwidth of the local link and test link, choose
// a bandwidth lower than 20Mbps, as the clock-granularity of the
// simulator can only handle a granularity of 1us.

// Default settings between the switch and the sender.
const QuicBandwidth kLocalLinkBandwidth =;
const QuicTime::Delta kLocalPropagationDelay =;

// Wired network settings.  A typical desktop network setup, a
// high-bandwidth, 30ms test link to the receiver.
const QuicBandwidth kTestLinkWiredBandwidth =;
const QuicTime::Delta kTestLinkWiredPropagationDelay =;
const QuicTime::Delta kTestWiredTransferTime =;
const QuicTime::Delta kTestWiredRtt =;
const QuicByteCount kTestWiredBdp =;

// Small BDP, Bandwidth-policed network settings.  In this scenario,
// the receiver has a low-bandwidth, short propagation-delay link,
// resulting in a small BDP.  We model the policer by setting the
// queue size to only one packet.
const QuicBandwidth kTestLinkLowBdpBandwidth =;
const QuicTime::Delta kTestLinkLowBdpPropagationDelay =;
const QuicByteCount kTestPolicerQueue =;

// Satellite network settings.  In a satellite network, the bottleneck
// buffer is typically sized for non-satellite links , but the
// propagation delay of the test link to the receiver is as much as a
// quarter second.
const QuicTime::Delta kTestSatellitePropagationDelay =;

// Cellular scenarios.  In a cellular network, the bottleneck queue at
// the edge of the network can be as great as 3MB.
const QuicBandwidth kTestLink2GBandwidth =;
const QuicBandwidth kTestLink3GBandwidth =;
const QuicByteCount kCellularQueue =;
const QuicTime::Delta kTestCellularPropagationDelay =;

// Small RTT scenario, below the per-ack-update threshold of 30ms.
const QuicTime::Delta kTestLinkSmallRTTDelay =;

struct TestParams {};

std::string TestParamToString(
    const testing::TestParamInfo<TestParams>& params) {}

// Constructs various test permutations.
std::vector<TestParams> GetTestParams() {}

}  // namespace

class SendAlgorithmTest : public QuicTestWithParam<TestParams> {};

INSTANTIATE_TEST_SUITE_P();

// Test a simple long data transfer in the default setup.
TEST_P(SendAlgorithmTest, SimpleWiredNetworkTransfer) {}

TEST_P(SendAlgorithmTest, LowBdpPolicedNetworkTransfer) {}

TEST_P(SendAlgorithmTest, AppLimitedBurstsOverWiredNetwork) {}

TEST_P(SendAlgorithmTest, SatelliteNetworkTransfer) {}

TEST_P(SendAlgorithmTest, 2GNetworkTransfer) {}

TEST_P(SendAlgorithmTest, 3GNetworkTransfer) {}

TEST_P(SendAlgorithmTest, LowRTTTransfer) {}

}  // namespace test
}  // namespace quic