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. The reporter is not known
(on_report_from).
Sourcepub fn on_report_from(
&mut self,
now: Instant,
reporter: Option<&str>,
sequence_number: u16,
received: bool,
ecn: Ecn,
)
pub fn on_report_from( &mut self, now: Instant, reporter: Option<&str>, sequence_number: u16, received: bool, ecn: Ecn, )
on_report from the participant whose RTCP CNAME is reporter. In a
group (more than one CNAME seen) a probe reported arriving ECT or CE confirms the
initiation for that participant, even when another reported the packet first.
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_counters_from(
&mut self,
now: Instant,
reporter: Option<&str>,
extended_highest: u32,
counters: EcnCounters,
)
pub fn on_counters_from( &mut self, now: Instant, reporter: Option<&str>, extended_highest: u32, counters: EcnCounters, )
on_counters from the participant whose RTCP CNAME is reporter:
its counters are compared with its own last ones, and in a group, ECT or CE counted with
nothing cleared confirms the initiation for it.
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 (the unicast optimisation).
Another CNAME makes the session a group: while the success is provisional “the sender
MUST fallback to only ECT-marking a small fraction of its RTP packets, while it
determines if ECN can be supported following the full procedure” ([Group]), and an
initiation in progress follows the full procedure from then on. Each new CNAME is a
change of the membership.
Sourcepub fn with_receiver_cnames<'a>(
self,
cnames: impl IntoIterator<Item = &'a str>,
) -> Self
pub fn with_receiver_cnames<'a>( self, cnames: impl IntoIterator<Item = &'a str>, ) -> Self
A validation that already knows the session’s RTCP CNAMEs (named before the stream started marking): more than one makes it a group from the start.
Sourcepub fn is_group(&self) -> bool
pub fn is_group(&self) -> bool
Whether more than one RTCP CNAME has been seen, so that initiation follows the full procedure of section 7.2.1.
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).