Skip to main content

Gcc

Struct Gcc 

Source
pub struct Gcc { /* private fields */ }
Expand description

Google Congestion Control.

§The two halves

reports ─┬─▶ SlopeEstimator ─▶ OveruseDetector ─▶ RateController ─┐
         │   group, filter      usage + adaptive   AIMD           ├─▶ min ─▶ target
         │                      threshold                         │
         ├─▶ RateCalculator ────────────────────────────────────▶─┘
         │   what is actually arriving
         └─▶ LossController ────────────────────────────────────▶─┘

The two are combined by min: whichever signal is more pessimistic wins. A path can be congested in either way independently — a deep buffer queues without losing, a shallow or lossy one loses without queueing — so neither half alone is sufficient and taking the lower of the two is the only combination that responds to both.

§Deliberate divergences from upstream

  • D3 — one clamp. Applied once, here, from configuration. Upstream clamps inside the loss controller to a hard-coded 100 kb/s–100 Mb/s and again in the rate controller to the configured range, and the two disagree.
  • D4 — loss may move the target alone. See LossController.
  • No hidden headroom. target_bitrate is what the pacer is asked for. Upstream’s pacer silently multiplies by 1.5, so its reported target and its wire rate differ by half again.
  • No clock. Every instant is a parameter, which is what makes a bitrate trajectory reproducible.

Implementations§

Source§

impl Gcc

Source

pub fn new(initial: f64, min: f64, max: f64) -> Self

An estimator starting at initial, held within min..=max.

Source

pub fn delay_based_bitrate(&self) -> f64

The delay-based half’s current target, in bits per second.

Source

pub fn loss_based_bitrate(&self) -> f64

The loss-based half’s current target, in bits per second.

Trait Implementations§

Source§

impl BandwidthEstimator for Gcc

Source§

fn on_reports(&mut self, now: Instant, reports: &[PacketReport])

Packets whose fate the remote has now reported, in send order. Read more
Source§

fn target_bitrate(&self) -> f64

The current estimate, in bits per second. Read more
Source§

fn stats(&self) -> EstimatorStats

Whatever the algorithm wants to expose. Never load-bearing.
Source§

fn handle_timeout(&mut self, _now: Instant)

Periodic work, for an estimator that has any. Most do not.
Source§

fn poll_timeout(&self) -> Option<Instant>

When this estimator next wants waking, or None if it does not. Read more
Source§

impl Default for Gcc

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Gcc

§

impl RefUnwindSafe for Gcc

§

impl Send for Gcc

§

impl Sync for Gcc

§

impl Unpin for Gcc

§

impl UnsafeUnpin for Gcc

§

impl UnwindSafe for Gcc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.