Skip to main content

EcnValidation

Struct EcnValidation 

Source
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

Source

pub fn new(initiation: EcnInitiation) -> Self

A stream about to send its first packet with ECN negotiated.

Source

pub fn with_retry_after(self, retry_after: Duration) -> Self

How long after a failed initiation the next one starts (DEFAULT_RETRY_AFTER).

Source

pub fn state(&self) -> EcnState

Where the stream is in the procedure.

Source

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.

Source

pub fn was_marked(&self, sequence_number: u16) -> bool

Whether the packet sequence_number was sent ECT, as far as the history still knows.

Source

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.

Source

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.

Source

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.
Source

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.

Source

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.

Source

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.

Source

pub fn on_reception_reported(&mut self)

A receiver report showed reception of the stream: the path carries its ECT packets.

Source

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).

Source

pub fn is_provisional(&self, now: Instant) -> bool

Whether the success of the initiation is still provisional at now.

Source

pub fn take_failures(&mut self) -> Vec<EcnFailure>

The failures detected since the last call, oldest first (at most sixteen are kept).

Trait Implementations§

Source§

impl Clone for EcnValidation

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EcnValidation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EcnValidation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.