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

// Copyright 2016 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 "quiche/quic/core/congestion_control/bbr_sender.h"

#include <algorithm>
#include <ostream>
#include <sstream>
#include <string>

#include "absl/base/attributes.h"
#include "quiche/quic/core/congestion_control/rtt_stats.h"
#include "quiche/quic/core/crypto/crypto_protocol.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_time_accumulator.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"

namespace quic {

namespace {
// Constants based on TCP defaults.
// The minimum CWND to ensure delayed acks don't reduce bandwidth measurements.
// Does not inflate the pacing rate.
const QuicByteCount kDefaultMinimumCongestionWindow =;

// The gain used for the STARTUP, equal to 2/ln(2).
const float kDefaultHighGain =;
// The newly derived gain for STARTUP, equal to 4 * ln(2)
const float kDerivedHighGain =;
// The newly derived CWND gain for STARTUP, 2.
const float kDerivedHighCWNDGain =;
// The cycle of gains used during the PROBE_BW stage.
const float kPacingGain[] =;

// The length of the gain cycle.
const size_t kGainCycleLength =;
// The size of the bandwidth filter window, in round-trips.
const QuicRoundTripCount kBandwidthWindowSize =;

// The time after which the current min_rtt value expires.
const QuicTime::Delta kMinRttExpiry =;
// The minimum time the connection can spend in PROBE_RTT mode.
const QuicTime::Delta kProbeRttTime =;
// If the bandwidth does not increase by the factor of |kStartupGrowthTarget|
// within |kRoundTripsWithoutGrowthBeforeExitingStartup| rounds, the connection
// will exit the STARTUP mode.
const float kStartupGrowthTarget =;
const QuicRoundTripCount kRoundTripsWithoutGrowthBeforeExitingStartup =;
}  // namespace

BbrSender::DebugState::DebugState(const BbrSender& sender)
    :{}

BbrSender::DebugState::DebugState(const DebugState& state) = default;

BbrSender::BbrSender(QuicTime now, const RttStats* rtt_stats,
                     const QuicUnackedPacketMap* unacked_packets,
                     QuicPacketCount initial_tcp_congestion_window,
                     QuicPacketCount max_tcp_congestion_window,
                     QuicRandom* random, QuicConnectionStats* stats)
    :{}

BbrSender::~BbrSender() {}

void BbrSender::SetInitialCongestionWindowInPackets(
    QuicPacketCount congestion_window) {}

bool BbrSender::InSlowStart() const {}

void BbrSender::OnPacketSent(QuicTime sent_time, QuicByteCount bytes_in_flight,
                             QuicPacketNumber packet_number,
                             QuicByteCount bytes,
                             HasRetransmittableData is_retransmittable) {}

void BbrSender::OnPacketNeutered(QuicPacketNumber packet_number) {}

bool BbrSender::CanSend(QuicByteCount bytes_in_flight) {}

QuicBandwidth BbrSender::PacingRate(QuicByteCount /*bytes_in_flight*/) const {}

QuicBandwidth BbrSender::BandwidthEstimate() const {}

QuicByteCount BbrSender::GetCongestionWindow() const {}

QuicByteCount BbrSender::GetSlowStartThreshold() const {}

bool BbrSender::InRecovery() const {}

void BbrSender::SetFromConfig(const QuicConfig& config,
                              Perspective perspective) {}

void BbrSender::ApplyConnectionOptions(
    const QuicTagVector& connection_options) {}

void BbrSender::AdjustNetworkParameters(const NetworkParams& params) {}

void BbrSender::OnCongestionEvent(bool /*rtt_updated*/,
                                  QuicByteCount prior_in_flight,
                                  QuicTime event_time,
                                  const AckedPacketVector& acked_packets,
                                  const LostPacketVector& lost_packets,
                                  QuicPacketCount /*num_ect*/,
                                  QuicPacketCount /*num_ce*/) {}

CongestionControlType BbrSender::GetCongestionControlType() const {}

QuicTime::Delta BbrSender::GetMinRtt() const {}

QuicByteCount BbrSender::GetTargetCongestionWindow(float gain) const {}

QuicByteCount BbrSender::ProbeRttCongestionWindow() const {}

void BbrSender::EnterStartupMode(QuicTime now) {}

void BbrSender::EnterProbeBandwidthMode(QuicTime now) {}

bool BbrSender::UpdateRoundTripCounter(QuicPacketNumber last_acked_packet) {}

bool BbrSender::MaybeUpdateMinRtt(QuicTime now,
                                  QuicTime::Delta sample_min_rtt) {}

void BbrSender::UpdateGainCyclePhase(QuicTime now,
                                     QuicByteCount prior_in_flight,
                                     bool has_losses) {}

void BbrSender::CheckIfFullBandwidthReached(
    const SendTimeState& last_packet_send_state) {}

void BbrSender::MaybeExitStartupOrDrain(QuicTime now) {}

void BbrSender::OnExitStartup(QuicTime now) {}

bool BbrSender::ShouldExitStartupDueToLoss(
    const SendTimeState& last_packet_send_state) const {}

void BbrSender::MaybeEnterOrExitProbeRtt(QuicTime now, bool is_round_start,
                                         bool min_rtt_expired) {}

void BbrSender::UpdateRecoveryState(QuicPacketNumber last_acked_packet,
                                    bool has_losses, bool is_round_start) {}

void BbrSender::CalculatePacingRate(QuicByteCount bytes_lost) {}

void BbrSender::CalculateCongestionWindow(QuicByteCount bytes_acked,
                                          QuicByteCount excess_acked) {}

void BbrSender::CalculateRecoveryWindow(QuicByteCount bytes_acked,
                                        QuicByteCount bytes_lost) {}

std::string BbrSender::GetDebugState() const {}

void BbrSender::OnApplicationLimited(QuicByteCount bytes_in_flight) {}

void BbrSender::PopulateConnectionStats(QuicConnectionStats* stats) const {}

BbrSender::DebugState BbrSender::ExportDebugState() const {}

static std::string ModeToString(BbrSender::Mode mode) {}

std::ostream& operator<<(std::ostream& os, const BbrSender::Mode& mode) {}

std::ostream& operator<<(std::ostream& os, const BbrSender::DebugState& state) {}

}  // namespace quic