[−][src]Struct packet_loss_classification::Trend
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 currentrott
.
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,