pub struct Bbr { /* private fields */ }展开描述
实验性!使用风险自负。
目标是减少 buffer bloat,并在高带宽时延积(BDP)的网络上提升性能。基于 Google 的 quiche 实现 https://source.chromium.org/chromium/chromium/src/+/master:net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc, 对应的 BBR 规范见 https://datatracker.ietf.org/doc/html/draft-cardwell-iccrg-bbr-congestion-control。 更多讨论与链接见 https://groups.google.com/g/bbr-dev。
实现§
trait 实现§
源代码§impl Controller for Bbr
impl Controller for Bbr
源代码§fn on_ack(
&mut self,
now: Instant,
sent: Instant,
bytes: u64,
app_limited: bool,
rtt: &RttEstimator,
)
fn on_ack( &mut self, now: Instant, sent: Instant, bytes: u64, app_limited: bool, rtt: &RttEstimator, )
Packet deliveries were confirmed 更多信息
源代码§fn on_end_acks(
&mut self,
now: Instant,
in_flight: u64,
app_limited: bool,
largest_packet_num_acked: Option<u64>,
)
fn on_end_acks( &mut self, now: Instant, in_flight: u64, app_limited: bool, largest_packet_num_acked: Option<u64>, )
数据包以批量形式被确认,所有包使用相同的
now 参数。这表示其中某一批已完成。源代码§fn on_congestion_event(
&mut self,
_now: Instant,
_sent: Instant,
_is_persistent_congestion: bool,
lost_bytes: u64,
)
fn on_congestion_event( &mut self, _now: Instant, _sent: Instant, _is_persistent_congestion: bool, lost_bytes: u64, )
Packets were deemed lost or marked congested 更多信息
源代码§fn on_mtu_update(&mut self, new_mtu: u16)
fn on_mtu_update(&mut self, new_mtu: u16)
当前网络路径的已知 MTU 已更新
源代码§fn metrics(&self) -> ControllerMetrics
fn metrics(&self) -> ControllerMetrics
检索实现特有的指标,用于在启用
qlog 时填充追踪记录源代码§fn clone_box(&self) -> Box<dyn Controller>
fn clone_box(&self) -> Box<dyn Controller>
复制此控制器的状态
源代码§fn initial_window(&self) -> u64
fn initial_window(&self) -> u64
初始拥塞窗口
自动 trait 实现§
impl Freeze for Bbr
impl RefUnwindSafe for Bbr
impl Send for Bbr
impl Sync for Bbr
impl Unpin for Bbr
impl UnsafeUnpin for Bbr
impl UnwindSafe for Bbr
blanket 实现§
源代码§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 更多信息