[−][src]Struct packet_loss_classification::ZigZag
Packet loss classifier based on the ZigZag
scheme.
In wireless networks wireless errors are the most common errors. Congestion errors usually come with a higher delay. Intuitively classification can be done with a threshold. The ZigZag scheme uses thresholds that depend on the number of packets that have been lost consecutively.
The more packets lost in a row the higher the threshold for classifying congestion errors. This is because a higher number of lost packets comes with a higher expectation for the ROTT.
The thresholds depend on the standard deviation and the mean value of the ROTT which
are calculated on the fly using an exponential average with the exponential decaying
factor 1.0 - alpha
.
use packet_loss_classification::{ZigZag, PacketLoss}; let mut zigzag = ZigZag::default(); assert_eq!(zigzag.classify(10.0, 1), PacketLoss::Congestion); assert_eq!(zigzag.classify(10.0, 1), PacketLoss::Congestion); assert_eq!(zigzag.classify(0.3, 4), PacketLoss::Wireless);
Methods
impl ZigZag
[src]
pub fn new(alpha: f64) -> Self
[src]
Creates a new packet loss classifier based on the ZigZag scheme.
Arguments
- 1.0 -
alpha
: exponential decaying factor that weights the impact of the currentrott
.
Panics
Panics if alpha
is not in [0.0, 1.0].
pub fn classify(&mut self, rott: f64, num_lost_packets: u32) -> 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.num_lost_packets
: the number of packets that have been lost.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ZigZag
impl Send for ZigZag
impl Sync for ZigZag
impl Unpin for ZigZag
impl UnwindSafe for ZigZag
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>,