[][src]Struct packet_loss_classification::Trend

pub struct Trend { /* fields omitted */ }

Packet loss classifier based on the Trend scheme.

Classification of packet loss depends on the observation of values such as packet timestamps and packet serial numbers. Algorithms such as ZigZag and Spike rely on the ROTT, but perform unreliably if ROTT is around the threshold.

Trend takes the delay trend of packets into account which is summarized in the cited paper as follows:

"When a packet loss is observed at time t, it should be considered as a congestion loss if T_d is in an ascending phase; otherwise it is categorized as wireless loss."

use packet_loss_classification::{Trend, PacketLoss};

let mut trend = Trend::default();
for i in 0..16 {
    assert_eq!(trend.classify((i as f64).powf(1.5)), PacketLoss::Wireless);
}
assert_eq!(trend.classify(150.0), PacketLoss::Congestion);

Methods

impl Trend[src]

pub fn new(gamma: f64, s_threshold: f64) -> Self[src]

Creates a new packet loss classifier based on the Trend scheme.

Arguments

  • 1.0 - gamma: exponential decaying factor that weights the impact of the current rott.

Panics

Panics if gamma or s_threshold are not in [0.0, 1.0].

pub fn classify(&mut self, rott: f64) -> PacketLoss[src]

Classifies the reason of packet loss based on the ROTT of the current packet.

This function is called with the ROTT (relative one-way trip time) of the current packet if previous packets were lost.

Arguments

  • rott: relative one-way trip time of the current packet.

Trait Implementations

impl Debug for Trend[src]

impl Default for Trend[src]

Auto Trait Implementations

impl RefUnwindSafe for Trend

impl Send for Trend

impl Sync for Trend

impl Unpin for Trend

impl UnwindSafe for Trend

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.