pub enum LossModel {
None,
Random(RandomLoss),
GilbertElliot(GilbertElliot),
}Expand description
Loss model for packet dropping.
Real networks rarely have uniform random loss. Instead, losses tend to come in bursts due to congestion, interference, or route changes. This enum provides different models to simulate various loss patterns.
Variants§
None
No packet loss. All packets are delivered.
Random(RandomLoss)
Probability-based random loss with optional correlation.
See RandomLoss for configuration options.
GilbertElliot(GilbertElliot)
Gilbert-Elliot model for realistic bursty packet loss.
This 2-state Markov model alternates between GOOD (low loss) and BAD (high loss) states, producing realistic burst patterns where losses cluster together rather than being spread evenly.
Use the builder methods or presets on GilbertElliot:
GilbertElliot::wifi()- occasional short burstsGilbertElliot::cellular()- moderate bursts from handoffsGilbertElliot::satellite()- rare but longer burstsGilbertElliot::congested()- frequent drops
Trait Implementations§
Source§impl From<GilbertElliot> for LossModel
impl From<GilbertElliot> for LossModel
Source§fn from(value: GilbertElliot) -> Self
fn from(value: GilbertElliot) -> Self
Converts to this type from the input type.
Source§impl From<RandomLoss> for LossModel
impl From<RandomLoss> for LossModel
Source§fn from(value: RandomLoss) -> Self
fn from(value: RandomLoss) -> Self
Converts to this type from the input type.
impl Copy for LossModel
Auto Trait Implementations§
impl Freeze for LossModel
impl RefUnwindSafe for LossModel
impl Send for LossModel
impl Sync for LossModel
impl Unpin for LossModel
impl UnsafeUnpin for LossModel
impl UnwindSafe for LossModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more