pub struct CongestionControlBuilder<E: BandwidthEstimator> { /* private fields */ }Expand description
Builder for CongestionControlInterceptor.
§Example
use rtci_interceptor::{Slot, CongestionControlBuilder, ConstantBitrate, Registry};
let chain = Registry::new()
.with(Slot::CongestionControl, CongestionControlBuilder::new(ConstantBitrate::new(1_000_000.0)).build())
.build();Implementations§
Source§impl<E: BandwidthEstimator> CongestionControlBuilder<E>
impl<E: BandwidthEstimator> CongestionControlBuilder<E>
Sourcepub fn with_prune_horizon(self, prune_horizon: Duration) -> Self
pub fn with_prune_horizon(self, prune_horizon: Duration) -> Self
How long an unacknowledged packet is kept before it is written off.
Sourcepub fn with_circuit_breaker(self, handle: CircuitBreakerHandle) -> Self
pub fn with_circuit_breaker(self, handle: CircuitBreakerHandle) -> Self
The circuit breaker of the same chain. When its congestion breaker asks for a tenth of the rate (RFC 8083 section 4.3) the limit becomes an upper bound of the estimator.
Sourcepub fn with_unnegotiated_tmmbr(self, honoured: bool) -> Self
pub fn with_unnegotiated_tmmbr(self, honoured: bool) -> Self
Whether a TMMBR is honoured for a stream that did not negotiate ccm tmmbr.
Off by default: RFC 5104 section 7.1 has a codec control message used only when the
session description names it (a=rtcp-fb:<pt> ccm tmmbr), and section 7.2 has the
answerer remove what it does not support, so a TMMBR for a stream without it is a
message the session never agreed to and is ignored, unanswered. true is the lenient
behaviour: every TMMBR that names one of this endpoint’s streams limits it and is
answered with a TMMBN.
Sourcepub fn with_bandwidth_probing(self, bandwidth_probing: bool) -> Self
pub fn with_bandwidth_probing(self, bandwidth_probing: bool) -> Self
Whether the path is probed for capacity above the target: short clusters of packets
at a multiple of the target, whose arrival shows at once whether the path carries
that rate. Off for a builder (it needs the pacer and the NACK responder of the same
chain); on in the peer connection’s default interceptor set
(DefaultInterceptorOptions::bandwidth_probing).
Without it the estimate climbs as fast as the delay-based controller raises it, 8% a
second in Gcc: from 300 kbit/s to 2.5 Mbit/s takes most of half a
minute. With it, two clusters at the start (three and six times the starting rate),
further ones at twice the result while the path keeps carrying what is asked, and one
every five seconds while the application sends less than the target allows; a path
with 2.5 Mbit/s is found in well under a second.
RFC 8836 section 2 (requirement 4, a SHOULD) asks for quick adaptation to the initial
conditions and names “probing during setup” as one way; draft-ietf-rmcat-gcc-02 has
none. It is libwebrtc’s behaviour, in outline, and adds traffic the application did
not write: padding-only packets on the RTX stream fill a cluster the application’s own
media does not (they carry no media, and receivers drop them), so it needs RTX
negotiated to probe a sender with little to send. After a large drop of the target
(a third or more), the rate before it is probed for a few seconds
(ProbeController::with_probe_after_drop).
What it costs: an application sending a fifth of what the path carries spends about
4% of its octets on probes, one cluster every five seconds. The pacer
(PacerInterceptor) and the NACK responder
(NackResponderInterceptor) of the same chain do
the sending; the estimator hears the result through
BandwidthEstimator::on_probe_result.
Sourcepub fn build(self) -> CongestionControlInterceptor<E>
pub fn build(self) -> CongestionControlInterceptor<E>
Build the interceptor.
Sourcepub fn build_with_handle(
self,
) -> (CongestionControlInterceptor<E>, CongestionControlHandle)
pub fn build_with_handle( self, ) -> (CongestionControlInterceptor<E>, CongestionControlHandle)
Build the interceptor and the handle the application reads the estimate from and gives the negotiated limits to.