pub struct NetworkEmulation {
pub delay_ms: u32,
pub jitter_ms: u32,
pub loss_percent: f64,
pub loss_correlation: f64,
}Expand description
Network emulation settings using Linux tc netem.
These settings simulate realistic network conditions like latency and packet loss. Useful for testing congestion control behavior under real-world conditions.
§Example
use freenet_test_network::docker::NetworkEmulation;
// Simulate intercontinental latency (100-150ms) with 1% packet loss
let emulation = NetworkEmulation {
delay_ms: 125,
jitter_ms: 25,
loss_percent: 1.0,
..Default::default()
};Fields§
§delay_ms: u32Base latency in milliseconds
jitter_ms: u32Latency jitter (+/- this value) in milliseconds
loss_percent: f64Packet loss percentage (0.0 - 100.0)
loss_correlation: f64Correlation percentage for loss (consecutive losses are correlated)
Implementations§
Source§impl NetworkEmulation
impl NetworkEmulation
Sourcepub fn intercontinental() -> Self
pub fn intercontinental() -> Self
Create settings for intercontinental network (US to Europe)
Sourcepub fn high_latency() -> Self
pub fn high_latency() -> Self
Create settings for high-latency network (US to Asia-Pacific) This is the scenario that triggered the BBR timeout storm bug.
Sourcepub fn challenging() -> Self
pub fn challenging() -> Self
Create settings for challenging network conditions
Trait Implementations§
Source§impl Clone for NetworkEmulation
impl Clone for NetworkEmulation
Source§fn clone(&self) -> NetworkEmulation
fn clone(&self) -> NetworkEmulation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkEmulation
impl Debug for NetworkEmulation
Auto Trait Implementations§
impl Freeze for NetworkEmulation
impl RefUnwindSafe for NetworkEmulation
impl Send for NetworkEmulation
impl Sync for NetworkEmulation
impl Unpin for NetworkEmulation
impl UnwindSafe for NetworkEmulation
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