#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 {
const QuicByteCount kDefaultMinimumCongestionWindow = …;
const float kDefaultHighGain = …;
const float kDerivedHighGain = …;
const float kDerivedHighCWNDGain = …;
const float kPacingGain[] = …;
const size_t kGainCycleLength = …;
const QuicRoundTripCount kBandwidthWindowSize = …;
const QuicTime::Delta kMinRttExpiry = …;
const QuicTime::Delta kProbeRttTime = …;
const float kStartupGrowthTarget = …;
const QuicRoundTripCount kRoundTripsWithoutGrowthBeforeExitingStartup = …;
}
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 ) 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 ,
QuicByteCount prior_in_flight,
QuicTime event_time,
const AckedPacketVector& acked_packets,
const LostPacketVector& lost_packets,
QuicPacketCount ,
QuicPacketCount ) { … }
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) { … }
}