pub struct EcnValidation { /* private fields */ }Expand description
RFC 6679 sections 7.2-7.4 for one RTP stream, fed from RFC 8888 reports. See the module documentation.
Implementations§
Source§impl EcnValidation
impl EcnValidation
Sourcepub fn new(initiation: EcnInitiation) -> Self
pub fn new(initiation: EcnInitiation) -> Self
A stream about to send its first packet with ECN negotiated.
Sourcepub fn with_retry_after(self, retry_after: Duration) -> Self
pub fn with_retry_after(self, retry_after: Duration) -> Self
How long after a failed initiation the next one starts (DEFAULT_RETRY_AFTER).
Sourcepub fn marks_all(&self) -> bool
pub fn marks_all(&self) -> bool
Whether a packet of the stream that is not one of its own numbered packets (an RTX retransmission, say) goes out ECT: only in ongoing use, so probes are the stream’s own packets, whose reports name them.
Sourcepub fn was_marked(&self, sequence_number: u16) -> bool
pub fn was_marked(&self, sequence_number: u16) -> bool
Whether the packet sequence_number was sent ECT, as far as the history still knows.
Sourcepub fn on_send(&mut self, now: Instant, sequence_number: u16) -> bool
pub fn on_send(&mut self, now: Instant, sequence_number: u16) -> bool
A packet of the stream is sent at now: whether it goes out ECT.
Sourcepub fn on_report(
&mut self,
now: Instant,
sequence_number: u16,
received: bool,
ecn: Ecn,
)
pub fn on_report( &mut self, now: Instant, sequence_number: u16, received: bool, ecn: Ecn, )
An RFC 8888 report about the packet sequence_number arrived at now: whether it was
received, and if so the ECN field it arrived with.
Sourcepub fn on_counters(
&mut self,
now: Instant,
extended_highest: u32,
counters: EcnCounters,
)
pub fn on_counters( &mut self, now: Instant, extended_highest: u32, counters: EcnCounters, )
An RFC 6679 report about the stream arrived at now: the receiver’s cumulative ECN
counters (an RTCP ECN Feedback packet, section 5.1, or an XR ECN Summary Report,
section 5.2) and the extended highest sequence number they relate to (the feedback
packet’s, or the reception report’s in the same compound packet). The procedure is the
one on_report runs, on what changed since the last report: the
packets sent up to the new highest sequence number, how many went out ECT, and how many
the receiver counted ECT or CE, not-ECT, lost and duplicated (section 7.4.2).
- Initiating: ECT or CE counts confirm probes; not-ECT counts beyond the unmarked packets sent (and the duplicates) are a negative indication; more than three probes sent with no ECT counted is a failure (section 7.2.1).
- Ongoing use: each packet sent ECT is reported; the not-ECT count beyond duplicates is bleaching, the lost count is loss; the thresholds are those of per-packet reports.
Sourcepub fn on_remote_cname(&mut self, now: Instant, cname: &str)
pub fn on_remote_cname(&mut self, now: Instant, cname: &str)
RFC 6679 section 7.2.1: a source of the session named its RTCP CNAME at now. The
first one is the receiver the probes are confirmed by. Another CNAME while the
success is provisional is another participant: “the sender MUST fallback to only
ECT-marking a small fraction of its RTP packets” and initiates again.
Sourcepub fn on_reception_report_without_ecn(
&mut self,
now: Instant,
extended_highest: u32,
)
pub fn on_reception_report_without_ecn( &mut self, now: Instant, extended_highest: u32, )
RFC 6679 section 7.2.1: “ECN initiation is considered to have failed at the instant
the initiating RTP sender received an RTCP packet that doesn’t contain an RTCP ECN
Feedback Report or ECN Summary Report from any RTP session participant that has an
RTCP RR with an extended RTP sequence number field that indicates that it should have
received multiple (>3) ECT-marked RTP packets.” extended_highest is that field of a
reception report about the stream in a compound packet without an ECN report about it.
Sourcepub fn on_report_without_reception(&mut self, now: Instant)
pub fn on_report_without_reception(&mut self, now: Instant)
RFC 6679 section 7.2.3, leap of faith: a receiver report (SR or RR) arrived that has no report block about the stream, or one showing that nothing was received. A path with an ECN-blocking middlebox shows that way; but “a receiver might generate its first RTCP packet … before it has had chance to receive any data packets”, so “a sender that receives an RTCP SR/RR packet indicating lack of reception by a receiver SHOULD … wait for a second RTCP report from that receiver”: the second such report in a row ends the marking. Nothing changes once reception was reported, outside the leap of faith, or before a marked packet was sent.
Sourcepub fn on_reception_reported(&mut self)
pub fn on_reception_reported(&mut self)
A receiver report showed reception of the stream: the path carries its ECT packets.
Sourcepub fn with_receiver_cname(self, cname: &str) -> Self
pub fn with_receiver_cname(self, cname: &str) -> Self
A validation that knows the receiver by its RTCP CNAME already (named before the stream started marking).
Sourcepub fn is_provisional(&self, now: Instant) -> bool
pub fn is_provisional(&self, now: Instant) -> bool
Whether the success of the initiation is still provisional at now.
Sourcepub fn take_failures(&mut self) -> Vec<EcnFailure>
pub fn take_failures(&mut self) -> Vec<EcnFailure>
The failures detected since the last call, oldest first (at most sixteen are kept).