pub struct BbrCongestionController { /* private fields */ }Expand description
A congestion controller that implements “Bottleneck Bandwidth and Round-trip propagation time” version 2 (BBRv2) as specified in https://datatracker.ietf.org/doc/draft-cardwell-iccrg-bbr-congestion-control/.
Based in part on the Chromium BBRv2 implementation, see https://source.chromium.org/chromium/chromium/src/+/main:net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc and the Linux Kernel TCP BBRv2 implementation, see https://github.com/google/bbr/blob/v2alpha/net/ipv4/tcp_bbr2.c
Implementations§
Source§impl BbrCongestionController
impl BbrCongestionController
Sourcepub fn new(max_datagram_size: u16, app_settings: ApplicationSettings) -> Self
pub fn new(max_datagram_size: u16, app_settings: ApplicationSettings) -> Self
Constructs a new BbrCongestionController
max_datagram_size is the current max_datagram_size, and is
expected to be 1200 when the congestion controller is created.
Sourcepub fn pacing_rate(&self) -> Bandwidth
pub fn pacing_rate(&self) -> Bandwidth
Returns the current pacing rate
Trait Implementations§
Source§impl Clone for BbrCongestionController
impl Clone for BbrCongestionController
Source§fn clone(&self) -> BbrCongestionController
fn clone(&self) -> BbrCongestionController
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CongestionController for BbrCongestionController
impl CongestionController for BbrCongestionController
Source§type PacketInfo = PacketInfo
type PacketInfo = PacketInfo
Additional metadata about a packet to track until a sent packet
is either acknowledged or declared lost
Source§fn congestion_window(&self) -> u32
fn congestion_window(&self) -> u32
Returns the size of the current congestion window in bytes
Source§fn bytes_in_flight(&self) -> u32
fn bytes_in_flight(&self) -> u32
Returns the current bytes in flight
Source§fn is_congestion_limited(&self) -> bool
fn is_congestion_limited(&self) -> bool
Returns
true if the congestion window does not have sufficient
space for a packet of max_datagram_size considering the current
bytes in flightSource§fn requires_fast_retransmission(&self) -> bool
fn requires_fast_retransmission(&self) -> bool
Returns
true if the current state of the congestion controller
requires a packet to be transmitted without respecting the
available congestion windowSource§fn on_packet_sent<Pub: Publisher>(
&mut self,
time_sent: Timestamp,
sent_bytes: usize,
app_limited: Option<bool>,
rtt_estimator: &RttEstimator,
publisher: &mut Pub,
) -> Self::PacketInfo
fn on_packet_sent<Pub: Publisher>( &mut self, time_sent: Timestamp, sent_bytes: usize, app_limited: Option<bool>, rtt_estimator: &RttEstimator, publisher: &mut Pub, ) -> Self::PacketInfo
Invoked when a packet is sent Read more
Source§fn on_rtt_update<Pub: Publisher>(
&mut self,
_time_sent: Timestamp,
_now: Timestamp,
rtt_estimator: &RttEstimator,
publisher: &mut Pub,
)
fn on_rtt_update<Pub: Publisher>( &mut self, _time_sent: Timestamp, _now: Timestamp, rtt_estimator: &RttEstimator, publisher: &mut Pub, )
Invoked each time the round trip time is updated, which is whenever the
newest acknowledged packet in an ACK frame is newly acknowledged
Source§fn on_ack<Pub: Publisher>(
&mut self,
newest_acked_time_sent: Timestamp,
bytes_acknowledged: usize,
newest_acked_packet_info: Self::PacketInfo,
rtt_estimator: &RttEstimator,
random_generator: &mut dyn Generator,
ack_receive_time: Timestamp,
publisher: &mut Pub,
)
fn on_ack<Pub: Publisher>( &mut self, newest_acked_time_sent: Timestamp, bytes_acknowledged: usize, newest_acked_packet_info: Self::PacketInfo, rtt_estimator: &RttEstimator, random_generator: &mut dyn Generator, ack_receive_time: Timestamp, publisher: &mut Pub, )
Invoked when an acknowledgement of one or more previously unacknowledged packets is received Read more
Source§fn on_packet_lost<Pub: Publisher>(
&mut self,
lost_bytes: u32,
packet_info: Self::PacketInfo,
_persistent_congestion: bool,
new_loss_burst: bool,
random_generator: &mut dyn Generator,
timestamp: Timestamp,
publisher: &mut Pub,
)
fn on_packet_lost<Pub: Publisher>( &mut self, lost_bytes: u32, packet_info: Self::PacketInfo, _persistent_congestion: bool, new_loss_burst: bool, random_generator: &mut dyn Generator, timestamp: Timestamp, publisher: &mut Pub, )
Invoked when a packet is declared lost Read more
Source§fn on_explicit_congestion<Pub: Publisher>(
&mut self,
ce_count: u64,
event_time: Timestamp,
_publisher: &mut Pub,
)
fn on_explicit_congestion<Pub: Publisher>( &mut self, ce_count: u64, event_time: Timestamp, _publisher: &mut Pub, )
Invoked when the Explicit Congestion Notification counter increases. Read more
Source§fn on_mtu_update<Pub: Publisher>(
&mut self,
max_datagram_size: u16,
_publisher: &mut Pub,
)
fn on_mtu_update<Pub: Publisher>( &mut self, max_datagram_size: u16, _publisher: &mut Pub, )
Invoked when the path maximum transmission unit is updated.
Source§fn on_packet_discarded<Pub: Publisher>(
&mut self,
bytes_sent: usize,
_publisher: &mut Pub,
)
fn on_packet_discarded<Pub: Publisher>( &mut self, bytes_sent: usize, _publisher: &mut Pub, )
Invoked for each packet discarded when a packet number space is discarded.
Auto Trait Implementations§
impl Freeze for BbrCongestionController
impl RefUnwindSafe for BbrCongestionController
impl Send for BbrCongestionController
impl Sync for BbrCongestionController
impl Unpin for BbrCongestionController
impl UnwindSafe for BbrCongestionController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more